Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
--Creating new user role condition and set operator != and login user match this condition and still return false after debugging uc_discounts_role_check I found it check with isset ignoring operator.
-It fixed by replacing this code
##return isset($user->roles[$condition->item_id]);
to be:
##
if ($condition->op == '=') {
return isset($user->roles[$condition->item_id]);
} else {
return !isset($user->roles[$condition->item_id]);
}
I attached patch with these changes.
Comment | File | Size | Author |
---|---|---|---|
uc_discounts_role.module.patch | 554 bytes | melsawy |