cannot upgrade spam module from 5.x-3.0-beta1 to 6.x-1.0
| Project: | Hosting |
| Version: | 6.x-0.4-alpha2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
So this is rather weird. I'm getting an error trying to upgrade my blog from Drupal 5.17 to Drupal 6.20. I am running the spam module version 5.x-3.0-beta1 and the version on the new platform is 6.x-1.0.
Out of the box, alpha2 will refuse doing the upgrade: there will be an error marked in the platform listing. When comparing packages, it shows the spam module as only version "6" in the target column (as opposed to 6.x-1.0), and the box is red.
spam 5.x-3.0-beta1 (5305) 6When running the comparison request by hand, we see the following in the tables:
mysql> SELECT * FROM current c LEFT JOIN target t ON c.nid=t.nid WHERE (c.schema_version > t.schema_version) OR (c.version_code > t.version_code) AND NOT ( (c.version_code < t.version_code) OR (c.schema_version < t.schema_version)) AND c.status=1;
+-----+------------+--------------+----------------+---------------+--------+------+------------+--------------+----------------+---------+--------+
| nid | short_name | version_code | schema_version | version | status | nid | short_name | version_code | schema_version | version | status |
+-----+------------+--------------+----------------+---------------+--------+------+------------+--------------+----------------+---------+--------+
| 54 | spam | 50003000301 | 5305 | 5.x-3.0-beta1 | 1 | 54 | spam | 60001000500 | 0 | 6.x-1.0 | 0 |
+-----+------------+--------------+----------------+---------------+--------+------+------------+--------------+----------------+---------+--------+Notice the version_code is 0 for the 6.x instance.
I have a solution, but i'm a bit unsure about it so I'm uploading it for review. The first chunk fixes the display in the comparison page by priorising upgrades and the second one fixes the platform listing by making sure the target code is valid when comparing.
The patch sits in my production branch (as I needed it right away!): http://git.koumbit.net/?p=drupal/modules/hosting/.git;a=commitdiff_plain...
I'm a bit unconfortable about having different algorithms for the two functions.
Testing required.

#1
A patch is necessary on the backend too:
http://git.koumbit.net/?p=drupal/modules/provision/.git;a=commitdiff_pla...
#2
it's only checking schema versions now, and spam module had it's schema removed.
#3
I have ported the patches to current head:
http://git.koumbit.net/?p=drupal/modules/provision/.git;a=commitdiff_pla...
http://git.koumbit.net/?p=drupal/modules/hosting/.git;a=commitdiff_plain...
Also note that this may be related to #605406: package comparison : removal of d5->d6 upgrade path means D7 package schema version not detectable.
#4
the issue is that the module itself provides no upgrade path.
all the updates have been removed, so there is no upgrade path :
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/spam/spam.i...
we detect the schema version of the module based on which update_x functions are contained inside the .install file, so this leaves us with 2 options.
1. disable the module before doing the migration, and re-enable it.
2. consider the minimum target schema version to be the current schema version. this might open us to other errors however.
#5
committed with slight variations.
thanks anarcat.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.