From 61a10e50932af5ab148bb90a2dd75eb3d47e9619 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 3 Aug 2014 21:05:03 +0200 Subject: [PATCH] Fix like list issues with guest comments --- .../files/lib/data/like/ViewableLikeList.class.php | 5 +++-- .../manager/UserProfileCommentManager.class.php | 10 +++++----- wcfsetup/install/lang/de.xml | 4 ++-- wcfsetup/install/lang/en.xml | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/wcfsetup/install/files/lib/data/like/ViewableLikeList.class.php b/wcfsetup/install/files/lib/data/like/ViewableLikeList.class.php index cff5673dae..b8b1a3509b 100644 --- a/wcfsetup/install/files/lib/data/like/ViewableLikeList.class.php +++ b/wcfsetup/install/files/lib/data/like/ViewableLikeList.class.php @@ -1,6 +1,7 @@ objects as &$like) { - $userIDs[] = $like->objectUserID; + $userIDs[] = $like->userID; $like = new ViewableLike($like); if (!isset($likeGroups[$like->objectTypeID])) { @@ -60,7 +61,7 @@ class ViewableLikeList extends LikeList { $users = UserProfile::getUserProfiles($userIDs); foreach ($this->objects as $like) { - $like->setUserProfile($users[$like->objectUserID]); + $like->setUserProfile($users[$like->userID]); } } diff --git a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php index c490b82fe3..2cbf1741c4 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php @@ -186,12 +186,12 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa if (isset($comments[$like->objectID])) { $comment = $comments[$like->objectID]; - if (isset($users[$comment->objectID]) && isset($users[$comment->userID]) && !$users[$comment->objectID]->isProtected()) { + if (isset($users[$comment->objectID]) && !$users[$comment->objectID]->isProtected()) { $like->setIsAccessible(); // short output $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment', array( - 'commentAuthor' => $users[$comment->userID], + 'commentAuthor' => $comment->userID ? $users[$comment->userID] : null, 'user' => $users[$comment->objectID], 'like' => $like )); @@ -208,13 +208,13 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa $response = $responses[$like->objectID]; $comment = $comments[$response->commentID]; - if (isset($users[$comment->objectID]) && isset($users[$comment->userID]) && isset($users[$response->userID]) && !$users[$comment->objectID]->isProtected()) { + if (isset($users[$comment->objectID]) && !$users[$comment->objectID]->isProtected()) { $like->setIsAccessible(); // short output $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment.response', array( - 'responseAuthor' => $users[$response->userID], - 'commentAuthor' => $users[$comment->userID], + 'responseAuthor' => $comment->userID ? $users[$response->userID] : null, + 'commentAuthor' => $comment->userID ? $users[$comment->userID] : null, 'user' => $users[$comment->objectID], 'like' => $like )); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index f55fcd6e6d..350265d98c 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2148,8 +2148,8 @@ Fehler sind beispielsweise: - {$commentAuthor->username} an der Pinnwand von {$user->username}{if $like->isDislike()} nicht{/if}.]]> - {$responseAuthor->username} zum Kommentar von {$commentAuthor->username} an der Pinnwand von {$user->username}{if $like->isDislike()} nicht{/if}.]]> + von {$commentAuthor->username}{else}eines Gasts{/if} an der Pinnwand von {$user->username}{if $like->isDislike()} nicht{/if}.]]> + von {$responseAuthor->username}{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von {$commentAuthor->username} an der Pinnwand von {$user->username}{else}eines Gasts{/if}{if $like->isDislike()} nicht{/if}.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 3ea99e4fbd..7496bad486 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2115,8 +2115,8 @@ Errors are: - {$commentAuthor->username} an der Pinnwand von {$user->username}{if $like->isDislike()} nicht{/if}.]]> - {$responseAuthor->username} zum Kommentar von {$commentAuthor->username} an der Pinnwand von {$user->username}{if $like->isDislike()} nicht{/if}.]]> + von {$commentAuthor->username}{else}eines Gasts{/if} an der Pinnwand von {$user->username}{if $like->isDislike()} nicht{/if}.]]> + von {$responseAuthor->username}{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von {$commentAuthor->username} an der Pinnwand von {$user->username}{else}eines Gasts{/if}{if $like->isDislike()} nicht{/if}.]]> -- 2.20.1