#1321: AgaviValidationReportQuery::getErrors() does only return first error
message of each incident
--------------------------+-------------------------------------------------
Reporter: thomasbachem | Owner: dominik
Type: defect | Status: new
Priority: normal | Milestone: 1.0.4
Component: validation | Version: HEAD-1.0
Severity: normal | Keywords:
Has_patch: 0 |
--------------------------+-------------------------------------------------
There seems to be a senseless "break" statement in
AgaviValidationReportQuery::getErrors() line 278:
{{{
/**
* Retrieves all AgaviValidationError objects which match the currently
* defined filter rules.
*
* @return array An array of AgaviValidationError objects.
*
* @author Dominik del Bondio <[email protected]>
* @since 1.0.0
*/
public function getErrors()
{
$incidents = $this->getFilteredIncidents();
$errors = array();
foreach($incidents as $incident) {
foreach($incident->getErrors() as $error) {
if(!$this->errorNameFilter ||
in_array($error->getName(), $this->errorNameFilter)) {
$errors[] = $error;
break;
}
}
}
return $errors;
}
}}}
Removing the "break" statement works for us.
--
Ticket URL: <http://trac.agavi.org/ticket/1321>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets