diff --git a/core/modules/block/custom_block/src/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/src/Tests/CustomBlockListTest.php index 82bcb4490897bfe7fde3da74053bc05907cc1d1c..8bded49d6eb7eb1146a7fff3797bd2aedab4ec3a 100644 --- a/core/modules/block/custom_block/src/Tests/CustomBlockListTest.php +++ b/core/modules/block/custom_block/src/Tests/CustomBlockListTest.php @@ -21,7 +21,7 @@ class CustomBlockListTest extends WebTestBase { * * @var array */ - public static $modules = array('block', 'custom_block'); + public static $modules = array('block', 'custom_block', 'config_translation'); public static function getInfo() { return array( @@ -35,7 +35,7 @@ public static function getInfo() { * Tests the custom block listing page. */ public function testListing() { - $this->drupalLogin($this->drupalCreateUser(array('administer blocks'))); + $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'translate configuration'))); $this->drupalGet('admin/structure/block/custom-blocks'); // Test for the page title. diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 256bfba7a40def737ab69ceb86d14d0119c33609..6504b86e1168baa9eca6c647693fba1463e9c21a 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -174,7 +174,10 @@ function config_translation_config_translation_info(&$info) { */ function config_translation_entity_operation(EntityInterface $entity) { $operations = array(); - if (\Drupal::currentUser()->hasPermission('translate configuration')) { + $entity_type = $entity->getEntityType(); + if ($entity_type->isSubclassOf('Drupal\Core\Config\Entity\ConfigEntityInterface') && + $entity->hasLinkTemplate('drupal:config-translation-overview') && + \Drupal::currentUser()->hasPermission('translate configuration')) { $operations['translate'] = array( 'title' => t('Translate'), 'weight' => 50,