? ? Failure

User tests: Successful: Unsuccessful:

avatar BrainforgeUK
BrainforgeUK
3 Jun 2019

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.

avatar BrainforgeUK BrainforgeUK - open - 3 Jun 2019
avatar BrainforgeUK BrainforgeUK - change - 3 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Jun 2019
Category Libraries
avatar BrainforgeUK
BrainforgeUK - comment - 3 Jun 2019

Replaces pull request #24925

avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Jun 2019
The description was changed
avatar franz-wohlkoenig franz-wohlkoenig - edited - 3 Jun 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Jun 2019
Title
Added event onContentValidateData
[4.0] Added event onContentValidateData
avatar franz-wohlkoenig franz-wohlkoenig - edited - 3 Jun 2019
avatar sakiss
sakiss - comment - 13 Feb 2020

I cannot understand the usefulness of that change.
Seems like a rename of an event for the shake of renaming it.

avatar BrainforgeUK
BrainforgeUK - comment - 13 Feb 2020

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.

avatar BrainforgeUK
BrainforgeUK - comment - 13 Feb 2020

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.

avatar sakiss
sakiss - comment - 13 Feb 2020

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.

avatar wilsonge wilsonge - change - 1 Apr 2020
Labels Added: ?
avatar wilsonge wilsonge - change - 1 Apr 2020
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: ?
avatar wilsonge wilsonge - close - 1 Apr 2020
avatar wilsonge wilsonge - merge - 1 Apr 2020
avatar wilsonge
wilsonge - comment - 1 Apr 2020

Thanks!

Add a Comment

Login with GitHub to post a comment