Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MediaWiki 1.39 for actor and templatelinks migration #188

Merged
merged 67 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b37032d
Drop revision_actor_temp support
Universal-Omega Jun 23, 2022
eaac61d
Update extension.json
Universal-Omega Jun 23, 2022
f109597
Update mediawiki-tests.yml
Universal-Omega Jun 23, 2022
4aaff17
Update Query.php
Universal-Omega Jun 23, 2022
afb2802
Update seed-data.xml
Universal-Omega Jun 23, 2022
b22ac2e
Update DPLIntegrationTestCase.php
Universal-Omega Jun 23, 2022
af09941
Update createTemplate.php
Universal-Omega Jun 23, 2022
6ca66ef
Update UpdateArticle.php
Universal-Omega Jun 23, 2022
40f57a5
CI: lint code to MediaWiki standards
Jun 23, 2022
5146acb
Update Article.php
Universal-Omega Jun 23, 2022
3baac2d
Update seed-data.xml
Universal-Omega Jun 23, 2022
b1d6f8c
Update seed-data.xml
Universal-Omega Jun 23, 2022
f7a98c1
Update DPLIntegrationTestCase.php
Universal-Omega Jun 23, 2022
c1d1032
Update DPLIntegrationTestCase.php
Universal-Omega Jun 23, 2022
98e6845
Update DPLQueryIntegrationTest.php
Universal-Omega Jun 23, 2022
3ea48ab
Update DPLIntegrationTestCase.php
Universal-Omega Jun 23, 2022
e09b77e
Update DPLQueryIntegrationTest.php
Universal-Omega Jun 23, 2022
0678a8f
Update DPLIntegrationTestCase.php
Universal-Omega Jun 23, 2022
db29c83
CI: lint code to MediaWiki standards
Jun 24, 2022
b0f6cd6
Update CHANGELOG.md
Universal-Omega Jul 13, 2022
0ed1dd9
Merge branch 'master' into revision
Universal-Omega Aug 6, 2022
9b11cef
Merge branch 'master' into revision
Universal-Omega Aug 8, 2022
c9014ef
Merge branch 'master' into revision
Universal-Omega Aug 11, 2022
cbe4f22
Update CHANGELOG.md
Universal-Omega Aug 11, 2022
8c3b367
Merge branch 'master' into revision
Universal-Omega Aug 23, 2022
b80c317
Merge branch 'master' into revision
Universal-Omega Aug 28, 2022
e7e6641
Merge branch 'master' into revision
Universal-Omega Sep 13, 2022
1374e6a
Update Query.php
Universal-Omega Sep 13, 2022
ae0505d
Update Query.php
Universal-Omega Sep 13, 2022
0108595
Update mediawiki-tests.yml
Universal-Omega Sep 13, 2022
4bfce1a
Update extension.json
Universal-Omega Sep 13, 2022
636118f
Update CHANGELOG.md
Universal-Omega Sep 13, 2022
a13d4fb
Update mediawiki-tests.yml
Universal-Omega Sep 13, 2022
4978cee
Update CHANGELOG.md
Universal-Omega Sep 13, 2022
8f51aa4
Update Query.php
Universal-Omega Sep 13, 2022
0d02a80
Update Query.php
Universal-Omega Sep 13, 2022
dad698e
Update Query.php
Universal-Omega Sep 13, 2022
1eb6d46
Update Query.php
Universal-Omega Sep 13, 2022
4953eb6
Update Query.php
Universal-Omega Sep 13, 2022
1b444c5
Update CHANGELOG.md
Universal-Omega Sep 13, 2022
8993321
Update DPLIntegrationTestCase.php
Universal-Omega Sep 13, 2022
f807e3e
Update seed-data.xml
Universal-Omega Sep 13, 2022
0c42afe
Merge branch 'master' into revision
Universal-Omega Sep 21, 2022
c47707a
Merge branch 'master' into revision
Universal-Omega Oct 12, 2022
d27079f
Merge branch 'master' into revision
Universal-Omega Oct 13, 2022
c49b3a0
Update Parse.php
Universal-Omega Oct 13, 2022
6a6b046
Update LST.php
Universal-Omega Oct 13, 2022
8dfa04a
Update Hooks.php
Universal-Omega Oct 13, 2022
68908c0
Update Parse.php
Universal-Omega Oct 13, 2022
62c0077
Update LST.php
Universal-Omega Oct 13, 2022
a285e13
Update LST.php
Universal-Omega Oct 13, 2022
870455b
Update Parse.php
Universal-Omega Oct 13, 2022
6368e2e
Update Parse.php
Universal-Omega Oct 13, 2022
f28f86c
Update Parse.php
Universal-Omega Oct 13, 2022
c6c0a2c
Update UpdateArticle.php
Universal-Omega Oct 13, 2022
e607a4b
Update Query.php
Universal-Omega Oct 13, 2022
36acf71
Update mediawiki-tests.yml
Universal-Omega Oct 13, 2022
c82d5a7
Update mediawiki-tests.yml
Universal-Omega Oct 13, 2022
f10d20e
Update seed-data.xml
Universal-Omega Oct 13, 2022
c607bf4
Merge branch 'master' into revision
Universal-Omega Nov 2, 2022
9e6066f
replace intval() with (int)
Universal-Omega Nov 2, 2022
353d6ae
Update CHANGELOG.md
Universal-Omega Nov 2, 2022
0dece73
Update includes/Query.php
Universal-Omega Dec 6, 2022
7d13f5f
Merge branch 'master' into revision
Universal-Omega Dec 6, 2022
59e1db3
Update CHANGELOG.md
Universal-Omega Dec 6, 2022
002c616
Update CHANGELOG.md
Universal-Omega Dec 6, 2022
25f9eae
Update extension.json
Universal-Omega Dec 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 28 additions & 133 deletions .github/workflows/mediawiki-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,10 @@ jobs:
strategy:
matrix:
include:
# Latest stable MediaWiki - PHP 7.3 (phan)
- mw: 'REL1_36'
php: 7.3
php-docker: 73
experimental: false
stage: phan

