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
Comment #1
damien tournoud commentedPatch against 2.x-dev.
Comment #2
rszrama commentedPatch works great for me, exactly as expected. And it's kind of a requirement now for the beta4 of Commerce. : P
Comment #3
khiminrm commentedSubscribe
Comment #4
googletorp commentedI would like to see this committed to Rules.
Comment #5
fagothanks, committed.
Comment #6
guy_schneerson commentedSubscribe