Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello!
I think there is an error in the new rule.
I added a rule and defined, if Logged In User = User Viewed, then display an other panel than the usual user/%user panel.
The rule works only, if I select Not equal. Maybe this the error is in this piece of code:
user_compare.inc
/**
* Check for access.
*/
function ctools_compare_users_access_check($conf, $context) {
if (empty($context) || count($context) != 2 || empty($context[0]->data) || empty($context[1]->data)) {
return FALSE;
}
$account1 = $context[0]->data;
$account2 = $context[1]->data;
// xor returns true if the two bools are the same, and false if they are not.
// i.e, if we asked for equality and they are equal, return true.
// If we asked for inequality and they are equal, return false.
return ($account1->uid == $account2->uid) xor !empty($conf['equality']);
}
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedFixed in CVS. Thanks!