-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unique Group.Title and Group.Code enforced in change in v4.10, can't save/update existing duplicates #10436
Comments
I think stopping two groups from being created with the same title was a mistake, especially so given that groups can have parents. If you comment out this bit of validation, are you able to save the group information then? silverstripe-framework/src/Security/Group.php Lines 511 to 524 in 8a314a9
I think the group code should then automatically update to ensure it’s unique. If that works, I’d propose we just remove that validation. |
Or we add ParentID to the filter so that the same groups can exist on different levels. |
On version ~4.10.0 I would need to comment out both the validation pieces in order to save.
I've just upgraded to version 4.11 as I see there have actually been some changes to this area. silverstripe-framework/src/Security/Group.php Lines 511 to 524 in 8a314a9
It makes sense to me to not need a unique "Title". Only having one unique value to worry (Code) about/reference by. |
@kinglozzer to confirm are you proposing we keep the Group.Code unique validation though remove the Group.Title validation? If so that seems fine to me, I think a PR targeting 4.11 for a patch release is fine since we're reverting a feature that created a regression. If you're happy to spin up a PR I can get it merged and released for you @michalkleiner do you have an objections to this? |
I think the main concern was the group code duplication. The title can possibly be the same on different levels and still make sense, so I would be ok with removing the title validation. Also apologies for the delay in responding. |
Thanks for this. Looking into workarounds in the meantime as this has a direct impact on one of our sites. It didn't look like I could change easily identify and change the If anyone could think of a better way, then that would be great to see.
|
Note: there was a silverstripe-framework/src/Security/Group.php Line 724 in 0b80643
The deprecation text there said "Remove deduping in favour of throwing a validation error for duplicates." - I'll put this issue into our internal CMS backlog queue. I can't give a time estimate though we'll review what to do with this issue |
Note - follow on API depredations work from #10525 (comment)
Affected Version
4.10.0 +
Description
After reading this pull request #10113
Looks as though Titles and Codes are now being validated to make sure they are unique.
We have an existing project that does not have unique group Titles and Codes.
Assuming this was just allowed prior to the 4.10 release
The issue is that admins are no longer able to update the group information even if changing the Title to a unique name (which the don't want to do right now) as the code only updates on initial creation
Any workaround or ideas would be appreciated
Steps to Reproduce
eg.
The text was updated successfully, but these errors were encountered: