I have just started working on a old Drupal 5 site with ubercart, that needs to be upgraded to Drupal 6.

During the upgrade process, I got a fatal error as db_next_id is deprecated and from what I've seen db_last_insert_id should be used instead.

This affects

• uc_flatrate.install
• uc_catelog.install
• uc_product.install

Comments

googletorp’s picture

Title: db_next_id in upgrade hooks D. » db_next_id in upgrade hooks deprecated.

Fixed title.

longwave’s picture

I have successfully upgraded Ubercart sites from D5 to D6 and I don't really consider this a bug. The upgrade docs at http://drupal.org/node/340073 say:

Begin the upgrade process by first upgrading Drupal and all installed modules to their latest available 5.x versions.

If you do this, the functions containing db_next_id() will already have been run. However, these update functions should probably be removed from the .install files and replaced with hook_update_last_removed() so Drupal complains if you try to upgrade to 6.x without updating to the latest 5.x version first.

tr’s picture

Title: db_next_id in upgrade hooks deprecated. » Investigate use of hook_update_last_removed() in .install files
Version: 6.x-2.4 » 7.x-3.x-dev
Category: bug » task

Like longwave said, this is the way it's supposed to be.

I don't know where I read it, but once when I looked into the matter of hook_update_last_removed() I read that updates for the current and previous Drupal versions (D6 and D5 in this case) should be retained unless they are too numerous (e.g. the system.module). In Ubercart 3.x Lyle has already thrown away all the D5->D6 update functions as well as the D6->D6 update functions, but he hasn't used hook_update_last_removed() at all. So I'm going to move the issue to the UC 3.x queue and rename it to reflect what I think is the only outstanding question from this thread.

tr’s picture

Issue tags: -5.x upgrade

Removing tag.

tr’s picture

Status: Active » Closed (duplicate)