Part of #1998638: Replace almost all remaining superglobals ($_GET, $_POST, etc.) with Symfony Request object

Files that need converting are:

  • core/modules/path/path.admin.inc
Files: 
CommentFileSizeAuthor
#4 remove_request_in_path-1999424-3.patch758 bytesjiff
PASSED: [[SimpleTest]]: [MySQL] 56,100 pass(es).
[ View ]
#2 remove_request_in_path-1999424-2.patch755 bytespbuyle
PASSED: [[SimpleTest]]: [MySQL] 55,886 pass(es).
[ View ]
#1 remove-request.patch755 bytesmarcingy
PASSED: [[SimpleTest]]: [MySQL] 55,951 pass(es).
[ View ]

Comments

marcingy’s picture

Status:Active» Needs review
StatusFileSize
new755 bytes
PASSED: [[SimpleTest]]: [MySQL] 55,951 pass(es).
[ View ]

Hopefully this kills off $_ in this module.

pbuyle’s picture

StatusFileSize
new755 bytes
PASSED: [[SimpleTest]]: [MySQL] 55,886 pass(es).
[ View ]
+++ b/core/modules/path/path.admin.inc
@@ -202,9 +202,9 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
+  if (Drupal::request()->query->get('destination')) {
     $destination = drupal_get_destination();

This should uses Drupal::request()->query->has('destination') as done in the attached patch.

kim.pepper’s picture

Status:Needs review» Needs work
+++ b/core/modules/path/path.admin.incundefined
@@ -202,9 +202,9 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
+  if (Drupal::request()->query->has('destination')) {
...
+    Drupal::request()->query->remove('destination');

Let's extract a $query variable to reduce verbosity.

jiff’s picture

Status:Needs work» Needs review
StatusFileSize
new758 bytes
PASSED: [[SimpleTest]]: [MySQL] 56,100 pass(es).
[ View ]
Crell’s picture

Status:Needs review» Reviewed & tested by the community

This is replacing one evil horrid hack for a new-code evil horrid hack. So, I guess we accept it for now. :-)

Crell’s picture

Issue tags:+Quick fix

Tagging

alexpott’s picture

Status:Reviewed & tested by the community» Fixed

Committed 8679f24 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.