Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,12 @@ jobs:
strategy:
matrix:
include:
- mw: 'REL1_40'
php: 7.4
experimental: false
- mw: 'REL1_40'
php: 8.0
experimental: false
- mw: 'REL1_41'
php: 8.1
experimental: false
- mw: 'REL1_42'
php: 8.2
experimental: false
- mw: 'REL1_43'
php: 8.3
experimental: false
- mw: 'REL1_44'
php: 8.3
experimental: false
- mw: 'master'
php: 8.4
experimental: true
Expand Down Expand Up @@ -83,13 +74,11 @@ jobs:

- name: Run PHPUnit
run: php tests/phpunit/phpunit.php -c extensions/Maps
if: matrix.mw != 'REL1_43'

- name: Run PHPUnit with code coverage
run: |
php tests/phpunit/phpunit.php -c extensions/Maps --coverage-clover coverage.xml
bash <(curl -s https://codecov.io/bash)
if: matrix.mw == 'REL1_43'


# Psalm:
Expand Down
5 changes: 1 addition & 4 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
"type": "parserhook",

"requires": {
"MediaWiki": ">= 1.40.0",
"platform": {
"php": ">= 7.4"
}
"MediaWiki": ">= 1.43.0"
},

"AutoloadNamespaces": {
Expand Down
8 changes: 7 additions & 1 deletion src/GeoJsonPages/GeoJsonContentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Maps\MapsFactory;
use Maps\Presentation\OutputFacade;
use MediaWiki\Content\Renderer\ContentParseParams;
use MediaWiki\Title\Title;
use ParserOutput;

class GeoJsonContentHandler extends \JsonContentHandler {
Expand Down Expand Up @@ -47,8 +48,13 @@ protected function fillParserOutput(
// to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson
$text = json_encode( $content->getData()->getValue() );

$subjectPage = $cpoParams->getPage();
if ( !$subjectPage instanceof Title ) {
// all underlying methods expect a Title, so cast it to one
$subjectPage = Title::newFromPageReference( $subjectPage );
}
MapsFactory::globalInstance()
->newSemanticGeoJsonStore( $parserOutput, $cpoParams->getPage() )
->newSemanticGeoJsonStore( $parserOutput, $subjectPage )
->storeGeoJson( $text );
}

Expand Down
Loading