I'm creating a custom J3.x component. I'm manually adding my own error notices where needed via
JFactory::getApplication()->enqueueMessage()
However, when a record is not saved by my component, it is triggering the line:
$this->setMessage($this->getError(), 'error');
within the /libraries/src/MVC/Controller/FormController.php which displays a notice like "Save failed with the following error: ", with no error listed.
I would like to either...
- (Ideally) Be able to add my own error notice (from within my component code) that is displayed at the end of that phrase via that getError line.
OR ALTERNATELY
- Disable that notice - preferably at the component level, and ideally based on the specific view, not globally.
Any ideas how to programmatically accomplish either of these solutions (or possibly have another option so that I can display my own error notices at the component/view level?
JFactory::getApplication()->enqueueMessage()
? If you're doing it anywhere other than the controller, you're doing it wrong.