Skip to content

Commit

Permalink
Dont use setSelectedValue in CategorySelector if there is no selected…
Browse files Browse the repository at this point in the history
… category.

This patch fixes E_NOTICE: Undefined offset: 0 in
/.../lib/Zikula/Form/Plugin/CategorySelector.php Zeile 361
  • Loading branch information
phaidon committed Sep 9, 2012
1 parent 6c3b720 commit 3fcb43a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Zikula/Form/Plugin/CategorySelector.php
Expand Up @@ -357,7 +357,7 @@ public function loadValue(Zikula_Form_View $view, &$values)
$selectedValues[] = $c->getCategory()->getId();
}
}
if ($this->selectionMode == 'single') {
if ($this->selectionMode == 'single' && isset($selectedValues[0])) {
$this->setSelectedValue($selectedValues[0]);
} else {
$this->setSelectedValue($selectedValues);
Expand Down

0 comments on commit 3fcb43a

Please sign in to comment.