mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Description2
synced 2024-11-23 14:26:44 +00:00
ParserOutput::getPageProperty() now returns null when key is missing.
The return value of ParserOutput::getPageProperty() has transitioned to returning `null` instead of `false` when the page property is missing. Bug: T301915 Depends-On: Iaa25c390118d2db2b6578cdd558f2defd5351d15 Change-Id: I31d4115d75e080bb0177f30b2acf55ca2525a19d
This commit is contained in:
parent
84276905bc
commit
b269304773
|
@ -29,8 +29,7 @@ class Description2 {
|
|||
$parserOutput = $parser->getOutput();
|
||||
if ( method_exists( $parserOutput, 'getPageProperty' ) ) {
|
||||
// MW 1.38+
|
||||
// T301915
|
||||
if ( ( $parserOutput->getPageProperty( 'description' ) ?? false ) !== false ) {
|
||||
if ( $parserOutput->getPageProperty( 'description' ) !== null ) {
|
||||
return;
|
||||
}
|
||||
$parserOutput->setPageProperty( 'description', $desc );
|
||||
|
@ -113,12 +112,14 @@ class Description2 {
|
|||
// Export the description from the main parser output into the OutputPage
|
||||
if ( method_exists( $parserOutput, 'getPageProperty' ) ) {
|
||||
// MW 1.38+
|
||||
// T301915
|
||||
$description = $parserOutput->getPageProperty( 'description' ) ?? false;
|
||||
$description = $parserOutput->getPageProperty( 'description' );
|
||||
} else {
|
||||
$description = $parserOutput->getProperty( 'description' );
|
||||
if ( $description === false ) {
|
||||
$description = null;
|
||||
}
|
||||
}
|
||||
if ( $description !== false ) {
|
||||
if ( $description !== null ) {
|
||||
$out->addMeta( 'description', $description );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue