chrissie Posted October 24, 2010 Share Posted October 24, 2010 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?ThanksChrissie Link to comment Share on other sites More sharing options...
rocky Posted October 25, 2010 Share Posted October 25, 2010 There must be something messed up in your database. That error message occurs when PrestaShop tries to load a specified category ID, but is unable to find the category data in the database. Link to comment Share on other sites More sharing options...
chrissie Posted October 25, 2010 Author Share Posted October 25, 2010 Thanks RockyIn 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 More sharing options...
rocky Posted October 25, 2010 Share Posted October 25, 2010 Yes, it appears so, though to be sure, you can add the category ID to the error message: die('Category ' . self::$_category . ' cannot be loaded'); Link to comment Share on other sites More sharing options...
chrissie Posted October 25, 2010 Author Share Posted October 25, 2010 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 More sharing options...
tomerg3 Posted October 25, 2010 Share Posted October 25, 2010 you will need to add a new record in category_lang for the home category. Link to comment Share on other sites More sharing options...
chrissie Posted October 26, 2010 Author Share Posted October 26, 2010 Thank you. That worked Link to comment Share on other sites More sharing options...
chrissie Posted November 8, 2010 Author Share Posted November 8, 2010 Update - that didn't actually work as I'd expected it would - I still have no categories showing. The category block is there, but empty.Anyone know whats going on? Link to comment Share on other sites More sharing options...
tomerg3 Posted November 8, 2010 Share Posted November 8, 2010 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 More sharing options...
chrissie Posted November 8, 2010 Author Share Posted November 8, 2010 Hi, thanks, but I had already done that. The setting I have are as you've shown them:-S Link to comment Share on other sites More sharing options...
tomerg3 Posted November 8, 2010 Share Posted November 8, 2010 can you post a dump of your category table Link to comment Share on other sites More sharing options...
chrissie Posted November 8, 2010 Author Share Posted November 8, 2010 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 More sharing options...
tomerg3 Posted November 8, 2010 Share Posted November 8, 2010 That looks correct, do you have any javascript errors on the page? Link to comment Share on other sites More sharing options...
chrissie Posted November 8, 2010 Author Share Posted November 8, 2010 no, none Link to comment Share on other sites More sharing options...
tomerg3 Posted November 8, 2010 Share Posted November 8, 2010 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 More sharing options...
chrissie Posted November 10, 2010 Author Share Posted November 10, 2010 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 More sharing options...
Ciferal Posted February 9, 2012 Share Posted February 9, 2012 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) 1 Link to comment Share on other sites More sharing options...
randymorgado Posted February 23, 2012 Share Posted February 23, 2012 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 More sharing options...
tuna_bones Posted May 7, 2012 Share Posted May 7, 2012 Ciferal funcionó perfecto Ciferal It works perfect Gracias Link to comment Share on other sites More sharing options...
Recommended Posts