constantina Posted February 6, 2013 Share Posted February 6, 2013 (edited) 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 February 6, 2013 by constantina (see edit history) Link to comment Share on other sites More sharing options...
constantina Posted February 6, 2013 Author Share Posted February 6, 2013 SOLVED. Solution is very simple, you don't need to manipulate lots of .php files to solve it. Just ignore "features" column if you do not use it. 1 Link to comment Share on other sites More sharing options...
design4VIP Posted February 21, 2013 Share Posted February 21, 2013 what why use fearutes? haw to write corect feature? Link to comment Share on other sites More sharing options...
constantina Posted February 21, 2013 Author Share Posted February 21, 2013 (edited) 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 February 21, 2013 by constantina (see edit history) Link to comment Share on other sites More sharing options...
design4VIP Posted February 22, 2013 Share Posted February 22, 2013 On .csv file you can give the feature as "feature:featurevalue". Otherwise it will fail. thx, that's correct. for multiple fearures: feature1:feature1value, feature2:feature2value, feature3:feature3value 1 Link to comment Share on other sites More sharing options...
Tahar R Posted March 7, 2013 Share Posted March 7, 2013 (edited) 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 Edited March 7, 2013 by Tahar R (see edit history) 1 Link to comment Share on other sites More sharing options...
silentRun Posted March 26, 2013 Share Posted March 26, 2013 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 More sharing options...
Tahar R Posted March 27, 2013 Share Posted March 27, 2013 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 More sharing options...
silentRun Posted April 2, 2013 Share Posted April 2, 2013 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 More sharing options...
stimpy Posted April 2, 2013 Share Posted April 2, 2013 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 1 Link to comment Share on other sites More sharing options...
silentRun Posted April 10, 2013 Share Posted April 10, 2013 Ok I will try that also, thanks ! Link to comment Share on other sites More sharing options...
Abhishek Gupta Posted July 16, 2013 Share Posted July 16, 2013 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 More sharing options...
stimpy Posted July 17, 2013 Share Posted July 17, 2013 I mean my value contains a comma then what to do ? I'm not sure, never tried this myself. I would say, make a test csv with a few lines of data and test it. Link to comment Share on other sites More sharing options...
Abhishek Gupta Posted July 17, 2013 Share Posted July 17, 2013 I'm not sure, never tried this myself. I would say, make a test csv with a few lines of data and test it. Well i sorted it out. I used ~ and | for multiple value separator. Link to comment Share on other sites More sharing options...
vucumbra Posted November 17, 2016 Share Posted November 17, 2016 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 thx great solution Link to comment Share on other sites More sharing options...
Recommended Posts