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...)

CommentFileSizeAuthor
hs_diff.jpg172.51 KBzserno

Comments

drupaliedude’s picture

This 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.

zserno’s picture

First, this is not a patch just a bug report with a suggestion (see status).
Second,

If you add this, the checkbox will always stay unchecked even if HS is enabled for the vocab

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?

wim leers’s picture

Title: Edit vocabulary form does not remember for "Use the Hierarchical Select form element for this vocabulary." setting » Vocabulary form does not remember the "Use HS for this vocabulary" setting
Assigned: Unassigned » wim leers
Status: Active » Fixed

That 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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