diff --git a/core/lib/Drupal/Core/Entity/EntityAccessController.php b/core/lib/Drupal/Core/Entity/EntityAccessController.php index da0c003..06e92f2 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessController.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessController.php @@ -45,7 +45,7 @@ public function access(EntityInterface $entity, $operation, $langcode = Language // We grant access to the entity if both of these conditions are met: // - No modules say to deny access. // - At least one module says to grant access. - $access = module_invoke_all($entity->entityType() . '_access', $entity, $operation, $account, $langcode); + $access = module_invoke_all($entity->entityType() . '_access', $entity->getBCEntity(), $operation, $account, $langcode); if (in_array(FALSE, $access, TRUE)) { $return = FALSE; diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 4bc59fe..350b4e3 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -59,6 +59,10 @@ protected function prepareEntity() { public function form(array $form, array &$form_state) { $node = $this->entity; + if ($this->operation == 'edit') { + drupal_set_title(t('Edit @type @title', array('@type' => node_get_type_label($node), '@title' => $node->label())), PASS_THROUGH); + } + $user_config = config('user.settings'); // Some special stuff when previewing a node. if (isset($form_state['node_preview'])) { diff --git a/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php b/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php index fc4da34..5503100 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php @@ -25,7 +25,8 @@ * "render" = "Drupal\node\NodeRenderController", * "access" = "Drupal\node\NodeAccessController", * "form" = { - * "default" = "Drupal\node\NodeFormController" + * "default" = "Drupal\node\NodeFormController", + * "edit" = "Drupal\node\NodeFormController" * }, * "translation" = "Drupal\node\NodeTranslationController" * }, diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 2cd835f..82c4ce6 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1711,13 +1711,9 @@ function node_menu() { ); $items['node/%node/edit'] = array( 'title' => 'Edit', - 'page callback' => 'node_page_edit', - 'page arguments' => array(1), - 'access callback' => 'node_access', - 'access arguments' => array('update', 1), + 'route_name' => 'node_page_edit', 'type' => MENU_LOCAL_TASK, 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE, - 'file' => 'node.pages.inc', ); $items['node/%node/delete'] = array( 'title' => 'Delete', diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 9aa4982..3fb5260 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -12,22 +12,6 @@ use Drupal\Core\Entity\EntityInterface; /** - * Page callback: Presents the node editing form. - * - * @param object $node - * A node object. - * - * @return array - * A form array as expected by drupal_render(). - * - * @see node_menu() - */ -function node_page_edit($node) { - drupal_set_title(t('Edit @type @title', array('@type' => node_get_type_label($node), '@title' => $node->label())), PASS_THROUGH); - return entity_get_form($node); -} - -/** * Page callback: Displays add content links for available content types. * * Redirects to node/add/[type] if only one content type is available. diff --git a/core/modules/node/node.routing.yml b/core/modules/node/node.routing.yml new file mode 100644 index 0000000..0fc5af9 --- /dev/null +++ b/core/modules/node/node.routing.yml @@ -0,0 +1,6 @@ +node_page_edit: + pattern: '/node/{node}/edit' + defaults: + _entity_form: 'node.edit' + requirements: + _entity_access: 'node.update'