D5 to D6 Update path

webernet - July 23, 2008 - 22:14
Project:ImageField
Version:6.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Comparing an imagefield created in 6.x with a 5.x update, the following are not being updated properly:
content_node_field_instance -- widget_type, widget_module, widget_active

Even after correcting those fields, images still aren't appearing.

#1

dopry - July 23, 2008 - 22:20
Status:active» active (needs more info)

how are they not being updates properly? Do you have an example table you can dump for testing... content_node_field and content_node_instance before and after update?

#2

webernet - July 23, 2008 - 22:37
Status:active (needs more info)» active

The following changes are not made (still needed):

content_node_field_instance:
widget_type: "image" --> "imagefield_widget"
widget_module: "" --> "imagefield"
widget_active: "0" --> "1"

content_node_field
db_columns: shouldn't be empty?

#3

webernet - August 10, 2008 - 13:35
Title:D6 Update path» D5 to D6 Update path

#4

Matthew Davidson - August 28, 2008 - 04:00

Here are the two tables before and after for a (fortunately) very simple site I've just upgraded from Drupal 5.9/Imagefield 5.x-2.1 to Drupal 6.4/Imagefield 6.x-3.0-alpha1.

AttachmentSize
imagefield-6.x-3.0-alpha1.sql_.txt2.03 KB
imagefield-5.x-2.1.sql_.txt1.61 KB

#5

Matthew Davidson - September 1, 2008 - 01:39

Here's a workaround that kinda works. Sorry I can't provide a patch, but I'm not at all familiar with how .install files work, and that's where the problem is bound to be.

  1. Make a new field, either using the same site/database with a different field name, or a different site/database, which works the way you want your old field to work.
  2. In the `content_node_field` table, copy the content of the `db_columns` field from your new (imagefield) field to your old (imagefield) field. (okay, the two contexts for the word 'field' is confusing here). In my case this content was 'a:3:{s:3:"fid";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}s:4:"list";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}s:4:"data";a:2:{s:4:"type";s:4:"text";s:9:"serialize";b:1;}}', but I expect this will vary depending on how you've configured your field.
  3. In the `content_node_field_instance` field for your old (imagefield) field, change `widget_type` to 'imagefield_widget', `widget_module` to 'imagefield', and `widget_active` to '1'
  4. You will probably need to clear your Drupal cache (using Devel module or whatever), and check your field's config and display settings at '/admin/content/node-type/*'.

I'm finding that on old nodes, image thumbnails are not being displayed on the edit form, but this may be an unrelated issue, and I can live with that. New uploaded images are fine.

#6

grendzy - September 15, 2008 - 23:02

I had this issue too. Matthew's post #5 did work, although it took a few tries to get right (once, the database column content_type_TYPENAME.field_FIELDNAME_fid got dropped from the database).

 
 

Drupal is a registered trademark of Dries Buytaert.