Closed (won't fix)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Nov 2011 at 15:23 UTC
Updated:
4 Nov 2011 at 00:16 UTC
When the REST server tries to render an empty response body in YAML, a PHP error is generated:
Invalid argument supplied for foreach() in sites/all/modules/services/servers/rest_server/lib/spyc.php on line 167.
This would come up, for instance, from the services error resulting from failed session authentication. The Spyc class expects an array and it doesn't check if the supplied argument is null before diving into the loop. Attached is a possible solution.
| Comment | File | Size | Author |
|---|---|---|---|
| yaml_rendering.patch | 647 bytes | kevin.dutra |
Comments
Comment #1
marcingy commentedPostponed until a decision on #1325572: Integrate services with the libraries module to improve handling of third party libraries. is made.
Comment #2
ygerasimov commented@kevin.dutra will following simple code work?
Could you please test?
As I understand issue #1325572 won't change the behavior of the bug.
Comment #3
marcingy commentedNeeds be fixed in d7 first
Comment #4
kevin.dutra commented@ygerasimov
Yes, it looks like the type cast also works. I didn't realize that casting null to array would yield an empty array, so I'll have to file that one away in the back of my brain somewhere :)
Comment #5
kylebrowning commentedSo what are we doing here?
Comment #6
cotto commentedNote that #1313976: upgrade SPYC to latest version would fix this issue too.
Comment #7
marcingy commentedWe are removing this library #1325572: Integrate services with the libraries module to improve handling of third party libraries. very soon as it should not be in the repo. Marking as postponed as the the efforts should be placed on the other issue - note you can update to the new version spyc if you wish right now.
Comment #8
marcingy commentedLibraries no longer ship with services