HTTP 500 in local_mobile webservice

Re: HTTP 500 in local_mobile webservice

by Oscar Martínez -
Number of replies: 0

Hi,

i have found it!

It is because of de PHP version.

externallib.php uses the abreviated sintax to declare arrays [] that doesn't work in PHP 5.3.3

I have changed those declarations and now it works!

Here are de diff between the original file and the modified one:

7697c7697

<                 $viewablefields = array();

---

>                 $viewablefields = [];

9402,9403c9402,9403

<         $result['someoptions'] = array();

<         $result['alloptions'] = array();

---

>         $result['someoptions'] = [];

>         $result['alloptions'] = [];

9535c9535

<                 $errors = $accessmanager->validate_preflight_check($provideddata, array(), $currentattemptid);

---

>                 $errors = $accessmanager->validate_preflight_check($provideddata, [], $currentattemptid);

9639c9639

<             $errors = $accessmanager->validate_preflight_check($provideddata, array(), $params['attemptid']);

---

>             $errors = $accessmanager->validate_preflight_check($provideddata, [], $params['attemptid']);


Thanks for your help!