mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-23 18:30:06 +00:00
Merge "List is no longer an associative array"
This commit is contained in:
commit
4bf6c5d7cd
|
@ -50,7 +50,7 @@ class ApiEchoNotifications extends ApiQueryBase {
|
|||
|
||||
if ( $foreignNotifications && $foreignNotifications->getCount( $section ) > 0 ) {
|
||||
// insert fake notification for foreign notifications
|
||||
$result[$section]['list'][-1] = $this->makeForeignNotification( $user, $params['format'], $foreignNotifications, $section );
|
||||
array_unshift( $result[$section]['list'], $this->makeForeignNotification( $user, $params['format'], $foreignNotifications, $section ) );
|
||||
}
|
||||
|
||||
$this->getResult()->setIndexedTagName( $result[$section]['list'], 'notification' );
|
||||
|
@ -69,7 +69,7 @@ class ApiEchoNotifications extends ApiQueryBase {
|
|||
$section = count( $params['sections'] ) === 1 ? reset( $params['sections'] ) : null;
|
||||
|
||||
if ( $foreignNotifications->getCount( $section ) > 0 ) {
|
||||
$result['list'][-1] = $this->makeForeignNotification( $user, $params['format'], $foreignNotifications, $section );
|
||||
array_unshift( $result['list'], $this->makeForeignNotification( $user, $params['format'], $foreignNotifications, $section ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ class ApiEchoNotifications extends ApiQueryBase {
|
|||
foreach ( $notifs as $notif ) {
|
||||
$output = EchoDataOutputFormatter::formatOutput( $notif, $format, $user, $this->getLanguage() );
|
||||
if ( $output !== false ) {
|
||||
$result['list'][$notif->getEvent()->getID()] = $output;
|
||||
$result['list'][] = $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -472,7 +472,7 @@
|
|||
.then(
|
||||
// Success
|
||||
function ( data ) {
|
||||
var notifData, id,
|
||||
var i, notifData,
|
||||
notificationModel, content,
|
||||
newNotifData = {},
|
||||
sources = {},
|
||||
|
@ -481,8 +481,8 @@
|
|||
|
||||
data = data || {};
|
||||
|
||||
for ( id in data.list ) {
|
||||
notifData = data.list[ id ];
|
||||
for ( i = 0; i < data.list.length; i++ ) {
|
||||
notifData = data.list[ i ];
|
||||
content = notifData[ '*' ] || {};
|
||||
|
||||
// Collect common data
|
||||
|
@ -514,7 +514,7 @@
|
|||
model.api,
|
||||
model.unreadCounter,
|
||||
sources,
|
||||
id,
|
||||
notifData.id,
|
||||
$.extend( true, {}, newNotifData, {
|
||||
// This should probably be separated by bundled
|
||||
// type. Some types don't have read messages, but
|
||||
|
@ -531,7 +531,7 @@
|
|||
);
|
||||
} else {
|
||||
notificationModel = new mw.echo.dm.NotificationItem(
|
||||
id,
|
||||
notifData.id,
|
||||
newNotifData
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue