View Issue Details

IDProjectCategoryView StatusLast Update
0003218OXID eShop (all versions)1.05. Userspublic2015-05-04 15:34
Status resolvedResolutionfixed 
Product Version4.5.1 revision 38045 
Target VersionFixed in Version4.5.6 revision 40808 
Summary0003218: oxUser::addToGroup() stores wrong entity in oxUser::_oGroups attribute
DescriptionInstead of adding the oxGroups instance to the class internal $_oGroups attribute, addToGroup() stores the relation representation oxObject2Group instance in this attribute as you can see here:

This misbehavior causes major problems for all group related tasks such as oxUser::removeFromGroup() and makes user group based sql statements useless (see oxActionList::_getUserGroupFilter()) if they are processed at the same request as addToGroup() was called.
Steps To Reproduce$oUser = oxNew('oxUser');

$oGroup = oxNew('oxGroups');


foreach($oUser->getUserGroups() as $sGroupOxid=>$oGroup)
    printf("%-9s - %-14s - %-32s\n", $sGroupOxid, get_class($oGroup), $oGroup->getId());

// ignore this -> only for reproducibility
oxDb::getDb()->Execute("DELETE FROM oxobject2group WHERE oxgroupsid = 'newgroup'");

Expected result:
oxidadmin - oxGroups - oxidadmin
newgroup - oxGroups - newgroup

Actual result:
oxidadmin - oxGroups - oxidadmin
newgroup - oxObject2Group - 82061831685d3f8bfb82f192914e1
TagsNo tags attached.
PHP Versionany
Database Versionany



2011-11-22 14:28

reporter   ~0005434

@developers please check from source code


2011-12-06 16:25

reporter   ~0005462

After user is assigned to the new user group set oxGroups object in user groups cache