Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Wim LeersInteresting. 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.
Comment #2
digi24 CreditAttribution: digi24 commentedIt 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.
Comment #3
Wim LeersSorry for the late commit … but now I finally did! :) This was extremely minor anyway :)
http://drupal.org/cvs?commit=335080