Commit ab87217a authored by Dries's avatar Dries

Issue #1999340 by chertzog, kim.pepper: Use Symfony Request for comment module.

parent 23faf5a2
......@@ -20,7 +20,7 @@
* @see comment_multiple_delete_confirm()
*/
function comment_admin($type = 'new') {
$edit = $_POST;
$edit = Drupal::request()->request->all();
if (isset($edit['operation']) && ($edit['operation'] == 'delete') && isset($edit['comments']) && $edit['comments']) {
return drupal_get_form('comment_multiple_delete_confirm');
......
......@@ -430,12 +430,12 @@ function comment_permalink(Comment $comment) {
$page = comment_get_display_page($comment->id(), $node->type);
// @todo: Cleaner sub request handling.
$request = drupal_container()->get('request');
$request = Drupal::request();
$subrequest = Request::create('/node/' . $node->nid, 'GET', $request->query->all(), $request->cookies->all(), array(), $request->server->all());
$subrequest->query->set('page', $page);
// @todo: Convert the pager to use the request object.
$_GET['page'] = $page;
return drupal_container()->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
$request->query->set('page', $page);
return Drupal::service('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
}
throw new NotFoundHttpException();
}
......
......@@ -38,7 +38,7 @@
function comment_reply(EntityInterface $node, $pid = NULL) {
// Set the breadcrumb trail.
drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->label(), 'node/' . $node->nid)));
$op = isset($_POST['op']) ? $_POST['op'] : '';
$op = Drupal::request()->request->get('op');
$build = array();
// The user is previewing a comment prior to submitting it.
......
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