Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue.

Issue fork roleassign-3297982

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

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new8.91 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module this patch makes this module compatible with Drupal 10! 🎉
This patch updates the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #139

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.24
  2. palantirnet/drupal-rector: 0.13.0
project update bot’s picture

StatusFileSize
new378 bytes
new9.03 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module this patch makes this module compatible with Drupal 10! 🎉
This patch updates the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #145

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.1
berdir’s picture

Issue summary: View changes
Status: Needs review » Needs work
+++ b/src/ProxyClass/RoleAssignUninstallValidator.php
@@ -7,15 +7,19 @@
 namespace Drupal\roleassign\ProxyClass {
 
+    use Drupal\Core\Extension\ModuleUninstallValidatorInterface;
+    use Drupal\Core\DependencyInjection\DependencySerializationTrait;
+    use Symfony\Component\DependencyInjection\ContainerInterface;
+    use Drupal\Core\StringTranslation\TranslationInterface;
     /**
      * Provides a proxy class for \Drupal\roleassign\RoleAssignUninstallValidator.
      *
      * @see \Drupal\Component\ProxyBuilder
      */
-    class RoleAssignUninstallValidator implements \Drupal\Core\Extension\ModuleUninstallValidatorInterface
+    class RoleAssignUninstallValidator implements ModuleUninstallValidatorInterface
     {
 

changes in this file should be reverted. this is only about uses and this is a generated proxy class, it should not be changed manually.

taniachque’s picture

Status: Needs work » Needs review
StatusFileSize
new6.87 KB
new4.54 KB

Reverting changes in RoleAssignUninstallValidator.php.
Fixing errors in RoleAssignPermissionTest.php.

jatingupta40’s picture

Assigned: Unassigned » jatingupta40

I will review this patch.

jatingupta40’s picture

Assigned: jatingupta40 » Unassigned
Status: Needs review » Reviewed & tested by the community

The patch #5 is working absolutely fine on drupal 10.0.
So, moving to RTBC.

Thanks.

project update bot’s picture

prudloff’s picture

Issue summary: View changes
StatusFileSize
new660 bytes

Here is a patch without tests in case you need to apply it on 1.0.0-beta1.
(Do not use it if you need to run tests.)

project update bot’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.14 KB
new6.98 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module this patch makes this module compatible with Drupal 10! 🎉
Therefore this patch updates the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #8662

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.1
rajab natshah’s picture

Priority: Normal » Major
svendecabooter’s picture

Status: Needs review » Reviewed & tested by the community

This patch adds D10 compatibility and seems to work fine.
Any update from project maintainer when D10 compatibility would be added to this module?

rajab natshah’s picture

Thank you, for having time to maintain this important role assigning management module.

Hoping for a soft commit on the 8.x-1.x branch, to ease testing with Drupal 10.
A soft tag release ( pre-release ) would help speeding up work with Drupal ~10.0 using the composer.

Testing now with git clone --branch '8.x-1.x' https://git.drupalcode.org/project/roleassign.git
and a git apply for the patch

rajab natshah’s picture

Priority: Major » Critical
rajab natshah’s picture

rajab natshah’s picture

rajab natshah’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Related issues: +#3135048: No assignable roles shown
StatusFileSize
new35.13 KB
new2.47 KB

#3135048: No assignable roles shown

Had Real physical testing round for RoleAssign 1.0.x-dev with Drupal ~10 and Drupal ~9

Used the following steps in the attached file
Real-physical-testing-round-for-roleassign-1-0-x-dev--with-d10-and-d9.zip

RoleAssign 1.0.x-dev with Drupal ~10

Build Drupal ~10.0 sandbox test site and have Drush ~11.0

mkdir -p /var/www/html/sandboxes
composer create-project drupal/recommended-project:~10.0 /var/www/html/sandboxes/drupal10roleassign_1__test
cd /var/www/html/sandboxes/drupal10roleassign_1__test/
composer require drush/drush:~11.0;

Change minimum stability to dev for testing on the recommended Drupal 10 project template

composer config minimum-stability dev

Add the RoleAssign module

mkdir -p /var/www/html/sandboxes/drupal10roleassign_1__test/web/modules/contrib
cd /var/www/html/sandboxes/drupal10roleassign_1__test/web/modules/contrib/
git clone --branch '8.x-1.x' https://git.drupalcode.org/project/roleassign.git

Git Apply the patch.

cd /var/www/html/sandboxes/drupal10roleassign_1__test/web/modules/contrib/roleassign/
wget https://www.drupal.org/files/issues/2022-08-24/3297982-drupal-10-compatibility-fixes-roleassign-5.patch
git apply 3297982-drupal-10-compatibility-fixes-roleassign-5.patch

Change file/directory mod and ownership of files:

cd /var/www/html/sandboxes/drupal10roleassign_1__test/
sudo chmod 775 -R .;sudo chown www-data:$USER -R .;

Install with Drush

./vendor/drush/drush/drush site:install standard --yes --site-name="RoleAssign 1.0.x-dev - Real physical testing with Drupal ~10" --account-name="webmaster" --account-pass="d" --account-mail="test@drupal.org" --db-url="mysql://root:123___@localhost/sandboxes_drupal10roleassign_1__test" -vvv ;

./vendor/drush/drush/drush pm:enable roleassign

Rebuild the cache:

sudo chmod 775 -R .;sudo chown www-data:$USER -R .;
./vendor/drush/drush/drush cache:rebuild

Open a browser and change the address to: http://localhost/sandboxes/drupal10roleassign_1__test/web/

following with configuration steps

Still the module is not functional in Drupal 10 and Drupal 9
#3135048: No assignable roles shown

rajab natshah’s picture

It feels that this module is not functional.

following with

Configuration

  • Log in as site administrator.
  • Go to the administration page for access control and grant Assign roles permission to those roles that should be able to assign roles to other users. Notice that besides the Assign roles permission, these roles also must have the Administer users permission.
  • Go to the administration page for role assign and select those roles that should be available for assignment by users with Assign roles permission.
  • For each user that should be able to assign roles, go to the user's account and select a role with both the Assign roles and the Administer users permissions.

Assertions in the Automated testing are not doing the right needed checks.

teknocat’s picture

I find that this module works sufficiently well in it's current beta state in D9 (no issues for my company's use cases so far) and using the patch for D10 also has it working no differently than the D9 version, at least as far as I can tell.

This module is currently in a beta release only, so there's an expectation that it still has issues to work out, these issues are known and being worked on and have been discussed here.

As such, why block a D10 compatibility release just because of these known issues? Why not do another beta release for D10, with these known issues still in progress?

It doesn't seem necessary to block that until everything is fully resolved and you have a non-beta release ready to go.

berdir’s picture

Status: Needs work » Reviewed & tested by the community

Agreed. Patch in #5 and #10 are pretty identical and changes nothing except the test and version compatibility, so the module should work just as well as it did before.

rajab natshah’s picture

Thank you, Peter, Sascha for following up.

Created a MR for the #10 patch
I tested the module in #17
The module can be enabled, configured.

Only faced #3135048: No assignable roles shown in Drupal 9 with the 1.0.0-beta1 release.

Using the issue fork repo and branch for further testing with the composer build.

I was wondering what is the next step? and when a soft tag release ( pre-release ) would be released?

Appreciate that you are making time for this.

teknocat’s picture

Would it also make sense to take this opportunity to switch over to semver for D10 and perhaps release it as 2.0-beta1? It would be nice to see all modules do away with the 8.x- prefix on their version numbers, but there does of course need to be an appropriate point at which to do that.

Just a thought. I've seen some other modules do this, but then the new version is D10 only while they still maintain a separate branch for continued D9 support. I don't see that as necessary unless there's a desire or need to offer a greater range of backwards compatibility, such as D8 versions that don't support the latest core APIs.

berdir’s picture

There have been no commits in this project for 2 years and barely any since the previous D9 compatibility release. The next step is that either a current maintainer shows up and commits this and creates a new release, or someone applies to become a new maintainer and does the same then.

In projects I maintain, I'd prefer to not switch to semver just for the sake of it, it tends to take a very long time for even a majority of users to switch over and will cause more work in case of a security issue or so. But that will be for whoever will maintain this in the future to decide.

svendecabooter’s picture

I am willing to step up to maintain this module and create a Drupal 10 release, as well as look into the other RTBC issues.
I have some limited maintainer access already, as I've done part of the Drupal 9 upgrade of this module. But I do not have access to Git or release management.
I have reached out to salvis via his contact form, to be able to get maintainer access.

If no reaction in the next 14 days, I will start the process of requesting project maintainer change.

poker10’s picture

@svendecabooter Thanks! I have contacted Salvis about D7 release compatible with PHP8 few days ago, but no answer until now, so hopefully if we get some response we will be able to sort out also D7 version :)

  • nord102 committed fd48bdb1 on 8.x-1.x
    Issue #3297982 by Project Update Bot, Rajab Natshah, taniachque:...
nord102’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all for the contribution on this!

svendecabooter’s picture

@nord102 do you plan to make a new release with D10 support soon?

joseph.olstad’s picture

nord102’s picture

@svendecabooter yes, just trying to get a few more issues fixed and then I'll do a new release, aiming for the end of this week

svendecabooter’s picture

Ok great to hear!
Thanks for your efforts

Status: Fixed » Closed (fixed)

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