Access is "true" when using "only one criteria must pass" but none of them pass

PeteS - March 30, 2009 - 15:24
Project:Chaos tool suite
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I tried adding two selection criteria rules, and set the logic field to "Only one criteria must pass." On a page where neither rule was a match, my panel was still being applied.

I think the issue is in includes/context.inc at the bottom of ctools_access(). As it's looping through each test, it returns the correct value for pass+OR and !pass+AND. Then, if it goes through all of the rules without returning, it returns TRUE (the last line of the function). This seems like a problem, because if there were no "passes" at all, then it will return true here.

Here's what I tried, which seems to resolve my problem:

1. Set a $gotOnePass to FALSE before looping through the tests
2. If a rule is a pass, set the variable to TRUE
3. After the loop, return $gotOnePass instead of return TRUE.

Or, if not the exactly that, I think some change is in order to account for the scenario where none of the rules are true and logic == OR.

Thanks!

#1

merlinofchaos - July 17, 2009 - 21:54
Status:active» fixed

Looks like I fixed this a long time ago but did not mark the issue fixed.

#2

System Message - July 31, 2009 - 22:00
Status:fixed» closed

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

#3

josepvalls - October 3, 2009 - 10:11
Version:6.x-1.0-alpha2» 6.x-1.0

Sorry. I saw this issue was closed once I already submitted my comment.
Will open a new one.

 
 

Drupal is a registered trademark of Dries Buytaert.