Skip to content

Commit

Permalink
Take articles into account when merging users
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntimeX committed Oct 24, 2024
1 parent 2d33bd2 commit 090ae94
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wcfsetup/install/files/lib/acp/form/UserMergeForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ public function save()
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters()));

// articles
$conditions = new PreparedStatementConditionBuilder();
$conditions->add("userID IN (?)", [$this->mergedUserIDs]);
$sql = "UPDATE wcf" . WCF_N . "_article
SET userID = ?
" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(\array_merge([$this->destinationUserID], $conditions->getParameters()));

// delete merged users
$action = new UserAction($this->mergedUserIDs, 'delete');
$action->executeAction();
Expand Down

0 comments on commit 090ae94

Please sign in to comment.