Closed (fixed)
Project:
Hierarchical Select
Version:
5.x-3.x-dev
Component:
Code - Taxonomy
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Oct 2008 at 09:11 UTC
Updated:
19 Oct 2008 at 15:12 UTC
Edit vocabulary form does not remember for "Use the Hierarchical Select form element for this vocabulary." setting after I hit submit on a page like 'admin/content/taxonomy/edit/vocabulary/1'.
Thus it can't be used later on. I looked into hs_taxonomy.module's code and realized the following diff between RC3 and dev:
// Add a validate callback to override the freetagging and multiple select
// settings if necessary.
- $form['#validate']['hierarchical_select_taxonomy_form_vocabulary_validate'] = array();
- $form['#submit']['hierarchical_select_taxonomy_form_vocabulary_submit'] = array();
+ if (variable_get("taxonomy_hierarchical_select_$vid", 0)) {
+ $form['#validate']['hierarchical_select_taxonomy_form_vocabulary_validate'] = array();
+ $form['#submit']['hierarchical_select_taxonomy_form_vocabulary_submit'] = array();
+ }
This if statement is funny because the only place where this 'taxonomy_hierarchical_select_$vid' variable is set is in the 'hierarchical_select_taxonomy_form_vocabulary_submit' function.
So Wim, could you please explain me the meaning of that if statement?
(Attached the diff for visual people...)
| Comment | File | Size | Author |
|---|---|---|---|
| hs_diff.jpg | 172.51 KB | zserno |
Comments
Comment #1
drupaliedude commentedThis patch is bad. It breaks the "checkbox". If you add this, the checkbox will always stay unchecked even if HS is enabled for the vocab. Commenting out the if line fixes it but
// Add a validate callback to override the freetagging and multiple select
// settings if necessary.
//if (variable_get("taxonomy_hierarchical_select_$vid", 0))
{
$form['#validate']['hierarchical_select_taxonomy_form_vocabulary_validate'] = array();
$form['#submit']['hierarchical_select_taxonomy_form_vocabulary_submit'] = array();
}
The problem of the HS check not saving is somewhere else. All this does is break the checkbox. To disable/enable things, I have to manually delete things from the variable table. The problem isnt the checkbox itself, its the actual saving/deleting of the variable in the variable table.
Comment #2
zserno commentedFirst, this is not a patch just a bug report with a suggestion (see status).
Second,
I'm sorry, but I don't have this problem if I comment out the if line and its closing bracket. Could you explain a bit more?
Comment #3
wim leersThat was a bad fix for a bug. The bug was: when HS was disabled, its validate callback would still be called and therefore manipulate some of the default vocabulary settings. That has been properly fixed now.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.