When called directly with form_builder, forms are loaded skipping the call to form_alter to allow other modules to mess with it.

Replacing

$form = form_builder('taxonomy_manager_form', $form);

with

drupal_prepare_form('taxonomy_manager_form', $form);

moves it up the one level needed to let form_alter work on it, which has worked for me with no ill effects.

Patch attached. Note that the latter function works by reference, which is why "$form = " was removed.

(There are a couple other places where $form = form_builder('form_id', $form) is called that perhaps could be replaced with drupal_prepare_form('form_id', $form).)

Rationale: This makes it possible for modules that do complex stuff with Taxonomy to still have what Taxonomy Manager does work too. The example in this case is Place (place_taxonomy, taxonomy_location) which is used on World Social Forum 2008.

(Offtopic: The main listing of terms, however, is not a form. Anyway to hook into that to disable or modify the setting of weights?)

benjamin, Agaric Design Collective

Comments

mlncn’s picture

Here's the patch.

mikl’s picture

Version: 5.x-1.x-dev » 6.x-2.x-dev
Assigned: mlncn » Unassigned
Status: Needs review » Fixed

This is fixed in Drupal 6.

Status: Fixed » Closed (fixed)

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