Just attempted an upgrade of a site from date 6.x-2.0rc6 to 6.x-2.3 and update.php never successfully finishes.

(Yes, I know 6.x-2.0rc6 is an old version, but this issue should also apply when upgrading from versions newer than 6.x-2.0rc6.)

Diagnosis:

Update.php lists available updates date:6005 and date_api:6002-6005. The updates date_api:6002-6005 runs first, creates a table {date_format}, and then renames it to {date_formats}. Update date:6005 then runs, and never finishes, because it is checking for the existence of a table {date_format} before proceeding, but {date_format} does not exist and *will not exist*. It has already been renamed to {date_formats}.

A workaround would be to get all users to upgrade to 6.x-2.2 first before attempting to upgrade to 6.x-2.3. This may be a satisfactory workaround, and perhaps you don't need to make any code fixes, but you should at least be aware of this issue.

Comments

bengtan’s picture

Priority: Normal » Critical
bengtan’s picture

One possibility is to change line 534 in date_update_6005() from:

from:

  if (!db_table_exists('date_format') || !db_table_exists('date_format_types')) {

to:

  if ((!db_table_exists('date_format') && !db_table_exists('date_formats')) || !db_table_exists('date_format_types')) {
Leeteq’s picture

Status: Active » Closed (duplicate)
bengtan’s picture

Status: Closed (duplicate) » Active

Sorry, this is different from http://drupal.org/node/535008. Please read the original post again. Thanks.

David_Rothstein’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

I confirmed that this is a problem, although I'm pretty sure 6.x-2.0rc6 is the most recent release for which it would occur (since it looks like the 2.0 release of Date is when that update function was first added...)

Looking at the affected code, the suggestion in #2 above makes sense to me, so here it is as a patch.

agileware’s picture

Version: 6.x-2.3 » 6.x-2.x-dev
StatusFileSize
new1002 bytes

The patch works for me too.

Sorry to be picky but there are a couple of unnecessary lines in the #5 patch so I have made a slightly cleaner version. It is against 6.x-2.x-dev.

pastk’s picture

subscribing

woodybrando’s picture

Hi,
I'm having the same problem and was wondering if anyone could tell me how to apply the patch.
thx, jayson
lostvalley.org

agileware’s picture

Check out this how to - http://drupal.org/patch/apply

This patch will apply with
patch -p0 < date_update_6005_2.patch

woodybrando’s picture

thx Justin for the quick reply. Which directory should I be in when i run that command?

Oops, just answered my own question. I ran that command from /var/www/sites/all/modules/ and it returned this message:
patching file date/date/date.install

thx again for the help Justin!

jayson
lostvalley.org

agileware’s picture

Generally you put the file in the folder of the module you are patching and then run the command from that same folder.

caillou’s picture

The patch works for me too.
Thanks very much !

seutje’s picture

marked #522608: date.install update 6005 problem as duplicate, even though it's older, this one is more comprehensive and offers a patch

kmonty’s picture

Status: Needs review » Reviewed & tested by the community

Patch #6 works great

karens’s picture

Status: Reviewed & tested by the community » Fixed

Yep, the table got renamed from date_format to date_formats and this test didn't get updated to match that.

glass.dimly’s picture

Did as #9 and #10 suggested, and the patch worked great. Wish I didn't have to patch at all, wish it was in Date core. Probably it is in the 2.x branch.

glass.dimly’s picture

Can somebody roll this into the current branch of the date module? It's not in the 2.x branch.

kmonty’s picture

Status: Fixed » Patch (to be ported)
anarcat’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
StatusFileSize
new1.01 KB

The ported (to 2.4) patch is attached, please commit.

anarcat’s picture

StatusFileSize
new912 bytes

Last patch unintentionally fixed line endings, fixed.

agileware’s picture

Patch in #20 works for me for 6.x-2.4

owen barton’s picture

StatusFileSize
new1.15 KB

Tested and can confirm that this fixed the issue

Updated patch for 2.x HEAD (#20 no longer applied)

karens’s picture

Status: Reviewed & tested by the community » Fixed

My original fix worked for me, could never replicate a need for a further fix, but based on the above reports I went ahead and committed it. We don't patch existing releases, only the dev version gets patched.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jwilson3’s picture

Title: Upgrading from old versions to 6.x-2.3: update.php never finishes » Upgrading from old versions to 6.x-2.4: update.php never finishes
Status: Closed (fixed) » Fixed

This bug is still apparent in the latest official release from sept 2009. Just updating the title ;)

If you hit this bug, you may want to subscribe to this thread: #837364: D6-2.x branch release?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.