Needs compat line adding. Could also do with a test as well but I will leave that for the maintainers.

Command icon 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

ikit-claw created an issue. See original summary.

ikit-claw’s picture

StatusFileSize
new483 bytes
ikit-claw’s picture

Status: Active » Needs review
anthonylindsay’s picture

StatusFileSize
new3.69 KB

Complete D9-readiness patch attached, with deprecated code issues dealt with.

ikit-claw’s picture

StatusFileSize
new3.69 KB

Tweaked file

louis-cuny’s picture

Status: Needs review » Reviewed & tested by the community

Perfect

louis-cuny’s picture

Priority: Normal » Major

Just changed some details
Please release

devreltomtom’s picture

Can you guys please release it, we are also waiting for this update :)

tlwatson’s picture

+1
I see the dev module's code is already D9 compatible, but the above PR needs merged so that the .info.yml files are also compatible.

spiritcapsule’s picture

Status: Reviewed & tested by the community » Needs work

I attempted to apply the patch in #6 - it failed. That is because it tries to modify lines that were already modified in https://www.drupal.org/project/user_restrictions/issues/3142032. So #6 was not created against the dev branch.

I successfully applied the patch in #3. The changes in #7 could be added to #3 and re-rolled.

tr’s picture

Version: 8.x-1.0-rc1 » 8.x-1.x-dev

I triggered a D9 test on the MR, and as you can see the tests fail. The assumption that all a module needs for D9 compatibility is the core_version_requirement is just wrong. The D9 test failures need to be fixed, and the D9 tests need to run green before you can call it D9 compatible. With my modules I prefer to remove all the deprecations first, before updating the core_version_requirement key, then commit a new .info.yml file with the updated key and be prepared to immediately fix any tests that break. The above test results show that there are still some "deprecated in D8 / removed in D9" issues that need to be addressed.

jonathan_hunt’s picture

Needs D9 test changes and composer.json but I'm not sure how to offer these on top of the MR:

diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..c66df87
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,9 @@
+{
+  "name": "drupal/user_restrictions",
+  "description": "Specifies rules for restricting users allowed access to a site.",
+  "type": "drupal-module",
+  "license": "GPL-2.0-or-later",
+  "require": {
+      "drupal/core": "^8.8 || ^9"
+  }
+}
diff --git a/tests/src/Functional/UserRestrictionsBasicTest.php b/tests/src/Functional/UserRestrictionsBasicTest.php
index 57d80a3..3933c70 100644
--- a/tests/src/Functional/UserRestrictionsBasicTest.php
+++ b/tests/src/Functional/UserRestrictionsBasicTest.php
@@ -9,6 +9,11 @@ namespace Drupal\Tests\user_restrictions\Functional;
  */
 class UserRestrictionsBasicTest extends UserRestrictionsTestBase {
 
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * ID (machine name) of restriction rule used in this test.
    *
diff --git a/tests/src/Functional/UserRestrictionsExpireTest.php b/tests/src/Functional/UserRestrictionsExpireTest.php
index 34adc1f..debdb49 100644
--- a/tests/src/Functional/UserRestrictionsExpireTest.php
+++ b/tests/src/Functional/UserRestrictionsExpireTest.php
@@ -9,6 +9,11 @@ namespace Drupal\Tests\user_restrictions\Functional;
  */
 class UserRestrictionsExpireTest extends UserRestrictionsTestBase {
 
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
   protected $id = 'test_rule_expire_1';
 
   protected $name = 'Test rule with expiration #1';
diff --git a/tests/src/Functional/UserRestrictionsLoginTest.php b/tests/src/Functional/UserRestrictionsLoginTest.php
index 0a40ef4..e3ee5c0 100644
--- a/tests/src/Functional/UserRestrictionsLoginTest.php
+++ b/tests/src/Functional/UserRestrictionsLoginTest.php
@@ -11,6 +11,11 @@ use Drupal\Component\Render\FormattableMarkup;
  */
 class UserRestrictionsLoginTest extends UserRestrictionsTestBase {
 
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * Ensure a user cannot log in if their name is on the blacklist.
    */
diff --git a/tests/src/Functional/UserRestrictionsTestBase.php b/tests/src/Functional/UserRestrictionsTestBase.php
index b6d6150..33eeba5 100644
--- a/tests/src/Functional/UserRestrictionsTestBase.php
+++ b/tests/src/Functional/UserRestrictionsTestBase.php
@@ -20,6 +20,11 @@ abstract class UserRestrictionsTestBase extends BrowserTestBase {
    */
   protected $storage;
 
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * {@inheritdoc}
    */
@@ -30,7 +35,7 @@ abstract class UserRestrictionsTestBase extends BrowserTestBase {
       ->getStorage('user_restrictions');
 
     // Allow registration by site visitors without administrator approval.
-    \Drupal::configFactory()->getEditable('user.settings')->set('register', USER_REGISTER_VISITORS)->save();
+    \Drupal::configFactory()->getEditable('user.settings')->set('register', Drupal\user\UserInterface::REGISTER_VISITORS)->save();
   }
 
 }

giorgosk’s picture

Status: Needs work » Needs review

Drupal compatibility and new review functionality has been committed and released in the latest 2.x-dev
it seems to be working but feel free to test it and report back
will try to incorporate jonathan_hunt's changes on the next iteration

ikit-claw’s picture

This has been reviewed now thanks so much GiorgosK I have made a beta release devs can be problematic will give it a few weeks in prod and all being well release the stable version.

ikit-claw’s picture

Status: Needs review » Fixed

Thanks @GiorgosK we have been running this for awhile now so marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

giorgosk’s picture

@jonathan_hunt changes regarding D9 tests have been pushed to the latest DEV version. If there is an issue with them a new issue should be opened.