From 71812dc37dcb46d2368ccdf7ec37df6a308f5af7 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Fri, 29 Jan 2016 15:00:20 +0300 Subject: [PATCH] =?UTF-8?q?FIX=20-=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B2=20=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=D1=85=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B9=20?= =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D1=91=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/user/notification.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/views/user/notification.php b/views/user/notification.php index c570233..9ebc0ca 100644 --- a/views/user/notification.php +++ b/views/user/notification.php @@ -12,17 +12,23 @@ switch ($notification->type) { break; case Notifications::typeNewCommentPoint: $comment = $notification->RefComment; - $point = Point::model()->getByPK($comment->parentId); - print strftime('%d %b %H:%M', $notification->date).' — Новый комментарий к точке "'.$point->name.'".'; + if ($comment) { + $point = Point::model()->getByPK($comment->parentId); + print strftime('%d %b %H:%M', $notification->date).' — Новый комментарий к точке "'.$point->name.'".'; + } break; case Notifications::typeNewCommentArticle: $comment = $notification->RefComment; - $article = Article::model()->getByPK($comment->parentId); - print strftime('%d %b %H:%M', $notification->date).' — Новый комментарий к статье "'.$article->title.'".'; + if ($comment) { + $article = Article::model()->getByPK($comment->parentId); + print strftime('%d %b %H:%M', $notification->date).' — Новый комментарий к статье "'.$article->title.'".'; + } break; case Notifications::typeReply: $comment = $notification->RefComment; - print strftime('%d %b %H:%M', $notification->date).' — '.$comment->RefUser->nick.' ответил(-а) на ваш комментарий.'; + if ($comment) { + print strftime('%d %b %H:%M', $notification->date).' — '.$comment->RefUser->nick.' ответил(-а) на ваш комментарий.'; + } break; case Notifications::typePointLike: print strftime('%d %b %H:%M', $notification->date).' — '.$notification->RefFromUser->nick.' нравится ваша точка '.$notification->RefPoint->name.'.';