Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is similar to #609108: Menu admin page should say something when you save and #620592: Taxonomy admin page ... need feedback when saving. Role admin page admin/people/permissions/roles
doesn't reports anything when you save. Attached patch adds statement to print necessary status message.
Comment | File | Size | Author |
---|---|---|---|
#25 | 787684_role_weight_test_25.patch | 2.65 KB | Sivaji_Ganesh_Jojodae |
#23 | 787684_role_weight_test_21.patch | 2.75 KB | markabur |
#20 | 787684_role_weight_test_20.patch | 2.43 KB | mikey_p |
#19 | 787684_role_weight_test_19.patch | 2.79 KB | Sivaji_Ganesh_Jojodae |
#15 | 787684_role_weight_test_8.patch | 2.78 KB | Sivaji_Ganesh_Jojodae |
Comments
Comment #1
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedAttached is a patch with test for role weight change operation.
Comment #2
ghills88 CreditAttribution: ghills88 commentedI tested this patch off the latest HEAD from CVS and ran into unexpected behaviors on the Permissions tab.
Although the patch works as desired when saving changes on the Roles tab, anytime the permissions page is viewed the message is displayed dozens of time in a long list. See the screenshot attached.
Comment #3
markabur CreditAttribution: markabur commentedWould it make sense to check whether user_role_save() was actually successful, and make the message reflect that?
Comment #4
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commented@ghills88, Thank you for testing, i could not see any unexpected behaviors on the Permissions tab.
@markabur, I guess it makes sense to check
user_role_save()
response, attached patch will do it.Comment #5
codi CreditAttribution: codi commentedTested patch against alpha 4. Works as expected and doesn't display what ghills88 mentioned. Not sure if I'm allowed to switch the issue to RTBC without the automated tests running, but I'm doing it anyways.
Edit: Looks like the automated test ran and all is good.
Comment #6
Dries CreditAttribution: Dries commentedI'm not sure I agree with the 'try later or contact site administrator' comment. Not only does it have a typo, it is also something we shouldn't say. It is not very helpful, especially because chances are really high that the person performing the operation is the site administrator.
Comment #7
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedAttached patch uses
drupal_set_message(t('Unable to save role setting.'), 'error');
instead ofdrupal_set_message(t('There is a problem in saving the form. Try later or contact site administrator'));
. Let me know if there are any other changes to be made.Comment #8
markabur CreditAttribution: markabur commentedI think the new message is an improvement. Thanks for fixing the spelling error too. :-)
Comment #9
mmccollow CreditAttribution: mmccollow commentedI tested this against CVS HEAD and it works as expected. I think the message is clear, and having some feedback when you click save is a great improvement.
Comment #10
mmccollow CreditAttribution: mmccollow commentedDidn't mean to add the quick fix tag back, apologies. It's my first patch review :)
Comment #11
Cibes CreditAttribution: Cibes commentedWorks fine and resolves the issue. (How would I get the operation to fail in order to test the error message?)
I don't know much about the weight system but just to be sure as it might happen in the random check: Assigning same weight to two roles is okay? And is there a limit that could be reached by just adding 1 no matter what the value is?
Comment #12
jergason CreditAttribution: jergason commented#7: 787684_role_weight_test_7.patch queued for re-testing.
Comment #13
jergason CreditAttribution: jergason commentedTested against HEAD and it works fine.
Comment #14
Dries CreditAttribution: Dries commentedShouldn't that be 'settings' (plural)?
Ditto.
Shouldn't that be 'operations' (plural)?
Comment #15
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedAttached patch makes changes mentioned in #14.
Comment #16
tim.plunkettNeeds full stop.
Retrive/Retrieve
Powered by Dreditor.
Comment #17
tim.plunkettComment #18
markabur CreditAttribution: markabur commentedUpdating status
Comment #19
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedRerolled with changes mentioned in #16.
Comment #20
mikey_p CreditAttribution: mikey_p commentedThe changes from #6 and #7 didn't make it into the latest patch.
Comment #21
markabur CreditAttribution: markabur commentedLooks good, the changes are all there and the message shows when re-ordered roles are saved. This test description has some weird grammar:
How about:
Also, while we're here, might as well fix this typo up in line 1349 (creat => create):
Otherwise it's RTBC as far as I can tell.
Comment #22
markabur CreditAttribution: markabur commentedComment #23
markabur CreditAttribution: markabur commentedReroll with those nits from #21.
Comment #24
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedAdding
string freeze
tagComment #25
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedAttached is the patch rolled against the recent code base with following changes
1. Removed user_role_save() status check.
2. Replaced 'rand' to 'random' in comment line.
Hope this is ready to go.
Comment #26
mikey_p CreditAttribution: mikey_p commentedStill applies and looks good to me. The error message isn't very helpful anyway.
Comment #27
webchickLooks like all previous feedback has been addressed.
Committed to HEAD. Thanks!