From 1ef1f38aefd24296c2c59e50732ca90a3190b33f Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 1 Jun 2013 19:38:43 +0200 Subject: [PATCH] Fixes comments/comment responses of deleted users --- com.woltlab.wcf/template/commentList.tpl | 20 +++++++++++++++---- .../template/commentResponseList.tpl | 20 ++++++++++++++----- .../data/comment/StructuredComment.class.php | 5 +++++ .../StructuredCommentResponse.class.php | 5 +++++ 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/com.woltlab.wcf/template/commentList.tpl b/com.woltlab.wcf/template/commentList.tpl index 093b956bb5..38814db6e7 100644 --- a/com.woltlab.wcf/template/commentList.tpl +++ b/com.woltlab.wcf/template/commentList.tpl @@ -1,14 +1,26 @@ {foreach from=$commentList item=comment}
  • - - {@$comment->getUserProfile()->getAvatar()->getImageTag(32)} - + {if $comment->userID} + + {@$comment->getUserProfile()->getAvatar()->getImageTag(32)} + + {else} + {@$comment->getUserProfile()->getAvatar()->getImageTag(32)} + {/if}
    -

    {$comment->username} - {@$comment->time|time}

    +

    + {if $comment->userID} + {$comment->username} + {else} + {$comment->username} + {/if} + + - {@$comment->time|time} +

    {@$comment->getFormattedMessage()}

    diff --git a/com.woltlab.wcf/template/commentResponseList.tpl b/com.woltlab.wcf/template/commentResponseList.tpl index b5482e16bc..458140a204 100644 --- a/com.woltlab.wcf/template/commentResponseList.tpl +++ b/com.woltlab.wcf/template/commentResponseList.tpl @@ -1,15 +1,25 @@ {foreach from=$responseList item=response}
  • - - {if $response->getUserProfile()->getAvatar()} + {if $response->userID} + {@$response->getUserProfile()->getAvatar()->getImageTag(32)} - {/if} - + + {else} + {@$response->getUserProfile()->getAvatar()->getImageTag(32)} + {/if}
    -

    {$response->username} - {@$response->time|time}

    +

    + {if $response->userID} + {$response->username} + {else} + {$response->username} + {/if} + + - {@$response->time|time} +

    {@$response->getFormattedMessage()}

    diff --git a/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php b/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php index 5a13c6d35b..5107660a4e 100644 --- a/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php +++ b/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php @@ -1,6 +1,7 @@ userProfile === null) { + $this->userProfile = new UserProfile(new User(null, $this->data)); + } + return $this->userProfile; } diff --git a/wcfsetup/install/files/lib/data/comment/response/StructuredCommentResponse.class.php b/wcfsetup/install/files/lib/data/comment/response/StructuredCommentResponse.class.php index 7e56d80c5c..d565c98468 100644 --- a/wcfsetup/install/files/lib/data/comment/response/StructuredCommentResponse.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/StructuredCommentResponse.class.php @@ -1,5 +1,6 @@ userProfile === null) { + $this->userProfile = new UserProfile(new User(null, $this->data)); + } + return $this->userProfile; } -- 2.20.1