Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2012 at 04:59 UTC
Updated:
2 May 2012 at 19:10 UTC
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
Comment #1
ygerasimov commentedI 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.
Comment #2
boombatower commentedBased 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.
Comment #3
Hugo Wetterberg commentedI'm guessing that you use the source parameter data instead of data => category. If you post your definition it's easier to tell.
Comment #4
boombatower commentedhttps://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?
Comment #5
Hugo Wetterberg commentedNo, but source => params/data => category. Again, the actual controller definition would allow me to be more specific.
Comment #6
boombatower commentedI 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.
Comment #7
Hugo Wetterberg commentedYeah, sorry about that, replying from a phone. You want to change that to
'source' => array(
'data' => 'category',
)
/Hugo
Comment #8
kylebrowning commentedhttps://github.com/boombatower/conduit/pull/1