Received the following warning when attempting to add the first action to a new imagecache preset. The error is due to improper escaping of quotes at least in PostgreSQL.

user warning: query: INSERT INTO imagecache_action (actionid, presetid, weight, data) VALUES (3, 1, 0, "a:1:{s:8:"function";s:5:"scale";}") in /opt/www/drupal-4.7.int.thatsbj.com/includes/database.pgsql.inc on line 113.

I changed line 385 of imagecache.module from

db_query('INSERT INTO {imagecache_action} (actionid, presetid, weight, data) VALUES (%d, %d, %d, "%s")', $next_id, $action['presetid'], $action['weight'], serialize($action['data']));

to

db_query('INSERT INTO {imagecache_action} (actionid, presetid, weight, data) VALUES (%d, %d, %d, \'%s\')', $next_id, $action['presetid'], $action['weight'], serialize($action['data']));

This appears to have solved the problem.

Comments

dopry’s picture

Status: Active » Fixed

tnx. fixed in DRUPAL-4-7 and DRUPAL-HEAD

Anonymous’s picture

Status: Fixed » Closed (fixed)