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

CommentFileSizeAuthor
taxonomy.module_15.patch1.38 KBZen

Comments

adrian’s picture

Status: Needs review » Reviewed & tested by the community

+1

patch is sane.

Zen’s picture

Status: Reviewed & tested by the community » Active

The secondary patch has been committed. The primary issue remains.

Thanks
-K

morbus iff’s picture

Status: Active » Postponed

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

webchick’s picture

Status: Postponed » Active

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

magico’s picture

News about this?

moshe weitzman’s picture

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

morbus iff’s picture

moshe: 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.

LAsan’s picture

Version: x.y.z » 7.x-dev

Is this still an issue in current dev version?

webchick’s picture

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

Peter Swietoslawski’s picture

Version: 7.x-dev » 6.10

I'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?

bdragon’s picture

Version: 6.10 » 7.x-dev

Resetting version.

maria_zk’s picture

the bug still remains in 6.13?

catch’s picture

Status: Active » Closed (duplicate)

Field API!!!!!