Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Critical
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.5
-
Fix Version/s: 4.4.6
-
Component/s: CiviCRM API
-
Labels:None
Description
It seems that the fix for CRM-14253 breaks the REST API. All you get in reply with 4.4.5 is 'Unknown function invocation.'
The problem is, that the array returned by the new ::exportValues() function is not identical to the formerly used $_REQUEST. In our case:
Output $_REQUEST: [Wed Apr 23 12:05:12.895522 2014] [:error] [pid 5214] [client 127.0.0.1:60554] Array( [sequential] => 1 [entity] => Contact [json] => 1 [version] => 3 [key] => KEY [action] => update [api_key] => APIKEY [id] => 127) Output CRM_Utils_Request::exportValues(): [Wed Apr 23 12:05:12.895560 2014] [:error] [pid 5214] [client 127.0.0.1:60554] Array( [sequential] => 1 [entity] => Contact [json] => 1 [version] => 3 [key] => KEY [action] => update [api_key] => APIKEY [id] => 127 [q] => node)
The additional 'q' parameter then triggers the bail out in CRM_Utils_REST:255.
To reproduce, just go to the API explorer, enter a simple query and generate the REST URL. Once you replaced the site and the api key in that URL, you should get the error described above.