Skip to content

Instantly share code, notes, and snippets.

@filiphazardous
Last active November 15, 2021 09:23
Show Gist options
  • Save filiphazardous/d32547c6af338394088d0782ff2b808a to your computer and use it in GitHub Desktop.
Save filiphazardous/d32547c6af338394088d0782ff2b808a to your computer and use it in GitHub Desktop.
Patch to bring the user_revision up to D9 compatibility
diff --git a/src/Form/UserRevisionDeleteForm.php b/src/Form/UserRevisionDeleteForm.php
index cb7f0ce..3d3237f 100644
--- a/src/Form/UserRevisionDeleteForm.php
+++ b/src/Form/UserRevisionDeleteForm.php
@@ -42,7 +42,7 @@ class UserRevisionDeleteForm extends ConfirmFormBase {
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
- $entity_manager = $container->get('entity.manager');
+ $entity_manager = $container->get('entity_type.manager');
return new static(
$entity_manager->getStorage('user')
);
diff --git a/src/Form/UserRevisionRevertForm.php b/src/Form/UserRevisionRevertForm.php
index 1064d88..354f3b2 100644
--- a/src/Form/UserRevisionRevertForm.php
+++ b/src/Form/UserRevisionRevertForm.php
@@ -43,7 +43,7 @@ class UserRevisionRevertForm extends ConfirmFormBase {
*/
public static function create(ContainerInterface $container) {
return new static(
- $container->get('entity.manager')->getStorage('user')
+ $container->get('entity_type.manager')->getStorage('user')
);
}
diff --git a/user_revision.info.yml b/user_revision.info.yml
index 63fe7aa..6f7cc2b 100644
--- a/user_revision.info.yml
+++ b/user_revision.info.yml
@@ -2,7 +2,7 @@ name: 'User revision'
type: module
description: 'Provides revision support for users.'
version: VERSION
-core: 8.x
+core_version_requirement: ^8 || ^9
package: User
dependencies:
- user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment