Uncaught TypeError

JackGoa

Member
Hi, I'm busy developing a site an noticed an error I have not seen before in Chrome's Developer Tools.

I'm not too clued up with Javascript and whatnot, so just bringing it to your attention:

Code:
VM328:1 Uncaught TypeError: this.findClassUp is not a function
    at eval (eval at runLoadEvent (http://xxx/media/com_fabrik/js/dist/element.js:2:2650), <anonymous>:1:22)
    at Object.runLoadEvent (http://xxx/media/com_fabrik/js/dist/element.js:2:2650)
    at Object.e.extend.$owner (http://xxx/media/system/js/mootools-core.js:38:495)
    at Object.addNewEvent (http://xxx/media/com_fabrik/js/dist/element.js:2:3158)
    at Object.e.extend.$owner (http://xxx/media/system/js/mootools-core.js:38:495)
    at Object.dispatchEvent (http://xxx/media/com_fabrik/js/dist/form.js:2:13632)
    at Object.e.extend.$owner (http://xxx/media/system/js/mootools-core.js:38:495)
    at http://xxx/services/web-design.html:783:8
    at Object.execCb (eval at <anonymous> (http://xxx/media/jui/js/jquery.min.js:2:2651), <anonymous>:29:311)
    at $.check (eval at <anonymous> (http://xxx/media/jui/js/jquery.min.js:2:2651), <anonymous>:18:423)
 
Look like a problem with some of your JS, when eval'ing your code on a load event on one of your element. Hence the "eval at runLoadEvent".

It should probably be this.element.findClassUp().

Although tbh it'd be better to start using jQuery(this.element).closest('.whatever'), as findClassUp() is an old Mootools method, which got deprecated years ago, and we added to our Mootools extension class.

-- hugh
 
Aha. I know where that problem is. It's a field I added a very long time ago to stop bots from filling in this form. You still gave me that, but as I said, it's very, very long ago. It does a PHP Validation:

PHP:
return empty($data);

And then the Javascript code is:

JavaScript:
var container = this.findClassUp('fabrikElementContainer');
container.parentNode.removeChild(container);

I unpublished that field now and the error goes away.

Can this perhaps be done with one of the pre-defined actions now? I don't really know how to read that Javascript.
 
Nope, no predefined action, but ...

Code:
jQuery(this.element).closest('.fabrikElementContainer').parent().remove();

... should do it. If you have more than one element per row in the group, you may need to leave out the parent().

-- hugh
 
hi hugh, thanks, that seems to take away the error. i do have more than one element in the group, so removed the parent() bit. thanks for that!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top