There currently seems to be lot of disabled, outdated code like selecting node transations on the translation set page.

Working on it...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
14.81 KB

Ok, here is a first patch.

- The whole thing (adding and removing nodes to a translation set) should be working now.
- Also wrote some tests for it
- Fixed a bug in the tests base class and made it a bit more extensible (allow to provide additional admin permissions).

Jose Reyero’s picture

Status: Needs review » Active

Looks great, you even added some test, thanks!

This is committed. There are a few minor issues with this page though that we can fix with next patches:

- Language neutral showing up?
- Language names for fields.

(changed issue status to active, instead of fixed, though patch is committed)

Berdir’s picture

Status: Active » Needs review
FileSize
1.06 KB

Ok, new patch to hide the language neutral row.

Berdir’s picture

FileSize
1.05 KB

Updated patch with a better comment.

Jose Reyero’s picture

Status: Needs review » Fixed

Fixed, thanks.

Lars Toomre’s picture

A small nit when reviewing this issue for examples of tests... I think that the middle test below was meant to make sure that the english autocomplete suggestion was found. Am I wrong?

+    // Check the autocomplete suggestions.
+    $this->drupalGet('i18n/node/autocomplete/page/es/' . substr($es_title, 0, 3));
+    $this->assertText($es_title);
+    $this->assertNoText($en_title);
+    $this->assertNoText($ptbr_title);
+
+    $this->drupalGet('i18n/node/autocomplete/page/es/' . substr($en_title, 0, 3));
+    $this->assertNoText($es_title);
+    $this->assertNoText($en_title);
+    $this->assertNoText($ptbr_title);
+
+    $this->drupalGet('i18n/node/autocomplete/page/pt-br/' . substr($ptbr_title, 0, 3));
+    $this->assertNoText($es_title);
+    $this->assertNoText($en_title);
+    $this->assertText($ptbr_title);
Berdir’s picture

Actually, no. It was meant to make sure that the english autocomplete does *not* work when using the spanish autocomplete path.

Lars Toomre’s picture

OK... But then what is the purpose of the third test? It appears to be like the first of the three just using a different parameter.

Berdir’s picture

It is. 1 and 2 test the same thing, just using two different languages. 2 tests that it does not work when using the wrong language.

Lars Toomre’s picture

Thanks for the explanation... I am learning more about testing all the time and am now including an in-line comment in my own code above what here was 1), 2) and 3). It helps me remember in plain text what condition was being tested for.

Jose Reyero’s picture

Status: Fixed » Needs work
FileSize
45.82 KB

I am seeing you get all languages for autocomplete (enabled and disabled ones) which is not consistent with other options (extended language option for nodes) and also not consistent with the list above.

See screenshot. Chinese and Portuguese are disabled languages.

Berdir’s picture

Status: Needs work » Needs review
Issue tags: -di18nscb

Ok, disabled languages are now hidden, test has been updated to catch this.

Berdir’s picture

Issue tags: +di18nscb
FileSize
3.1 KB

Ok, disabled languages are now hidden, test has been updated to catch this.

Jose Reyero’s picture

Status: Needs review » Fixed

Committed, thanks.

It works great now!

Jose Reyero’s picture

Status: Fixed » Closed (fixed)

Keeping our list clean.