Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The User module's services user.private_tempstore
and user.shared_tempstore
are deprecated in favour of tempstore.private
and tempstore.shared
. Code that uses the User module services should be updated to use the new services from core.
3x: \Drupal\user\PrivateTempStoreFactory is scheduled for removal in Drupal 9.0.0. Use \Drupal\Core\TempStore\PrivateTempStoreFactory instead. See https://www.drupal.org/node/2935639.
and
3x: \Drupal\user\SharedTempStoreFactory is scheduled for removal in Drupal 9.0.0. Use \Drupal\Core\TempStore\SharedTempStoreFactory instead. See https://www.drupal.org/node/2935639.
The same three tests cause this message, all in Drupal\Tests\webprofiler\FunctionalJavascript
1x in ToolbarTest::testToolbarOnFrontPage
1x in ToolbarTest::testToolbarReportPage
1x in ToolbarTest::testToolbarNotAppearsOnExcludedPath
Change record: https://www.drupal.org/node/2935639
Comments
Comment #2
d70rr3s CreditAttribution: d70rr3s at Hiberus commentedComment #3
d70rr3s CreditAttribution: d70rr3s at Hiberus commentedThe test it self does not invoke nor uses the user.*_tempstore services, neither the parent (WebprofilerTesBase) class. This could be related base class which provides all user and session support adn must be addressed in core.
Comment #4
salah1Thank you @Jonathan1055 & @d70rr3s
The warnings come up everytime the [webproflier/tests/src/FunctionalJavascript/ToolbarTest.php] tests run.
I did some manual debug on this and i can confirm that the module code doesn't use the deprecated code.
However, what's is going on is Composer\Autoload\ClassLoader thing.
Here is part of the stacktrace:
../webprofiler/src/Compiler/ServicePass.php:72
../webprofiler/src/Compiler/ServicePass.php:26
#2 Composer\Autoload\ClassLoader->loadClass()
#3 spl_autoload_call()
#4 ReflectionClass->__construct() called at [/var/www/contrib-modules/devel-8.x-3.x/webprofiler/src/Compiler/ServicePass.php:72]
#5 Drupal\webprofiler\Compiler\ServicePass->extractData() called at [/var/www/contrib-modules/devel-8.x-3.x/webprofiler/src/Compiler/ServicePass.php:26]
#6 Drupal\webprofiler\Compiler\ServicePass->process() called at [/var/www/d8-test-web-compsr-dwnld/vendor/symfony/dependency-injection/Compiler/Compiler.php:140]
I haven't had a chance to see if there a magic line that can be put on inside /webproflier/tests/src/FunctionalJavascript/ToolbarTest.php that says ignore "deprecation xyz".
Perhaps, it could also be beneficial to create a separate issue "to re-write webprofiler module or its tests" and link this issue and other issues(so someone with time can grab that).
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedSee https://gitlab.com/drupalspoons/devel/-/issues/216
and https://gitlab.com/drupalspoons/webprofiler/-/issues/9
Both are now closed