Skip to content
Snippets Groups Projects
Commit 78251c46 authored by catch's avatar catch
Browse files

Issue #3084030 by hchonov, jibran: route node.add should be defined through...

Issue #3084030 by hchonov, jibran: route node.add should be defined through _entity_form instead through _controller
parent 04febf66
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ node.add_page:
node.add:
path: '/node/add/{node_type}'
defaults:
_controller: '\Drupal\node\Controller\NodeController::add'
_entity_form: 'node.default'
_title_callback: '\Drupal\node\Controller\NodeController::addPageTitle'
requirements:
_node_add_access: 'node:{node_type}'
......@@ -35,6 +35,7 @@ node.add:
_node_operation_route: TRUE
parameters:
node_type:
type: entity:node_type
with_config_overrides: TRUE
entity.node.preview:
......
......@@ -121,8 +121,13 @@ public function addPage() {
*
* @return array
* A node submission form.
*
* @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Define
* entity form routes through the _entity_form instead through the
* _controller directive.
*/
public function add(NodeTypeInterface $node_type) {
@trigger_error(__METHOD__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Define entity form routes through the _entity_form instead through the _controller directive. See https://www.drupal.org/node/3084856', E_USER_DEPRECATED);
$node = $this->entityTypeManager()->getStorage('node')->create([
'type' => $node_type->id(),
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment