Free tag vocabularies - #weight issues

Zen - February 4, 2006 - 14:55
Project:Drupal
Version:7.x-dev
Component:taxonomy.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

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

AttachmentSizeStatusTest resultOperations
taxonomy.module_15.patch1.38 KBIgnoredNoneNone

#1

adrian - February 9, 2006 - 08:19
Status:needs review» reviewed & tested by the community

+1

patch is sane.

#2

Zen - February 12, 2006 - 22:06
Status:reviewed & tested by the community» active

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

Thanks
-K

#3

Morbus Iff - February 13, 2006 - 16:01
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.

#4

webchick - June 28, 2006 - 02:34
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.

#5

magico - September 20, 2006 - 18:57

News about this?

#6

moshe weitzman - September 29, 2006 - 04:39

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.

#7

Morbus Iff - September 29, 2006 - 11:39

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.

#8

LAsan - April 4, 2008 - 11:22
Version:x.y.z» 7.x-dev

Is this still an issue in current dev version?

#9

webchick - April 29, 2008 - 03:49

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.

#10

peter.swietoslawski - March 13, 2009 - 09:07
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?

#11

bdragon - July 22, 2009 - 20:48
Version:6.10» 7.x-dev

Resetting version.

#12

maria_zk - July 27, 2009 - 00:18

the bug still remains in 6.13?

#13

catch - October 13, 2009 - 13:04
Status:active» duplicate

Field API!!!!!

 
 

Drupal is a registered trademark of Dries Buytaert.