? Success
Related to # 4672

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
1 Dec 2014

Original by @itbra :

I found the form validator to process the passed value only making it hard to implement custom validation rules. I am using form field types that make use of additional data-attributes. These attributes may serve information required to implement a custom validation rule. For instance to validate a date field (filled by a datepicker) the validator not only needs the value, but also a rule (date format) to validate against. This rule may be geographically different and a data-attribute like data-format="YY/MM/DD"may allow to validate the selected date against this rule. When it was possible to pass the element being validated along with the value to be checked the handler may fetch the required date format from the data-format attribute and apply it.
I did not touch the existing handlers' signature since they must not explicitely changed. The passed in element may be accessible via the implicitly accessable arguments object. But, if it is wished to add them a second function parameter for the element i can change it.

This PR implements a very tiny change providing more validation flexibility.

(I am just helping with the PR)

avatar roland-d roland-d - open - 1 Dec 2014
avatar jissues-bot jissues-bot - change - 1 Dec 2014
Labels Added: ?
avatar roland-d
roland-d - comment - 1 Dec 2014

@itbra can you give this a test to be sure all is OK? I think with the 2 original tests we shoul dbe good to go.

avatar itbra
itbra - comment - 2 Dec 2014

@roland-d Works as intended. Thank you very much for your effort!

avatar roland-d roland-d - alter_testresult - 2 Dec 2014 - itbra: Tested successfully
avatar roland-d roland-d - change - 2 Dec 2014
Status Pending Ready to Commit
Rel_Number 4672
Relation Type Related to
avatar roland-d
roland-d - comment - 2 Dec 2014

Setting this to RTC as it has 2 successful tests on the original PR and one on this one.

The original PR is outdated and this is just to bring it in sync with staging.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5277.

avatar brianteeman brianteeman - change - 2 Dec 2014
Labels Added: ?
avatar wilsonge wilsonge - close - 22 Dec 2014
avatar zero-24 zero-24 - close - 22 Dec 2014
avatar wilsonge wilsonge - change - 22 Dec 2014
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2014-12-22 23:22:52
avatar wilsonge
wilsonge - comment - 22 Dec 2014

Merged. Thanks guys!

avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment