diff -u b/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module --- b/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -157,9 +157,9 @@ */ function config_translation_entity_access(EntityInterface $entity, $operation, AccountInterface $account, $langcode) { if ($operation == 'translate' && $account->hasPermission('translate configuration')) { - return $entity::ALLOW; + return TRUE; } - return $entity::DENY; + return NULL; } /** diff -u b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php --- b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationEntityListController.php @@ -73,6 +73,8 @@ '#type' => 'operations', '#links' => $this->operations->getOperations($entity, $this->currentUser), ); + // This is a translation UI for translators. Show the translation + // operation only. foreach (array_keys($row['operations']['data']['#links']) as $operation) { if ($operation != 'translate') { unset($row['operations']['data']['#links'][$operation]); @@ -93,21 +95,6 @@ /** * {@inheritdoc} */ - public function buildOperations(EntityInterface $entity) { - $operations = parent::buildOperations($entity); - foreach (array_keys($operations['#links']) as $operation) { - // This is a translation UI for translators. Show the translation - // operation only. - if (!($operation == 'translate')) { - unset($operations['#links'][$operation]); - } - } - return $operations; - } - - /** - * {@inheritdoc} - */ public function sortRows($a, $b) { return $this->sortRowsMultiple($a, $b, array('label')); } diff -u b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php --- b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -148,50 +148,6 @@ /** * {@inheritdoc} */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - $uri = $entity->uri(); - - $operations['clone'] = array( - 'title' => $this->t('Clone'), - 'href' => $uri['path'] . '/clone', - 'options' => $uri['options'], - 'weight' => 15, - ); - - // Add AJAX functionality to enable/disable operations. - foreach (array('enable', 'disable') as $op) { - if (isset($operations[$op])) { - $operations[$op]['ajax'] = TRUE; - $operations[$op]['route_name'] = 'views_ui.operation'; - $operations[$op]['route_parameters'] = array('view' => $entity->id(), 'op' => $op); - // @todo Remove this when entity links use route_names. - unset($operations[$op]['href']); - } - } - - return $operations; - } - - /** - * {@inheritdoc} - */ - public function buildOperations(EntityInterface $entity) { - $build = parent::buildOperations($entity); - - // Allow operations to specify that they use AJAX. - foreach ($build['#links'] as &$operation) { - if (!empty($operation['ajax'])) { - $operation['attributes']['class'][] = 'use-ajax'; - } - } - - return $build; - } - - /** - * {@inheritdoc} - */ public function render() { $entities = $this->load(); $list['#type'] = 'container';