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

Comments

aaronott’s picture

Assigned: Unassigned » aaronott

Starting the conversion.

aaronott’s picture

Assigned: aaronott » Unassigned
Status: Active » Needs review
FileSize
1.69 KB
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

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

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

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.