- Issue was unassigned.
If a custom module caused this we will have to see the code to offer support.
- Status changed to Postponed: needs info
over 1 year ago 12:32pm 23 June 2023 Providing the actual code is the best way forward for support. This could be a bug however we don't have sufficient evidence.
- ๐บ๐ธUnited States Greg Boggs Portland Oregon
In config, when a role config or any config depends on something, like a view or a module, that config is deleted when the dependency is deleted. I don't think there's a good way to resolve this.
One way resolve it so you can uninstall your module without deleting t he role is that you have to export your site config to yml, edit the yml file manually to remove the dependency, then reimport the config to active. After that, you can delete your custom module without deleting the role config.
- ๐ช๐ธSpain tunic Madrid
@vishal282001, I'm not sure but from the link you rpovide to Github I see the "config/sync/user.role.authenticated_user.yml" has been removed (and some other related). That file holds the configuration for the authenticated user role. If you delete it and import configuration, the role is deleted because is not present anymore in the configuration.
To fix this, I would recover those files:
- config/sync/system.action.user_add_role_action.authenticated_user.yml
- config/sync/system.action.user_remove_role_action.authenticated_user.yml
- config/sync/user.role.authenticated_user.yml
Then, import configuration. If you don't have relevant date in the site I would reinstall the site because removing the role may have impacted the integrity of the site.
- ๐ช๐ธSpain tunic Madrid
That screenshot means uninstalling that module will update the Authenticated User role. Is not clear what the changes are, but if your module provides permissions probably the changes are removing those permissions form the role, what is safe.
I would go ahead, but pelase have a backup if you have important data in the site.
@vishal282001
There are two questions here:
Why did my code do this?
We donโt know because you do not show your code.
How do I fix this?
Community members are giving you advice.
You are posting screenshots.
- ๐ฎ๐ณIndia vishal282001
@Greg Boggs , @cilefen i have updated the problem description for the sake of better understanding, so kindly revisit the issue and provide with the any feasible solution if exists.
- ๐ฎ๐ณIndia Vivek Panicker Kolkata
@cliefen The code necessary to reproduce the issue has already been posted by @vishal.
It's as simple as creating a module with defines a permisison, assigning that permission to a user role and then trying to uninstall the module.
At that point, we see the issue as shown in the screenshot. The user role seems to be getting deleted.
And this is also reproducible when we try to uninstall any contrib module which provides permissions.
The Drupal version used here is 10.4.
- ๐ช๐ธSpain tunic Madrid
#16 What you describe would modify the role because some permissions are changed (see my explanation on #12) but not remove the role completely. Please double check that your claims is true (any module providing Authenticated User permissions removes that role when uninstalled) because it is hard to believe because this issue would be flooded by user comments having the same issue.
@tunic is correct.
Author a module that you verify reproduces the problem on a newly-installed Drupal site. Provide that module here and we'll have a look.
- Status changed to Closed: cannot reproduce
over 1 year ago 3:02pm 27 June 2023 - ๐ฎ๐ณIndia Vivek Panicker Kolkata
@cliefen We checked again thoroughly, and actually the role is not getting deleted, it is just getting updated.
Orignally when @vishal mentioned about the role getting deleted, that was because we were trying out some random stuff in code, which must have corrupted the data.
So there's actually no issue and we're good to close this ticket.
Thanks for your time everyone and apologies for any inconvenience caused.
- ๐บ๐ธUnited States tr Cascadia
This does happen, for the reason @Greg Boggs mentioned above in #8. I added some related issues.
I personally think it's a very serious problem with core that was introduced in #2571235: [regression] Roles should depend on objects that are building the granted permissions โ .
I don't think that core should EVER automatically delete the Authenticated and Anonymous roles under any conditions because doing that destroys data (specifically how those roles are configured) and almost certainly breaks the website.
Config dependencies should prevent the permissions from being deleted if they are being used, and should NOT be deleting the roles without confirmation if the permissions are removed.
- Status changed to Active
over 1 year ago 6:47pm 27 June 2023 - ๐ฌ๐งUnited Kingdom jaydenpearly
This happened to me too after I uninstalled paragraphs demo and entity browser modules.
I don't know which one is the killer or if these modules have something to do with it.
I manually added a role with the machine name "authenticated" but all permissions were gone. "authenticated" is perceived as a new role. So it didn't work.
- ๐ฌ๐งUnited Kingdom jaydenpearly
I've tested again. It's proven that entity browser module delete authenticated role when it's uninstalled.
- Status changed to Closed: duplicate
over 1 year ago 12:11am 4 July 2023 This issue should have been moved to entity browser, to preserve the history.
- ๐ฎ๐ณIndia krishna mishra
I can reproduce same issue: Custom roles like (editor, author) on drush deploy :
1: Roles removed
2: Then again role created as config files exits for roles during deploy process. But this causes issue that for users role assignment has been removed as in first stpe of deploy roles are deleted.Steps to reproduce :
1: Update D9 to D10
2: Manually edit core.extension.yml and remove entity_browser
3: Execute drush deploy -y this will uninstall EB module and result above issue.Thanks!!