Importing CSV-file fails

Status
Not open for further replies.

Emile

New Member
Joomla 4.3.2 Fabrik 4delta PHP 8.1.13
Importing csv-file fails.

List, Import, CSV file with ; as separation
Primary key yes
List of elements is OK
After import message Fout bij import.PNG appears.

Problem is that table name is not registered in Fabrik. Field in List, Data, Data, Database table is empty.
It is possible to make a new list and choose the databasetable. Then the name of the table is correct.
Fields are OK too, but records are not imported.

In Publish, creation date there is deprecated code.
See fout na import publiceren.png
 

Attachments

  • Fout bij import data bekijken.PNG
    Fout bij import data bekijken.PNG
    12.7 KB · Views: 57
  • Fout bij import.PNG
    Fout bij import.PNG
    17.6 KB · Views: 53
Yes I can confirm this.

You need to make the following changes to the following file.

/administrator/components/com_fabrik/models/list.php

At line 805 you will see the following.

Code:
//trob: make strict happy
$row->set('created_by',(int)$row->get('created_by') );
$row->set('checked_out', 0);
$row->set('hits', 0);
$row->set('private', 0);

Change it to

Code:
   //trob: make strict happy
   $row->set('created_by',(int)$row->get('created_by') );
   $row->set('checked_out', 0);
   $row->set('hits', 0);
   $row->set('private', 0);
   $row->set('filter_action', 'onchange');
   $row->set('group_by', '');

Adding the last two lines.

You'll also need to go into Lists, Forms, Groups and Elements removing any orphans as Fabrik is actually creating things but not connecting them together. Double check via Phpmyadmin that the table is removed as well before another import.



@troester Adding defaults in the schema didn't make a difference here but it's probably best to do it via the code.

Whilst we are there we can also change.

Code:
if (trim($this->getlistModel()->getPrimaryKey()) !== '')

to

Code:
if (trim($this->getlistModel()->getPrimaryKey() ?? '') !== '')

at line 1360 on components\com_fabrik\models\importcsv.php to stop the depreciation messages.

Code:
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in F:\web\www\fab4testing\components\com_fabrik\models\importcsv.php on line 1360
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top