reverted: --- b/core/modules/responsive_preview/lib/Drupal/responsive_preview/DeviceAccessController.php +++ /dev/null @@ -1,40 +0,0 @@ -hasPermission('administer site configuration'); - break; - } - } - - /** - * {@inheritdoc} - */ - protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { - return $account->hasPermission('administer site configuration'); - } - -} diff -u b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Entity/Device.php b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Entity/Device.php --- b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Entity/Device.php +++ b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Entity/Device.php @@ -19,7 +19,6 @@ * label = @Translation("Responsive preview device"), * module = "responsive_preview", * controllers = { - * "access" = "Drupal\responsive_preview\DeviceAccessController", * "storage" = "Drupal\Core\Config\Entity\ConfigStorageController", * "list" = "Drupal\responsive_preview\DeviceListController", * "form" = { @@ -28,6 +27,7 @@ * "delete" = "Drupal\responsive_preview\Form\DeviceDelete" * } * }, + * admin_permission = "administer site configuration", * config_prefix = "responsive_preview.device", * entity_keys = { * "id" = "id", diff -u b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Form/DeviceDelete.php b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Form/DeviceDelete.php --- b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Form/DeviceDelete.php +++ b/core/modules/responsive_preview/lib/Drupal/responsive_preview/Form/DeviceDelete.php @@ -19,7 +19,7 @@ * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete the device %name?', array('%name' => $this->entity->label())); + return $this->t('Are you sure you want to delete the device %name?', array('%name' => $this->entity->label())); } /** @@ -35,7 +35,7 @@ * {@inheritdoc} */ public function getConfirmText() { - return t('Delete'); + return $this->t('Delete'); } /** @@ -44,7 +44,7 @@ public function submit(array $form, array &$form_state) { $this->entity->delete(); watchdog('responsive_preview', 'Device %name has been deleted.', array('%name' => $this->entity->label())); - drupal_set_message(t('Device %name has been deleted.', array('%name' => $this->entity->label()))); + drupal_set_message($this->t('Device %name has been deleted.', array('%name' => $this->entity->label()))); $form_state['redirect'] = 'admin/config/content/responsive-preview'; } diff -u b/core/modules/responsive_preview/responsive_preview.module b/core/modules/responsive_preview/responsive_preview.module --- b/core/modules/responsive_preview/responsive_preview.module +++ b/core/modules/responsive_preview/responsive_preview.module @@ -34,25 +34,6 @@ 'description' => 'Configure device listings for content preview.', 'route_name' => 'responsive_preview.device.list', ); - $items['admin/config/content/responsive-preview/add'] = array( - 'route_name' => 'responsive_preview.device.add', - 'type' => MENU_SIBLING_LOCAL_TASK, - ); - $items['admin/config/content/responsive-preview/%responsive_preview_device'] = array( - 'title' => 'Edit device', - 'route_name' => 'responsive_preview.device.edit', - ); - $items['admin/config/content/responsive-preview/%responsive_preview_device/edit'] = array( - 'title' => 'Edit device', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/config/content/responsive-preview/%responsive_preview_device/delete'] = array( - 'title' => 'Delete device', - 'route_name' => 'responsive_preview.device.delete', - 'type' => MENU_LOCAL_TASK, - 'context' => MENU_CONTEXT_INLINE, - 'weight' => 10, - ); return $items; } /** @@ -96,20 +77,6 @@ } /** - * Fetches a responsive preview device by ID. - * - * @param string $id - * A string representing the device ID (machine name). - * - * @return - * A fully-loaded device object if a device with the given ID exists, - * or FALSE otherwise. - */ -function responsive_preview_device_load($id) { - return entity_load('responsive_preview_device', $id); -} - -/** * Prevents the preview tab from rendering on administration pages. */ function responsive_preview_access() { only in patch2: unchanged: --- /dev/null +++ b/core/modules/responsive_preview/responsive_preview.contextual_links.yml @@ -0,0 +1,5 @@ +responsive_preview.device.delete: + title: 'Delete device' + route_name: responsive_preview.device.delete + weight: 10 + group: responsive_preview only in patch2: unchanged: --- /dev/null +++ b/core/modules/responsive_preview/responsive_preview.local_tasks.yml @@ -0,0 +1,4 @@ +responsive_preview.device.edit: + route_name: responsive_preview.device.edit + title: 'Edit device' + tab_root_id: responsive_preview.device.edit