Closed (fixed)
Project:
Taxonomy Term Reference Tree Widget
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2012 at 02:01 UTC
Updated:
25 Apr 2013 at 19:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
bartk commentedHopefully 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.
Comment #2
bartk commentedSorry 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.
Comment #3
bradjones1Actually, 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.
Comment #4
dave reidCommitted #3 to 7.x-1.x. Thanks!
http://drupalcode.org/project/term_reference_tree.git/commit/cd5016e