I have a boolean variable set up in Rules, and I set up a "Data Comparison" action in the Rules UI, selecting this variable.

When I got to the step where I was supposed to enter the value to compare, it gave me a checkbox saying "Data Value":
Rules UI screen shot

I found that very confusing... A help/description message saying "Check for TRUE, and uncheck for FALSE" or something like that would have helped, or better yet instead of a checkbox, make it a select or radios with values TRUE and FALSE. The single on-off checkbox with label "Data value" just didn't make sense. Keep in mind that in a "data comparison" action I have to choose a variable/value to compare with another variable/value, so checking a box doesn't seem like "entering a value" to me.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

The UI is similarly confusing for Set a Data Value for Booleans, where it also has a checkbox with label "Value".

heddn’s picture

I agree that this is very confusing. It was only after finding this issue that I was able to figure out how to use this type of data comparison.

fago’s picture

Converting to radios sounds reasonable. Anyone cares to roll a patch?

heddn’s picture

Status: Active » Needs review
FileSize
1.03 KB

Here you go.

heddn’s picture

Here's a screenshot.
rules-UI-BooleanValues-2014065.png

jhodgdon’s picture

That looks like probably the right fix... guess it probably needs manual testing though.

Does this patch fix Booleans wherever they appear, or does there need to be a separate fix depending on if it's being used in a Data Comparison or a Set a Data Value?

heddn’s picture

Issue tags: +Novice, +Needs manual testing

In response to: #6, it fixes both conditional and set data value.
Tagging appropriately.

ditcheva’s picture

+1 for this - I agree the UI is very confusing. Just tested the patch in #4 and it works well for me! Maybe with another user test, we can switch to 'reviewed and tested'??

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks like we have two manual tests and I reviewed the code too, so let's at least provisionally set to RTBC.

fago’s picture

Status: Reviewed & tested by the community » Needs work

I see that this is confusing in that situation, but the same UI will be used to generate other checkboxes as well, e.g. check the page redirect action with the patch applied. I doubt it makes a good UX there?

So, we
a) need to find a solution that works for both cases or
b) we leave the current way as default and implement an alternate way that's used to input booleans for the generic actions/conditions only. I doubt this would be very simple though, as we'd have to some checking to add the UI customizations only for booleans params... :-/

Maybe, you've got some good ideas for a) though?

heddn’s picture

Status: Needs work » Needs review
FileSize
1.24 KB

After looking at the page redirect action I see what you mean. I've revised the wording a little better now. This wording makes sense to me. Anyone else?

fago’s picture

hm. I tried to improve it a bit - see attached, but I think it's still a too big pita for the page-redirect case.

What about going with radios and labels "Enabled" / "Disabled" ?

fago’s picture

FileSize
792 bytes
fago’s picture

Issue tags: -Novice

that's not so simple, actually ;-)

heddn’s picture

heddn’s picture

Cross-post on the screenshots. They are related to #11

bserem’s picture

This really needs to be pushed to Rules... I was fiddling with the data comparison for quite some time and it really doesn't make sense the way it is being displayed by default.

ditcheva’s picture

I like the approach in #11. That makes the most sense to me!

SocialNicheGuru’s picture

Issue summary: View changes

#13 works for me.

SocialNicheGuru’s picture

Status: Needs review » Reviewed & tested by the community

is it ok to show rtbc if you are not a maintainer. Just changing status so that it will trigger in the maintainer queue.

fago’s picture

Status: Reviewed & tested by the community » Fixed

ok, I've committed #13.

For the regular configuration checkbox imo it would make sense to provide a separate "checkbox" ui class, which one could specify for those parameters. I decided to commit this now anyway as it avoids further confusion with the data comparison now. The checkbox ui class can be provided in a follow-up, please feel free to open an issue + ping me for guidance if you are interested on working on that.

  • Commit c45f5bd on 7.x-2.x authored by heddn, committed by fago:
    Issue #2014065 by heddn, fago | jhodgdon: UI very confusing for Data...

Status: Fixed » Closed (fixed)

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