Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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_7203
With 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.
Comment | File | Size | Author |
---|---|---|---|
#3 | fontyourface-fontyourface_update_7203_did_not_work_properly_on_some_databases-1803264-3.patch | 1.17 KB | Drave Robber |
Comments
Comment #1
Drave Robber CreditAttribution: Drave Robber commentedAccording 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().
Comment #2
Drave Robber CreditAttribution: Drave Robber commentedBy 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().
Comment #3
Drave Robber CreditAttribution: Drave Robber commentedActually, 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)
Comment #4
sreynen CreditAttribution: sreynen commentedCommitted.