Databasejoin element "Add option in front end" causing problems

Status
Not open for further replies.
Joomla 4.3.2
Fabrik 4 delta
PHP 8.1.21

I've updated a site from J3/F3 to the above and I'm having problems with the "add option in front end" in a databasejoin element.

I have a repeating group with two fields: a dropdown and a databasejoin element. The databasejoin renders as a dropdown to another table in the site database and the value is the ID. (The other table is a People table with only two fields, first name and last name.) The "Add option in front end" is enabled.

When adding data, if I use the add button, a form pops up and saves the data to the People table correctly. However, the databasejoin element is not populated with the data just added and, much worse, any data previously added to any of the databasejoin elements in the repeating group are deleted!

I've also tried this in a brand new J4/F4 installation and in a situation where I'm not using a repeating group: the results are the same - the data entered in the popup form is saved to the joined table but any data entered in the field on the main form is deleted.

I tried switching on Debug but nothing is shown on the front end. I'm seeing nothing in the browser console either.

Any ideas?
 
Arrg, found it (In J!4 it's returning integer values for dbjoins).

In plugins\fabrik_element\databasejoin\databasejoin.js line 395 add
o.value = o.value.toString();

(and run uncompressed JS-files with Fabrik Options/Debugging/ DebugJS)
 
Not quite!
I've added the line of code and set Fabrik Options Debugging "Allow fabrikDebug" to Debug JS. Now the data entered saves and is displayed in the dbj field but all the previous dbj fields are deleted! And until the record is saved and closed, only the newly entered People data is showing in the dbj dropdown.
Tried adding the line of code above current line 395 and below it but get the same effect.
:confused:
 
upload_2023-8-2_16-44-25.png


is ok for me.
Working with existing groups and also if adding a new group and do the frontend add then (without saving before).
And with/without enhanced.
 
Sorry @troester , it's working for me now. Had to completely clear my cache, then it worked.
Strange that no one had spotted it so far; I would have thought it's a popular feature.
Thank you once again! :)
 
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