Warning: Invalid argument supplied for foreach() in /concrete/elements/system_errors.php on line 18
- Copied error.php to the top level /helpers/validation/error.php
- Updated "class ValidationErrorHelper" to: "class SiteValidationErrorHelper"
The error messages work great on the front end but I get this error when in the c5 dashboard:
Warning: Invalid argument supplied for foreach() in /path/to/site/root/concrete/elements/system_errors.php on line 18
The foreach statement referred to in the dashboard error is this:
<div class="alert-message error"> <?php foreach($_error as $e): ?> <?php echo $e?><br/> <?php endforeach; ?> </div>
I can see that $e is also called many times in error.php - so does that mean that overriding a helper will cause issues like this?
If I remove my override file, the c5 dashboard is all sweet again.
Here's the markup I changed in error.php (changed the ul to a div and changed the classes to bootstrap alert classes) but I don't really see what would cause the dashboard error sorry:
Also, can anyone explain how to override the markup c5 generates for forms and validation?
Forms are kinda painful anyway, but Foundation and Bootstrap solve many issues - it's just that controlling how c5 renders form and validation markup so Bootstrap or Foundation works properly is fairly confusing.
Any pointers in the right direction would be much appreciated.