From ea655d4f2a4ac9257e800cbb5d7012d450900b86 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 5 Aug 2026 11:25:33 +0200 Subject: [PATCH 1/3] Stop using deprecated SpecialPage constructor parameters MediaWiki 1.46 deprecated the $restriction, $listed, $function, $file and $includable parameters of the SpecialPage constructor. SpecialBatchUpload passed three of them, so MediaWiki emitted a deprecation warning every time the special page was constructed. Pass only the page name to the parent constructor, and declare the required "upload" right by overriding getRestriction() instead. The $name and $restriction parameters of our own constructor were already ignored, and $listed was only ever the default, so no caller loses anything. getRestriction() is untyped in MediaWiki 1.43 to 1.45 and declared as ": string" in 1.46, so the override carries the return type to stay compatible across the whole supported range. Co-Authored-By: Claude Opus 5 (1M context) --- src/SpecialBatchUpload.php | 13 ++++++------- tests/phpunit/SpecialBatchUploadTest.php | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 tests/phpunit/SpecialBatchUploadTest.php diff --git a/src/SpecialBatchUpload.php b/src/SpecialBatchUpload.php index be675d3..b5b1c26 100644 --- a/src/SpecialBatchUpload.php +++ b/src/SpecialBatchUpload.php @@ -33,13 +33,12 @@ */ class SpecialBatchUpload extends SpecialPage { - /** - * @param string $name Name of the special page, as seen in links and URLs - * @param string $restriction User right required, e.g. "block" or "delete" - * @param bool $listed Whether the page is listed in Special:Specialpages - */ - public function __construct( $name = '', $restriction = '', $listed = true ) { - parent::__construct( 'BatchUpload', 'upload', $listed ); + public function __construct() { + parent::__construct( 'BatchUpload' ); + } + + public function getRestriction(): string { + return 'upload'; } /** diff --git a/tests/phpunit/SpecialBatchUploadTest.php b/tests/phpunit/SpecialBatchUploadTest.php new file mode 100644 index 0000000..4b86826 --- /dev/null +++ b/tests/phpunit/SpecialBatchUploadTest.php @@ -0,0 +1,17 @@ +assertSame( 'upload', ( new SpecialBatchUpload() )->getRestriction() ); + } + +} From c4eed12996e4ee067252613a5fd21735d39e9da5 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 5 Aug 2026 12:05:10 +0200 Subject: [PATCH 2/3] Stop treating the MediaWiki 1.46 CI job as experimental MediaWiki 1.46 has been released, so failures against it are real failures rather than early warnings about an unreleased branch. Only the job tracking MediaWiki master stays non-blocking. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e93354..44a0667 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: experimental: false - mw: 'REL1_46' php: '8.4' - experimental: true + experimental: false - mw: 'master' php: '8.5' experimental: true From 051d1d7a210bd6cd25ce0938d2607719bfa184f3 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 5 Aug 2026 11:54:13 +0200 Subject: [PATCH 3/3] Release version 3.0.3 Co-Authored-By: Claude Opus 5 (1M context) --- extension.json | 2 +- release-notes.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/extension.json b/extension.json index cdb377a..595eb0f 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "SimpleBatchUpload", - "version": "3.0.2", + "version": "3.0.3", "author": [ "[https://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]", "[https://professional.wiki/ Professional Wiki]", diff --git a/release-notes.md b/release-notes.md index 589ba61..33b108a 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,11 @@ ## Release Notes +### SimpleBatchUpload 3.0.3 + +Released on August 5, 2026. + +* Fixed deprecation warning shown on MediaWiki 1.46 + ### SimpleBatchUpload 3.0.2 Released on July 1, 2026.