diff --git a/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php index fbe08c9..522344b 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationOperationsTest.php @@ -108,14 +108,9 @@ public function testOperationTranslateLink() { $this->assertResponse(403); $this->drupalLogout(); - // Ensure that when I disable translation for a content type I don't - // see a translate link anymore in the actions block. - $this->drupalLogin($this->baseUser2); - // Place the actions block. - $this->drupalPlaceBlock('local_tasks_block'); - // Publish the node again. + // Ensure the 'Translate' local task does not show up anymore when disabling + // translations for a content type. $node->setPublished(TRUE)->save(); - // Make the user ablo to submit the translation settings form. user_role_change_permissions( Role::AUTHENTICATED_ID, [ @@ -123,20 +118,17 @@ public function testOperationTranslateLink() { 'administer languages' => TRUE, ] ); - // Warm cache. + $this->drupalPlaceBlock('local_tasks_block'); + $this->drupalLogin($this->baseUser2); $this->drupalGet('node/' . $node->id()); - // Check that we can see the translate link. $this->assertLinkByHref('node/' . $node->id() . '/translations'); - // Make article not translatable. $this->drupalPostForm('admin/config/regional/content-language', ['settings[node][article][translatable]' => FALSE], t('Save configuration')); - // Go back to the node. $this->drupalGet('node/' . $node->id()); - // Check that there is no link to translate anymore. $this->assertNoLinkByHref('node/' . $node->id() . '/translations'); } /** - * Test the access to the overview page for translations. + * Tests the access to the overview page for translations. * * @see content_translation_translate_access() */ diff --git a/core/modules/language/src/Form/ContentLanguageSettingsForm.php b/core/modules/language/src/Form/ContentLanguageSettingsForm.php index cf17c31..18575b7 100644 --- a/core/modules/language/src/Form/ContentLanguageSettingsForm.php +++ b/core/modules/language/src/Form/ContentLanguageSettingsForm.php @@ -168,8 +168,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ->save(); } } - // Invalidate the rendered tag cache because we need to show new actions in - // blocks with tabs. eg. "Translate". + // Invalidate the 'rendered' tag cache in order to refresh tab links + // like "Translate". $this->cacheTagsInvalidator->invalidateTags(['rendered']);; drupal_set_message($this->t('Settings successfully updated.')); }