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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcingy’s picture

Status: Active » Needs review
FileSize
836 bytes

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

+++ 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.

jlandfried’s picture

Status: Needs work » Needs review
FileSize
840 bytes
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.