Part of #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user']

All places in views_ui module should be fixed

core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php:

return is_object($this->lock) && ($this->lock->owner != $GLOBALS['user']->id());

Comments

alphawebgroup’s picture

Status: Active » Needs review
StatusFileSize
new627 bytes
alphawebgroup’s picture

Issue summary: View changes

Updated issue summary.

dawehner’s picture

StatusFileSize
new9.46 KB

Let's inject the request object properly.

Status: Needs review » Needs work

The last submitted patch, vdc-2061925-2.patch, failed testing.

alphawebgroup’s picture

looks like that piece of code has an error

public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
	return new static(
		$container,
		$plugin_id,
		$plugin_definition,
		$container->get('request')
	);
}

should be:

public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
	return new static(
		$configuration,
		$plugin_id,
		$plugin_definition,
		$container->get('request')
	);
}
alphawebgroup’s picture

@dawehner
btw, thanks a lot for your patch.. I've got a very good lesson on how to use dependency injection in plugins

andypost’s picture

Issue tags: +Needs reroll

This needs to be converted to current_user service

dawehner’s picture

Well, this basically needs a full rewrite.

alphawebgroup’s picture

yep, will work on it

alphawebgroup’s picture

Status: Needs work » Needs review
StatusFileSize
new9.67 KB
andypost’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
@@ -128,6 +146,18 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi
+      $container->get('request')

+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
@@ -154,6 +166,17 @@ public function __construct(ViewStorageInterface $storage, ViewExecutable $execu
+      $container->get('request')

You should inject 'current_user' service https://drupal.org/node/2032447

Status: Needs review » Needs work

The last submitted patch, 2061925-9.patch, failed testing.

albert volkman’s picture

StatusFileSize
new11.61 KB

Re-roll.

albert volkman’s picture

Status: Needs work » Needs review
StatusFileSize
new9.79 KB

Accidentally added some unrelated changes. Disregard #12.

Status: Needs review » Needs work

The last submitted patch, 2061925-13.patch, failed testing.

alphawebgroup’s picture

Status: Needs work » Needs review
StatusFileSize
new2.24 KB

new patch according to "current user" servise
+ test for isLocked method

Status: Needs review » Needs work

The last submitted patch, 2061925-15.patch, failed testing.

alphawebgroup’s picture

Status: Needs work » Needs review
StatusFileSize
new2.23 KB

Status: Needs review » Needs work
Issue tags: -Needs reroll, -CodeSprintCIS

The last submitted patch, 2061925-17.patch, failed testing.

alphawebgroup’s picture

Status: Needs work » Needs review

#17: 2061925-17.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +CodeSprintCIS

The last submitted patch, 2061925-17.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
Issue tags: +PHPUnit, +VDC
StatusFileSize
new926 bytes
new2.58 KB

Adding some tests.

Thanks for adding some phpunit tests! This is just fixing them.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -CodeSprintCIS

This looks great, applies passes and nice work on the test @alweb :) And that fix @dawehner!

PHPUnit tests run so much quicker!

joelpittet’s picture

Issue summary: View changes

Updated issue summary.

xano’s picture

21: vdc-2061925-21.patch queued for re-testing.

xano’s picture

21: vdc-2061925-21.patch queued for re-testing.

alphawebgroup’s picture

looks like this #21 patch can be commited
it's RTBC since 26 Oct

andypost’s picture

21: vdc-2061925-21.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 21: vdc-2061925-21.patch, failed testing.

alphawebgroup’s picture

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 268435456 bytes) in /var/lib/drupaltestbot/sites/default/files/checkout/core/lib/Drupal/Core/Database/Connection.php on line 336
FATAL Drupal\system\Tests\Common\UrlTest: test runner returned a non-zero error code (255).

alphawebgroup’s picture

Status: Needs work » Needs review

21: vdc-2061925-21.patch queued for re-testing.

dawehner’s picture

It is not your fault ...

dawehner’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

back to RTBC

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

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