zikula/core — Issue #159: FormUtil::getValidationErrors() incorrectly clears and forgets validation errors
Author: rgasch
Created: 2011-11-03 08:06:39+00:00
State: open

The code for FormUtil::getValidationErrors() should look like this:

public static function getValidationErrors()
{
static $ve = null;
if ($ve === null) {
if (isset($_SESSION['validationErrors']) && is_array($_SESSION['validationErrors'])) {
$ve = $_SESSION['validationErrors'];
unset($_SESSION['validationErrors']);
} else {
$ve = array();
}
}

return $ve;
}

because right now it clears validation errors and forgets about them, resulting in the fact that only a single validation error is reported.