Commerce doesn't always properly namespace its 'global' data. Commerce Payment, for instance, uses $form_state['payment_method'], which violates Payment's namespace. Because of this, EVERYTHING should be prefixed with "commerce".

Comments

rszrama’s picture

Title: Namespace 'global' data » Namespace form state variables
Category: bug » task

Thanks for making this postponed, as we can't really address it until 2.x. I disagree that not namespacing certain bits is a bug - for example, paths (we use cart instead of commerce-cart) - and I'm not really sure why us using the form state on forms we define should be considered bad. If the form comes from our module and your module wants to alter it, the onus should be on your module to work with the existing form - or propose the change as a feature request. : )

Let's leave this as an open task; I updated the title, but we can probably broaden the scope further if there are other points of conflict. Since D8 is going to have namespacing anyways, that may already take care of constants / function names, though, and I'm not sure where else we'd have this issue besides form states.

xano’s picture

I recall some Rules actions or conditions somewhere showing up in my "payment" namespace, but I'm not sure which plugins those were anymore. If I see anything else, I'll let you know.

rszrama’s picture

All of our Rules events / conditions / actions have the commerce_prefix afaik; if not I'd definitely update those, though it sucks to change anything in Rules from an update path standpoint. : P

bojanz’s picture

Issue summary: View changes
Status: Postponed » Closed (works as designed)