I have a clients site running 6.x-1.3 and they want additional functionality that I believe was introduced in the 6.x-3.x branch, so I'm in the process of upgrading homebox on there site.

Both the frontpage and the module itself says that a complete un-install and re-install is required, which is very disappointing it's not really a valid approach for deploying the update to the site.

So I intend to implement some sort of upgrade path, which the module should definitely have (if possible), but just looking at the .install of the 1.3 and 3.x versions it's quite obvious that there are issues, the 1.3 version has hook_update_N() numbered 6001 -> 6005, whereas the 3.x version has 6000 -> 6003. This of course means that the schema version for the module in 1.3 is higher than that in 3.x.....

General rule of thumb is that the numbering of hook_update_N() should be:
XY##
X = Major version of Drupal (6)
Y = Major version of Module (1,2,3)
## = Incremental number (00, 01, 02)

This is so that when you got from the 6.x-1.x branch to the 6.x-2.x branch all updates in between will be run and then the user will have an upgrade path.

I'm sure there was a valid reason made to not do this, but it means that my job is now much harder.

Fixing this issue now is also likely to be quite hard, because re-numbering the hook_update_N() functions will cause issues for all.

Will try to submit a patch, but the first version will most likely just be a case of providing an upgrade path just for 1.3 -> the latest 3.x

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deciphered’s picture

Title: Re-used hook_update_N() functions » 6.x-1.3 upgrade path
Category: bug » task
Status: Active » Needs review
FileSize
5.34 KB

So as I said at the end, I would likely just concentrate on adding the upgrade path from 1.3 to 3.x, I have updated to title to reflect that and a patch is ready to go.

It's implemented with a check so while it will run on all previous versions, the actual logic for the upgrade path will only be triggered if coming from the 1.x branch.

Haven only tested it from 1.3 to 3.0-beta5, and all seems well so far.

Cheers,
Deciphered.

Deciphered’s picture

Updated patch, adds a drupal_flush_all_caches() so that drupal_write_record() uses the updated tables.

Deciphered’s picture

And hopefully the last change, forgot to re-add the primary keys.

drumm’s picture

Status: Needs review » Closed (won't fix)

Homebox 6.x is no longer supported. If this still works with an upgrade to Drupal 7, please re-open the issue.

There are very few sites still running 6.x-1.x, and I have no real way to test it.