Index: library/Zend/Form/Element.php =================================================================== --- library/Zend/Form/Element.php (revision 18081) +++ library/Zend/Form/Element.php (working copy) @@ -2099,7 +2099,7 @@ if (null !== $translator) { $message = $translator->translate($message); } - if ($this->isArray() || is_array($value)) { + if ($this->isArray() && is_array($value)) { $aggregateMessages = array(); foreach ($value as $val) { $aggregateMessages[] = str_replace('%value%', $val, $message); Index: tests/Zend/Form/Element/MultiCheckboxTest.php =================================================================== --- tests/Zend/Form/Element/MultiCheckboxTest.php (revision 18081) +++ tests/Zend/Form/Element/MultiCheckboxTest.php (working copy) @@ -263,6 +263,22 @@ $this->assertFalse($this->element->isValid('test')); } /**#@-*/ + + /** + * @see ZF-5412 + */ + public function testAddingError() + { + $options = array( + 'foo' => 'Foo Value', + 'bar' => 'Bar Value', + 'baz' => 'Baz Value', + ); + $this->element->setMultiOptions($options); + $this->element->addError('someError'); + $this->assertTrue($this->element->hasErrors()); + $this->assertEquals(array('someError'), $this->element->getErrorMessages()); + } } // Call Zend_Form_Element_MultiCheckboxTest::main() if this source file is executed directly.