The function renderOptionsLabel() contains bad logic. In the following conditional, the "else" can be executed when $value is not an array (i.e. when isset($options[$value]) returns FALSE), resulting in PHP warnings.
The code at fault (found in ui/ui.data.inc line 98):
if (!is_array($value) && isset($options[$value])) {
$value = $options[$value];
}
else {
foreach ($value as $key => $single_value) {
if (isset($options[$single_value])) {
$value[$key] = $options[$single_value];
}
}
$value = implode(', ', $value);
}
If a non-array $value gets into the "else" statement, you get errors:
# Warning: Invalid argument supplied for foreach() in RulesDataUI::renderOptionsLabel() (line 102 of /xxx/sites/all/modules/rules/ui/ui.data.inc).
# Warning: implode() [function.implode]: Invalid arguments passed in RulesDataUI::renderOptionsLabel() (line 107 of /xxx/sites/all/modules/rules/ui/ui.data.inc).
Comments
Comment #1
tr commented... and the patch:
Comment #2
rfayJust setting this to CNW because the testbots are testing it over and over and I want them to catch up. Not sure what's going on. OK to retest later.
Comment #3
tr commentedComment #4
tr commentedBump. This causes a big problem with Ubercart, and we're trying to get out a new beta release this week.
Comment #5
tr commentedLet's try uploading that patch again - looks like the testbot forgot about it, and there's no way to restart.
Comment #6
Island Usurper commentedClicking "View details" shows all green. Also fixes #1068782: /admin/store/settings/quotes/methods/usps invalid arugment RulesDataUI::renderOptionsLabel() errors, which is the where this bug report came from in the first place.
Comment #7
fagothanks, committed.