Jump to content

Error while importing categories from .csv file


Claudiu Nesa

Recommended Posts

I'm trying to upload ca .csv file with new caegories on my Prestashop 1.5.2 and i receive the following error:

Fatal error: Uncaught exception 'PrestaShopException' with message 'Property Category->date_add is not valid' in /path/classes/ObjectModel.php:790 Stack trace:
#0 /path/classes/ObjectModel.php(265): ObjectModelCore->validateFields()
#1 /path/classes/ObjectModel.php(551): ObjectModelCore->getFields()
#2 /path/classes/Category.php(210): ObjectModelCore->update(false)
#3 /path/modules/ebaycategories/ebaycategories.php(370): CategoryCore->update()
#4 /path/modules/ebaycategories/getCategories.php(34): EbayCategories->categoryImport()
#5 {main} thrown in /path/classes/ObjectModel.php on line 790

 

Is there some one who can give some tips about how can I avoid this. Note that the data inside .csv file is correct.

 

Thanks,

C.

Link to comment
Share on other sites

Not sure all is as it seems there, as those messages seem to be mentioning Ebay?

 

Are you cuploading to an Ebay module? Or are you uploading an ebay export file?

 

Perhaps if you could attach a sample of the CSV file and some screen shots of before the error

Link to comment
Share on other sites

Well ebaycategories that you are seeing there is a module which simply grabs the categories from ebay, it setups it accordingly to the guidelines provided by the PS team and then it simply tries to upload them in prestashop.

 

I have a made some tests at the beginning to upload all the 18.205 categories but they are to many so i created 19 .csv files and I made a copy of the categoryImport() from AdminImportController, which I changed to grab those 19 files at once and try to upload them separately.

 

Here is a sample from one of my .csv files:

id;Active (0/1);Name*;Parent Category;Root category (0/1);Description;Meta-title;Meta-keywords;Meta-description;URL rewritten;Image URL;ID ou nom de la boutique
20081;1;Antiques;Home;0;;;;;antiques;;1,2
37903;1;Antiquities;Antiques;0;;;;;antiquities;;1,2
37908;1;The Americas;Antiquities;0;;;;;the-americas;;1,2
162922;1;Byzantine;Antiquities;0;;;;;byzantine;;1,2
162923;1;Celtic;Antiquities;0;;;;;celtic;;1,2
37905;1;Egyptian;Antiquities;0;;;;;egyptian;;1,2

Link to comment
Share on other sites

Beyond me I m afraid, but in case others can help - is this a bought module or one you have created yourself?

 

I would always try it with just one category first

Link to comment
Share on other sites

This is a module that I created and I'm working on!

When I'm trying to add only one file (1000 entries) it works. I receive the error when I'm trying to upload all of the 19 files and most of the times it appears after the fourth .csv file is imported.

 

It's strange for me because I tried to import also a .csv file with more than 2000 entries and it worked.

 

The entrire function gets each line of the .csv file which is similar to one category and simply adds it in the database by creating a new category.

 

Anyway thank you for your implication. :)

 

Cheers,

C.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...