From 84276905bca3170e5b4b42adf6cf881573a6f15a Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Wed, 16 Feb 2022 19:31:35 -0500 Subject: [PATCH] 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 --- includes/Description2.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Description2.php b/includes/Description2.php index 8bb1ab6..4b6ed1a 100644 --- a/includes/Description2.php +++ b/includes/Description2.php @@ -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' ); }