The system module is creating the node_type table in update_1005, but not checking whether the table exists before doing so. This is the table that was used by CCK in the 4.7 version. Anyone currently using CCK who has kept their code up to date and has performed all the updates will have no problem with the system update because their version of the node_type table will have been renamed. However, many people have not kept it up to date and still have the node_type table on their system. Worse, some people may have tried CCK out long enough to create that table but no longer have CCK installed.

We have been struggling in http://drupal.org/node/100744 to find a way to correct the problems that arise if someone with a non-current version of CCK updates to 5.0, and have concluded there is just no way we can fix or overcome all the problems that could result without a core patch (especially for users who don't have CCK enabled when they do the 5.0 update).

As it stands, they will get a whole page of error messages because the table will not be created, and all the subsequent steps will fail. This will provide a very ugly upgrade experience.

I propose a patch to update_1005 that should fix things whether or not the user has CCK installed at the time they do the update. It just checks if the table exists already, and renames it if it does, then proceeds to create the proper table.

CommentFileSizeAuthor
#5 patch_68.txt1.25 KBwebernet
system.install_10.patch1.19 KBKarenS
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Version: 4.7.4 » 5.x-dev

Wrong version...

chx’s picture

Status: Needs review » Reviewed & tested by the community

Usually this kind of code is not accepted. But, this does not bloat the running code of Drupal, this only runs on install. So no probs with that.

And while core mostly does not care about contrib, this is CCK. I think we are better off with this than without it. Esp that it can't possibly break anything: if you had your own custom table named node_types , zero sweat, your data remained.

moshe weitzman’s picture

i agree. no harm here.

Dries’s picture

Status: Reviewed & tested by the community » Needs work

The quality of the code comment needs work. For example, it lacks capitalization.

I'd also add a TODO to indicate that this hack should be removed in Drupal 6.0.

webernet’s picture

Status: Needs work » Needs review
FileSize
1.25 KB

Updated the comments, added a TODO, and rerolled from root.

chx’s picture

Status: Needs review » Reviewed & tested by the community

I thought even the previous one was OK...

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)