This patch defines a new API function that simply looks at $form and returns TRUE or FALSE indicating whether or not it represents a product node form. This will be usable anywhere the core modules or contributed modules want to add to or alter product node forms. So far, each implementation of hook_form_alter() has had to perform its own check.

No longer!

This patch includes an example use in the quote module, along with a general cleanup of uc_quote_form_alter(). Sorry, couldn't resist. I think it's good to keep doing cleanup in these patches anyways, especially commenting.

We can either commit this one and then spread the wealth to other implementations or roll it all into this one patch.

Comments

Island Usurper’s picture

Status: Needs work » Fixed
StatusFileSize
new16.85 KB

I've spread the wealth around to the shipping method modules, so here's the new patch. Nothing major, so committed.

Status: Fixed » Closed (fixed)
Issue tags: -code cleanup

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