Issue 1: Free tag vocabularies are missing the #weight parameter in taxonomy form. Patch attached.
Issue 2:
$form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', '#default_value' => $typed_string, '#maxlength' => 100, '#autocomplete_path' => 'taxonomy/autocomplete/'. $vocabulary->vid, '#required' => $vocabulary->required, '#title' => $vocabulary->name, '#description' => $help);
Free tag vocabularies are grouped together in taxonomy.module under a ['tags'] element. The Form API processes this element as well and gives it a default weight of 0. As a result, all free tag vocabularies are grouped together as a block of weight 0, thus negating their individual weights.
I am unsure whether Forms API should handle this or if the taxonomy module should restructure the form..
Thanks
-K
| Comment | File | Size | Author |
|---|---|---|---|
| taxonomy.module_15.patch | 1.38 KB | Zen |
Comments
Comment #1
adrian commented+1
patch is sane.
Comment #2
Zen commentedThe secondary patch has been committed. The primary issue remains.
Thanks
-K
Comment #3
morbus iffPostponing this per IRC discussion. The larger issue (which affects every vocabulary, freetag or not) is that "vocabs are always stuck within a parent container and can never be weighted outside that container" - whether free tags (in ['tags'], then in fieldset "Categories") or not (in fieldset "Categories"). Unfortunately, this isn't just a easy FAPI change - to weight vocabularies outside of a parent requires crazier changes within the form processing code of taxonomy.module. Save it for 4.8.
Comment #4
webchickHey hey, it's 4.8 time. :) And I really wish there was some way to pull these suckers out of the fieldset, so re-opening this issue.
Comment #5
magico commentedNews about this?
Comment #6
moshe weitzman commentedWhat about we just skip fieldsets for vocabs? seems like an simple fix. not perfect, but simple ... noone else has proposed a fix for 6 months now.
Comment #7
morbus iffmoshe: I don't believe it is that easy. If I recall correctly, $form['taxonomy'] is a #tree - we could certainly get rid of the visual approximations of the fieldset, but we'd still require the #tree and $form['taxonomy'] structure. This would continue to prohibit the inner element weighting amongst the rest of the form.
Comment #8
LAsan commentedIs this still an issue in current dev version?
Comment #9
webchickYes it is, and it's still a complete PITA to deal with.
I would love to do #6 and just have $form['taxonomy']['vocab_name'], $form['taxonomy']['vocab_name_2'] and be able to do a simple hook_form_alter() to shift the #weight to throw the fields wherever the heck I want. I don't know how to get around the #tree problem, though.
Comment #10
Peter Swietoslawski commentedI've just installed clean 6.10 and still can see tag type vocabularies to get wrong weight of 0 in taxonomy_form_alter.
6.10 have attached patch applied but it only fixes weights for tag type vocabs i.e. inside container $form['taxonomy']['tags']. The container itself is still weighted wrongly to 0 and if you have other not tag type vocabs on page with positive weights they will be pushed below all tag type vocabs regardless of being "lighter".
Is there any plan to fix this in 6.x?
Comment #11
bdragon commentedResetting version.
Comment #12
maria_zk commentedthe bug still remains in 6.13?
Comment #13
catchField API!!!!!