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

Files that need converting are:

  • core/modules/views/includes/ajax.inc
  • core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
  • core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
  • core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
  • core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
Files: 
CommentFileSizeAuthor
#8 1999450_8-replace-raw-variables-views.patch1.78 KBaaronott
PASSED: [[SimpleTest]]: [MySQL] 55,612 pass(es). View
#8 1999450_-replace-raw-variables-views_interdiff.txt921 bytesaaronott
#6 1999450_6-replace-raw-variables-views.patch1.69 KBaaronott
PASSED: [[SimpleTest]]: [MySQL] 55,918 pass(es). View
#4 1999450_4-replace-raw-variables-views.patch1.69 KBaaronott
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to checkout from [git://git.drupal.org/project/drupal.git]. View
#4 1999450-replace-raw-variables-views.innerdiff.txt763 bytesaaronott
#2 1999450_2-replace-raw-variables-views.patch1.69 KBaaronott
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Comments

aaronott’s picture

Assigned: Unassigned » aaronott

Starting the conversion.

aaronott’s picture

Assigned: aaronott » Unassigned
Status: Active » Needs review
FileSize
1.69 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View
damiankloip’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -290,8 +290,8 @@ public function generateResultsKey() {
+        if (Drupal::request()->query->get($key)) {
+          $key_data[$key] = Drupal::request()->query->get($key);

We call that method twice here, we should use ->has($key) instead, or assign it to a variable first to re use.

aaronott’s picture

FileSize
763 bytes
1.69 KB
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to checkout from [git://git.drupal.org/project/drupal.git]. View

I switched this to the ->has($key)

Status: Needs review » Needs work

The last submitted patch, 1999450_4-replace-raw-variables-views.patch, failed testing.

aaronott’s picture

Status: Needs work » Needs review
FileSize
1.69 KB
PASSED: [[SimpleTest]]: [MySQL] 55,918 pass(es). View

Again with PSR-0

kim.pepper’s picture

Status: Needs review » Needs work
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.phpundefined
@@ -290,8 +290,8 @@ public function generateResultsKey() {
+          $key_data[$key] = Drupal::request()->query->get($key);

This needs to be namespaced as well in PSR-0. Should be \Drupal.

We should also create a $query variable to be re-used.

aaronott’s picture

Status: Needs work » Needs review
FileSize
921 bytes
1.78 KB
PASSED: [[SimpleTest]]: [MySQL] 55,612 pass(es). View

Makes sense to me. Thanks!

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Oh I thought we would have converted all of them, so these ones sort of got lost.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a5343cb and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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