From 8a413435036eeee3a7d68f5a493a9b8a22409b3f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 8 Jan 2017 12:38:01 +0100 Subject: [PATCH] Fixed missing `aboutMe` rebuilding --- .../worker/UserRebuildDataWorker.class.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php index c0bafe93cc..4e18b78f17 100644 --- a/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php @@ -4,6 +4,7 @@ use wcf\data\like\Like; use wcf\data\user\avatar\UserAvatar; use wcf\data\user\avatar\UserAvatarEditor; use wcf\data\user\avatar\UserAvatarList; +use wcf\data\user\User; use wcf\data\user\UserEditor; use wcf\data\user\UserList; use wcf\data\user\UserProfileAction; @@ -40,6 +41,8 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { protected function initObjectList() { parent::initObjectList(); + $this->objectList->sqlSelects = 'user_option_value.userOption' . User::getUserOptionID('aboutMe') . ' AS aboutMe'; + $this->objectList->sqlJoins = "LEFT JOIN wcf".WCF_N."_user_option_value user_option_value ON (user_option_value.userID = user_table.userID)"; $this->objectList->sqlOrderBy = 'user_table.userID'; } @@ -81,7 +84,12 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { $statement->execute($conditionBuilder->getParameters()); } - // update signatures + // update signatures and about me + $sql = "UPDATE wcf".WCF_N."_user_option_value + SET userOption" . User::getUserOptionID('aboutMe') . " = ? + WHERE userID = ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $htmlInputProcessor = new HtmlInputProcessor(); WCF::getDB()->beginTransaction(); /** @var UserEditor $user */ @@ -93,6 +101,14 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker { 'signature' => $htmlInputProcessor->getHtml(), 'signatureEnableHtml' => 1 ]); + + if ($user->aboutMe) { + $htmlInputProcessor->process($user->aboutMe, 'com.woltlab.wcf.user.aboutMe', $user->userID, true); + $statement->execute([ + $htmlInputProcessor->getHtml(), + $user->userID + ]); + } } } WCF::getDB()->commitTransaction(); -- 2.20.1