Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello, I can't create new actions in presets. When I save action, I've got an error:
user warning: Unknown column 'module' in 'field list' query: INSERT INTO imagecache_action (presetid, weight, module, action, data) VALUES (0, 0, 'imagecache', 'imagecache_scale_and_crop', 'a:2:{s:5:\"width\";s:3:\"100\";s:6:\"height\";s:2:\"70\";}') in D:\portal\nnn\www\includes\common.inc on line 3318.
My solution is to add new update iteration for missing field in imagecache.install
function imagecache_update_5() {
$ret = array();
db_add_field($ret, 'imagecache_action', 'module', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE));
return $ret;
}
Comment | File | Size | Author |
---|---|---|---|
#17 | imagecache_304376.patch | 2.3 KB | drewish |
#16 | imagecache_304376.patch | 2.28 KB | drewish |
#13 | imagecache.install.patch | 1.85 KB | zroger |
#12 | imagecache.install.patch | 1.74 KB | zroger |
#4 | imagecache.install.patch | 1.17 KB | zroger |
Comments
Comment #1
drewish CreditAttribution: drewish commentedif that's a D6 update function (i'm guessing it is because it's calling db_add_field()) then the update needs to be named 6000.
marked #321190: Drupal 6 upgrade path as a duplicate... it has the update number right but wasn't using db_add_field(). it also had a bit to set the module on existing actions:
not sure if it's necessary but since i'm marking it as duplicate i didn't want that bit get lost.
also this need to be submitted as a proper patch see http://drupal.org/patch for more details
Comment #2
zroger CreditAttribution: zroger commentedHere's a patch that implements imagecache_update_6000(). It modifies the tables to make the primary keys serial types. It follows the way it is done for core in system_update_6019.
Comment #3
zroger CreditAttribution: zroger commentednew patch also removes imagecache entries in the sequences table
Comment #4
zroger CreditAttribution: zroger commentedsorry for so many posts/patches.
this one uses update_sql for the sequences queries rather than db_query
Comment #5
drewish CreditAttribution: drewish commentedseems like the autoincrement is duplicating the patch on #333769: imagecache_preset needs auto increment?
Comment #6
drewish CreditAttribution: drewish commentedmarked the other as a duplicate of this issue.
Comment #7
drewish CreditAttribution: drewish commentedseems like the delete query could go inside the for loop...
Comment #8
marcoBauli CreditAttribution: marcoBauli commentedpatch at #6 didn't fix the problem here.. running update.php performs the new updates, but i am still getting the warning
Comment #9
SlipAngel CreditAttribution: SlipAngel commentedI just applied the patch at #4, and I can now add presets again. I am still unable to add actions to the presets. I do not get an error message. After clicking "Add Action" I am returned to the preset's screen with only the "Add Actions" dropdown showing. Any ideas?
Comment #10
ravenGR CreditAttribution: ravenGR commentedI have the same experience as @SlipAngel exactly - I can create the preset name, but after creating and clicking "add action" for any given preset, I am returned to the Actions interface without a preset action. Preset actions from my 6.x ubercart installation are there, but I can't add any new preset actions.
Comment #11
trupalizer CreditAttribution: trupalizer commentedI got it working after applying the patch #4, running update.php and adding this database column manually, as suggested in http://drupal.org/node/331858#comment-1099296 :
ALTER TABLE imagecache_action ADD module VARCHAR(255) AFTER weight;
Comment #12
zroger CreditAttribution: zroger commentedHere's a new patch that addresses the missing module column. I used schema.module to figure out what else might be missing and noticed that the presetid index was also missing.
Another serious problem that I found is that imagecache_update_4() is missing a break after the mysql/mysqli case, causing the postgres case to also run. This created a couple of errors during my update. I've added the break and all seems to be working.
Comment #13
zroger CreditAttribution: zroger commentedjust noticed from the duplicate issue that the module field should also be populated with 'imagecache'.
new patch to fix it.
Comment #14
drewish CreditAttribution: drewish commentedyou cannot call:
in an update function. think about it for a second, what happens when we update the schema and someone who's upgrading from D5 runs this? they'll be getting a current copy of the schema and updates after this will fail. you need to put a full copy of the field in the update function.
we don't need:
because db_add_field() will look in the $spec parameter for the key 'initial' which will be used to fill the newly created field.
Comment #15
drewish CreditAttribution: drewish commentedalso the break in update_4() has been committed in another patch.
Comment #16
drewish CreditAttribution: drewish commentedhere's an untested patch.
Comment #17
drewish CreditAttribution: drewish commentedokay, tested this and i'm satisfied. committed to HEAD.