Prestashop Addict Posted November 17, 2017 Share Posted November 17, 2017 Hi, Version used PS: 1.6.1.17 I notice a strange behavior with the method Group::getCurrent() in core class GroupCore that retrieve the current default group of the user context. To reproduce the issue : Create a category, and assign to only default group (means only users with account) Browse the boutique as unidentified user, category doesn't appear in menu => good Browse the boutique as identified user, category appears in menu => good Disconnect and browse the boutique as unidentified user, category doesn't appear in menu => good Now go directly to url of the category, the page is displayed => bad (according to default group only users with account should access this category, we should have an error message: you cannot access this category) When I analyse the method in class th problem comes from this part of code : if (!$groups[$id_group]->isAssociatedToShop(Context::getContext()->shop->id)) { $id_group = (int)$ps_customer_group; if (!isset($groups[$id_group])) { $groups[$id_group] = new Group($id_group); } Before this test, the $id_group is well assigned to Configuration::get('PS_UNIDENTIFIED_GROUP'). Why this test force to Configuration::get('PS_CUSTOMER_GROUP') ? I think it's a bug isn't it ? John Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 17, 2017 Author Share Posted November 17, 2017 I found the issue. The bug coming from ps_group_shop table that didn't contain initial values for guest and customer. You should run SQL command INSERT INTO `ps_group_shop` (`id_group`, `id_shop`) VALUES ('2', '1'); INSERT INTO `ps_group_shop` (`id_group`, `id_shop`) VALUES ('3', '1'); I don't know if it's a Prestashop install bug or upgrade. Hope this help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now