View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007138 | OXID eShop (all versions) | 2.5. Administer users | public | 2020-05-18 09:47 | 2024-12-04 15:41 |
Reporter | tte | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 6.1.5 | ||||
Summary | 0007138: Deleting users won't delete user references left in other tables | ||||
Description | Invoking the user model's delete() function in Application/Model/User.php will call several other functions which should take care of deleting the remaining user references from various tables. However, the invoked functions always try to get the user's ID using $this->getId() instead of using the $oxid param which might be present in the parent delete() function. This results in user references not being deleted properly from other tables while the original user has already been removed from oxuser. | ||||
Steps To Reproduce | Delete a user account in the shop's backend. | ||||
Tags | No tags attached. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
Reproduced in 6.2.1 ideas for a solution: Either extend the method \OxidEsales\EshopCommunity\Application\Model\User::delete to set the object property by hand: public function delete($oxid = null) { if (!$oxid) { $oxid = $this->getId(); } if (!$oxid) { return false; } if ($oxid && !$this->_sOXID) { // <-- new $this->_sOXID = $oxid; // <-- new } // <-- new Or set the property by the calling controller: \OxidEsales\EshopCommunity\Application\Controller\Admin\AdminListController::deleteEntry public function deleteEntry() { $delete = oxNew($this->_sListClass); //disabling deletion for derived items if ($delete->isDerived()) { return; } $delete->setId($this->getEditObjectId()); // <-- new $blDelete = $delete->delete($this->getEditObjectId()); -MK |