I test migration (since so long); know with new i18n version.
How to get automatically translation still existing in D6 for list text value?
I see that we can translate for each field when managing content type, but system has already that translation (I can check that in admin/config/regional/translate/translate).
But in content type, field translation, that traduction does not appear, I have the default language text (French is my default language).
I also ajusted the "default translated" value in display tab of that content type.

Thinking perhaps it's needs a refresh, I go to admin/config/regional/translate/i18n_string and active refresh for fields.
I get that error :

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /cms/mdbMig540/batch?id=33&op=do StatusText: OK ResponseText: Fatal error: Cannot use string offset as an array in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\cms\mdbMig540\sites\all\modules\i18n\i18n_field\i18n_field.inc on line 148

I also respected the upgrading sequence mentionned in http://drupal.org/node/1113358

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sahuni’s picture

I'm nearly ready for my migration, but 2 or 3 problems.
Select list values not heritating translated values from D6 is one.
Do you suggest I translate again that values in D7 for me not to be blocked?

Jose Reyero’s picture

Category: bug » support
Status: Active » Closed (works as designed)

These are different translations, not using locale t(), I'm afraid you'll need to retranslate those terms.

dergachev’s picture

Title: Translation of list text » i18n_field_update_7000 fails on #allowed_values
Version: 7.x-1.4 » 7.x-1.x-dev
Component: Upgrade » Fields
Category: Support request » Bug report
Issue summary: View changes
Status: Closed (works as designed) » Active

We just ran did another D6 -> D7 upgrade with i18n, and ran into this bug for the second time.
After enabling i18n_menu, we "lost" all the #allowed_value translations. Here's a diagnostic SQL query:

SELECT  s.lid, s.location, s.textgroup, t.translation
FROM locales_source s
LEFT OUTER JOIN locales_target t
ON t.lid = s.lid
WHERE s.textgroup = 'field'
AND s.location LIKE '%admin_faculty_code%';
+-------+---------------------------------------------------+-----------+-------------------------------------------------+
| lid   | location                                          | textgroup | translation                                     |
+-------+---------------------------------------------------+-----------+-------------------------------------------------+
| 12200 | field::field_admin_faculty_code:option_CE         | field     | École d'éducation permanente                    |
| 12202 | field::field_admin_faculty_code:option_YC         | field     | Éducation permanente (sans transcription)       |
| 12309 | field::field_admin_faculty_code:option_AG         | field     | Sciences de l'agriculture et de l'environnement |
| 12310 | field::field_admin_faculty_code:option_AR         | field     | Arts et service social                          |
| 12311 | field::field_admin_faculty_code:option_AS         | field     | Interfacultaire, B.A. & Sc.                     |
| 12313 | field::field_admin_faculty_code:option_DE         | field     | Médecine dentaire                               |
| 12314 | field::field_admin_faculty_code:option_DP         | field     | Études dentaires postdoc                        |
| 12315 | field::field_admin_faculty_code:option_ED         | field     | Sciences de l'éducation                         |
| 12316 | field::field_admin_faculty_code:option_EN         | field     | Génie et l'architecture                         |
| 12317 | field::field_admin_faculty_code:option_GR         | field     | Études supérieures et recherch                  |
| 12318 | field::field_admin_faculty_code:option_LW         | field     | Droit                                           |
| 12319 | field::field_admin_faculty_code:option_MD         | field     | Médecine                                        |
| 12320 | field::field_admin_faculty_code:option_MG         | field     | Gestion                                         |
| 12321 | field::field_admin_faculty_code:option_MU         | field     | Musique                                         |
| 12322 | field::field_admin_faculty_code:option_NU         | field     | Sciences infirmières                            |
| 12323 | field::field_admin_faculty_code:option_PO         | field     | Physiothérapie et Ergothérapie                  |
| 12324 | field::field_admin_faculty_code:option_RS         | field     | Études Religieuses                              |
| 12326 | field::field_admin_faculty_code:option_ZE         | field     | École de l'environnement                        |
| 12606 | field:field_admin_faculty_code:catalog:label      | field     | NULL                                            |
| 12607 | field::field_admin_faculty_code:option_SC         | field     | NULL                                            |
| 12608 | field::field_admin_faculty_code:option_ZF         | field     | NULL                                            |
| 15126 | field:field_admin_faculty_code:#allowed_values:AG | field     | NULL                                            |
| 15127 | field:field_admin_faculty_code:#allowed_values:AR | field     | NULL                                            |
| 15128 | field:field_admin_faculty_code:#allowed_values:AS | field     | NULL                                            |
| 15129 | field:field_admin_faculty_code:#allowed_values:CE | field     | NULL                                            |
| 15130 | field:field_admin_faculty_code:#allowed_values:DE | field     | NULL                                            |
| 15131 | field:field_admin_faculty_code:#allowed_values:DP | field     | NULL                                            |
| 15132 | field:field_admin_faculty_code:#allowed_values:ED | field     | NULL                                            |
| 15133 | field:field_admin_faculty_code:#allowed_values:EN | field     | NULL                                            |
| 15134 | field:field_admin_faculty_code:#allowed_values:GR | field     | NULL                                            |
| 15135 | field:field_admin_faculty_code:#allowed_values:LW | field     | NULL                                            |
| 15136 | field:field_admin_faculty_code:#allowed_values:MD | field     | NULL                                            |
| 15137 | field:field_admin_faculty_code:#allowed_values:MG | field     | NULL                                            |
| 15138 | field:field_admin_faculty_code:#allowed_values:MU | field     | NULL                                            |
| 15139 | field:field_admin_faculty_code:#allowed_values:NU | field     | NULL                                            |
| 15140 | field:field_admin_faculty_code:#allowed_values:PO | field     | NULL                                            |
| 15141 | field:field_admin_faculty_code:#allowed_values:RS | field     | NULL                                            |
| 15142 | field:field_admin_faculty_code:#allowed_values:SC | field     | NULL                                            |
| 15143 | field:field_admin_faculty_code:#allowed_values:YC | field     | NULL                                            |
| 15144 | field:field_admin_faculty_code:#allowed_values:ZE | field     | NULL                                            |
| 15145 | field:field_admin_faculty_code:#allowed_values:ZF | field     | NULL                                            |
+-------+---------------------------------------------------+-----------+-------------------------------------------------+

