array(
'name' => 'message',
'type' => 'string',
'source' => 'data',
'optional' => FALSE,
),
When using this argument definition and sending the data with the
Content-Disposition "form-data", the callback gets an empty array
(instead of one holding the 'message' argument) for some operations,
even though the message argument has been set in the sent request.
This only happens for form-data, if you use
"Content-Type: application/x-www-form-urlencoded" instead,
it works just fine.
It also only happens for some operation definitions. For other ones it works.
For a 'working' operation it always works, while for a non-working one it never does.
http://npaste.de/p/Hf/ This is the code in which I encountered the issue.
The message argument works fine with form-data in the 'create'-operation
while it always fails in the 'update'-operation.
I also noted that even though I marked this argument as being non-optional
it doesn't get tested for. This seems to be the case for all arguments with
'source' => 'data'. Shouldn't this be implementable with array_key_exists?
Comments
Comment #1
skyredwangI can confirm this bug. The form-data works fine for POST, but if the method is PUT, the values passed through aren't parsed (they are empty). Switching to "application/x-www-form-urlencoded" is a workaround.
Comment #2
marcingy commentedThis is not a major bug
Comment #3
kylebrowning commentedbut how do we fix it :(
Comment #4
kylebrowning commentedCleaning issue queue. If someone wishes to work on this, let me know by reopening this ticket.