Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php |
— | — | @@ -96,15 +96,18 @@ |
97 | 97 | global $wgOut, $wgArticleFeedbackRatings; |
98 | 98 | |
99 | 99 | $rows = array(); |
100 | | - foreach ( $this->getDailyHighsAndLows() as $page ) { |
101 | | - $row = array(); |
102 | | - $pageTitle = Title::newFromId( $page['page'] ); |
103 | | - $row['page'] = Linker::link( $pageTitle, $pageTitle->getPrefixedText() ); |
104 | | - foreach ( $page['ratings'] as $id => $value ) { |
105 | | - $row['rating-' . $id] = $value; |
| 100 | + $pages = $this->getDailyHighsAndLows(); |
| 101 | + if ( $pages ) { |
| 102 | + foreach ( $pages as $page ) { |
| 103 | + $row = array(); |
| 104 | + $pageTitle = Title::newFromId( $page['page'] ); |
| 105 | + $row['page'] = Linker::link( $pageTitle, $pageTitle->getPrefixedText() ); |
| 106 | + foreach ( $page['ratings'] as $id => $value ) { |
| 107 | + $row['rating-' . $id] = $value; |
| 108 | + } |
| 109 | + $row['average articleFeedback-table-cell-score-' . round( $page['average'] )] = $page['average']; |
| 110 | + $rows[] = $row; |
106 | 111 | } |
107 | | - $row['average articleFeedback-table-cell-score-' . round( $page['average'] )] = $page['average']; |
108 | | - $rows[] = $row; |
109 | 112 | } |
110 | 113 | $this->renderTable( |
111 | 114 | wfMsg( 'articleFeedback-table-caption-dailyhighsandlows' ), |
— | — | @@ -216,7 +219,7 @@ |
217 | 220 | ); |
218 | 221 | |
219 | 222 | // if we have no results, just return |
220 | | - if ( !$row->afshl_ts ) { |
| 223 | + if ( !$row || !$row->afshl_ts ) { |
221 | 224 | return; |
222 | 225 | } |
223 | 226 | |