Needs review
Project:
OpenScholar
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2011 at 19:01 UTC
Updated:
6 May 2011 at 15:38 UTC
Editing a group space preset and saving results in the following error:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ''' at line 1 query: SELECT id FROM purl WHERE provider = 'vsite_domain' AND = '' in /var/www/SCHOLAR-2-0-BETA10/sites/all/modules/contrib/purl/purl.module on line 591.
Comments
Comment #1
rolando.isidoro commentedHi Mark,
I got the same error you described and dug a little bit into the source code and this is what I could figure out. In the file sites/all/modules/contrib/purl/purl.module, at line 582 we have the purl_delete function as follow:
The error "user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ''' at line 1 query: SELECT id FROM purl WHERE provider = 'vsite_domain' AND = '' in /sites/all/modules/contrib/purl/purl.module on line 591" is thrown when the previous function is called with the following argument:
Following the code we can easily see that with this input, both variables $param and $where aren't set, resulting in the malformed query. From the looks of it, this occurs when we don't set any value in the Your Sites Custom Domain form field.
Backtracing the source code a little more the call to the previous function is made in the /sites/all/modules/openscholar_vsite/vsite_domain/vsite_domain.module file, at line 173 in the vsite_domain_vsite_generic_settings_domain_submit function.
To solve the problem we could reinforce the 1st if statement in this function, changing it from:
to:
Best regards,
Rolando