Comments

dstorozhuk’s picture

Status: Needs review » Active
StatusFileSize
new1.88 KB

Removed calls to deprecated global $user in core/includes/bootstrap.inc
in 3 functions:

  1. watchdog()
  2. drupal_get_user_timezone()
  3. _drupal_bootstrap_page_cache()
dstorozhuk’s picture

Status: Active » Needs review

Status: Active » Needs work

The last submitted patch, bootstrap.inc-2062069.patch, failed testing.

sergeypavlenko’s picture

The last submitted patch, drupal8.base-system.2062069-4.patch, failed testing.

sergeypavlenko’s picture

Status: Needs work » Needs review

#4: drupal8.base-system.2062069-4.patch queued for re-testing.

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

The last submitted patch, drupal8.base-system.2062069-4.patch, failed testing.

blainelang’s picture

StatusFileSize
new1.51 KB

Updated patch to use: $user = Drupal::request()->attributes->get('_account');

blainelang’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal8.base-system.2062069-5.patch, failed testing.

m1r1k’s picture

m1r1k’s picture

Status: Needs work » Needs review

Push for testing

Status: Needs review » Needs work

The last submitted patch, bootstrap-remove-global-user-from-bootstrap-inc-2062069-11.patch, failed testing.

m1r1k’s picture

m1r1k’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, bootstrap-remove-global-user-from-bootstrap-inc-2062069-13.patch, failed testing.

joelpittet’s picture

Assigned: dstorozhuk » Unassigned
Status: Needs work » Needs review
Issue tags: -CodeSprintCIS
StatusFileSize
new1.18 KB

Same as #14 but without the scope bit which was done elsewhere(temporarily)

Status: Needs review » Needs work

The last submitted patch, bootstrap-remove-global-user-from-bootstrap-inc-2062069-17.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, bootstrap-remove-global-user-from-bootstrap-inc-2062069-17.patch, failed testing.

cosmicdreams’s picture

Status: Needs work » Needs review
StatusFileSize
new548 bytes

This patch makes just one change. Let's see if it breaks the install.

Status: Needs review » Needs work

The last submitted patch, GlobalUser.patch, failed testing.

joelpittet’s picture

Here's the error on the patch above #21:

WD php: Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "current_user", path: "current_user". in              [error]
Symfony\Component\DependencyInjection\Container->get() (line 283 of
/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "current_user", path: "current_user". in Symfony\Component\DependencyInjection\Container->get() (line 283 of /core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
dawehner’s picture

  global $user;
  $config = \Drupal::config('system.date');

  if ($user && $config->get('timezone.user.configurable') && $user->isAuthenticated() && $user->getTimezone()) {

Let's have a look at this piece of code. $user is not required to let this be run. I think this behavior is intended as the installer
or other really early bootstrap code don't have a user yet. In order to use a service you can use \Drupal::getContainer()->get('current_user', \Symfony\Component\DependencyInjection\ContainerInterface::IGNORE_ON_INVALID_REFERENCE); which will not throw an exception.

joelpittet’s picture

Status: Needs work » Needs review
StatusFileSize
new619 bytes

Seems to be still failing locally with the same error, but thanks for giving more hints @dawehner

Status: Needs review » Needs work

The last submitted patch, 2062069-25-global-user-bootstrap-simple.patch, failed testing.

tim.plunkett’s picture

if (\Drupal::getContainer()->has('current_user')) {
 $user = \Drupal::getContainer()->get('current_user');
}
dawehner’s picture

Oh right, this is indeed way simpler.

joelpittet’s picture

StatusFileSize
new648 bytes

Still not working locally, so I expect the same results.

joelpittet’s picture

Status: Needs work » Needs review

.

Status: Needs review » Needs work

The last submitted patch, 2062069-29-global-user-bootstrap-simple.patch, failed testing.

berdir’s picture

Yeah, well.

Unfortunately, our oh so great pluggable authentication system is a lie. Or to be specific, the Cookie authentication provider is a lie.

It simply calls drupal_session_initialize(), that then directly populates global $user and only global $user and directly calls date_default_timezone_set(drupal_get_user_timezone()); Obviously, in there, the user service is never going to be set.

What needs to happen is that this function is moved to the authentication manager, after we are able to populate the user service. But moving that will probably not work, because the reason the cookie stuff works like this is that this code is still shared with the installer/update/authenticate stuff.

Something needs to happen to session.inc. Something that involves fire. But #1858196: [meta] Leverage Symfony Session components isn't working either so far :(

cosmicdreams’s picture

I would love to knock the session issue out but need help. The frustrating thing is that I was hoping this issue would help as I'm trying to remove the use of the global user there to.

Regardless, I feel we are dramatically close to a solution with the session patch. Please help.

ianthomas_uk’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 29: 2062069-29-global-user-bootstrap-simple.patch, failed testing.

ianthomas_uk’s picture

Issue summary: View changes
Status: Needs work » Postponed

Status: Postponed » Needs review

Status: Needs review » Needs work

The last submitted patch, 29: 2062069-29-global-user-bootstrap-simple.patch, failed testing.

chr.fritsch’s picture

Status: Needs work » Needs review
StatusFileSize
new619 bytes

Status: Needs review » Needs work

The last submitted patch, 39: 2062069-39-global-user-bootstrap-simple.patch, failed testing.

berdir’s picture

Status: Needs work » Closed (duplicate)

See #2328645: Remove remaining global $user, closing as duplicate of that.