I'm testing an upgrade from Drupal 5 to 6, and I consistently get the following MySQL warning when running update.php:

user warning: Table 'r2_drupal.node_field_instance' doesn't exist query: SELECT field_name, type_name, display_settings FROM node_field_instance WHERE widget_type = 'image' in C:\Users\bondra.4\Documents\ApacheRoot\R2_redesign\r2_drupal\sites\all\modules\imagefield\imagefield.install on line 92.

I get no installation errors, just the warning.

I've followed the documentation (installing all other modules (specifically CCK, Image API, and File Field) before installing ImageField.

After upgrading and getting this warning, my Image fields don't seem to show that any images are associated with my content. (i.e. when editing content there's no indication that the images previously associated with the nodes are still there)

Comments

zooney’s picture

Priority: Normal » Critical

I just checked through my database and it seems that that table may actually be named "content_node_field_instance" and not "node_field_instance".

In content_node_field_instance it seems as if the columns "widget_type" and "widget_module" aren't getting updated how I would expect given the form of the query in the error.

They still have values such as "imagefield_widget" and "imagefield" respectively. I imagine you may simply be attempting to rename them "image_widget" and "image" for the Drupal 6 version, I can't say.

Is that what needs to happen? If so I can run a simple query to fix it. I may attempt doing so in that I seem to be getting peculiar errors when trying to update the image fields, (such as a dropdown menu for a required field not being able to be set to any value I give it, even though the value I'm setting is obviously valid... ...what with it actually being in the dropdown... :) )

zooney’s picture

I mentioned in my previous comment that this error might be linked to a problem with the dropdown menus when I create nodes with CCK fields. This is not the case. That is an unrelated bug which shows up regardless of ImageField being enabled.

Apologies for the excessive self-commenting, I'm having trouble figuring out what exactly is failing here.

All I can say is that there seems to be some issue with the installer. It doesn't seem to properly update pre-existing image fields from a Drupal 5 install.

zooney’s picture

Priority: Critical » Normal

Although this warning still persists, it seems innocuous.

I've found that my further problems with the upgrade process were simply due to the need to generate thumbnails for pre-existing images. I've put that in a new issue: http://drupal.org/node/372239

quicksketch’s picture

Status: Active » Fixed

This problem existed in imagefield_update_3() I believe. It would only occur if you upgraded from a version of ImageField prior to 2.3 directly to the Drupal 6 version. The problem was that imagefield_update_3() assumed the D5 table structure and CCK functions, however since you ran the update on Drupal 6, the table name had changed and it didn't run properly.

To prevent this problem from happening again, I implemented hook_update_last_removed() and removed updates 1-3 from the Drupal 6 version. Unfortunately this means that it's impossible to upgrade from D5 to D6 unless you upgrade to ImageField 2.3 or later on your D5 site before upgrading. However, this is a common approach since many other modules (such as CCK itself) won't update unless you're running the latest schema.

This change was made in #397578: Uncouple ImageField from FileField Custom Hooks.

Status: Fixed » Closed (fixed)

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