Hello!
I am using Breezing Forms 1.7.1 for several days and I found it very impressive.
I like particularly the Integrator which is a very powerful feature.
The integrator works perfectly when saving elements that have a single record (example: username-joe doe)
Unfortunately, I encountered a problem when using the integrator for saving multiple-values generated by checkboxgroup or select-list with multiple option enabled in a joomla _jos table.
If I have a checkboxgroup with 3 values, and I check the all, for instance
0;apple;1
0;banana;2
0;mango;3
when I hit the submit button, only the last value (3, which corresponds to mango) is saved in the database _jos table, that is the last record for the fruit checkboxgroup element.
If I go to Manage records I can see all the 3 values are recorded in the breezing forms database, each one having a distinct record ID, but all of them the same element ID (I attached an example in the screenshot)
If I export to a csv file, I can see that the values are exported correctly. The checkboxgroup values are separated by comma, exactly as I need.
USERNAME;FRUIT;
Joe Doe;1,2,3;
But, when I check the _jos table in the phpmyadmin, I can see that only the last value is saved (3).
I also wrote a custom code in the code field from integrator to check if when submitting the form, the integrator saves all the 3 values or just one and I learned that it saves just the last value.
Here is the code:
function write($filePath,$what){
$df = @fopen ( $filePath, 'a+' );
if ( $df === false ) return false;
$line = "write(".date("H:i").")\n===============\n";
fwrite( $df, $line, strlen( $line ) );
$data = print_r ( $what, true );
fwrite($df, $data, strlen($data));
fwrite($df,"\n",strlen("\n"));
fclose( $df );
return true;
}
$filePath = "D:\logs.txt";
$result = write($filePath, $value);
if(!$result) {
throw new Exception("Nu pot deschide fisierul");
}
How can I make breezing forms save all the values (records) generated by checkboxgroup or select-list with multiple option enabled in a joomla _jos table?
Is this possible by writing a code in the integrator?
Or, maybe there is a different solution?
Thank you!