Multiple filters Errors in response
A for , submitted by icek on 08 February 2010
Announcement
Symphony's issue tracker has been moved to Github.
Issues are displayed here for reference only and cannot be created or edited.
Browse
Closed#226: Multiple filters Errors in response
I’m not sure, but this code should looks like this:
if(is_array($filter_results) && !empty($filter_results)){ $all_filters_status = true; foreach($filter_results as $fr){ list($type, $status, $message) = $fr; $result->appendChild(buildFilterElement($type, ($status ? 'passed' : 'failed'), $message)); if(!$status) $all_filters_status = false; } if(!$all_filters_status){ $result->appendChild($post_values); $result->setAttribute('result', 'error'); $result->appendChild(new XMLElement('message', __('Entry encountered errors when saving.'))); return false; } }
Status checking should be after all errors have been attached to the page.
This change as been implemented http://github.com/symphony/symphony-2/commit/b14eaaca9fbc240a626ca1156ecbf09563fe3ca4. Look for it in 2.0.8
This issue is closed.
I’ve created form with recaptcha extension attached (it simply works as filter). When user make mistake in form (eg forget required field) and didn’t pass captcha field, errors in event response are only shown for captcha.
I found part of code responsible for that in event.section.php:
The problem is with line 45
return false;
which returns on first found error and rest of them are not attached to the page.