diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index c39fcff..426fbdb 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -247,11 +247,8 @@ function comment_menu() { // so we don't end up loading it twice (in the page and access callback). $items['comment/%comment/edit'] = array( 'title' => 'Edit', - 'page callback' => 'comment_edit_page', - 'page arguments' => array(1), - 'access callback' => 'entity_page_access', - 'access arguments' => array(1, 'update'), 'type' => MENU_LOCAL_TASK, + 'route_name' => 'comment_edit_page', ); $items['comment/%comment/approve'] = array( 'title' => 'Approve', @@ -1483,19 +1480,6 @@ function comment_get_display_page($cid, $node_type) { } /** - * Page callback: Displays the comment editing form. - * - * @param Drupal\comment\Comment $comment - * The comment object representing the comment to be edited. - * - * @see comment_menu() - */ -function comment_edit_page(Comment $comment) { - drupal_set_title(t('Edit comment %comment', array('%comment' => $comment->subject->value)), PASS_THROUGH); - return entity_get_form($comment); -} - -/** * Generates a comment preview. * * @param Drupal\comment\Comment $comment diff --git a/core/modules/comment/comment.routing.yml b/core/modules/comment/comment.routing.yml new file mode 100644 index 0000000..6f786dd --- /dev/null +++ b/core/modules/comment/comment.routing.yml @@ -0,0 +1,7 @@ +comment_edit_page: + pattern: 'comment/{comment}/edit' + defaults: + _entity_form: comment.default + requirements: + _entity_access: comment.update +