Skip to content

Commit

Permalink
fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-topway-it authored Mar 19, 2024
1 parent 2049d8c commit 9c3d99c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/GeoJsonPages/GeoJsonContentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@ protected function fillParserOutput(
'@phan-var GeoJsonContent $content';
// this method won't be called below MW_VERSION 1.38

if ( $cpoParams->getGenerateHtml()
&& $content->isValid()
&& MapsFactory::globalInstance()->smwIntegrationIsEnabled() ) {
if ( $cpoParams->getGenerateHtml() && $content->isValid() ) {

// display map
( GeoJsonMapPageUi::forExistingPage( GeoJsonContent::formatJson( $content->getData()->getValue() ) ) )
->addToOutput( OutputFacade::newFromParserOutput( $parserOutput ) );

// @FIXME alternatively decode $this->mText in GeoJsonLegacyContent
// to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson
$text = json_encode( $content->getData()->getValue() );
if ( MapsFactory::globalInstance()->smwIntegrationIsEnabled() ) {
// @FIXME alternatively decode $this->mText in GeoJsonLegacyContent
// to avoid decoding it again in SubObjectBuilder -> getSubObjectsFromGeoJson
$text = json_encode( $content->getData()->getValue() );

MapsFactory::globalInstance()
->newSemanticGeoJsonStore( $parserOutput, $cpoParams->getPage() )
->storeGeoJson( $text );
MapsFactory::globalInstance()
->newSemanticGeoJsonStore( $parserOutput, $cpoParams->getPage() )
->storeGeoJson( $text );
}

} else {
parent::fillParserOutput( $content, $cpoParams, $parserOutput );
Expand Down

0 comments on commit 9c3d99c

Please sign in to comment.