Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion libraries/src/MVC/Model/FormModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,20 @@ public function validate($form, $data, $group = null)
// Include the plugins for the delete events.
PluginHelper::importPlugin($this->events_map['validate']);

Factory::getApplication()->triggerEvent('onUserBeforeDataValidation', array($form, &$data));
$dispatcher = Factory::getContainer()->get('dispatcher');

if (!empty($dispatcher->getListeners('onUserBeforeDataValidation')))
{
@trigger_error(
'The `onUserBeforeDataValidation` event is deprecated and will be removed in 5.0.'
. 'Use the `onContentValidateData` event instead.',
E_USER_DEPRECATED
);

Factory::getApplication()->triggerEvent('onUserBeforeDataValidation', array($form, &$data));
}

Factory::getApplication()->triggerEvent('onContentValidateData', array($form, &$data));
Copy link
Contributor

@sakiss sakiss Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the other events (using before/after) something like onBeforeDataValidation possibly would be better


// Filter and validate the form data.
$data = $form->filter($data);
Expand Down