Fabrik JS objects not initializing in module

TheGr8

New Member
I was wondering if I hit a known issue and if somebody else who experienced it might have found a solution.

I am displaying a Fabrik form in a module and providing a JavaScript form_8.js file for some client-side logic. It all works perfectly if I use the form as a component. As soon as I put it in a module elements is undefined, in fact Fabrik.blocks is an empty object. Am I missing anything or did I just found a bug?

Thank you!

Code:
requirejs(['fab/fabrik'], function () {
    elements = Fabrik.getBlock('form_8').elements;
   //elements is undefined only when the form is displayed in a module, component works perfectly fine.
...
});
 
I was wrong, it appears that when this form is used as a component is also fails at about 50 / 50 rate, appears to be pretty random. It looked like it was actually happening at a higher rate until I wrapped the whole function to execute on document ready event.

I have a feeling that it interferes with some JavaScript script on the page but I can't quite pinpoint which one.
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top