$formModel->updateFormData

kinkaz

Member
Hi,

I tried to make some updates on my form using a php plugin and just added this line in my php code box (I tried onAfterProcess and onBeforeProcess) : $formModel->updateFormData(... as explained in wiki) but it's not working.

Is this issue coming from my config or not ?
 
It won't work from onAfterProcess, because that happens after the data has been written to the database.
Can you paste you exact code?

--hugh
 
$formModel->updateFormData('odqeg_fab_voiture___commentaire', '1');

I only have this line left in my box now and still not updating my data.
 
What element type is it? If it's something with the concept of a 'value' and a 'label', like joins, dropdowns, radios, etc. try adding true as the third arg ...

Code:
$formModel->updateFormData('odqeg_fab_voiture___commentaire', '1', true);

-- hugh
 
I already tried to add "true" as third argument but it didn't work (just re-tested it). My field commentaire is a textarea.

I'll also need to update data from a database join element, so just added a line in my code for this element, just to see if it would work (but no).

Here's my code now :

PHP:
$formModel->updateFormData('odqeg_fab_voiture___commentaire', '1', true); // textarea field
$formModel->updateFormData('odqeg_fab_voiture___derniere_attribution', '1', true); // database join field

Plugin's settings :

do : php
in : both
on : both
process script : onBeforeProcess
PHP file : none
Require once : No
 
I find myself in this exact situation.
Did you get it solved?
How?
Thank you in advance


Follow-up:
(same kinkaz settings)
<baby steps>

Code:
$formModel->updateFormData( 'jos_fab_ven_atts___venueid', 'Greg' , true );
Test data working now

Code:
$jinput  = JFactory::getApplication()->input;
 
$venueid = $jinput->getInt('rowid', 0);
 
$formModel->updateFormData( 'jos_fab_ven_atts___venueid', $venueid , true );
Test data working now


So here is my end goal...
1. Fetch CLIENT id on page load
$jinput = JFactory::getApplication()->input;
$venueid = $jinput->getInt('id', 0);

2. Pass CLIENT id ($venueid) to Fabrik.

3a. If client id ($venueid) EXISTS in a $row, list that $row.

3b. If client id ($venueid) DOES NOT EXIST in a $row, create new $row, list new $row.

At the rate I'm going I should have this working in 6 months or so...

Pay attention in school kids!

:/
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top