Before updating to current stable services build my callback function had the following signature.

function callme($category) {}

Now instead of getting a string category it receives an array like the following.

array('category' => 'some_category');

Is there anyway to get the old functionality back?

Comments

ygerasimov’s picture

Status: Active » Fixed

I would recommend to use hook_rest_server_request_parsed_alter to amend parsed arguments. If it is still no-go I can suggest to have custom REST server class that inherits services RESTServer where you amend only getControllerArguments() method.

For more information about this change #1083242: Fix for argument source handling in REST Server

Please reopen this issue if you have any further questions.

boombatower’s picture

Based on that hook it does not seem I have the control I need to make it behave like it used to. Secondly I would rather not make this all specified to a certain server backend. Seems that I'm stuck either changing my function signatures or writing wrappers.

Thanks for the confirmation.

Hugo Wetterberg’s picture

I'm guessing that you use the source parameter data instead of data => category. If you post your definition it's easier to tell.

boombatower’s picture

https://github.com/boombatower/conduit/blob/7.x-1.x/includes/services.inc

so if I change source => 'category' it will work like it used to?

Hugo Wetterberg’s picture

No, but source => params/data => category. Again, the actual controller definition would allow me to be more specific.

boombatower’s picture

I provided the services definitions in #4 is that not what you are looking for? The functions that are called are then https://github.com/boombatower/conduit/blob/7.x-1.x/includes/api.inc.

Hugo Wetterberg’s picture

Yeah, sorry about that, replying from a phone. You want to change that to
'source' => array(
'data' => 'category',
)
/Hugo

kylebrowning’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.