# Latest stable MediaWiki - PHP 7.4 (phan)
- mw: 'REL1_36'
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: phan

# Latest MediaWiki release branch - PHP 7.3 (phan)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
experimental: true
stage: phan

# Latest MediaWiki release branch - PHP 7.4 (phan)
- mw: 'REL1_37'
php: 7.4
php-docker: 74
experimental: true
stage: phan

# Latest MediaWiki master - PHP 7.3 (phan)
- mw: 'master'
php: 7.3
php-docker: 73
experimental: true
stage: phan

Expand All @@ -55,157 +27,80 @@ jobs:
experimental: true
stage: phan

# Latest stable MediaWiki - PHP 7.3 (coverage)
- mw: 'REL1_36'
php: 7.3
php-docker: 73
experimental: false
stage: coverage

# Latest MediaWiki release branch - PHP 7.3 (coverage)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
# Latest stable MediaWiki - PHP 7.4 (coverage)
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: coverage

# Latest MediaWiki master - PHP 7.3 (coverage)
# Latest MediaWiki master - PHP 7.4 (coverage)
- mw: 'master'
php: 7.3
php-docker: 73
experimental: false
stage: coverage

# Latest stable MediaWiki - PHP 7.3 (phpunit-unit)
- mw: 'REL1_36'
php: 7.3
php-docker: 73
experimental: false
stage: phpunit-unit

# Latest stable MediaWiki - PHP 7.4 (phpunit-unit)
- mw: 'REL1_36'
php: 7.4
php-docker: 74
experimental: false
stage: phpunit-unit

# Latest MediaWiki release branch - PHP 7.3 (phpunit-unit)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
experimental: false
stage: phpunit-unit
stage: coverage

# Latest MediaWiki release branch - PHP 7.4 (phpunit-unit)
- mw: 'REL1_37'
# Latest stable MediaWiki - PHP 7.4 (phpunit-unit)
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: phpunit-unit

# Latest MediaWiki master - PHP 7.3 (phpunit-unit)
- mw: 'master'
php: 7.3
php-docker: 73
experimental: false
stage: phpunit-unit

# Latest MediaWiki master - PHP 7.4 (phpunit-unit)
- mw: 'master'
php: 7.4
php-docker: 74
experimental: false
stage: phpunit-unit

# Latest stable MediaWiki - PHP 7.3 (phpunit)
- mw: 'REL1_36'
php: 7.3
php-docker: 73
experimental: false
stage: phpunit

# Latest stable MediaWiki - PHP 7.4 (phpunit)
- mw: 'REL1_36'
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: phpunit

# Latest MediaWiki release branch - PHP 7.3 (phpunit)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
experimental: false
stage: phpunit

# Latest MediaWiki release branch - PHP 7.4 (phpunit)
- mw: 'REL1_37'
php: 7.4
php-docker: 74
experimental: false
stage: phpunit

