Problem/Motivation
The Service "user.private_tempstore" is deprecated for Drupal 9.x and must be replaced with the new Service "tempstore.private".
Steps to reproduce
Use Drupal core 9.x, enable the module and will see a php error
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "user.private_tempstore". in Drupal\Component\DependencyInjection\Container->get() (line 151 of /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
Proposed resolution
Replace deprecated Service.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | broken_link-deprecated_services-3165809-10.patch | 3.37 KB | grimreaper |
| #4 | Screenshot from 2020-10-29 14-35-41.png | 8.74 KB | ankithashetty |
| #4 | interdiff_3165809_2-4.txt | 870 bytes | ankithashetty |
| #4 | 3165809-4.patch | 1.05 KB | ankithashetty |
| #2 | replace-service-private_tempstore-3165809-2.patch | 1.08 KB | theodorosploumis |
Issue fork broken_link-3165809
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
theodorosploumisComment #3
ankithashettyThe error stated in the Issue Summary does exist. But after applying the patch in #2, I got a different error.
Looks like the patch has provided a different service, it needs to be replaced with
tempstore.private+ $container->get('user.tempstore.private'),Thanks.
Comment #4
ankithashettyHere is the updated patch, please review. The module installed successfully after the patch.
Thanks
Comment #5
vodde83 commentedLooks good. Module does indeed install cleanly after the patch!
Comment #6
grimreaperHello,
https://www.drupal.org/node/2935639
The PHPDoc had not been updated.
I will update the patch and create a MR.
Comment #7
grimreaperAs the development versions are not published on this module, impossible to reference it in the "version" field of the issue and so provided commands for fork and MR workflow are not complete.
Comment #8
grimreaperAlso found out that the entity.manager service was used while it is also deprecated.
Comment #10
grimreaperMR created ans here is a patch from the MR.
Comment #11
z3cka commentedMR !2 needs a rebase for some views stuff; also, patch from #10 solved this issue for me. Any chance this could make it into an official D9 release? ...especially as D8 is now at its end of life.
Comment #12
andeersg commentedI tested the patch in #10 and it worked.
My database update crashed because of the missing service, and with the patch the updates applies without problems.
Comment #13
juburin commentedAfter installing the patch I get the following error:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "comment_publish_action" plugin does not exist. Valid plugin IDs for Drupal\Core\Action\ActionManager are: broken_link_delete_action, comment_unpublish_by_keyword_action, node_set_sub_type_video_action, node_set_sub_type_article_action, node_set_sub_type_rich_media_action, node_assign_owner_action, node_unpromote_action, node_promote_action, node_make_sticky_action, node_unpublish_by_keyword_action, node_make_unsticky_action, redirect_delete_action, user_add_role_action, user_block_user_action, user_cancel_user_action, user_remove_role_action, user_unblock_user_action, webform_archive_action, webform_close_action, webform_delete_action, webform_open_action, webform_unarchive_action, webform_submission_delete_action, webform_submission_make_lock_action, webform_submission_make_sticky_action, webform_submission_make_unlock_action, webform_submission_make_unsticky_action, pathauto_update_alias, entity:delete_action:comment, entity:delete_action:media, entity:delete_action:node, entity:delete_action:webform, action_send_email_action, action_goto_action, action_message_action, entity:publish_action:block_content, entity:publish_action:comment, entity:publish_action:media, entity:publish_action:node, entity:publish_action:path_alias, entity:publish_action:taxonomy_term, entity:publish_action:menu_link_content, entity:publish_action:paragraph, entity:save_action:block_content, entity:save_action:comment, entity:save_action:file, entity:save_action:media, entity:save_action:node, entity:save_action:taxonomy_term, entity:save_action:user, entity:save_action:menu_link_content, entity:unpublish_action:block_content, entity:unpublish_action:comment, entity:unpublish_action:media, entity:unpublish_action:node, entity:unpublish_action:path_alias, entity:unpublish_action:taxonomy_term, entity:unpublish_action:menu_link_content, entity:unpublish_action:paragraph in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).Comment #14
juburin commentedComment #15
hanoii@Juburin, I am 95% sure that the error is completely unrelated to this patch. I also had to update those actions manually for the upgrade to work, but not related to the patch in this issue.
Unrelated, but
should help you with that.
Comment #18
mahaveer003 commentedMerged and Release
Thanks