Fixed J5 & Fabrik4 Issue adding to a repeating group when editing a form

Status
Not open for further replies.

ghicar

Member
Many thanks for all the hard work on getting the official Fabrik4 release out which i have just installed in a dev environment:
Joomla 5.0.2
Fabrik 4.0
PHP 8.2.14

I have a list with a repeating group. The repeating group is in table template and is sortable with drag&drop. When you edit or add a row in the list and then in the form attempt to add another row to the repeating group you get the following javascript error:

Uncaught TypeError: Cannot read properties of null (reading 'id')
at Object.duplicateGroup (form.js:2605:100)
at e.extend.$owner (mootools-core.js:787:27)
at HTMLAnchorElement.<anonymous> (form.js:1840:26)
at exec (jquery.ba-throttle-debounce.js:149:26)
at HTMLAnchorElement.wrapper (jquery.ba-throttle-debounce.js:161:17)
at HTMLFormElement.dispatch (jquery.js?3.7.1:5145:27)
at elemData.handle (jquery.js?3.7.1:4949:28)

The result is you can only add one row per edit. This error did not occur with Fabrik 4-Zeta and earlier release beta releases.
I have tried switching to List template and removing sortable but still get the same error.
 
Is there a site you can point me to to test this? You can pm me with the details if you like. I recently made a change to the way the element IDs are set for elements in a repeating group. This may be an artifact.
 
Probably not the correct fix but I changed line 2605 Fabrik ver4 file ~/media/com_fabrik/js/form.js to include a

JavaScript:
if( container )
{
    lastinput.getParent('.fabrikElementContainer').getElement('label').htmlFor = container.id;
}

and that allowed me to add multiple rows of the repeat group as before in Fabrik 4zeta and earlier versions.
 
Interesting, that code hasn't changed in years, but per some of the preceding code impacted it. I don't see any downside to implementing the above code so will do so.
 
Implimented. The js code and minified version will be available in the fabrik public repo tomorrow following the overnight update.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top