Posted by cledwyn on October 4, 2012 at 1:33pm
4 followers
| Project: | @font-your-face |
| Version: | 7.x-2.x-dev |
| Component: | Code (general) |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
The update command for function fontyourface_upadate_7203() is invalid sql format for SQLite. It should be
/**
* Remove single quotes from CSS selectors
*/
function fontyourface_update_7203() {
db_query("UPDATE {fontyourface_font} SET css_family = REPLACE(css_family, '''', '');");
} // fontyourface_update_7203With this modification the update script runs.
Also, per Issue #14 on http://www.sqlite.org/faq.html, the single-quote(') charachter are escaped by putting two single quotes in a row.
Comments
#1
According to http://dev.mysql.com/doc/refman/5.1/en/string-literals.html,
...so proposed fix is OK for MySQL (checked docs for 5.0 and 5.1, tested live on 5.1.63-0ubuntu0.11.04.1);
I can't right now find authoritative reference for PostgreSQL, but AFAIR
''was considered the normal way there, and\'the odd one.I'm not sure however how to fix this for SQLite users who have already ran this update - it might take fontyourface_update_7204().
#2
By the way, does it throw errors in SQLite or just fails silently? If the latter, we might make "do it once again, this time properly" fontyourface_update_7204().
#3
Actually, documentation for db_query() explicitly warns against using it for UPDATE queries.
Patch attached.
(Trying to remove single quotes once again where fontyourface_update_7203 worked would not do much harm, I reckon)
#4
Committed.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.