Skip to content

Commit

Permalink
(cleanup) Replace deprecated constant DB_MASTER
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardspec committed Nov 14, 2024
1 parent 799b1e8 commit 3a48ac7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ List of changes between releases of Extension:JsCalendar.
== master branch (will become JsCalendar 0.3.4 or 0.4.0, depending on magnitude of changes) ==

Features:
* Support MediaWiki 1.43.
* Added an option to use FullCalendar 5 (most current version) instead of FullCalendar 2.9.1.
This is experimental, because the styling of v5 calendar is preliminary and may be changed later.
Can be enabled with $wgJsCalendarFullCalendarVersion = 5;
Expand Down
2 changes: 1 addition & 1 deletion includes/EventCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function findEvents( array $opt, Parser $recursiveParser ) {
$res = $query->getResult();

// Obtain connections to DB/cache that may or may not be used for storing snippets in cache.
$dbw = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_MASTER );
$dbw = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_PRIMARY );
$dbCache = ObjectCache::getInstance( CACHE_DB );

$eventmap = [];
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/EventCalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ public function testSnippetCacheWasUsed() {
$cache = ObjectCache::getInstance( CACHE_DB );
$cacheKey = $cache->makeKey( 'jscalendar-snippet-' ) . $pageId;

$dbw = $this->getServiceContainer()->getDBLoadBalancer()->getConnection( DB_MASTER );
$dbw = $this->getServiceContainer()->getDBLoadBalancer()->getConnection( DB_PRIMARY );
$dbw->insert( 'objectcache', [
'keyname' => $cache->makeKey( 'jscalendar-snippet-' ) . $pageId,
'value' => $expectedSnippet,
Expand Down

0 comments on commit 3a48ac7

Please sign in to comment.