Jump to content

[SOLVED] category cannot be loaded


Recommended Posts

Does anyone know why I'm getting this "category cannot be loaded" when I click the category tab. All the info is there in the database. I've even deleted the lot, categories and products, and added the tables again, but still the same result.
Help anyone?
Thanks
Chrissie

Link to comment
Share on other sites

Thanks Rocky
In admincatalog.php it says

/* Get current category */
       $id_category = abs(intval(Tools::getValue('id_category')));
       if (!$id_category) $id_category = 1;
       self::$_category = new Category($id_category);
       if (!Validate::isLoadedObject(self::$_category))
           die('Category cannot be loaded');


Im guessing this means its looking for category_id 1, this being the top level category?

Chrissie

Link to comment
Share on other sites

I finally managed to get categories in the back office working again. It was because of the missing category_id 1. for some reason tho when I uploaded the csv file it didn't like the images so had to add them all manually!
Problem now is that there are no categories showing on the main page. The category block is there but empty. I've uninstalled it and reinstalled and it makes no difference whether its set to dynamic or not.
Any ideas?
Chrissie :)

I just noticed that my top level category has no name! Isn't it supposed to be called "home"? I have no idea how I managed to lose that but how can I get it back? :red:

Link to comment
Share on other sites

  • 2 weeks later...

It need to be connected to a category in ps_category (same id)

ps_category

id_category     id_parent     level_depth     active     date_add     date_upd
   1     0     0     1     2010-09-25 05:47:24     2010-09-25 05:47:24



ps_category_lang

id_category     id_lang     name     description     link_rewrite     meta_title     meta_keywords     meta_description
1     1     Home     NULL     home     NULL     NULL     NULL

Link to comment
Share on other sites

ps_category table. thanks :)


id_category   id_parent   level_depth   active   date_add   date_upd
1   0   0   1   2010-10-17    15:33:27   2010-10-17    15:33:27 
10   5   2   1   2010-10-17    16:28:19   2010-10-17    16:28:19 
11   5   2   1   2010-10-17    16:28:19   2010-10-17    16:28:19 
12   5   2   1   2010-10-17    16:28:19   2010-10-17    16:28:19 
13   6   2   1   2010-10-19    15:08:24   2010-10-19    15:08:24 
14   6   2   1   2010-10-19    15:08:24   2010-10-19    15:08:24 
15   6   2   1   2010-10-19    15:08:24   2010-10-19    15:08:24 
3   6   2   1   2010-10-19    15:08:24   2010-10-19    15:08:24 
4   6   2   1   2010-10-19    15:08:24   2010-10-19    15:08:24 
5   1   1   1   2010-10-17    16:18:05   2010-10-17    16:18:05 
6   1   1   1   2010-10-17    16:19:43   2010-10-17    16:19:43 
7   1   1   1   2010-10-17    16:20:44   2010-10-17    16:20:44 
8   5   2   1   2010-10-17    16:28:19   2010-10-17    16:28:19 
9   5   2   1   2010-10-17    16:28:19   2010-10-17    16:28:19 

Link to comment
Share on other sites

The only other thing I can suggest is make sure you are using the original category block without any modifications.

If that doesn't help, than I'm out of ideas, anything else would require a close examination of the code and possibly add debug lines to find out if the categories are actually loaded correctly, and where they get "lost"

Link to comment
Share on other sites

After numerous cups of coffee, several headaches and severe hairloss, I finally found out what was wrong and am kicking myself for not looking sooner at the ps_category_group table !!!
My top (home) category was missing from the list.
Oh well, fixed now :)

Link to comment
Share on other sites

  • 1 year later...

Hola, si alguien se manda la misma estupidez que yo de truncar todas las tablas, desde mySQL ejecutar:

 

Solo para idioma es

 

 

INSERT INTO `ps_category_lang`(`id_category`, `id_lang`, `name`, `description`, `link_rewrite`, `meta_title`, `meta_keywords`, `meta_description`) VALUES (0, 'es', 'Inicio', 'Inicio', 'inicio', 'inicio', 'inicio', 'inicio')

INSERT INTO `ps_category`(`id_category`, `id_parent`, `level_depth`, `nleft`, `nright`, `active`, `date_add`, `date_upd`, `position`) VALUES (0 , 0, 0, 0, 0, 0, 0, 0, 0)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Para el que le interese:

 

1- Borré todo el contenido de la carpeta cache (de la tienda).

2- Borré la cache del navegador

 

Listo. Todo ok. La categoría con problemas ya no está. Al parecer esto ocurre porque prestashop guarda una caché para las tablas y aveces queda corrupta.

 

For interest:

 

1 - I deleted the entire contents of the cache folder (of prestashop).

 

2 - I deleted the browser cache

 

Done. All ok. The category is no longer problems. Apparently this is because prestashop keeps a cache for tables and sometimes is corrupt.

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...