views:

30

answers:

1

Is there a trick, addon or patch that allows me to find out what modules altered a specfic form?

A list of all hook_form_alters is not too hard to achieve. But I want to list only those that actually changed my form.

Modules can alter a form trough a generic modulename_form_alter() and modulename_form_FORMID_alter() it would be nice if both are taken into consideration.

A: 

The drupal_prepare_form function calls all hook_form_alter functions. In this function, there is no storage for any modules that implement hook_form_alter. However, there is a container ($data) there that pulls all the alter functions then is applied with drupal_alter. Getting this data would require modifying this file (ref: line 543 in /includes/form.inc in Drupal 6.19).

Andrew Sledge
I poked around there already. But $data is quite "fluid", so comparing one $data to another $data, in order to find if a form was "altered" does not work. It will (somehow) always return TRUE: somehow $data is changed on each iteration here.
berkes

related questions