Error message in custom attribute
PermalinkI made a custom attribute based on this how to:http://www.concrete5.org/documentation/how-tos/developers/custom-at...
My problem is that the error message in this example overrides all the other errors addded to the error message. Any idee how i add errors to the original error/helper in an custom attribute controller? Thanks!

In validateForm()
$sets = $this->getSets(); if (is_object($sets['error'])){ $e = $sets['error']; } else { $e = Loader::helper('validation/error'); } // ... validation code that may add error messages to $e ... return $e;
The above looks for any error object set by a previous attribute and uses it, or creates one otherwise.
Then in saveForm()
$e = $this->validateForm($data); if (is_object($e) && $e->has()){ $this->set('error', $e); } else { $this->saveValue($data['value']); }
This checks for a current error object, and either sets it for display or saves the validated value. It also gets round another glitch in custom attributes where the attribute value could be saved even if it failed validation.