Prestashop 1.7 CSV Import create new product as n.d. instead of updating existing ones

24 Views Asked by At

after upgrading from Prestashop 1.7.2 to 1.7.8 (with PHP 7.4), when I try to import a csv file to update the products the import is successful without errors but new products with name n.d. are created. and inside the contents actually present in the csv file. Instead of updating existing products.

I disabled the modules, enabled debugging and there are no errors, the product ids in the file are correct.

Checking the log file when I start importing the csv file I find this:

[php7:notice] PHP Notice: Trying to access array offset on value of type null in .../controllers/admin/AdminImportController.php on line 1954

and in the specified file I find this, line 1954

$link_rewrite = Tools::link_rewrite($product->name[$id_lang]);

`$link_rewrite = (is_array($product->link_rewrite) && isset($product->link_rewrite[$id_lang])) ? trim($product->link_rewrite[$id_lang]) : '';
    $valid_link = Validate::isLinkRewrite($link_rewrite);
    if ((isset($product->link_rewrite[$id_lang]) && empty($product->link_rewrite[$id_lang])) || !$valid_link) {
        $link_rewrite = Tools::link_rewrite($product->name[$id_lang]);
        if ($link_rewrite == '') {
            $link_rewrite = 'friendly-url-autogeneration-failed';
        }
    }

[php7:notice] PHP Notice: Trying to access array offset on value of type null in .../controllers/admin/AdminImportController.php on line 1964

and in the specified file I find this, line 1964

'%1$s' => Tools::htmlentitiesUTF8($product->name[$id_lang]),

if (!$valid_link) {
        $this->informations[] = $this->trans(
            'Rewrite link for %1$s (ID %2$s): re-written as %3$s.',
            [
                '%1$s' => Tools::htmlentitiesUTF8($product->name[$id_lang]),
                '%2$s' => !empty($info['id']) ? Tools::htmlentitiesUTF8($info['id']) : 'null',
                '%3$s' => Tools::htmlentitiesUTF8($link_rewrite),
            ],
            'Admin.Advparameters.Notification'
        );
    }

The file import for images occurs without errors.

The tool for importing csv files works because the content is loaded, and the images are imported correctly. The import files for the products are the same as those used before the Prestashop version update, for format and columns.

How could it be solved? Searching online I didn't find any applicable solutions.

Thank you

0

There are 0 best solutions below