diff --git a/libraries/src/MVC/Model/FormModel.php b/libraries/src/MVC/Model/FormModel.php index dd2ebbc058051..70d8f7936666e 100644 --- a/libraries/src/MVC/Model/FormModel.php +++ b/libraries/src/MVC/Model/FormModel.php @@ -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)); // Filter and validate the form data. $data = $form->filter($data);