Jump to content

[RC5 fixed]How to set the group access for all categories at one time?


Guest JoshQiu

Recommended Posts

PS 1.3.0.7

After I import categories by the same CSV file for twice, all the categories' Group access check box are set to null. Because of this I can not see any categories on my home page? I have more than 150 categories imported, which change all of their the Group access one by one would take a very long time?
Maybe delete all the existing categories and import one more time would help.
So I tried to delete all the categories, but when i import the CSV file, the same result.
Any ideas?

23416_MgbLD3Mfh6bMI4riSvLJ_t

Link to comment
Share on other sites

Well, this bug has been fixed on SVN version at revision 2287, but i still don't know how to solve my problem.
Maybe I have to import the categories in 1.2.5.0 and then update the PS to 1.3.0.7.

Link to comment
Share on other sites

  • 2 weeks later...

if you don't want upgrade:

http://www.prestashop.com/bug_tracker/view/1286

SOLUTION FOR THIS PROBLEM:

open phpmyadmin and run this sql, worked for me and all categories were visible and accessible

INSERT INTO ps_category_group (id_category,id_group) SELECT id_category AS id_category, ‘1’ AS id_group FROM ps_category;



fixing:
in classes/Category.php after method public function updateGroup($list) place code:

   static public function categoryGroupFix()
   {
       Db::getInstance()->Execute("INSERT INTO "._DB_PREFIX_."category_group (id_category,id_group) SELECT  id_category AS id_category, '1' AS id_group FROM  "._DB_PREFIX_."category;");
   }



and in admin/tabs/AdminImport.php method categoryImport() after $this->closeCsvFile($handle); place code:

       Category::categoryGroupFix();

  • Like 1
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...