Skip to content

Commit af7fa76

Browse files
committed
Add fallback getDescription method for MW < 1.41 compat
Fixes: #191
1 parent 702d6e4 commit af7fa76

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

src/EntryPoints/SpecialWikibaseExport.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ public function getGroupName(): string {
3838
return 'wikibase';
3939
}
4040

41-
public function getDescription(): Message {
42-
return $this->msg( 'special-wikibase-export' );
41+
/**
42+
* @return string|Message Returns string in MW < 1.41 and Message in MW >= 1.41
43+
*/
44+
public function getDescription() {
45+
if ( version_compare( MW_VERSION, '1.41', '>=' ) ) {
46+
return $this->msg( 'special-wikibase-export' );
47+
} else {
48+
return $this->msg( 'special-wikibase-export' )->escaped();
49+
}
4350
}
4451

4552
private function shouldShowConfigLink(): bool {

src/EntryPoints/SpecialWikibaseExportConfig.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace ProfessionalWiki\WikibaseExport\EntryPoints;
66

7+
use Message;
78
use SpecialPage;
89
use Title;
910

@@ -27,8 +28,15 @@ public function getGroupName(): string {
2728
return 'wikibase';
2829
}
2930

30-
public function getDescription(): string {
31-
return $this->msg( 'special-wikibase-export-config' )->escaped();
31+
/**
32+
* @return string|Message Returns string in MW < 1.41 and Message in MW >= 1.41
33+
*/
34+
public function getDescription() {
35+
if ( version_compare( MW_VERSION, '1.41', '>=' ) ) {
36+
return $this->msg( 'special-wikibase-export-config' );
37+
} else {
38+
return $this->msg( 'special-wikibase-export-config' )->escaped();
39+
}
3240
}
3341

3442
}

0 commit comments

Comments
 (0)