Merge "Move section ID fallbacks into headers themselves"
[lhc/web/wiklou.git] / includes / revisiondelete / RevDelLogItem.php
index 9e76f4c..998c695 100644 (file)
@@ -102,8 +102,9 @@ class RevDelLogItem extends RevDelItem {
                // User links and action text
                $action = $formatter->getActionText();
                // Comment
+               $comment = CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text;
                $comment = $this->list->getLanguage()->getDirMark()
-                       . Linker::commentBlock( $this->row->log_comment );
+                       . Linker::commentBlock( $comment );
 
                if ( LogEventsList::isDeleted( $this->row, LogPage::DELETED_COMMENT ) ) {
                        $comment = '<span class="history-deleted">' . $comment . '</span>';
@@ -119,16 +120,10 @@ class RevDelLogItem extends RevDelItem {
                        'id' => $logEntry->getId(),
                        'type' => $logEntry->getType(),
                        'action' => $logEntry->getSubtype(),
+                       'userhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_USER ),
+                       'commenthidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_COMMENT ),
+                       'actionhidden' => (bool)$logEntry->isDeleted( LogPage::DELETED_ACTION ),
                ];
-               $ret += $logEntry->isDeleted( LogPage::DELETED_USER )
-                       ? [ 'userhidden' => '' ]
-                       : [];
-               $ret += $logEntry->isDeleted( LogPage::DELETED_COMMENT )
-                       ? [ 'commenthidden' => '' ]
-                       : [];
-               $ret += $logEntry->isDeleted( LogPage::DELETED_ACTION )
-                       ? [ 'actionhidden' => '' ]
-                       : [];
 
                if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
                        $ret['params'] = LogFormatter::newFromEntry( $logEntry )->formatParametersForApi();
@@ -141,7 +136,7 @@ class RevDelLogItem extends RevDelItem {
                }
                if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
                        $ret += [
-                               'comment' => $this->row->log_comment,
+                               'comment' => CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text,
                        ];
                }