Add missing update during user merge
authorMatthias Schmidt <gravatronics@live.com>
Tue, 23 Feb 2016 20:32:05 +0000 (21:32 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 23 Feb 2016 20:32:05 +0000 (21:32 +0100)
files/lib/system/event/listener/ConversationUserMergeListener.class.php

index ca31e1a3109a8639a0ca8e74ada89cfc1787d30f..e19c0555c5424d2aa483c2e0d490888ae7e64623 100644 (file)
@@ -33,6 +33,15 @@ class ConversationUserMergeListener implements IParameterizedEventListener {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($parameters);
                
+               $participantConditions = new PreparedStatementConditionBuilder();
+               $participantConditions->add("lastPosterID IN (?)", array($eventObj->mergedUserIDs));
+               $sql = "UPDATE  wcf".WCF_N."_conversation
+                       SET     lastPosterID = ?,
+                               lastPoster = ?
+                       ".$participantConditions;
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute($parameters); // can still use $parameters, even though $participantConditions != $conditions
+               
                // conversation_to_user
                $participantConditions = new PreparedStatementConditionBuilder();
                $participantConditions->add("participantID IN (?)", array($eventObj->mergedUserIDs));