User tests: Successful: Unsuccessful:
Pull Request for Issue #24901.
Summary of Changes
Added event onContentValidateData
Event onUserBeforeDataValidation now depracted
Testing Instructions
Create a field plugin which implements onContentValidateData function like this...
public function onContentValidateData($form, &$data) {
// Change the data in some way
}
Expected result
The data get's changed.
Actual result
The data get's changed.
Documentation Changes Required
Add documentation for onContentValidateData event.
Add documentation for the existing, but undocumented and now deprecated, onUserBeforeDataValidation event.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
I cannot understand the usefulness of that change.
Seems like a rename of an event for the shake of renaming it.
The event name onUserBeforeDataValidation implies it is only for user validation.
Changing to a generic event means reading the code makes a lot more sense when using the event in other extensions.
My main point in raising / proposing this is to replace the event name with something more meaningful when using it outside of user validation - code easier to read / search.
It occurs during validation so an On... name places it within validation while OnBefore... would imply it is outside validation.
A quick code search shows other OnContent... events including onContentBeforeDelete and onContentAfterDelete so naming it onContentValidateData looks like it fits in with previously used naming conventions.
My main point in raising / proposing this is to replace the event name with something more meaningful when using it outside of user validation - code easier to read / search.
It occurs during validation so an On... name places it within validation while OnBefore... would imply it is outside validation.
A quick code search shows other OnContent... events including onContentBeforeDelete and onContentAfterDelete so naming it onContentValidateData looks like it fits in with previously used naming conventions.
The event is triggered before the validation logic. It is important to clarify if it is called before or after, to be clear what actions could be carried out through that. Also onContentValidateData implies that the data are validated by that, which is not the case.
Labels |
Added:
?
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-01 18:52:15 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!
Replaces pull request #24925