I'm reacting on a form (the durpal commerce checkout form) when it is submitted and i just want to know if it has been validated or canceled.
I've made a condition (i have in the list a submit:buttons:cancel data availlable, it seems great!),
i try 'data comparison' 'value is empty' on it and when i click 'ok' i've got a message :
Data selector submit:buttons:cancel for parameter data is invalid.

Have i missed something ?

Comments

kenorb’s picture

These fields are there, but are not available during that time ($this->availableVariables). See: Rules Workflow: Data selector is invalid

Not sure how we can fix it. Either these parameters shouldn't show, or we should make them available somehow.

kenorb’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Category: Support request » Bug report
kenorb’s picture

Title: I want to know if form has been canceled » Data selector X for parameter data is invalid.
caminadaf’s picture

Title: Data selector X for parameter data is invalid. » Document that Form Elements data selectors are only selectable for Rules Forms Conditions and Actions
Component: Rules » Documentation

@kenorb, I don't think that we can really control which selectors are available on $this->availableVariables because it is inherited from the rules event. I've recently commited a "Form element is empty" condition on 7.x-1.x, and this should be used for form elements instead of "Data comparison".

@yorguey31 to do what you described there is also the "Form button was clicked" condition, which will check which button was submitted on the form. Please try using that one instead.

Thus, I think that maybe this is more of a documentation problem than actually a bug. The documentation should explicitly say that the form elements can only be used with Rules Forms conditions and actions, since they depend on our processing. (at least for now on 7.x-1.x)