Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top