mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Fix no-JS Special:Notifications only displaying one notification per day
The loop accidentally overwrote the whole array in every iteration.
It's not necessary to define these empty arrays at all: when working
with multi-dimensional arrays, PHP will create them as needed.
Follow-up to 4835b6b1cb
.
Bug: T323491
Change-Id: I5043efc31722d2b9cd2a8dd482594355a761008e
This commit is contained in:
parent
35d89af670
commit
e9447a8786
|
@ -95,11 +95,6 @@ class SpecialNotifications extends SpecialPage {
|
|||
if ( $dateHeader !== $row['timestamp']['date'] ) {
|
||||
$dateHeader = $row['timestamp']['date'];
|
||||
}
|
||||
$notifArray[ $dateHeader ] = [
|
||||
'unread' => [],
|
||||
'notices' => []
|
||||
];
|
||||
|
||||
// Collect unread IDs
|
||||
if ( !isset( $row['read'] ) ) {
|
||||
$classes[] = 'mw-echo-notification-unread';
|
||||
|
@ -166,7 +161,7 @@ class SpecialNotifications extends SpecialPage {
|
|||
$heading->appendContent( $dateTitle );
|
||||
|
||||
// Mark all read button
|
||||
if ( $data[ 'unread' ] !== [] ) {
|
||||
if ( isset( $data[ 'unread' ] ) ) {
|
||||
// tell the UI to show 'unread' notifications only (instead of 'all')
|
||||
$out->addJsConfigVars( 'wgEchoReadState', 'unread' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue