?
avatar AbhishekDas
AbhishekDas
2 Feb 2014

validateField function should return null if form is equal to null otherwise it generates this error "Cannot read property 'H5Form' of null"

avatar abhishekdas abhishekdas - open - 2 Feb 2014
avatar Achal-Aggarwal
Achal-Aggarwal - comment - 2 Feb 2014

Yes, if a field is not associated with a form and you call validateField on that then it return null,
https://github.com/joomla/joomla-cms/blob/staging/media/system/js/html5fallback-uncompressed.js#L141

avatar abhishekdas
abhishekdas - comment - 2 Feb 2014

The present codes between lines 140 to 142:

            if(elem.form === undefined){
                return null;
            }

So when the form value is null it does return null instead generates this error "Cannot read property 'H5Form' of null"

Therefore it should be replaced with

            if(elem.form === undefined || elem.form === null){
                return null;
            }
avatar Achal-Aggarwal
Achal-Aggarwal - comment - 2 Feb 2014

I guess elem.form === null is needed only. But to be on the safer side we can check for both.
Can you just open a tracker and send a PR towards staging branch, it would be great.

avatar brianteeman
brianteeman - comment - 23 Jul 2014

I am closing this in favour of rhe referenced #3024 which has a PR so we only discuss things in one issue

avatar brianteeman brianteeman - change - 23 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-23 15:13:06
avatar brianteeman brianteeman - close - 23 Jul 2014
avatar zero-24 zero-24 - close - 23 Jul 2014
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?
Removed: ? ?

Add a Comment

Login with GitHub to post a comment