Kukunin Posted June 8, 2012 Share Posted June 8, 2012 I've installed fresh copy of Prestashop, without dummy products. When I go to Catalog -> Categories in Backoffice, I've get Redirect Loop. URL is further: /index.php?controller=admincategories&id_category=2&token=9bd19dbe7d95b70e4fb2f847fbd1bbc7 I've found several lines of code, which cause redirect loop. In /controllers/admin/AdminCategoriesControllerCore.php, from 109 line: if (!$this->_category->isAssociatedToShop()) { $this->redirect_after = self::$currentIndex.'&id_category='.(int)$this->context->shop->getCategory().'&token='.$this->token; $this->redirect(); } When you change id_category from 2 to 1, you'll see the Home category page, but you can't add new category. Link to comment Share on other sites More sharing options...
premanshu Posted June 26, 2012 Share Posted June 26, 2012 I am also facing the same problem. Is there any solution for the same?? Link to comment Share on other sites More sharing options...
premanshu Posted June 26, 2012 Share Posted June 26, 2012 Ok.. I found a workaround to deal with this problem till this is fixed. The Issue will only come when you will upgrade to Prestashop 1.5 from a prior prestashop version(in which you have already installed the sample products and categories by default). When I started uploading products and made new categories in prestashop version 1.4.x I deleted the default categories which were created for ipod, etc. It was id_category 2 to 4. I created further categories with id 5 to 32. I now upgraded to 1.5 and there is a 'root' category created with id 33 which is parent for home. When we click on category link on BO for first time it looks like it assumes home to be at category =2 which is not there as home is 1 and root is 33 and there is nothing with category 2. Solution: just create root category with id 1 and home category with id 2 in table ps_catagory like which will be created by default during fresh install. Then you will be able to see the category links for one time only. Open the visible categories for editing one by one and just save so that BO make relevant changes for category in DB automatically. Your shop category will get back to normal again. Hope it helps and gets resolved in next release of prestashop. Link to comment Share on other sites More sharing options...
dekez Posted November 24, 2012 Share Posted November 24, 2012 (edited) Hi I'm having the same problem as the op, fresh install with no products but can't access the categories due to redirect loop. This is with a manual install. I also tried to install with the products but the same problem. The solution above is for when there was a previous install, how should the database table look for a fresh install? If anyone could provide a screenshot or solution it would be much appreciated, cheers. edit: ignore, gone to 1.4 Edited November 26, 2012 by dekez (see edit history) Link to comment Share on other sites More sharing options...
Rhobur Posted January 9, 2013 Share Posted January 9, 2013 (edited) Ok.. I found a workaround to deal with this problem till this is fixed. The Issue will only come when you will upgrade to Prestashop 1.5 from a prior prestashop version(in which you have already installed the sample products and categories by default). When I started uploading products and made new categories in prestashop version 1.4.x I deleted the default categories which were created for ipod, etc. It was id_category 2 to 4. I created further categories with id 5 to 32. I now upgraded to 1.5 and there is a 'root' category created with id 33 which is parent for home. When we click on category link on BO for first time it looks like it assumes home to be at category =2 which is not there as home is 1 and root is 33 and there is nothing with category 2. Solution: just create root category with id 1 and home category with id 2 in table ps_catagory like which will be created by default during fresh install. Then you will be able to see the category links for one time only. Open the visible categories for editing one by one and just save so that BO make relevant changes for category in DB automatically. Your shop category will get back to normal again. Hope it helps and gets resolved in next release of prestashop. Thank you premanshu! It seems loke a great idea to start with I have a similar problem but for some unknown yet reason I cannot access the BO, the login page keeps looping( not a password problem). Since upgraded few of my products are rewritten to domain.com/home/product instead of the usual domain.com/category/product. I have looked in ps_category and I have the home category with id 1 and parent id 2542 ; the category with id 2542 has parent id 0. In ps_category_lang there is no category with id 2542. What do you think I should I do ? Change the parent id of the home category to 0 and delete the category with id 2542 ? Whatever has to be done I can do it only by working directly in the DB' tables not in BO. EDIT: did the above, changed the home category id from 2542 to 0, deleted the 2542 row but no change. I have redirected from htaccess /home/product to category/product but still get redirect loop, Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects. Checked my htaccess but cannot find any error!!! Edited January 9, 2013 by Caprice (see edit history) Link to comment Share on other sites More sharing options...
kornett Posted February 9, 2013 Share Posted February 9, 2013 This was the fix for me, just execute the following insert in your database: INSERT INTO `ps_category_shop` VALUES(1, IDshop, 0); IDshop would be the numeric id of the shop having this problem, after that you will be able to see the categories section, click on "Add new root category" to create new one. Link to comment Share on other sites More sharing options...
Recommended Posts