If using Organic Groups, it is possible to associate a vocabulary with a specific OG with the OG Vocabulary module. So if a node is being posted into an OG that has its own vocab, such nodes can be classified using terms from regular vocabs (ie, are not associated with an OG) PLUS terms from the OG specific vocab.
The default behaviour of the node edit form is that the OG-specific vocabs are hidden, unless the node is being posted into the OG that has its own vocab (using URL of form /node/add/TYPE?gids[]=GROUP_ID, or you are editing a node that has already been posted to the OG).
Since moving over to taxiselect the UI is fantastic, but OG-specific vocabs are being rendered for all nodes, regardless of whether they are 'Public' or being posted into any OG. Couldn't find anything obvious by poking around with devel_themer. Problem is it will allow users to use terms that don't "belong" to them.
Not sure if this is a bug, or if this is another feature that needs to be added to this module. Don't think it's OG Vocab's fault, as many other Taxonomy helper modules seem to work just fine (ie, hide OG-specific vocabs as required)
Comments
Comment #1
snorkers commentedSorry - didn't mean to be a lazy 'Help Vampire' - as soon as I posted, it struck me I thought I'd nose around the code for both modules.
I'm still working my way around custom modules and FAPI (practically a newbie), but it looks like OG Vocab hides the vocabs in hook_form_alter(), yet it seems that TaxiSelect completely rebuilds the vocab editing part of the node form in hook_form_alter(), possibly overriding the work that OG Vocab does. So had a quick look at module weights on MySQL (system table):
I changed TaxiSelect to weight 0 (so TaxiSelect is called first, then OG Vocab hides appropriate vocabs ??) and all was back to 'default' behavior (ie, OG Vocabs are displayed when appropriate).
Are there any significant implications of reducing the module weight to zero? Or should I be increasing OG Vocab weight? I've no idea at the moment
Comment #2
snorkers commentedSo is there a problem with
function taxiselect_incompatible_modules_fix()in taxiselect.install regarding setting weight?Sorry for string of posts... it's still Monday morning
Comment #3
alan d. commentedIn this use case, it will (should - I am talking about TaxiSelect... I have no idea about OG Vocab) be safe to increase the weight of the TaxiSelect < OG Vocab so that it runs first. If you look at the install file, you will see a list of modules that must be run before TaxiSelect as they bypass the core Taxonomy access checks on the core Flag 'taxonomy_override_selector'.
The issue here is that there is no mechanism in Drupal to control this form, the flag is a 0 or 1. The elements are added via a hook_form_alter() [Taxonomy module - weight = 0] so it is a race condition based on the system weight.
This will effect at least the following modules, so moving to the OG Vocab queue.
Internationalization - rewrites the vocabs
Hierarchical Select - like this, handles the Taxonomy form, as does a couple of others.
Solution - OG Vocab must run last
Comment #4
alan d. commentedAnother module that will have a conflict - Big Autocomplete TAXonomy
Comment #5
snorkers commentedI'd already had issues with BATAX, but couldn't nail down the problem. Thanks for the comments
Comment #6
alan d. commented@snorkers Both Taxiselect and BATAX will conflict if you don't already know that.
I can not update the OG Vocab system weight from taxiselect, is it running OK? It has been added to my watch list of modules in the past, but I see no reason for this currently. Please test the new weight combo, and if this runs OK I take it out of my watch list and let other maintainers of modules that use 'taxonomy_override_selector' know. Then OG Vocab just needs to make sure that it runs after these modules.
Comment #7
amitaibuThis sounds like a specific case, so a custom module can give og_vocab the required weight.
Comment #8
alan d. commentedSo you do not care about the core Drupal feature 'taxonomy_override_selector'? There are at least three modules that use this, maybe more. From the quick look at the most up to date code, all you need to do is make this module is run last and make sure that you do not update / create any of the vocabularies that are absent from the form when the form alter is called.
I think this is why the module was added to the "make sure that this is run first" module lists of HS & Taxiselect. It use to recreate the select widgets, the sole point that the 'taxonomy_override_selector' flag. This flag was added to allow better implementations of the term select widget, as a select element is very basic for a number of vocabularies. I personally have a country / region / city & town vocab that will cripple the best system if you try to render it in a single select element. (it is about 230 MB)
Anyway, your call.
Comment #9
alan d. commentedPS: That vocab cripples Drupal itself as the DnD page tries to load the most of the vocab in a single hit. Not a common use case unless someone creates a Drupal friendly geocode database of significance.
Comment #10
amitaibuOk, I might missed the point of this issue -- please explain how it's related to the taxonomy_override_selector variable.
Comment #11
alan d. commentedThis is a flag that stops the Taxonomy module from creating the form term elements. Once the flag is set, it simply saves the terms on submit, nothing else. Then it is up to the module that created the flag to implement these, usually with a form_alter().
The flag also overwrites the admin section select elements.