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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dopry’s picture

Status: Active » Postponed (maintainer 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?

webernet’s picture

Status: Postponed (maintainer 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?

webernet’s picture

Title: D6 Update path » D5 to D6 Update path
Matthew Davidson’s picture

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.

Matthew Davidson’s picture

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.

grendzy’s picture

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

seaneffel’s picture

Matt on #5 was spot on. I created a dummy imagefield field, copied the db_columns value from the dummy to my original imagefield in the {content_node_field} table, hand entered the values in the {content_node_field_instance} table, and then cleared my cache with Devel. All the images reappeared magically.

Thanks for posting this workaround.

webernet’s picture

Status: Active » Closed (duplicate)
aaronpinero’s picture

I had a similar issue with imagefield after updating from D5 to D6. After reading the solution provided by Matthew, I checked out the content_node_field table in the db and the db_columns field for the row that corresponds to my image field was empty. In the process of preparing to follow his protocol, I unintentionally re-saved the field's configuration settings under "Manage fields" in the associated content type. Doing so repopulated the db_columns field for the imagefield and my images once again appeared on the website. So I did the same thing for my other imagefields (simply clicking on the configure option under "Manage fields" and saving the configuration without making any changes) and all my images returned.

This error has been deviling me all day so thanks to Matthew et al for digging into this. I was wearing out Google trying to find a solution for this problem.