This may be a basic question (I'm not sure) but I could really use some expert advice as it's been very challenging for me.

I'm trying to edit a form on my website (the "Add New Product" form, from Ubercart) and have found some (but not all) of the areas in code where modules have implemented hook_form() and altered the appearance of this form.

There are a few items that are showing up on the form that I haven't been able to find (particularly, a drop-down box showing catalog categories). Is there a way to trace where hook_form or hook_form_alter is being called and which modules are adding which content? Even an idea about something I could print out using drupal_set_message would be very helpful.

Thank you!

Comments

ainigma32’s picture

Status: Active » Fixed

This is how the core finds (and calls) all modules that have a hook_form_alter defined :

foreach (module_implements('form_alter') as $module) {
  $function = $module .'_form_alter';
  $function($form_id, $form);
}

So if you stick something like this in a PHP block:

echo '<ul>';
foreach (module_implements('form_alter') as $module) {
  echo '<li>'. $module . '</li>';
}
echo '</ul>';

You should get a full list of modules that have an implementation of hook_form_alter.

- Arie

Status: Fixed » Closed (fixed)

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