Active
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2011 at 20:37 UTC
Updated:
14 Nov 2017 at 19:12 UTC
Jump to comment: Most recent
Hi,
I am trying build a rule that reminds users to fill in some mandatory profile information, by checking emptyness of a Profile2 profile field. Rule is as follows
{ "rules_remind_user_to_enter_profile_inf" : {
"LABEL" : "Remind user (individual) to enter mandatory information",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules" ],
"ON" : [ "user_login" ],
"IF" : [
{ "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "4" : "4" } } } },
{ "AND" : [] },
{ "data_is_empty" : { "data" : [ "account:profile-individual-profile:field-profile-sin" ] } }
],
"DO" : [
{ "redirect" : { "url" : "user\/[account:uid]\/edit?destination=dashboard" } },
{ "drupal_message" : { "message" : "Please fill in the mandatory parts of your profile (i.e. those marked with an asterisk)" } }
]
}
}
Am I doing something wrong, or is this a glitch?
Thanks
Oskar
Comments
Comment #1
larowlansub
Comment #2
videographics commentedI'm seeing the same thing with a date field.
Comment #3
anni commentedSame issue here...
Comment #4
gafenn08 commentedI am seeing this in rules 7.x-2.0 as well.
Comment #5
fagoI doubt this is caused by profile2. Please report with which field type and entity type the condition has troubles for you.
@date module: Please make sure to test the latest dev version of the module.
Comment #6
anni commentedIt happend with a date field and i used the actual dev version.
Comment #7
designcontext commentedSame problem with rules 7.x-2.0. I check for normal text fields in profiles.
Comment #8
mshepherd commentedSimilar to the OP, I'm using profile2.module and I'm trying to trigger an event after saving a new user.
When my plain text field is part of the profile entity, the condition Data field is empty always returns TRUE. When the same field is part of the user account, behaviour is as expected.
Matthew
Comment #9
succinct commentedI am having the same issue with a Decimal field. Here is an export of my rule:
This field has a value in it (the value was 80.00 for my test case) and the following was in the Rules log:
Why is it evaluating to TRUE when the field has a value?
Comment #10
succinct commentedAfter further testing, it seems that this only happens if the field had previously been set, and then unset again. Maybe a cache issue?
Comment #11
nerdcore commentedIf this is a caching issue as @succinct speculated, and given that @mshepherd indicated a problem during a trigger "After saving...", maybe this related Rules issue is useful to you here.