Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Nov 2011 at 16:39 UTC
Updated:
24 Dec 2015 at 17:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
marcingy commentedThis is not a bug. The code in question is a third party library that should never have been in the repo and was infact breaking the contributor agreement so it had to be removed.
Comment #2
mcfilms commentedAlthough not a bug, I would argue that the current alert is not clear. It took a web search for me to find it (and this issue). Might I suggest:
Of course an even better solution would be to read it from the sites/all/libraries location.
Comment #3
rszrama commentedAgreed with the above and renaming this issue. I couldn't find any documentation other than failing the installation and then downloading the recommended library. Additionally, the error message isn't clear that the REST Server module wasn't in fact enabled due to the error.
I recommend changing this:
Please download <a href="@download">spyc</a> and create a file called spyc.php in rest_server/lib
To this:
The REST Server module did not install because you are missing the <a href="@download">spyc</a> library. Download that library and move its spyc.php file into services/servers/rest_server/lib.
However, as mcfilms stated, it would be much better to depend on http://drupal.org/project/libraries and allow spyc to be placed in its entirety into sites/all/libraries/spyc instead of moving a single file into the module's subdirectory.
Comment #4
ygerasimov commentedI believe this issue is irrelevant now as integration with libraries and drush has been done. Closing this issue.
Comment #5
star-szrThe docs did not get updated as part of #1325572: Integrate services with the libraries module to improve handling of third party libraries., and this seemed like the best place for this patch.
Comment #6
hypertext200#5: services-1349588-5.patch queued for re-testing.
Comment #8
kylebrowning commentedNothing here applies and its part of a dependency now.
Comment #9
s.daniel commentedCurrently updating the module seems to break services if libaries 2.x is not installed:
[Sat Dec 01 20:21:53 2012] [warn] [client ....4] mod_fcgid: stderr: PHP Fatal error: Call to undefined function libraries_load() in /var/www/vhosts/a../httpdocs/sites/all/modules/services/servers/rest_server/rest_server.install on line 18, referer: http://.../admin/reports/updates/updateAlso for me it wasn't clear what to do once services was installed. "...or use Libraries to retrieve spyc." doesn't really tell you what to do. I copied the file into half a dozen places untill it worked so I'm not sure which one was to correct one and therefor can't make a suggestion how the text should read. I have to get going but I wanted to share: The current documentation is not clear about what to do. People will come and ask again if this is left as won't fix.
Comment #10
mile23+1 on #9.
Status Report shows me this: "To enable YAML HTTP requets/responses, please download spyc and create a file called spyc.php in rest_server/lib or use Libraries to retrieve spyc."
This is despite the fact that spyc.php is in rest_server/lib.
I've also put it in sites/all/libraries and sites/all/libraries/spyc.
The status report message remains, and my Services installation doesn't seem to work, so I have no idea which moving part is to blame.
AFAIK, you can't 'use' Libraries to install anything.
Comment #11
s.daniel commentedThink so too and the documentation doesn't rely tell something different obviously. However services ships with a make file that can be used with drush make...
A quick search for the file turns up:
There are several interesting bits in there:
I fixed the above mentioned items and updated the documentation. Please see and test the attacked patch.
Comment #12
s.daniel commentedTitle change.
Comment #13
s.daniel commentedI think
on the modules page shoud be replaced by
Comment #14
kylebrowning commented"If you are using the rest server you will need to download the latest version of SPYC."
This isnt true, this is only true if you want to enable YAML.
Comment #15
s.daniel commentedThank you for your feedback.
I didn't actually touch that part in the patch. Anyway your right, here is a new patch. I updated my last comment for the modules page as well.
btw: Should we have
dependencies[] = libraries (>=2.x)in the rest_server.info? Doesn't hurt and will be needed in most cases at some point but then I guess it's not a hard requirement for the module. Checking for libraries module would be a different issue though...Comment #16
kylebrowning commentedWell, its not required.
Its only required if you want YAML, so I think we need to figure out why its crashing when someone doesnt have libraries installed.
Comment #17
rszrama commentedIt's crashing if someone doesn't have Libraries b/c you put it in rest_service.info. This means a minor update from the version before that until now will screw your site up unless you get Libraries, whether you're using YAML or not. That's why s.Daniel suggested taking it out and just documenting for YAML users that it's needed along with Spyc.
Comment #18
s.daniel commentedActually it crashes also because there are calls to libraries_load.
All right, then lets check if libraries exists before we load the lib and make libraries optional. I'll post a patch later.
Comment #19
s.daniel commentedNow with version check of libraries.
Comment #21
s.daniel commentedNeeds version checking at other places as well...
Comment #22
s.daniel commentedThe checking is now bundled in a spyc_loaded() function. Please review in detail since im a PHP novice and don't use YAML (so I cant test this part).
One thing that should be considered here is the performance indications of the checkings since I don't know if the call to system_get_info is cached etc.
Comment #24
mile23Thanks, s.Daniel!
Also, some link to a page about how to use drush make to install only Services (or any module) would be great.
Comment #25
kylebrowning commented#22 breaks test :/
Comment #26
s.daniel commented#22: services-rest_server-Spyc-make_documentation_check_libraries-1349588-22.patch queued for re-testing.
Comment #28
marcingy commentedNumber of issues
* Missing empty lines at the end of certain files causes
Also lets name space the new function so services_spyc_loaded.
The new function has a lot of white space issues and appears to use tabs rather than spaces. And why are we checking version information on every single request this is what requirments info in the info file is for or hook requirements in .install.
Comment #29
s.daniel commentedDont rly get ad hoc why some services would be affected and some not by this patch. However I don't have access to my dev machine today so here is a patch only to the README.txt to ensure that the failure is actually related to this patch.
Comment #30
s.daniel commentedSry not used to simpletest yet...
Comment #32
s.daniel commented@marcingy: Just read your message. Thanks for the review. I'll check the whitespace issues when I have access to my dev machine which should be tomorrow.
This is what I ment in regards of performance.
As kylebrowning pointed out Spyc is only required if you want to use YAML and services is only required if you want to load Spyc. Therefore I removed
dependencies[] = libraries (>=2.x). If you all feel fine with making libraries a requirement (I am) then I'll be happy to change the patch. If we don't want that we need to check for libraries & spyc in the code and then we should probably think of a better way to do this. If someone can give me a pointer how it should be done I'll do it.Comment #34
marcingy commentedI am more concerned about the version checking on each ocassion why not just do
There really is no need for the $info = system_get_info('module', 'libraries'); hunk, if libraries exists as a module we use it.
Comment #35
s.daniel commentedOnly libraries version 2 has the libraries_load function. If someone has libraries 1 installed the code would break. We could do:
if (module_exists('libraries') && function_exists('libraries_load') && ($library = libraries_load('spyc')) && $library['loaded']) {Attached a simple patch without changes to validate the tests. Actual patch follows.
Comment #36
s.daniel commentedComment #37
s.daniel commentedOK seems like the errors where from previous recent commits.
Changes: Removed the extra function. Check for function_exists. Added a link to drush_make project page.
Comment #38
marcingy commentedThinking some more about this and can't we just do
Ie if we do want to determine if the version of libraries is correct just check the function?
Few other comments
Lets have this on one line and also missing space after if.
There are tab issues isn the array hunk following this.
What does this mean
Normal REST calls will still work.Why not say 'If you require YAML HTTP requets/responses, please....'
There is a missing new line at the end of rest_server.module.
And in the readme.txt why are you wrapping at column 65 and 66 please extend to 80 characters and oly wrap if the line is going to be over 80 characters.
So mostky nitpicks otherwise the path is looking good :)
Comment #39
jacobisreal commentedI am having the same issue. The file is in both the rest_server/lib folder and the libraries folder. Yet, I'm still getting the error that YAML is disabled. Can someone please tell me how to fix this? Thanks!
Comment #40
cimo75 commentedsame as #39
Comment #41
kalis1Same here too :(Finally, I've moved spyc.php from services/servers/rest_server/lib/spyc.php to sites/all/libraries/spyc/spyc.php, cleared the cache twice (!)... and it's working well.
Comment #42
cimo75 commentedspyc.php needs to go into a spyc folder, then do the ctfc routine ..
Comment #43
jaypanThis still needs to be fixed. The error message is not only confusing, it is pointing at spyc.php to be put in the services module folder, which is incorrect.
Comment #44
hswong3i commentedI give a simplified implementation for this patch, as reference from following:
Comment #45
hswong3i commentedPatch from #44 now applied to drustack_extra.make
Comment #47
kylebrowning commentedHeres an updated patch, it should be green now as the tests have been updated.
Comment #48
kylebrowning commentedComment #49
kylebrowning commentedI should remove the debug statements, but ill do that tomorrow and commit.
Comment #50
kylebrowning commentedComment #52
elijah lynnComment #53
rakun commentedI am using regular JSON for my API, and after noticing on status page that Sypc lib is missing, I have installed it. Unfortunately it converted my API responses from JSON to YAML automatically.
This was confusing.
Next I figured out that if I just leave empty "spyc" directory in sites/all/library status message still shows spyc version 0.5.1 even though there is no Spyc.php.
This was even more confusing.
Am I doing something wrong, on this needs to be fixed, at very least not to show spyc requirement on status page if you do not use yaml?
Comment #54
marcingy commentedPlease don't open old issues for support requests