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:
C. Scott Ananian 2022-02-16 19:33:00 -05:00
parent 84276905bc
commit b269304773

View file

@ -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 );
}
}