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, the single-quote(') charachter are escaped by putting two single quotes in a row.

#3 fontyourface-fontyourface_update_7203_did_not_work_properly_on_some_databases-1803264-3.patch1.17 KBDrave Robber
PASSED: [[SimpleTest]]: [MySQL] 9 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


Drave Robber’s picture

According to,

A “'” inside a string quoted with “'” may be written as “''”. 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().

Drave Robber’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
Status: Needs review » Needs work

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().

Drave Robber’s picture

Status: Needs work » Needs review
1.17 KB
PASSED: [[SimpleTest]]: [MySQL] 9 pass(es). View

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)

sreynen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.