Jump to content

[PrestaShopException] error while importing .csv file


Recommended Posts

Hello,

 

I get the following error while i import products with .csv file:

 

[PrestaShopException]

 

Property FeatureValue->value is empty

at line 872 in file classes/ObjectModel.php

 

866.
867. $message = $this->validateField($field, $value, $id_lang);
868. if ($message !== true)
869. {
870. if ($die)
871. throw new PrestaShopException($message);
872. return $error_return ? $message : false;
873. }
874. }
875. }
876.

  • ObjectModelCore->validateFieldsLang - [line 305 - classes/ObjectModel.php] - [0 Argument]
  • ObjectModelCore->getFieldsLang - [line 489 - classes/ObjectModel.php] - [0 Argument]
  • ObjectModelCore->add - [line 163 - classes/FeatureValue.php] - [2 Arguments]
  • FeatureValueCore->add - [line 154 - classes/FeatureValue.php] - [0 Argument]
  • FeatureValueCore::addFeatureValueImport - [line 1449 - controllers/admin/AdminImportController.php] - [2 Arguments]
  • AdminImportControllerCore->productImport - [line 2697 - controllers/admin/AdminImportController.php] - [0 Argument]
  • AdminImportControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
  • ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument]
  • DispatcherCore->dispatch - [line 50 - storeadmin/index.php] - [0 Argument]

 

Here's my configuration information:

 

Server information

 

Server information: Linux #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64

Server software version: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

PHP version: 5.3.21

Memory limit: 128M

Max execution time: 750

 

Database information

 

MySQL version: 5.1.66-cll

MySQL engine: InnoDB

Tables prefix: ps_

 

Store information

 

Prestashop version: 1.5.3.1

Current theme in use: default

 

Anyone can help?

Edited by constantina (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

I use the features to show on layered navigation filter.

 

First you should create a feature from back office -> catalog -> features -> add new feature

Then you can add a feature value from same menu.

 

On .csv file you can give the feature as "feature:featurevalue". Otherwise it will fail.

Edited by constantina (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi all!

I also got this error when importing products. I confirm, this is due to the features field (very smart, constantina ^^).

The explanation is that Prestashop, when importing separates features with a comma. When finding a comma on one of the product features (for a text or a sentence, for example), it assumes the feature ended, and considers the text following the comma as a new feature (and by the way creates a new feature. You should have find some new features automatically created with the error, am I right or am I right? ^^)

 

The solution is simple:

1- Replace the comma with an commonly unused character (don't use slash /). In my case, I used backslash --> \

which means my features were written this way: feature1:name:position1\feature2:name:position2\feature3:name:position3

2- Very important: Do the same with other fields which use a comma as separator value (e.g. Category)

3- When importing your file, set "Multiple value separator" as \ (or the character you chose to use)

4- Let the show begin :D

Edited by Tahar R (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi there !

I have a problem with prestashop 1.5. When importing, if I try to change the value of "multiple value separator" to a "\" for instance, the import procedure is done, however, it ignores the new value, and continue taking as the "multiple value separator" the first value ( the comma ) .

Has anybody experiented this ?

 

Thanks in advance

Link to comment
Share on other sites

Hi holylander,

Can you please give more details?

1- Did you replaced commas with backslashes on your csv file? And in all required fields?

2- You also put backslash as a multiple value separator in the Import page?

 

May be it could be useful if you upload some lines of your csv file, so that we can check it.

Link to comment
Share on other sites

Hi holylander,

Can you please give more details?

1- Did you replaced commas with backslashes on your csv file? And in all required fields?

2- You also put backslash as a multiple value separator in the Import page?

 

May be it could be useful if you upload some lines of your csv file, so that we can check it.

 

 

Hi thank you for your help

 

Yes I tried that stuff but it wasnt giving the desired result. At the end, I did a CSV import, ticking the option of "erase all categories before import" and, after that, the CSV were being imported correctly

Link to comment
Share on other sites

1- Replace the comma with an commonly unused character (don't use slash /). In my case, I used backslash --> \

There's no need to replace de comma with another character!

just make sure, you remove the last comma.

 

ex.:

feature1:featurevalue1,feature2:featurevalue2,

 

generates an error

When removing the last comma it will not.

 

ex.:

feature1:featurevalue1,feature2:featurevalue2

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

There's no need to replace de comma with another character!

just make sure, you remove the last comma.

 

ex.:

feature1:featurevalue1,feature2:featurevalue2,

 

generates an error

When removing the last comma it will not.

 

ex.:

feature1:featurevalue1,feature2:featurevalue2

 

 

Hello Stimpy

 

I have a query, if i have features like

 

Name:(Abhishek,Karam),Gender:Male

 

I mean my value contains a comma then what to do ?

Link to comment
Share on other sites

  • 3 years later...

Hi all!

I also got this error when importing products. I confirm, this is due to the features field (very smart, constantina ^^).

The explanation is that Prestashop, when importing separates features with a comma. When finding a comma on one of the product features (for a text or a sentence, for example), it assumes the feature ended, and considers the text following the comma as a new feature (and by the way creates a new feature. You should have find some new features automatically created with the error, am I right or am I right? ^^)

 

The solution is simple:

1- Replace the comma with an commonly unused character (don't use slash /). In my case, I used backslash --> \

which means my features were written this way: feature1:name:position1\feature2:name:position2\feature3:name:position3

2- Very important: Do the same with other fields which use a comma as separator value (e.g. Category)

3- When importing your file, set "Multiple value separator" as \ (or the character you chose to use)

4- Let the show begin biggrin.png

thx great solution

Link to comment
Share on other sites

×
×
  • Create New...