SOLVED: Incorrect integer value on csv import

Status
Not open for further replies.

dimoss

Well-Known Member
Joomla 4.2.9
Fabrik #4 Gamma 3
Cassiopeia
vanilla J & F installation

Hi,

trying to import a csv file to a db table directly from the list and i get the following error for a db column.

500 Store row failed: Incorrect integer value: '' for column `xxxxx`.`fab_matches`.`player_b_id` at row 1 ; Please inform your web-site owner

The whole db table, the list settings as well as the csv file are identical to the ones i used in Fabrik 3.9.

The column `player_b_id` is an INT NULL column. In csv the value `player_b_id` for row 1 is empty. Filed delimiter is ','.

Any ideas?

Thanks!
 
Update:

I did a short inverstigation and it seems it doesn't allow empty value on INT fields even if they have been set as NULL in db. It accepts empty values only in VARCHAR or any text db fields.
 
Can you try plugins\fabrik_element\field\field.php line 520
Code:
    public function storeDatabaseFormat($val, $data)
    {
        //Set "empty"=null for integer and decimal columns
        $element_format = $this->getParams()->get('text_format', 'text');
        if ($element_format != 'text' && $val=='') $val=null;
       
        if (is_array($val))
 
Can you try plugins\fabrik_element\field\field.php line 520
Code:
    public function storeDatabaseFormat($val, $data)
    {
        //Set "empty"=null for integer and decimal columns
        $element_format = $this->getParams()->get('text_format', 'text');
        if ($element_format != 'text' && $val=='') $val=null;
      
        if (is_array($val))

Perfect!
Thanks @troester
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top