Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php |
— | — | @@ -263,12 +263,19 @@ |
264 | 264 | |
265 | 265 | $feedback_hidden_detail = self::getFeedbackHiddenDetail($id); |
266 | 266 | |
267 | | - $footer = wfMessage('moodbar-hidden-footer')-> |
268 | | - rawParams( htmlspecialchars( $feedback_hidden_detail->log_user_text ), |
269 | | - $wgLang->date($feedback_hidden_detail->log_timestamp), |
270 | | - $wgLang->time($feedback_hidden_detail->log_timestamp), |
271 | | - htmlspecialchars( $feedback_hidden_detail->log_comment ), |
272 | | - $link )->escaped(); |
| 267 | + if($feedback_hidden_detail === false) { |
| 268 | + $footer = wfMessage('moodbar-hidden-footer-without-log')-> |
| 269 | + rawParams( $link )->escaped(); |
| 270 | + } |
| 271 | + else { |
| 272 | + $footer = wfMessage('moodbar-hidden-footer')-> |
| 273 | + rawParams( htmlspecialchars( $feedback_hidden_detail->log_user_text ), |
| 274 | + $wgLang->date($feedback_hidden_detail->log_timestamp), |
| 275 | + $wgLang->time($feedback_hidden_detail->log_timestamp), |
| 276 | + htmlspecialchars( $feedback_hidden_detail->log_comment ), |
| 277 | + $link )->escaped(); |
| 278 | + } |
| 279 | + |
273 | 280 | return Xml::tags( 'div', array( 'class' => 'error' ), $footer ); |
274 | 281 | } elseif ( $mode === 'hidden' ) { |
275 | 282 | $linkText = wfMessage('moodbar-feedback-show')->escaped(); |
— | — | @@ -502,12 +509,12 @@ |
503 | 510 | /** |
504 | 511 | * Get admin's username/timestamp/reason for hiding a feedback |
505 | 512 | * @param $mbf_id primary key for moodbar_feedback |
506 | | - * @return stdObject |
| 513 | + * @return ResultWrapper|bool |
507 | 514 | */ |
508 | 515 | protected static function getFeedbackHiddenDetail( $mbf_id ) { |
509 | 516 | $dbr = wfGetDB( DB_SLAVE ); |
510 | 517 | |
511 | | - $res = $dbr->select( array( 'logging' ), |
| 518 | + return $dbr->selectRow( array( 'logging' ), |
512 | 519 | array( 'log_user_text', 'log_timestamp', 'log_comment' ), |
513 | 520 | array( 'log_namespace' => NS_SPECIAL, |
514 | 521 | 'log_title' => 'FeedbackDashboard/' . intval( $mbf_id ), |
— | — | @@ -516,10 +523,6 @@ |
517 | 524 | __METHOD__, |
518 | 525 | array( 'LIMIT' => 1, 'ORDER BY' => "log_timestamp DESC" ) |
519 | 526 | ); |
520 | | - |
521 | | - $rows = iterator_to_array( $res, /*$use_keys=*/false ); |
522 | | - |
523 | | - return current($rows); |
524 | 527 | } |
525 | 528 | |
526 | 529 | } |
Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -95,6 +95,7 @@ |
96 | 96 | 'moodbar-feedback-show' => 'show hidden feedback', |
97 | 97 | 'moodbar-feedback-hide' => 'hide feedback', |
98 | 98 | 'moodbar-hidden-footer' => 'Hidden Feedback by $1 on $2 $3, reason: $4 $5', |
| 99 | + 'moodbar-hidden-footer-without-log' => 'Hidden Feedback $1', |
99 | 100 | 'moodbar-feedback-restore' => 'restore hidden feedback', |
100 | 101 | 'moodbar-action-item' => 'Feedback item:', |
101 | 102 | 'moodbar-action-reason' => 'Reason:', |
— | — | @@ -278,6 +279,7 @@ |
279 | 280 | 'moodbar-feedback-newer' => 'Text of the link that the user can click to go back to more recent results. Only visible if JavaScript is not enabled.', |
280 | 281 | 'moodbar-feedback-older' => 'Text of the link that the user can click to see less recent results. Only visible if JavaScript is not enabled.', |
281 | 282 | 'moodbar-hidden-footer' => '* $1 is the username, $2 is the date, $3 is the time, $4 is the reason for hiding the feedback,$5 is a link to restore the item displaying {{msg-mw|moodbar-feedback-restore}}', |
| 283 | + 'moodbar-hidden-footer-without-log' => '* $1 is a link to restore the item displaying {{msg-mw|moodbar-feedback-restore}}', |
282 | 284 | 'moodbar-type-happy' => '$1 is the username that can be used for GENDER', |
283 | 285 | 'moodbar-type-sad' => '$1 is the username that can be used for GENDER', |
284 | 286 | 'moodbar-type-confused' => '$1 is the username that can be used for GENDER', |