mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-25 03:09:37 +00:00
Merge "(bug 44247) Do not write to storage if read-only mode is on"
This commit is contained in:
commit
6d6f4b7fc2
|
@ -177,7 +177,7 @@ class EchoNotificationController {
|
|||
global $wgEchoBackend;
|
||||
|
||||
$eventIDs = array_filter( (array)$eventIDs, 'is_numeric' );
|
||||
if ( !$eventIDs ) {
|
||||
if ( !$eventIDs || wfReadOnly() ) {
|
||||
return;
|
||||
}
|
||||
$wgEchoBackend->markRead( $user, $eventIDs );
|
||||
|
@ -191,6 +191,10 @@ class EchoNotificationController {
|
|||
public static function markAllRead( $user ) {
|
||||
global $wgEchoBackend, $wgEchoMaxNotificationCount;
|
||||
|
||||
if ( wfReadOnly() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$notificationCount = self::getNotificationCount( $user );
|
||||
// Only update all the unread notifications if it isn't a huge number.
|
||||
// TODO: Implement batched jobs it's over the maximum.
|
||||
|
|
|
@ -72,6 +72,11 @@ class EchoEvent {
|
|||
public static function create( $info = array() ) {
|
||||
global $wgEchoNotifications;
|
||||
|
||||
// Do not create event and notifications if write access is locked
|
||||
if ( wfReadOnly() ) {
|
||||
throw new ReadOnlyError();
|
||||
}
|
||||
|
||||
$obj = new EchoEvent;
|
||||
static $validFields = array( 'type', 'variant', 'agent', 'title', 'extra' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue