Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not detect depricated \Drupal::service('user.private_tempstore') #242

Closed
lostcarpark opened this issue Aug 9, 2021 · 5 comments
Closed

Comments

@lostcarpark
Copy link

How is drupal-check installed?

drupal-check is installed globally via Composer

Environment:

  • OS: Linux (Ubuntu 21.04)
  • PHP Version: 7.4
  • Drupal core: 8.9.x

Describe the bug
My module had a number of instances referencing \Drupal::service('user.private_tempstore'), which is depricated in D9, but were not reported by drupal-check.
These needed to be updated to \Drupal::service('tempstore.private').
These could be tricky to detect, since the service name is a string, but I suspect a lot of cases could be caught by checking for the text above. The presence of a string containing 'user.private_tempstore' should at least generate a warning.

Console output
N/A, since case not caught by drupal-check.

@mglaman
Copy link
Owner

mglaman commented Oct 6, 2021

Let me get a new release of drupal-check out, this will be fixed by the latest phpstan-drupal release: https://github.com/mglaman/phpstan-drupal/releases/tag/0.12.15

@mglaman
Copy link
Owner

mglaman commented Oct 6, 2021

@lostcarpark try running composer update mglaman/drupal-check -W to get dependencies updated and see if the warning displays

@mglaman
Copy link
Owner

mglaman commented Oct 6, 2021

@lostcarpark
Copy link
Author

Thank you for fixing this. I've upgraded my own module to D9, so no sure I can test this.

@mglaman
Copy link
Owner

mglaman commented Oct 13, 2021

I'll just close it and see if anyone else reports it. Sorry it wasn't available before!

@mglaman mglaman closed this as completed Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants