Closed (won't fix)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.8
Component:
Plugins system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2010 at 17:11 UTC
Updated:
20 Apr 2012 at 15:56 UTC
Hi,
In your string_equal access plugin, in the ctools_string_equal_ctools_access_check function, you perfom this check :
(ctools/plugins/access/string_equal.inc line 53)
if (empty($context) || empty($context->data)) {
$string = '';
}
else {
$string = $context->data;
}
But, when $context->data is equal to '0', the empty test return true and the '0' is overwrite with ''.
This can be solved simply by replacing
empty($context->data)
with
$context->data === null
Thank you !
Comments
Comment #1
merlinofchaos commentedThat doesn't quite work, as comparing directly to NULL could cause a notice if there is no member there. We should use isset() instead of empty() though.
Comment #2
epieddy commentedYes indeed. I didn't know that in some case, $context->data doesn't exist.
So, ok, isset() is a better solution.
Comment #3
Ashlar commentedThis bug report has not been active for over six months. In an effort to clean-up the issue queue this item has been closed. If your modules are current and the report is still relevant please feel free to change the Status back to active.