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.
Comment | File | Size | Author |
---|---|---|---|
#5 | patch_68.txt | 1.25 KB | webernet |
system.install_10.patch | 1.19 KB | KarenS | |
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedWrong version...
Comment #2
chx CreditAttribution: chx commentedUsually 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.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedi agree. no harm here.
Comment #4
Dries CreditAttribution: Dries commentedThe 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.
Comment #5
webernet CreditAttribution: webernet commentedUpdated the comments, added a TODO, and rerolled from root.
Comment #6
chx CreditAttribution: chx commentedI thought even the previous one was OK...
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #8
(not verified) CreditAttribution: commented