Commit 01b33f5a authored by alexpott's avatar alexpott

Issue #1978946 by tim-e: Convert comment_edit_page() to a Controller.

parent a82a5efe
......@@ -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',
......@@ -1480,19 +1477,6 @@ function comment_get_display_page($cid, $node_type) {
return floor($ordinal / $comments_per_page);
}
/**
* 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.
*
......
comment_edit_page:
pattern: 'comment/{comment}/edit'
defaults:
_entity_form: comment.default
requirements:
_entity_access: comment.update
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment