Not 100% sure if this is critical, but it totally breaks the site, so..

When enabling the image.module on a upgraded site that had D6's image.module installed, Drupal does not install the schema because it thinks that the module has already been installed. This leads to pretty fatal table not found errors all over the place. Re-installing the module works, but is not exactly user friendly :)

Proposed solutions:
- Remove image.module from system table during upgrade
- Add a update function to image.module that is basically hook_install() if the tables are not yet there.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Issue tags: +D7 upgrade path

Seems critical enough to me, image.module has many thousands of users.

sun’s picture

Status: Active » Needs review
FileSize
565 bytes

omg.

The only viable way I see would be to add a update function to both core and image module (empty there).... d'oh, fatal error, omgomgomgomg

Alright. Add one update function to core that installs the new schema. At the same time, only add a comment to image.install in contrib to skip this update number.

...will break if the contributed module needs to add some updates. So let's make that update number high enough.

---

ok, just attached the patch, and now I realize that sites/all/modules/image has to be removed (or replaced) prior to upgrading to Drupal 7. image.info, image.install, image.module must not exist, or Drupal won't load the core files.

So this patch probably works, but the high number is probably not needed.

Berdir’s picture

Isn't that wrong? For example, if we add an additional column to a image.module table and a update function which would add that, 7099 would install the table with that attribute and 7100 would try to add it again.

See http://drupal.org/node/150220

catch’s picture

Status: Needs review » Needs work

Yes especially in this case we'll need to redeclare the full schema definition.

Berdir’s picture

Status: Needs work » Needs review
FileSize
3.04 KB

Ok, renamed the update function to 7000 (D6's image.module will have a different name in D7 or not exist at all or am I wrong? Also, Drupal will only include one image.module/install anyway) and duplicated the schema definition. I've also added a (single) tableExists() call to only create the tables if they aren't yet there.

catch’s picture

Status: Needs review » Reviewed & tested by the community

D6 image.module can't exist in D7, at least not on the same site, so I think we're good here.

sun’s picture

I agree. If this will need further tweaks, separate issue.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -D7 upgrade path

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