• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Update databasejoin element data in repeat group on form submit

startpoint

Active Member
Hi,
I tried to update value with following code:
PHP:
$v = array('test');
$formModel->formData['table___element_name']=$v;
$formModel->formData['table___element_name_raw']=$v;
or
PHP:
$v = array('test');
$formModel->updateFormData('table___element_name'), $v, true;
$formModel->updateFormData('table___element_name_raw'), $v, true;
This code run in php form plugin during Start on form submission (onBeforeProcess).
The value in database not updated.
The result is the same when code run from php file.
If element is simple field the value updated successfully.

Tested on Joomla 3.8.3 and latest github update.
Where is my mistake or have a bug?
 
Try ...

Code:
$v=array('test');
$formModel->updateFormData('table___element_name' , $v, true);

... so that's 3 args to the updateFormData() method.

The last one says "also set the _raw to this", so no need to explicitly update the _raw as well.

-- hugh
 
Oh, just noticed the subject says "database join". In which case you'll need to use the value, not the label. So ...

Code:
$v=array('123');

... or whatever the FK value is for that.

-- hugh
 
I made a mistake by writing the code here and forgetting to mention that the element is in a repeating group.
This is a actual code:
PHP:
$v=array('1');
//$v=array(array('1'));
$formModel->updateFormData('repeat_group___dbjoin_elem' , $v, true);
Again not working.
 
If it's a repeat element, the formdata entry itself will be an array, with as many entries as there are repeats.

-- hugh
 
OK, I've narrowed down what's going on, but it's not an entirely trivial fix. It'd be nice if you could take out a sub for the month to help out with the time needed to resolve it. I'll probably fix it anyway, but ... gotta pay the bills somehow ...

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top