Column locales_target.i18n_status is present in the source db, but after migration missing in the target db (verified on the database level).

The column was created in sites/all/modules/i18n/i18n_string/i18n_string.install.

An attempt to switch to the secondary language in the target-db-based Drupal installation results in:

PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column t.i18n_status does not exist at character 43: SELECT s.*, t.translation AS translation, t.i18n_status AS i18n_status FROM {i18n_string} s LEFT OUTER JOIN {locales_target} t ON s.lid = t.lid WHERE (s.textgroup = :db_condition_placeholder_0) AND (s.context = :db_condition_placeholder_1) AND (t.language = :db_condition_placeholder_2) LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => views [:db_condition_placeholder_1] => project_list_simple_:default:title [:db_condition_placeholder_2] => de ) in i18n_string_textgroup_default::load_translation() (line 600 of /opt/drupal/sites/all/modules/i18n/i18n_string/i18n_string.

Comments

manitoba22’s picture

Workarround: Insert the missing field (does not migrate any data!) to eliminate the sql error

drush php-eval "$schema = drupal_get_schema('locales_target', TRUE); db_add_field('locales_target', 'i18n_status', $schema['fields']['i18n_status']);"

unkn0wn’s picture

Asi i understand, migration process had a problems. Today i try to migrate to postgresql, but i have an error:
PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column "i18n_status" of relation "locales_target" does not exist LINE 1: ...target (lid, translation, language, plid, plural, i18n_statu... ^: INSERT INTO locales_target (lid, translation, language, plid, plural, i18n_status) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_ ....
I check schema, but it's ok:

$schema['locales_target'] = array(
  'description' => 'Stores translated versions of strings.',
  'fields' => array(
.....
   'i18n_status' => array(
      'description' => 'A boolean indicating whether this translation needs to be updated.',
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
  ),

Also, target table locales_target is empty, and there is no column 'i18n_status', althought original DB has this column.

I try to disable/uninstall/enable modules - no success.

Enabled modules: Internationalization, Field Translation, String Translation.

josh waihi’s picture

Status: Active » Fixed

Please try the new 7.x-1.1 release (currently building as I write this!) or the HEAD from git. There is an alter schema fix that may also fix this issue. Please re open if new release doesn't fix the issue. Cheers.

unkn0wn’s picture

Version: 7.x-1.0 » 7.x-1.1
Status: Fixed » Needs review

v.1.1 fix problem via drush, but when i try to migrate via web interface, error "column "i18n_status" of relation "locales_target" does not exist" is here.

Problem is in dbtng_migrator_batch_install_schema function, and it's very strange for me: function made call for rupal_alter('schema', $schema); , and module i18n_string must modify schema, but it's not true: when i patch dbtng_migrator_batch_install_schema like

....
    foreach ($original_schema_table_list as $name) {
      $table = $schema[$name];
      db_set_active($destination);


+      if ($name == "locales_target") {
+        print_r($table);
+    }
      db_create_table($name, $table);
      $success = db_table_exists($name);
....

i see:

Array ( [description] => Stores translated versions of strings. [fields] => Array ( [lid] => Array ( [type] => int [not null] => 1 [default] => 0 [description] => Source string ID. References {locales_source}.lid. ) [translation] => Array ( [type] => text [mysql_type] => blob [not null] => 1 [description] => Translation string value in this language. ) [language] => Array ( [type] => varchar [length] => 12 [not null] => 1 [default] => [description] => Language code. References {languages}.language. ) [plid] => Array ( [type] => int [not null] => 1 [default] => 0 [description] => Parent lid (lid of the previous string in the plural chain) in case of plural strings. References {locales_source}.lid. ) [plural] => Array ( [type] => int [not null] => 1 [default] => 0 [description] => Plural index number in case of plural strings. ) ) [primary key] => Array ( [0] => language [1] => lid [2] => plural ) [foreign keys] => Array ( [locales_source] => Array ( [table] => locales_source [columns] => Array ( [lid] => lid ) ) ) [indexes] => Array ( [lid] => Array ( [0] => lid ) [plid] => Array ( [0] => plid ) [plural] => Array ( [0] => plural ) ) [module] => locale [name] => locales_target )
There is no i18n_status field. It twise strange for me, because migration via drush works ok.

josh waihi’s picture

Drush and the web interface use the same method for migration. I wonder if the issue was due to cache?

unkn0wn’s picture

Status: Needs review » Closed (fixed)

Before migration i clear cache twise. Also i disable eaccelerator, run update.php, run apache with mod_php instead of php_fpm - no success. If it's a cache problem - looks like it's a very sly cache.

May be something wrong with my configuration? FreeBSD 9.0, Apache 2.2.22, PHP 5.3.11, migration MySQL 5.5.23 -> PostgreSQL 9.1.2, Drupal 7.14, enabled modules:
# ./drush pml | grep Enabled

 Administration   Administration menu (admin_menu)     Module  Enabled        7.x-3.0-rc2
 Chaos tool       Chaos tools (ctools)                 Module  Enabled        7.x-1.0
 Commerce         Cart (commerce_cart)                 Module  Enabled        7.x-1.2
 Commerce         Checkout (commerce_checkout)         Module  Enabled        7.x-1.2
 Commerce         Commerce (commerce)                  Module  Enabled        7.x-1.2
 Commerce         Commerce UI (commerce_ui)            Module  Enabled        7.x-1.2
 Commerce         Customer (commerce_customer)         Module  Enabled        7.x-1.2
 Commerce         Customer UI (commerce_customer_ui)   Module  Enabled        7.x-1.2
 Commerce         Line Item (commerce_line_item)       Module  Enabled        7.x-1.2
 Commerce         Line Item UI                         Module  Enabled        7.x-1.2
 Commerce         Order (commerce_order)               Module  Enabled        7.x-1.2
 Commerce         Order UI (commerce_order_ui)         Module  Enabled        7.x-1.2
 Commerce         Payment (commerce_payment)           Module  Enabled        7.x-1.2
 Commerce         Payment Method Example               Module  Enabled        7.x-1.2
 Commerce         Payment UI (commerce_payment_ui)     Module  Enabled        7.x-1.2
 Commerce         Price (commerce_price)               Module  Enabled        7.x-1.2
 Commerce         Product (commerce_product)           Module  Enabled        7.x-1.2
 Commerce         Product Pricing                      Module  Enabled        7.x-1.2
 Commerce         Product Pricing UI                   Module  Enabled        7.x-1.2
 Commerce         Product Reference                    Module  Enabled        7.x-1.2
 Commerce         Product UI (commerce_product_ui)     Module  Enabled        7.x-1.2
 Commerce         Commerce Feeds (commerce_feeds)      Module  Enabled        7.x-1.2
 Core             Block (block)                        Module  Enabled        7.14
 Core             Blog (blog)                          Module  Enabled        7.14
 Core             Color (color)                        Module  Enabled        7.14
 Core             Comment (comment)                    Module  Enabled        7.14
 Core             Contact (contact)                    Module  Enabled        7.14
 Core             Content translation (translation)    Module  Enabled        7.14
 Core             Contextual links (contextual)        Module  Enabled        7.14
 Core             Dashboard (dashboard)                Module  Enabled        7.14
 Core             Database logging (dblog)             Module  Enabled        7.14
 Core             Field (field)                        Module  Enabled        7.14
 Core             Field SQL storage                    Module  Enabled        7.14
 Core             Field UI (field_ui)                  Module  Enabled        7.14
 Core             File (file)                          Module  Enabled        7.14
 Core             Filter (filter)                      Module  Enabled        7.14
 Core             Help (help)                          Module  Enabled        7.14
 Core             Image (image)                        Module  Enabled        7.14
 Core             List (list)                          Module  Enabled        7.14
 Core             Locale (locale)                      Module  Enabled        7.14
 Core             Menu (menu)                          Module  Enabled        7.14
 Core             Node (node)                          Module  Enabled        7.14
 Core             Number (number)                      Module  Enabled        7.14
 Core             Options (options)                    Module  Enabled        7.14
 Core             Path (path)                          Module  Enabled        7.14
 Core             RDF (rdf)                            Module  Enabled        7.14
 Core             Search (search)                      Module  Enabled        7.14
 Core             Shortcut (shortcut)                  Module  Enabled        7.14
 Core             System (system)                      Module  Enabled        7.14
 Core             Taxonomy (taxonomy)                  Module  Enabled        7.14
 Core             Text (text)                          Module  Enabled        7.14
 Core             Update manager (update)              Module  Enabled        7.14
 Core             User (user)                          Module  Enabled        7.14
 Database         Schema (schema)                      Module  Enabled        7.x-1.x-dev
 DBTNG            DBTNG Migrator (dbtng_migrator)      Module  Enabled        7.x-1.1
 Development      Devel (devel)                        Module  Enabled        7.x-1.2
 Feeds            Feeds (feeds)                        Module  Enabled        7.x-2.0-alp
 Feeds            Feeds Admin UI (feeds_ui)            Module  Enabled        7.x-2.0-alp
 Feeds            Feeds Tamper (feeds_tamper)          Module  Enabled        7.x-1.0-bet
 Feeds            Feeds Tamper Admin UI                Module  Enabled        7.x-1.0-bet
 Feeds            Feeds: Entity Translation            Module  Enabled        7.x-1.x-dev
 Fields           Address Field (addressfield)         Module  Enabled        7.x-1.0-bet
 Fields           Title (title)                        Module  Enabled        7.x-1.0-alp
 Mail             Simplenews (simplenews)              Module  Enabled        7.x-1.0-bet
 Menus            Mega Menu (megamenu)                 Module  Enabled        7.x-1.x-dev
 Multilingual     Entity translation                   Module  Enabled        7.x-1.x-dev
 Multilingual -   Field translation (i18n_field)       Module  Enabled        7.x-1.5
 Multilingual -   Internationalization (i18n)          Module  Enabled        7.x-1.5
 Multilingual -   Multilingual content (i18n_node)     Module  Enabled        7.x-1.5
 Multilingual -   Multilingual select (i18n_select)    Module  Enabled        7.x-1.5
 Multilingual -   String translation (i18n_string)     Module  Enabled        7.x-1.5
 Other            Advanced help (advanced_help)        Module  Enabled        7.x-1.0
 Other            Entity API (entity)                  Module  Enabled        7.x-1.0-rc2
 Other            Entity tokens (entity_token)         Module  Enabled        7.x-1.0-rc2
 Other            Global Redirect (globalredirect)     Module  Enabled        7.x-1.4 no
 Other            Job Scheduler (job_scheduler)        Module  Enabled        7.x-2.0-alp
 Other            Libraries (libraries)                Module  Enabled        7.x-1.0
 Other            Pathauto (pathauto)                  Module  Enabled        7.x-1.0+3-d
 Other            Scheduler (scheduler)                Module  Enabled        7.x-1.0
 Other            Token (token)                        Module  Enabled        7.x-1.0+2-d
 Rules            Rules (rules)                        Module  Enabled        7.x-2.1
 Rules            Rules UI (rules_admin)               Module  Enabled        7.x-2.1
 Taxonomy Menu    Taxonomy Menu (taxonomy_menu)        Module  Enabled        7.x-1.2
 Variable         Variable (variable)                  Module  Enabled        7.x-1.2
 Views            Views (views)                        Module  Enabled        7.x-3.3
 Views            Views Bulk Operations                Module  Enabled        7.x-3.0-rc1
 Views            Views UI (views_ui)                  Module  Enabled        7.x-3.3
 Voting           Rate (rate)                          Module  Enabled        7.x-1.3
 Voting           Voting API (votingapi)               Module  Enabled        7.x-2.6
 Core             Seven (seven)                        Theme   Enabled        7.14
 Other            Ecommerce Pro (cos)                  Theme   Enabled        7.x-1.0

I admit the thought that my webserver may have a problems (because migration via drush is ok), so i'll change status to fixed. Please reopen issue if someone else have a problem with migration via web interface.