summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2017-03-07 18:45:40 (GMT)
committerxjm2017-03-07 18:45:40 (GMT)
commit252ff769249e59bf24d8f55d1df844f866c8f198 (patch)
tree357814994fc8c019cf10f25dc215ea436fc234e4
parentd370ee76fe43ff0fff0226ee5f4cc320adbe0ce6 (diff)
Revert "Issue #2671058 by Jo Fitzgerald, hchonov, tstoeckler, tameeshb, Munavijayalakshmi, pguillard: OverviewTerms doesn't respect the current content language when building the form and term urls and names are generated based on the terms default language"
This reverts commit d370ee76fe43ff0fff0226ee5f4cc320adbe0ce6.
-rw-r--r--core/modules/taxonomy/src/Form/OverviewTerms.php9
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php33
2 files changed, 0 insertions, 42 deletions
diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php
index 0ccb24b..b5014bb 100644
--- a/core/modules/taxonomy/src/Form/OverviewTerms.php
+++ b/core/modules/taxonomy/src/Form/OverviewTerms.php
@@ -22,13 +22,6 @@ class OverviewTerms extends FormBase {
protected $moduleHandler;
/**
- * The entity manager.
- *
- * @var \Drupal\Core\Entity\EntityManagerInterface
- */
- protected $entityManager;
-
- /**
* The term storage handler.
*
* @var \Drupal\taxonomy\TermStorageInterface
@@ -45,7 +38,6 @@ class OverviewTerms extends FormBase {
*/
public function __construct(ModuleHandlerInterface $module_handler, EntityManagerInterface $entity_manager) {
$this->moduleHandler = $module_handler;
- $this->entityManager = $entity_manager;
$this->storageController = $entity_manager->getStorage('taxonomy_term');
}
@@ -217,7 +209,6 @@ class OverviewTerms extends FormBase {
];
foreach ($current_page as $key => $term) {
/** @var $term \Drupal\Core\Entity\EntityInterface */
- $term = $this->entityManager->getTranslationFromContext($term);
$form['terms'][$key]['#term'] = $term;
$indentation = [];
if (isset($term->depth) && $term->depth > 0) {
diff --git a/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php
index f60e77e..fb000e9 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php
@@ -107,37 +107,4 @@ class TermLanguageTest extends TaxonomyTestBase {
$this->assertOptionSelected('edit-langcode-0-value', 'cc', "The expected langcode, 'cc', was selected.");
}
- /**
- * Tests that translated terms are displayed correctly on the term overview.
- */
- public function testTermTranslatedOnOverviewPage() {
- // Configure the vocabulary to not hide the language selector.
- $edit = [
- 'default_language[language_alterable]' => TRUE,
- ];
- $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id(), $edit, t('Save'));
-
- // Add a term.
- $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add');
- // Submit the term.
- $edit = [
- 'name[0][value]' => $this->randomMachineName(),
- 'langcode[0][value]' => 'aa',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']);
- $term = reset($terms);
-
- // Add a translation for that term.
- $translated_title = $this->randomMachineName();
- $term->addTranslation('bb', [
- 'name' => $translated_title,
- ]);
- $term->save();
-
- // Overview page in the other language shows the translated term
- $this->drupalGet('bb/admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview');
- $this->assertPattern('|<a[^>]*>' . $translated_title . '</a>|', 'The term language is correct');
- }
-
}