[MediaWiki-commits] [Gerrit] mediawiki...Score[wmf/1.31.0-wmf.17]: Always pass FileBackend instance to `new FileRepo()`
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405029 ) Change subject: Always pass FileBackend instance to `new FileRepo()` .. Always pass FileBackend instance to `new FileRepo()` Score::$backend is only initialized if Score::getBackend() has been called, but there are code paths in which getLength() will be called before that function is ever called. Instead just use Score::getBackend(), which will lazy-load the backend object, ensuring that we always pass one to FileRepo. Bug: T185204 Change-Id: Id75c270e1ee49bd94db06c11353b7be9ecb773de (cherry picked from commit 58e19ece76fa98dad17f63c02dd9d4743f1f9dc2) --- M includes/Score.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Thcipriani: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Score.php b/includes/Score.php index ca32ab4..492b14c 100644 --- a/includes/Score.php +++ b/includes/Score.php @@ -1034,7 +1034,7 @@ $isFileMp3 = pathinfo( $path, PATHINFO_EXTENSION ) === 'mp3'; $repo = new FileRepo( [ 'name' => 'foo', - 'backend' => self::$backend + 'backend' => self::getBackend() ] ); $f = new UnregisteredLocalFile( false, $repo, $path, $isFileMp3 -- To view, visit https://gerrit.wikimedia.org/r/405029 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id75c270e1ee49bd94db06c11353b7be9ecb773de Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Score Gerrit-Branch: wmf/1.31.0-wmf.17 Gerrit-Owner: JforresterGerrit-Reviewer: Legoktm Gerrit-Reviewer: Thcipriani Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Score[wmf/1.31.0-wmf.17]: Always pass FileBackend instance to `new FileRepo()`
Jforrester has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405029 ) Change subject: Always pass FileBackend instance to `new FileRepo()` .. Always pass FileBackend instance to `new FileRepo()` Score::$backend is only initialized if Score::getBackend() has been called, but there are code paths in which getLength() will be called before that function is ever called. Instead just use Score::getBackend(), which will lazy-load the backend object, ensuring that we always pass one to FileRepo. Bug: T185204 Change-Id: Id75c270e1ee49bd94db06c11353b7be9ecb773de (cherry picked from commit 58e19ece76fa98dad17f63c02dd9d4743f1f9dc2) --- M includes/Score.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score refs/changes/29/405029/1 diff --git a/includes/Score.php b/includes/Score.php index ca32ab4..492b14c 100644 --- a/includes/Score.php +++ b/includes/Score.php @@ -1034,7 +1034,7 @@ $isFileMp3 = pathinfo( $path, PATHINFO_EXTENSION ) === 'mp3'; $repo = new FileRepo( [ 'name' => 'foo', - 'backend' => self::$backend + 'backend' => self::getBackend() ] ); $f = new UnregisteredLocalFile( false, $repo, $path, $isFileMp3 -- To view, visit https://gerrit.wikimedia.org/r/405029 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id75c270e1ee49bd94db06c11353b7be9ecb773de Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Score Gerrit-Branch: wmf/1.31.0-wmf.17 Gerrit-Owner: JforresterGerrit-Reviewer: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits