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 a patch that adds a recursive functionality to the taxonomy access control admin interface.
It creates a drop-down with two options (Normal and Recursive) next to the "Add" button. If "Normal" is selected, all works as before. If "Recursive" is selected, a function is called that pulls all the child terms, and executes the "normal" functionality on each of them.
The effect will be the same as if you manually added each of the child terms yourself.
This only changes the admin interface, the rest of the module stays the same.
Comment | File | Size | Author |
---|---|---|---|
#7 | taxonomy_access-689668-7.patch | 3.26 KB | xjm |
#4 | taxonomy_access_recursive-4.patch | 2.82 KB | mr.andrey |
#3 | taxonomy_access_recursive-3.patch | 3.25 KB | mr.andrey |
#1 | taxonomy_access_recursive-2.patch | 2.15 KB | mr.andrey |
taxonomy_access_recursive-1.patch | 2.26 KB | mr.andrey | |
Comments
Comment #1
mr.andrey CreditAttribution: mr.andrey commentedA slightly cleaner version of the patch...
Comment #2
xjmTracking.
Comment #3
mr.andrey CreditAttribution: mr.andrey commentedUpdated patch. Better recursion, loop prevention.
Comment #4
mr.andrey CreditAttribution: mr.andrey commentedAfter some cleanup...
Comment #5
xjm+1. This is a great patch. Applied and tested on my site; works fine.
My only suggestion is to improve the form layout a little to save screen space; having both select boxes and add button on the same line (in separate cells) seems to cause problems in garland (the table escapes the center column of the page and the "list" checkbox becomes unclickable underneath right sidebar blocks, regardless of how wide the window is).
Comment #6
xjmAlso, maybe it would be better to replace the normal/recursive select box with a "With children" checkbox? That would probably be a little easier for users to understand.
Comment #7
xjmHere's the patch with the slight UI modifications I suggest in #5 and #6.
Comment #8
xjmRelated issues:
#364065: More options when Adding Terms and Vocabularies
#358064: Add term default permission should be the same as the vocabulary default (when it exists) or the global default
#364058: Allow configuration of TAC permissions on term/vocab create/edit
It might also be worthwhile to add an option to delete children in the same fashion; currently each term has to be checked individually before clicking "Delete."
Comment #9
xjmMore related issues:
#359534: Adding Child Terms with Parents (marked as duplicate of this issue)
#177502: Should unconfigured terms inherit access control settings of parent terms?
#38020: Inherited values?
Comment #10
xjmCommitted to 6.x-1.x-dev.
Comment #11
mr.andrey CreditAttribution: mr.andrey commentedYay :-)
Comment #13
xaa CreditAttribution: xaa commentedhello,
is there the possibility to invoke the recursive function on a child term automaticaly when it is created?
ex:
1user creates a child term --> the access rule is automatically defined (based on its parent term) instead of invoked the recursive function manually from the administration page. oO
Comment #14
mr.andrey CreditAttribution: mr.andrey commentedThat indeed would be cool.
Comment #15
xjmSee:
#177502: Should unconfigured terms inherit access control settings of parent terms?
#358064: Add term default permission should be the same as the vocabulary default (when it exists) or the global default
#364058: Allow configuration of TAC permissions on term/vocab create/edit
Also, generally best to check for open issues rather than closed ones (or open a new one if none exists) because I don't usually look at closed issues. :)
Comment #16
davidneedhamApparently this feature was dropped since coming to D7. Comments at #1673558: Set access set at partent term level? .