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

Files that need converting are:

  • core/modules/node/lib/Drupal/node/NodeFormController.php
Files: 
CommentFileSizeAuthor
#9 remove_request_in_node-1999404-5.patch840 bytesjiff
PASSED: [[SimpleTest]]: [MySQL] 56,793 pass(es). View
#4 remove_request_in_node-1999404-4.patch836 bytespbuyle
PASSED: [[SimpleTest]]: [MySQL] 55,912 pass(es). View
#1 remove-request.patch836 bytesmarcingy
PASSED: [[SimpleTest]]: [MySQL] 55,831 pass(es). View

Comments

marcingy’s picture

Status: Active » Needs review
FileSize
836 bytes
PASSED: [[SimpleTest]]: [MySQL] 55,831 pass(es). View

Status: Needs review » Needs work

The last submitted patch, remove-request.patch, failed testing.

marcingy’s picture

Status: Needs work » Needs review

#1: remove-request.patch queued for re-testing.

pbuyle’s picture

FileSize
836 bytes
PASSED: [[SimpleTest]]: [MySQL] 55,912 pass(es). View
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -464,9 +464,9 @@ public function save(array $form, array &$form_state) {
-    if (isset($_GET['destination'])) {

Should be \Drupal::request()->query->has('destination').

Status: Needs review » Needs work

The last submitted patch, remove_request_in_node-1999404-4.patch, failed testing.

trevjs’s picture

Status: Needs work » Needs review
trevjs’s picture

Status: Needs review » Needs work
kim.pepper’s picture

+++ b/core/modules/node/lib/Drupal/node/NodeFormController.phpundefined
@@ -464,9 +464,9 @@ public function save(array $form, array &$form_state) {
-    if (isset($_GET['destination'])) {
+    if (\Drupal::request()->query->has('destination')) {
       $destination = drupal_get_destination();
-      unset($_GET['destination']);
+      \Drupal::request()->query->remove('destination');

Let's use a variable to make this less verbose.

jiff’s picture

Status: Needs work » Needs review
FileSize
840 bytes
PASSED: [[SimpleTest]]: [MySQL] 56,793 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 2d5b6c4 and pushed to 8.x. Thanks!

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