Problem

  1. Enabling extra core modules after installation in a no English language throws missing index all over the place.
  2.  

  3. Also make sure to run import when adding a new languages
  4.  

  5. Also make sure to run the import on module enable for all enabled languages

Reproduce

Install with another language then English, then enable an extra core module. New translation is imported but then locale.bulk.inc throws error trying to processes the missing 'language' element in array(options).

We also prob. need tests coverage for this.

Files: 
CommentFileSizeAuthor
#13 i1751326-test-do-not-test.patch2.08 KBattiks
#8 i1751326-test.patch1.88 KBattiks
FAILED: [[SimpleTest]]: [MySQL] 40,649 pass(es), 12 fail(s), and 0 exception(s).
[ View ]
#1 language_empty_array_fix.patch1.03 KBsteinmb
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch language_empty_array_fix.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

steinmb’s picture

StatusFileSize
new1.03 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch language_empty_array_fix.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Let's get rid of those pesky index warnings first.

larowlan’s picture

Status:Active» Needs review
attiks’s picture

Status:Needs review» Reviewed & tested by the community

applies cleanly and works

Gábor Hojtsy’s picture

Issue tags:+sprint
Gábor Hojtsy’s picture

Title:language prosesses missing array element» When locale import happens on module enable, many notices are thrown
Status:Reviewed & tested by the community» Needs work

Maybe better title. Also still need tests. Should be as simple as setting the dir to the simpletest translations dir, and then enable a module and see what happens :)

attiks’s picture

Title:When locale import happens on module enable, many notices are thrown» language prosesses missing array element
Assigned:Unassigned» attiks
attiks’s picture

Title:language prosesses missing array element» When locale import happens on module enable, many notices are thrown

X-post

attiks’s picture

Status:Needs work» Needs review
StatusFileSize
new1.88 KB
FAILED: [[SimpleTest]]: [MySQL] 40,649 pass(es), 12 fail(s), and 0 exception(s).
[ View ]

failing test

Status:Needs review» Needs work

The last submitted patch, i1751326-test.patch, failed testing.

YesCT’s picture

Just some small coding style item. http://drupal.org/node/1354#general

+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.phpundefined
@@ -238,6 +238,46 @@ class LocaleImportFunctionalTest extends WebTestBase {
+    // Code for the language - manually set to match the test translation file.
...
+    // The English name for the language.

These comments should be sentences.

Like:
// Manually set the code for the language to match the test translation file.

and:
// Set the English name for the langage.

LoMo’s picture

I was able to replicate the issue and can confirm that the first (passing) patch applies cleanly and does what we need it to. No notices are displayed when enabling additional core modules and the localization import works properly, too.

attiks’s picture

Assigned:attiks» Unassigned
  1. Also make sure to run import when adding a new languages
  2. Also make sure to run the import on module enable for all enabled languages
attiks’s picture

StatusFileSize
new2.08 KB

latest patch, untestable of the issues in #12

attiks’s picture

Status:Needs work» Postponed
Gábor Hojtsy’s picture

Issue tags:+language-ui

Tagging for interface translation.

Gábor Hojtsy’s picture

Status:Postponed» Needs review

What else is left? @penyaskito, @attiks are you still experiencing this?

attiks’s picture

I think #12 still needs to be done, but not even sure if it's still a problem.

Let's try a retest first

attiks’s picture

#1: language_empty_array_fix.patch queued for re-testing.

LoMo’s picture

Hi attiks and Gábor,

Looks like the patch no longer applies properly... but also seems that we no longer have the long list of notices when following the "steps to replicate". Currently, I'm also not seeing much in the way of interface translation import happening, either (see #1785250: Undefined index: langcode in locale_translate_batch_import() and translations not imported), but even after making a small change that seems to correct that issue, when enabling another core module, I see UI translation take place (new strings imported), and no list of notices like we had before.

I think this might have been resolved by other fixes(?) I was going to see if I could re-roll the patch, but it really seems that the patch is no longer needed.

attiks’s picture

Status:Needs review» Closed (cannot reproduce)

i think it's save to close this, if the problem appears again, feel free to re-open this. i noticed the problem while working on the translations:// patch, but i didn't saw if last week.

@lomo thanks for testing.

LoMo’s picture

Right... I agree that it should be closed (at least for now). And thank you for all you are doing, Peter. It was nice seeing you in Munich. :-)

Anyway, while I didn't see lots of notices (earlier symptoms for this issue), I did see things not working at all properly and one notice that hinted why; I didn't see translations getting properly imported till I added the bit in #1785250: Undefined index: langcode in locale_translate_batch_import() and translations not imported. I'm wondering if someone can reproduce the issue I was seeing and verify or improve my patch. It's likely that you could reproduce the issue I observed even if installing in English, then adding another language, changing to it, and activating modules which trigger new string translation imports.

Gábor Hojtsy’s picture

Issue tags:-sprint

Moving off of the sprint.

Gábor Hojtsy’s picture

Issue summary:View changes

Updated issue summary.