# Latest MediaWiki master - PHP 7.3 (phpunit)
- mw: 'master'
php: 7.3
php-docker: 73
experimental: false
stage: phpunit

# Latest MediaWiki master - PHP 7.4 (phpunit)
- mw: 'master'
php: 7.4
php-docker: 74
experimental: false
stage: phpunit

# Latest stable MediaWiki - PHP 7.3 (selenium)
- mw: 'REL1_36'
php: 7.3
php-docker: 73
experimental: false
stage: selenium

# Latest MediaWiki release branch - PHP 7.3 (selenium)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
# Latest stable MediaWiki - PHP 7.4 (selenium)
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: selenium

# Latest MediaWiki master - PHP 7.3 (selenium)
# Latest MediaWiki master - PHP 7.4 (selenium)
- mw: 'master'
php: 7.3
php-docker: 73
php: 7.4
php-docker: 74
experimental: false
stage: selenium

# Latest stable MediaWiki - PHP 7.3 (qunit)
- mw: 'REL1_36'
php: 7.3
php-docker: 73
experimental: false
stage: qunit

# Latest MediaWiki release branch - PHP 7.3 (qunit)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
# Latest stable MediaWiki - PHP 7.4 (qunit)
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: qunit

# Latest MediaWiki master - PHP 7.3 (qunit)
# Latest MediaWiki master - PHP 7.4 (qunit)
- mw: 'master'
php: 7.3
php-docker: 73
php: 7.4
php-docker: 74
experimental: false
stage: qunit

# Latest stable MediaWiki - PHP 7.3 (composer-test)
- mw: 'REL1_37'
php: 7.3
php-docker: 73
# Latest stable MediaWiki - PHP 7.4 (composer-test)
- mw: 'REL1_39'
php: 7.4
php-docker: 74
experimental: false
stage: composer-test

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -787,3 +787,13 @@ Many thanks to GreenReaper on GitHub for reporting and finding issues with core
* Updated CreateTemplate to mention DPL3, not DPL
* Used database update maintenance script for creating VIEW
* Added additional isset check for mTemplatePath

# Version 3.4.7
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
* Dropped `revision_actor_temp` support and completed actor migration

Check notice

Code scanning

Lists should be surrounded by blank lines

Lists should be surrounded by blank lines
* Added support for `templatelinks` migration
* Added support for MediaWiki 1.39 and dropped support for older MediaWiki versions (before 1.39.0)

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 99

Expected: 80; Actual: 99
* Dropped official support for PHP versions before PHP 7.4.3, because MediaWiki 1.39 does not support older PHP versions anymore

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 128

Expected: 80; Actual: 128
* Fixed installing via composer version 2.2.1 and later
* Fixed using imagecontainer with openreferences
* Replaced usages of `intval()` with `(int)` in Query.php
* Swapped order of mapping for `Query::addTables()` from `[ alias => table ]` to `[ table => alias ]`

Check warning

Code scanning / Markdownlint (reported by Codacy)

Expected: 80; Actual: 101

