When I use domain_taxonomy to limit which taxonomy terms appear under which domains, this module ignores those settings and shows all terms from all domains, when I switch back to the normal "select list" field widget, I see the correct list

see http://drupal.org/project/domain_taxonomy

CommentFileSizeAuthor
#3 1462166-3-query_term_access_tag.patch382 bytesbradjones1

Comments

bartk’s picture

Hopefully this will just be a matter of checking for the presence of the domain taxonomy module and accounting for it. Unfortunately I have to grab the terms out of the database using SQL, because using the Drupal API to load them is extremely slow and memory intensive.

bartk’s picture

Status: Active » Postponed

Sorry to do this, but I'm postponing this until Domain Taxonomy is stable. It doesn't look like it uses standard drupal hooks on term load, which means I'd have to add in functions from an unstable module where the API might change. Here's a suggestion for patching this yourself:

In the function _term_reference_tree_get_children, run domain_taxonomy_load_term on each loaded term (you'll have to cast $term as an object), check to see if the domain matches the current domain, and omit items that don't.

bradjones1’s picture

Status: Postponed » Needs review
StatusFileSize
new382 bytes

Actually, domain_taxonomy module uses a standard hook_query_TAG_alter implementation. For an example of how this works at current with other contrib modules, see views, which adds the term_access tag to its term lookups and works OOTB with domain_taxonomy.

Attached is a simple patch that does the same for term_reference_tree.

While it's unrelated to the change to this module, users of domain_taxonomy module should see #1409028: Terms not restricted to domain on node add/edit form also apply a patch from #1560246: admin/structure/taxonomy/[vocabname] should respect domain access rules to allow the query alter to fire on node edit pages.

dave reid’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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