Jump to content

Category image upload


Recommended Posts

I am a recent PrestaShop user (Nov 2012) with version 1.5. I am in the development stage of a client store front. I updated to 1.5.3.1 this morning hoping to fix the problem with missing product images that started when I did the last update of 1.5.2. The product images are now showing.

 

Issue I have now is that I want to add an image to certain subcategories so that they show on the top category screen. I do not like to experiment or modify source code unless necessary. I leave that to people who have a better understanding of the functionality of PrestaShop.

 

Not sure if this is a bug, but the following is what appears after trying to save the category after choosing an image from my computer browse. It looks like a lot of files are effected. Anyone? or is the a bug in the latest version.

 

[PrestaShopException]

 

Property Category->date_add is not valid

at line 837 in file classes/ObjectModel.php

 

831.

832. $message = $this->validateField($field, $this->$field);

833. if ($message !== true)

834. {

835. if ($die)

836. throw new PrestaShopException($message);

837. return $error_return ? $message : false;

838. }

839. }

840.

841. return true;

Link to comment
Share on other sites

After updating from 1.5.2 to 1.5.3.1 I have a similar exception when changing any data of an existing category. Any fixes for this problem?

 

 

[EDIT: added the error message]

[PrestaShopException]

 

 

Property Category->date_add is not valid at line 837in file classes/ObjectModel.php

 

831.

832. $message = $this->validateField($field, $this->$field);

833. if ($message !== true)

834. {

835. if ($die)

836. throw new PrestaShopException($message);

837. return $error_return ? $message : false;

838. }

839. }

840.

841. return true;

 

ObjectModelCore->validateFields - [line 264 - classes/ObjectModel.php] - [0 Argument]

ObjectModelCore->getFields - [line 598 - classes/ObjectModel.php] - [0 Argument]

ObjectModelCore->update - [line 209 - classes/Category.php] - [1 Arguments]

CategoryCore->update - [line 719 - classes/controller/AdminController.php] - [0 Argument]

AdminControllerCore->processUpdate - [line 626 - classes/controller/AdminController.php] - [0 Argument]

AdminControllerCore->processSave - [line 541 - classes/controller/AdminController.php] - [0 Argument]

AdminControllerCore->postProcess - [line 521 - controllers/admin/AdminCategoriesController.php] - [0 Argument]

AdminCategoriesControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]

ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument]

DispatcherCore->dispatch - [line 50 - winkelbeheer/index.php] - [0 Argument]

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

I found a topic in the Spanish forum about this problem with a solution : http://www.prestashop.com/forums/index.php?/topic/215759-problema-meta-keywords-solucionado/page__view__findpost__p__1065713

 

After checking my ps_category table with phpMyAdmin I found that some categories have "0000-00-00 00:00:00" as a value for the field "date_add". In my table only 4 fields where zero, so I changed the fields by hand into a value smaller then the "date_upd" field next to it. The error above has now gone for me and I can edit my categories. No new zero fields appear, even after adding new categories.

 

Many thanks to Adsoa for the solution. Gracias!

 

Este problema lo tuve yo cuando intentaba añadir imagenes a categorias y revisando la tabla ps_category me dí cuenta que en la columna date_add estaban con el siguiente valor "0000-00-00 00:00:00".

 

La solución sería hacer el siguiente UPDATE:

 

UPDATE ps_category SET date_add = sysdate() WHERE id_category > 2;

 

A mi me funcionó asi, ya me contaras.

 

Nota: mi identificador de tablas es "ps_" revisa antes de nada cual es el tuyo.

 

Un saludo.

  • Like 3
Link to comment
Share on other sites

Wizzah,

 

Thanks for the posting. :) I had 7 "date_add" entries that had "0000-00-00 00:00:00". After I updated the fields as suggested, I went into one of the categories and entered a description before I tried to upload an image. No error, however the category somehow was moved to another root category as a sub cat. Tried moving back to root and it totally disappeared. Now waiting for database to be restored from earlier backup so that I can carefully repeat fix. Products still appearing in product list under missing category. Ready to scream in frustration.

Link to comment
Share on other sites

Wizzah,

 

Thanks for the posting. :) I had 7 "date_add" entries that had "0000-00-00 00:00:00". After I updated the fields as suggested, I went into one of the categories and entered a description before I tried to upload an image. No error, however the category somehow was moved to another root category as a sub cat. Tried moving back to root and it totally disappeared. Now waiting for database to be restored from earlier backup so that I can carefully repeat fix. Products still appearing in product list under missing category. Ready to scream in frustration.

 

Hi Mema.

 

First of all, sorry for my english :wacko: .

 

reviews the field called "level_depth" table "ps_category" and make sure the values ​​are the "2" category father, the "3" category descending from the parent category, etcetera.

 

 

Try this and you tell me something

 

regards.

Link to comment
Share on other sites

Hi Adsoa,

 

I did suspect that something happened to the level_depth and did find that the number jumped to "255". I corrected it to "2", but somehow when I went back into the admin area of the store, two categories that had the "255" vanished. The backup being restored soon by server tech staff. Thank you for your "help"

 

I will post when all resolved.

Link to comment
Share on other sites

Hi Adsoa and Wizzah,

 

Thank You both. Database restored. I seem to have everything working NOW. Once I fixed the "date_add" issue, I also had to pay close attention the "level_depth" and "id_parent". I have one question that you may be able to help me with. On the main category list, how do I get a Plus sign to show on a category that has sub categories. It was there before.

 

I APPRECIATE YOUR ASSISTANCE.

Link to comment
Share on other sites

  • 5 weeks later...
  • 6 months later...
  • 4 months later...
  • 3 months later...
  • 2 weeks later...

Hello,

I am having the same issue. How do I access the database to make these changes. I am using a hosting company that installed for me.

I have a file transfer program called Filezilla but I do not see the databases in my Prestashop directory.

Thanks!

Link to comment
Share on other sites

Hello,

I am having the same issue. How do I access the database to make these changes. I am using a hosting company that installed for me.

I have a file transfer program called Filezilla but I do not see the databases in my Prestashop directory.

Thanks!

 

Hello. 
 
The database you can find it in your hosting, you will have a section called "Databases" or "MySQL" or something similar. In Filezilla is only the files you need to run prestashop. 
 
Hope that helps. 
 
A greeting. 
 
Adsoa.
Link to comment
Share on other sites

Hello,

I am having the same issue. How do I access the database to make these changes. I am using a hosting company that installed for me.

I have a file transfer program called Filezilla but I do not see the databases in my Prestashop directory.

Thanks!

 

what hosting management software you've got?  cPanel? 

Link to comment
Share on other sites

  • 4 months later...

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...