Patch (to be ported)
Project:
UC Discounts
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2010 at 07:07 UTC
Updated:
22 Dec 2010 at 07:07 UTC
--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 |