Hello all,
First of all, please know that this is my first submission of a solution, so don't judge, I'm just trying to help
The problem:
When using the FlexiContent Import function, the data for the International Address field introduced on 2.2.1 is not properly inserted.
The cause:
In pratical terms, because the data is going to a Array inside another array, something like:
Array(1)([0]=>Array(10)([addr1][addr2].......))
Instead it should be directly inside the first array, like:
Array(10)([addr1][addr2].......)
I am not very good explaining why this happens, it's the way of flexicontent to import... if someone wants to explain to the community, awesome
The sollution:
On (Joomla Directory)/administrator/components/com_flexicontent/controllers/import.php line 521
Replace:
Code:
if ( $task != 'testcsv' ) foreach($_d as $fieldname => $field_values)
{
if ( $fieldname=='tags_names' )
{
with
Code:
if ( $task != 'testcsv' ) foreach($_d as $fieldname => $field_values)
{
if ( $fieldname=='property_address' )
{
$field_values['addr1'] = $field_values[0]['addr1'];
$field_values['addr2'] = $field_values[0]['addr2'];
$field_values['addr3'] = $field_values[0]['addr3'];
$field_values['city'] = $field_values[0]['city'];
$field_values['state'] = $field_values[0]['state'];
$field_values['province'] = $field_values[0]['province'];
$field_values['zip'] = $field_values[0]['zip'];
$field_values['country'] = $field_values[0]['country'];
$field_values['lat'] = $field_values[0]['lat'];
$field_values['lon'] = $field_values[0]['lon'];
/*echo "<br>";
print_r($field_values);*/
}
if ( $fieldname=='tags_names' )
{
uncomment the Print_r bit to see the array data when the import script is running in admin.
Simple! and it works
To-do:
This is not the perfect sollution and still insert the Array[0] data. It will duplicate the data but it will work.
I didn't create the Unset function because I don't know the code and I'm a bit afraid of breaking the import script
Cheers and thanks to the creators for such a good extension