Expected: 80; Actual: 101
4 changes: 2 additions & 2 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DynamicPageList3",
"version": "3.4.6",
"version": "3.4.7",
"author": [
"'''Universal Omega'''",
"Alexia E. Smith",
Expand All @@ -11,7 +11,7 @@
"license-name": "GPL-3.0-or-later",
"type": "parserhook",
"requires": {
"MediaWiki": ">= 1.35.3"
"MediaWiki": ">= 1.39.0"
},
"GroupPermissions": {
"sysop": {
Expand Down
12 changes: 6 additions & 6 deletions includes/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ public static function newFromRow(
$article = new self( $title, $pageNamespace );

$revActorName = null;
if ( isset( $row->revactor_actor ) ) {
$revActorName = $userFactory->newFromActorId( $row->revactor_actor )->getName();
if ( isset( $row->rev_actor ) ) {
$revActorName = $userFactory->newFromActorId( $row->rev_actor )->getName();
}

$titleText = $title->getText();
Expand Down Expand Up @@ -286,9 +286,9 @@ public static function newFromRow(
if ( $parameters->getParameter( 'goal' ) != 'categories' ) {
// REVISION SPECIFIED
if ( $parameters->getParameter( 'lastrevisionbefore' ) || $parameters->getParameter( 'allrevisionsbefore' ) || $parameters->getParameter( 'firstrevisionsince' ) || $parameters->getParameter( 'allrevisionssince' ) ) {
$article->mRevision = $row->revactor_rev;
$article->mRevision = $row->rev_id;
$article->mUser = $revActorName;
$article->mDate = $row->revactor_timestamp;
$article->mDate = $row->rev_timestamp;

// $article->mComment = $row->rev_comment;
}
Expand All @@ -298,8 +298,8 @@ public static function newFromRow(
$article->mDate = $row->page_touched;
} elseif ( $parameters->getParameter( 'addfirstcategorydate' ) ) {
$article->mDate = $row->cl_timestamp;
} elseif ( $parameters->getParameter( 'addeditdate' ) && isset( $row->revactor_timestamp ) ) {
$article->mDate = $row->revactor_timestamp;
} elseif ( $parameters->getParameter( 'addeditdate' ) && isset( $row->rev_timestamp ) ) {
$article->mDate = $row->rev_timestamp;
} elseif ( $parameters->getParameter( 'addeditdate' ) && isset( $row->page_touched ) ) {
$article->mDate = $row->page_touched;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static function dplParserFunction( $parser ) {
// @phan-suppress-next-line PhanPluginMixedKeyNoKey
$parser->getPreprocessor()->preprocessToObj( $dplresult, 1 ),
'isLocalObj' => true,
'title' => $parser->getTitle()
'title' => $parser->getPage()
];
}

Expand Down
13 changes: 5 additions & 8 deletions includes/LST.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class LST {
* @param Parser $parser
* @param string $part1
* @return bool
*
* @suppress PhanUndeclaredProperty Use of Parser::mTemplatePath
*/
public static function open( $parser, $part1 ) {
// Infinite loop test
Expand All @@ -70,8 +68,6 @@ public static function open( $parser, $part1 ) {
*
* @param Parser $parser
* @param string $part1
*
* @suppress PhanUndeclaredProperty Use of Parser::mTemplatePath
*/
public static function close( $parser, $part1 ) {
// Infinite loop test
Expand Down Expand Up @@ -111,7 +107,7 @@ private static function parse( $parser, $text, $part1, $skiphead = 0, $recursion

// Handle recursion here, so we can break cycles.
if ( $recursionCheck == false ) {
$text = $parser->preprocess( $text, $parser->getTitle(), $parser->getOptions() );
$text = $parser->preprocess( $text, $parser->getPage(), $parser->getOptions() );
self::close( $parser, $part1 );
}

Expand All @@ -124,7 +120,8 @@ private static function parse( $parser, $text, $part1, $skiphead = 0, $recursion
return $text;
}
} else {
return "[[" . $parser->getTitle()->getPrefixedText() . "]]" . "<!-- WARNING: LST loop detected -->";
$title = Title::castFromPageReference( $parser->getPage() );

Check warning

Code scanning / Phpmd (reported by Codacy)

Static access leads to hard to test code

Avoid using static access to class '\Title' in method 'parse'.
return "[[" . $title->getPrefixedText() . "]]" . "<!-- WARNING: LST loop detected -->";
}
}

Expand Down Expand Up @@ -708,7 +705,7 @@ public static function includeTemplate( $parser, Lister $lister, $dplNr, $articl
}
} else {
// put a red link into the output
$output[0] = $parser->preprocess( '{{' . $defaultTemplate . '|%PAGE%=' . $page . '|%TITLE%=' . $title->getText() . '|%DATE%=' . $date . '|%USER%=' . $user . '}}', $parser->getTitle(), $parser->getOptions() );
$output[0] = $parser->preprocess( '{{' . $defaultTemplate . '|%PAGE%=' . $page . '|%TITLE%=' . $title->getText() . '|%DATE%=' . $date . '|%USER%=' . $user . '}}', $parser->getPage(), $parser->getOptions() );
}

unset( $title );
Expand Down Expand Up @@ -757,7 +754,7 @@ public static function includeTemplate( $parser, Lister $lister, $dplNr, $articl
}

$argChain .= '|%DATE%=' . $date . '|%USER%=' . $user . '|%ARGS%=' . str_replace( '|', '§', preg_replace( '/[}]+/', '}', preg_replace( '/[{]+/', '{', substr( $invocation, strlen( $template2 ) + 2 ) ) ) ) . '}}';
$output[++$n] = $parser->preprocess( $argChain, $parser->getTitle(), $parser->getOptions() );
$output[++$n] = $parser->preprocess( $argChain, $parser->getPage(), $parser->getOptions() );
}
break;
}
Expand Down
Loading