Problem/Motivation
With a larger vocabulary where each user has multiple allowed terms selected in their user edit form if a site manager accidentally doesn't hold down the Ctrl or Cmd key when clicking on a new term they're adding, all the terms that were previously selected get lost. This is a nightmare for sites with lots of users and lots of terms.
Steps to reproduce
1. Have a vocabulary with many terms.
2. Edit the user to add a new term.
3. Accidentally click on the new term without holding the Ctrl/Cmd key.
Proposed resolution
Create an option to output the list of terms as Checkboxes so that each term is independently an on/off check and will not be affected by other terms.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | before.png | 33.75 KB | divya.sejekan |
| #2 | 3397350-2.patch | 4.29 KB | sidharth_soman |
Issue fork permissions_by_term-3397350
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
Comment #2
sidharth_soman commentedI have introduced an option for choosing the checkboxes output in the module's config and also a conditional for outputting the terms in checkboxes in the user form.
Please apply the patch and review.
Comment #3
marty.true commentedThe patch applied cleanly, and the new option works a treat! Thank you for addressing this issue — this option makes the module much more feasible now.
Comment #6
vitaliyb98 commentedImproved code provided in the patch.
Fixed error with unsetting the checkbox:
Added functional tests for this functionality.
Comment #7
vitaliyb98 commentedI would appreciate it if someone else could also test this solution.
Comment #8
divya.sejekan commentedTested the MR!66 , The fix works
If checked the "Display the terms in checkboxes" - checkbox in /admin/permissions-by-term/settings . The Terms are displayed as check boxes in the user account settings page
The Fix is working as expected . But the MR looks like it has merge issue . Changing it to need work , for someone to fix the merge error
Comment #9
vitaliyb98 commented@divya.sejekan, Thank you for reviewing and testing. I've resolved the merge conflict, but will keep the issue in Needs review, hoping that someone else can also verify it.
Comment #10
dhruv.mittal commentedReviewing it
Comment #11
damienmckennaInstead of naming the variable "output_checkboxes" maybe name it "selector_style" and have two values - "checkboxes" and "select", with it defaulting to "select"?
Comment #12
vitaliyb98 commented@damienmckenna Thanks for the feedback. I agree, it's a good idea.