While working on standardizing the tokens exposed by Drupal Commerce, we found an inconsistency in the Rules UI between "Data selection" and "Direct input mode":

In "Data selection" mode, the autocomplete encourages you to enter data selectors with variable names with dashes...

... even if it actually supports both forms.

On other hand, in "Direct entry mode", the RulesTokenEvaluator only supports variable names separated with understores:

For consistency with how core tokens work (the usual separator is dash), it would make sense to support both forms in RulesTokenEvaluator, but favor the form with dashes in the UI.

Comments

damien tournoud’s picture

Component: User Interface » User interface
Status: Active » Needs review
StatusFileSize
new1.27 KB

Patch against 2.x-dev.

rszrama’s picture

Status: Needs review » Reviewed & tested by the community

Patch works great for me, exactly as expected. And it's kind of a requirement now for the beta4 of Commerce. : P

khiminrm’s picture

Subscribe

googletorp’s picture

I would like to see this committed to Rules.

fago’s picture

Status: Reviewed & tested by the community » Fixed

thanks, committed.

guy_schneerson’s picture

Subscribe

Status: Fixed » Closed (fixed)

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