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