Closed (fixed)
Project:
Internationalization
Version:
7.x-1.x-dev
Component:
Upgrade
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Jun 2011 at 05:16 UTC
Updated:
26 Mar 2012 at 18:20 UTC
After upgrading the core from D6 to D7, and re-enabling the "String translation" module (latest i18n on d6 to 7.x-1.0-beta7), the following error occured when running update.php:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'context' cannot be null: UPDATE {locales_source} s SET s.context = (SELECT l.context FROM {i18n_string} l WHERE l.lid = s.lid); Array ( ) ini18n_string_update_7000() (line 147 of/var/www/robbie.basex.be/sites/all/modules/i18n/i18n_string/i18n_string.install).
I'll try running the update queries manually and see when and why this goes wrong...
Comments
Comment #1
xgmorkx commentedSeems that the following statement "UPDATE {locales_source} s SET s.context = (SELECT l.context FROM {i18n_string} l WHERE l.lid = s.lid);" causes problems, because there are a bunch (thousands) of records in my locales_source table, with a textgroup of "default" that don't exist in the i18n_string table. They will probably pose the same problem on upgrading i18n_menu, i18n_block, ...
Any suggestions?
Comment #2
jose reyero commentedThis should be fixed now. Please try latest (dev) version.
Comment #3
hs@henrikstrindberg.se commentedHi!
Got this error message after enabling String translation when upgrading form D6 to D7 and using the latest dev version:
PDOException: SQLSTATE[22004]: Null value not allowed: 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'textgroup' at row 0: UPDATE {i18n_string} s SET s.textgroup = (SELECT l.textgroup FROM {locales_source} l WHERE l.lid = s.lid); Array ( ) in i18n_string_update_7000() (line 214 of - - - - - /i18n/i18n_string/i18n_string.install).
Best / Henrik
Comment #4
jose reyero commentedThen we need to reopen I guess.
Comment #5
jose reyero commentedI'm thinking that all rows in locales_source should have a valid textgroup value. So you may have corrupted data in that table, please check.
Comment #6
jose reyero commentedFeel free to reopen if you can provide more information.
Comment #7
promesI downloaded version 7.x-1.4 today and got this error after upgrading D6->D7 and enabling the string translation module.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'textgroup' cannot be null: UPDATE {i18n_string} s SET s.textgroup = (SELECT l.textgroup FROM {locales_source} l WHERE l.lid = s.lid); Array ( ) in i18n_string_update_7000() (line 215 of example.com\sites\all\modules\i18n\i18n_string\i18n_string.install).
After this the string translation module was enabled. Enabling the variable translation module didn't give any problems.
I am testing the D7 upgrade of a site on my local pc with a WAMP installation, PHP 5.3.1, MySQL 5.1.41.
Comment #8
dkingofpa commentedI'm getting the "Column 'textgroup' cannot be null" error as well. I first looked to see which lid's from the i18n_strings table weren't in locales_source:
SELECT s.lid FROM i18n_strings s LEFT JOIN locales_source l ON s.lid = l.lid WHERE l.lid IS NULL;So before I enable the i18n_string module, I delete those rows from the i18n_strings table.
DELETE s FROM i18n_strings s LEFT JOIN locales_source l ON s.lid = l.lid WHERE l.lid IS NULL;Now I don't get that error when I enable the i18n_string module. I don't know if this is bad data or if it's a bug. Should we be handling this better in the i18n_string_update_7000() function?
Comment #9
jose reyero commentedOk, so instead of wasting time wondering why there's bad data on that table we clean it up before the update. Added a similar query to the update function.
This should fix the issue.