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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.andrey’s picture

A slightly cleaner version of the patch...

xjm’s picture

Tracking.

mr.andrey’s picture

Updated patch. Better recursion, loop prevention.

mr.andrey’s picture

After some cleanup...

xjm’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Category: support » feature

+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).

xjm’s picture

Also, 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.

xjm’s picture

Here's the patch with the slight UI modifications I suggest in #5 and #6.

xjm’s picture

Related 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."

xjm’s picture

xjm’s picture

Status: Needs review » Fixed

Committed to 6.x-1.x-dev.

mr.andrey’s picture

Yay :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xaa’s picture

hello,
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

mr.andrey’s picture

That indeed would be cool.

xjm’s picture

davidneedham’s picture

Issue summary: View changes

Apparently this feature was dropped since coming to D7. Comments at #1673558: Set access set at partent term level? .