mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Description2
synced 2024-11-27 16:10:05 +00:00
Update uses of ParserOutput::getPageProperty() to handle new return value
The return value of ParserOutput::getPageProperty() will transition to returning `null` instead of `false` when the page property is missing. Bug: T301915 Change-Id: Id95dbdd427310e4e1cf40330b149adfe2b68f848
This commit is contained in:
parent
adc340542c
commit
84276905bc
|
@ -29,7 +29,8 @@ class Description2 {
|
|||
$parserOutput = $parser->getOutput();
|
||||
if ( method_exists( $parserOutput, 'getPageProperty' ) ) {
|
||||
// MW 1.38+
|
||||
if ( $parserOutput->getPageProperty( 'description' ) !== false ) {
|
||||
// T301915
|
||||
if ( ( $parserOutput->getPageProperty( 'description' ) ?? false ) !== false ) {
|
||||
return;
|
||||
}
|
||||
$parserOutput->setPageProperty( 'description', $desc );
|
||||
|
@ -112,7 +113,8 @@ class Description2 {
|
|||
// Export the description from the main parser output into the OutputPage
|
||||
if ( method_exists( $parserOutput, 'getPageProperty' ) ) {
|
||||
// MW 1.38+
|
||||
$description = $parserOutput->getPageProperty( 'description' );
|
||||
// T301915
|
||||
$description = $parserOutput->getPageProperty( 'description' ) ?? false;
|
||||
} else {
|
||||
$description = $parserOutput->getProperty( 'description' );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue