Hey,

please correct me, if I am wrong, but should $form_state be really passed by reference? (it creates trouble for me, when using the functions from a custom module.

Index: hierarchical_select/modules/hs_taxonomy.module
===================================================================
--- hierarchical_select/modules/hs_taxonomy.module      (revision 1003)
+++ hierarchical_select/modules/hs_taxonomy.module      (working copy)
@@ -227,7 +227,7 @@
 /**
  * Implementation of hook_form_alter().
  */
-function hs_taxonomy_form_alter(&$form, &$form_state, $form_id) {
+function hs_taxonomy_form_alter(&$form, $form_state, $form_id) {
   // Change the term selection of nodes. Only affects hierarchical
   // vocabularies.
   if (isset($form['type']) && isset($form['#node']) && (variable_get('taxonomy_override_selector', FALSE)) && $form['type']['#value'] .'_node_form' == $form_id) {

Comments

Wim Leers’s picture

Title: Variable reference in hs_taxonomy_form_alter » $form_state incorrectly passed by reference to hs_taxonomy_form_alter()
Status: Active » Postponed (maintainer needs more info)

Interesting. I suppose that's indeed not needed. Probably a typo or copy/paste error.

If you can confirm everything keeps working for you, I'll commit it.

digi24’s picture

Status: Postponed (maintainer needs more info) » Needs review

It works for me and my users.

I haven't tested it in a setup with multiple hs forms, but as far as I can see, the function is not altering any $form_state data, its only checking for preview, so it should not make any difference.

Setting to "needs review" in case someone else would like to check too, but in my opinion it can be committed.

Wim Leers’s picture

Status: Needs review » Fixed

Sorry for the late commit … but now I finally did! :) This was extremely minor anyway :)

http://drupal.org/cvs?commit=335080

Status: Fixed » Closed (fixed)

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