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

Files that need converting are:

core/modules/edit/lib/Drupal/edit/EditController.php

Files: 
CommentFileSizeAuthor
#14 1999344_14-replace-raw-variables-edit.patch1.37 KBaaronott
PASSED: [[SimpleTest]]: [MySQL] 56,059 pass(es).
[ View ]
#14 1999344_11-replace-raw-variables-edit_interdiff.txt603 bytesaaronott
#11 1999344_11-replace-raw-variables-edit.patch1.36 KBaaronott
PASSED: [[SimpleTest]]: [MySQL] 55,846 pass(es).
[ View ]
#11 1999344_6-replace-raw-variables-edit_innerdiff.txt1.36 KBaaronott
#6 1999344_6-replace-raw-variables-edit.patch696 bytesaaronott
PASSED: [[SimpleTest]]: [MySQL] 55,825 pass(es).
[ View ]
#1 1999344_1-replace-raw-variables-edit.patch695 bytesaaronott
FAILED: [[SimpleTest]]: [MySQL] 55,808 pass(es), 4 fail(s), and 0 exception(s).
[ View ]

Comments

aaronott’s picture

Assigned:Unassigned» aaronott
Status:Active» Needs review
StatusFileSize
new695 bytes
FAILED: [[SimpleTest]]: [MySQL] 55,808 pass(es), 4 fail(s), and 0 exception(s).
[ View ]
aaronott’s picture

Assigned:aaronott» Unassigned

Status:Needs review» Needs work

The last submitted patch, 1999344_1-replace-raw-variables-edit.patch, failed testing.

arknoll’s picture

Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, 1999344_1-replace-raw-variables-edit.patch, failed testing.

aaronott’s picture

StatusFileSize
new696 bytes
PASSED: [[SimpleTest]]: [MySQL] 55,825 pass(es).
[ View ]

This time with PSR-0 Format

aaronott’s picture

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

Status:Needs review» Needs work
--- a/core/modules/edit/lib/Drupal/edit/EditController.php
+++ b/core/modules/edit/lib/Drupal/edit/EditController.phpundefined

@@ -126,7 +126,7 @@ public function fieldForm(EntityInterface $entity, $field_name, $langcode, $view
+    if (\Drupal::request()->request->get('nocssjs') === 'true') {

As this is a method being called in a controller route, we can just pass in Request as a magic parameter, instead of using \Drupal::request()

aaronott’s picture

@kim.pepper

I'm not sure how to do this or what you mean by passing in Request as a magic parameter. Do you have an example or link that I can read up on?

kim.pepper’s picture

Have a look at \Drupal\aggregator\Routing\AggregatorController::feedRefresh() http://drupalcode.org/project/drupal.git/blob/HEAD:/core/modules/aggrega...

The Request parameter can be passed into the method (in any order) and you don't need to specify it in your route configuration.

aaronott’s picture

Status:Needs work» Needs review
StatusFileSize
new1.36 KB
new1.36 KB
PASSED: [[SimpleTest]]: [MySQL] 55,846 pass(es).
[ View ]

Okay so I think I've got this.

Now allowing for the Request parameter to be passed in.

kim.pepper’s picture

Looking good!

One minor nitpick:

+++ b/core/modules/edit/lib/Drupal/edit/EditController.phpundefined
@@ -93,10 +93,12 @@ public function metadata(Request $request) {
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The current request object containing the search string.

Should have a new line after last param comment

kim.pepper’s picture

double post

aaronott’s picture

StatusFileSize
new603 bytes
new1.37 KB
PASSED: [[SimpleTest]]: [MySQL] 56,059 pass(es).
[ View ]

I thought so but missed it. here it is again. Thanks!

dawehner’s picture

Status:Needs review» Reviewed & tested by the community

Looks great!

alexpott’s picture

Status:Reviewed & tested by the community» Fixed

Committed e0db7eb and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

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