We have a patch that seems to work for us, and will upload it shortly.

amirkdv’s picture

This patch should do the job. The problem, AFAIU, is that in 6.x, i18ncck does
not store the 'property' column with the content type prefix, e.g. course-field_course_number, see http://drupalcode.org/project/i18n.git/blob/refs/heads/6.x-1.x:/i18ncck/....

Consequently, the parsing logic in i18n_field_update_7000() migrates allowed
values incorrectly. In the following, I include the output of a specific query
joining data from the relevant tables: i18n_string (already renamed from
i18n_strings by i18n_string.install), locales_source, and locales_target. The
query is:

SELECT *
FROM i18n_string s
INNER JOIN locales_source ls ON ls.lid = s.lid
INNER JOIN locales_target lt ON lt.lid = s.lid
WHERE s.lid = 12316

1. before enabling i18n_field the query results in:

*************************** 1. row ***************************
        lid: 12316
  textgroup: cck
    context: field:field_admin_faculty_code:option_EN
   objectid: field_admin_faculty_code
       type: field
   property: option_EN
objectindex: 0
     format: 0
        lid: 12316
   location: field:field_admin_faculty_code:option_EN
  textgroup: cck
     source: Faculty of Engineering
    version: none
    context: field:field_admin_faculty_code:option_EN
        lid: 12316
translation: Génie et l'architecture
   language: fr
       plid: 0
     plural: 0
i18n_status: 0
l10n_status: 0

2. without the patch, i18n_field_update_7000() generates the following:

*************************** 1. row ***************************
        lid: 12316
  textgroup: field
    context: :field_admin_faculty_code:option_EN
   objectid: field_admin_faculty_code
       type:
   property: option_EN
objectindex: 0
     format: 0
        lid: 12316
   location: field::field_admin_faculty_code:option_EN
  textgroup: field
     source: Faculty of Engineering
    version: none
    context: :field_admin_faculty_code:option_EN
        lid: 12316
translation: Génie et l'architecture
   language: fr
       plid: 0
     plural: 0
i18n_status: 0
l10n_status: 0

which is clearly broken (see objectid, property, type, location and context).
3. With the given patch, we get the following:

*************************** 1. row ***************************
        lid: 12316
  textgroup: field
    context: field_admin_faculty_code:#allowed_values:EN
   objectid: #allowed_values
       type: field_admin_faculty_code
   property: EN
objectindex: 0
     format: 0
        lid: 12316
   location: field:field_admin_faculty_code:#allowed_values:EN
  textgroup: field
     source: Faculty of Engineering
    version: none
    context: field_admin_faculty_code:#allowed_values:EN
        lid: 12316
translation: Génie et l'architecture
   language: fr
       plid: 0
     plural: 0
i18n_status: 0
l10n_status: 0
amirkdv’s picture

Status: Active » Needs review