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.
Currently, the admin form submit handler updates nodes affected by permissions changes on a per-row basis. This adds a lot of unneeded overhead to admin form submissions, because the same nodes may be affected by multiple terms or vocabularies. It would be better to collect a list of affected node ids and then run _taxonomy_access_node_access_update()
only once after all other processing has taken place.
Comment | File | Size | Author |
---|---|---|---|
#5 | tac_732844-5.patch | 4.41 KB | xjm |
#2 | tac_732844-2.patch | 5.17 KB | xjm |
Comments
Comment #1
xjmI looked through the code, and
_taxonomy_access_node_access_update()
is called in the following functions:Numbers 3 and 4 are all called only by the submit handler itself (#2), or by other functions that are in turn called by the submit handler. Therefore, this is what I propose:
_taxonomy_access_cache_affected_nodes()
to append more affected nodes to an existing list_taxonomy_access_node_access_update()
in 3 and 4 above with_taxonomy_access_cache_affected_nodes()
._taxonomy_access_node_access_update()
and then call that once with the cache as above.Comment #2
xjmAttached patch implements the solution described in #1. This needs to be tested thoroughly once #739732: Nodes not updated on vocabulary default add and #739874: Some nodes not updated on role disable are fixed.
Comment #3
keve CreditAttribution: keve commentedThe logic of this solution is ok, but it needs testing.
Comment #4
xjmThe patch needs to be rerolled against CVS; the first hunk fails. (The other 7 succeed with fuzz + offsets).
Comment #5
xjmHere's the patch rerolled against CVS.
Comment #6
xjmTested adding, deleting, and changing both terms and defaults; the list of nodes updated seems appropriate in all three cases.
Comment #7
xjmCommitted to 6.x-1.x-dev:
http://drupal.org/cvs?commit=341362