Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've detected two important problems in the upgrade procedure:
- The update does not work with
locale.module
enabled. This happens because functionlocale()
is called before tablelocales_source
is created. ALTER TABLE {table} ALTER COLUMN column DROP NOT NULL
is not a valid MySQL syntax.ALTER TABLE {table} MODIFY new_definition
must be used instead.
Comment | File | Size | Author |
---|---|---|---|
#7 | updates.inc_0.diff | 974 bytes | David Poblador i Garcia |
#6 | updates.inc.diff | 974 bytes | David Poblador i Garcia |
Comments
Comment #1
Dries CreditAttribution: Dries commentedComment #2
Dries CreditAttribution: Dries commentedComment #3
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedDavid, can you provide more info? Before the new locale module was committed to core, the upgrade process was tested several times and found to be working.
Comment #4
David Poblador i Garcia CreditAttribution: David Poblador i Garcia commentedSteps to reproduce the problem:
locale.module
.conf.php
into the right settings.users_roles
andlocales_meta
.http://host/update.php
.This makes Drupal crash:
Hope to be helpful.
Comment #5
David Poblador i Garcia CreditAttribution: David Poblador i Garcia commentedI've found more details! There are four wrong SQL sentences at the end of
update_85()
that cause some errors to be written bywatchdog.module
.watchdog()
usest()
to write the message, and given the factlocales_source
is not yet created, it produces above error.These are the wrong sentences:
Comment #6
David Poblador i Garcia CreditAttribution: David Poblador i Garcia commentedI've written a patch which solves the problem. I've changed above four SQL sentences.
Comment #7
David Poblador i Garcia CreditAttribution: David Poblador i Garcia commentedI've written a patch which solves the problem. I've changed above four SQL sentences.
Comment #8
Dries CreditAttribution: Dries commentedWhat's wrong with these queries? Please elaborate.
Comment #9
David Poblador i Garcia CreditAttribution: David Poblador i Garcia commentedmysql> ALTER TABLE aggregator_feed ALTER COLUMN image DROP NOT NULL;
ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL' at line 1
mysql>
Tested on MySQL 4.0.21 and 3.23.49.
Comment #10
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #11
Dries CreditAttribution: Dries commentedComment #12
(not verified) CreditAttribution: commentedComment #13
(not verified) CreditAttribution: commentedI'm having more problems with upgrading to 4.5 from 4.4 when I had locale module installed on 4.4 (disabled before attempting to upgrade to 4.5).
The update.php file says that I should manually create table locales_meta, with the following sql:
CREATE TABLE locales_meta (
locale varchar(12) NOT NULL default '',
name varchar(64) NOT NULL default '',
enabled int(2) NOT NULL default '0',
isdefault int(2) NOT NULL default '0',
plurals int(1) NOT NULL default '0',
formula varchar(128) NOT NULL default '',
PRIMARY KEY (locale)
);
But there's already a locales_meta table, with the following (and different) structure:
CREATE TABLE `locales_meta` (
`locale` varchar(12) NOT NULL default '',
`name` varchar(64) NOT NULL default '',
`name_en` varchar(64) NOT NULL default '',
`status` int(2) NOT NULL default '0',
`plurals` int(1) NOT NULL default '0',
`formula` varchar(128) NOT NULL default '',
PRIMARY KEY (`locale`)
) TYPE=MyISAM;
There's also a locales_source and a locales_target table, which makes me think that I will encounter more trouble when I try to run the database update script.
Since I have only a single entry translated in locales, my workaround is to just drop locales_meta, locales_source, and locales_target (I can recreate them after update succeeds). But I think this is a bug in update procedure, caused by weirdness around locale being moved from contrib into core.
Cheryl
Comment #14
(not verified) CreditAttribution: commentedSo I re-open this bug (sorry!).
Cheryl
Comment #15
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedCheryl, you apparently have been using the contrib locale module for 4.4 which was later merged into core. The merge required a slightly reworked db structure. I did not provide an upgrade path for the 4.4 users. The proper way to upgrade would be to export the PO files, delete the tables, run upgrade.php, and re-import the PO files.
Comment #16
(not verified) CreditAttribution: commented