mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 01:10:07 +00:00
Some final fixes for deployment
Change-Id: Idfde86bba1966a8741f2f4a318c3745cc2e8e658
This commit is contained in:
parent
72cae969ac
commit
5a955cc9d9
2
Echo.php
2
Echo.php
|
@ -147,6 +147,8 @@ $wgHooks['ArticleEditUpdateNewTalk'][] = 'EchoHooks::abortNewtalkNotification';
|
|||
|
||||
// Configuration
|
||||
|
||||
$wgEchoDisableStandardEmail = true;
|
||||
|
||||
$wgEchoDefaultNotificationTypes = array(
|
||||
'all' => array(
|
||||
'notify' => true,
|
||||
|
|
|
@ -243,7 +243,8 @@ class EchoHooks {
|
|||
* @return true in all cases
|
||||
*/
|
||||
static function abortEmailNotification() {
|
||||
return false;
|
||||
global $wgEchoDisableStandardEmail;
|
||||
return ! $wgEchoDisableStandardEmail;
|
||||
}
|
||||
|
||||
public static function makeGlobalVariablesScript( &$vars, $outputPage ) {
|
||||
|
|
|
@ -175,12 +175,14 @@ class EchoEvent {
|
|||
* Loads data from the database into this object, given the event ID.
|
||||
* @param $id Event ID
|
||||
*/
|
||||
public function loadFromID($id) {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
public function loadFromID( $id, $fromMaster = false ) {
|
||||
$db = wfGetDB( $fromMaster ? DB_MASTER : DB_SLAVE );
|
||||
|
||||
$row = $dbr->selectRow( 'echo_event', '*', array('event_id' => $id), __METHOD__ );
|
||||
$row = $db->selectRow( 'echo_event', '*', array('event_id' => $id), __METHOD__ );
|
||||
|
||||
if ( ! $row ) {
|
||||
if ( ! $row && !$fromMaster ) {
|
||||
$this->loadFromID( $id, true );
|
||||
} elseif ( ! $row ) {
|
||||
throw new MWException( "No EchoEvent found with ID: $id");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue