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

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!

Back to top