From 84b30a493a5b3c6543d2f3f30398517144d96f92 Mon Sep 17 00:00:00 2001 From: Bertrand Gorge Date: Wed, 24 Jun 2026 14:45:09 +0200 Subject: [PATCH] Fixed issue #28 - makes sure that base query is fully expanded even when it uses template parameters --- src/SearchEngineConfig.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SearchEngineConfig.php b/src/SearchEngineConfig.php index c9d064c..25f12d5 100644 --- a/src/SearchEngineConfig.php +++ b/src/SearchEngineConfig.php @@ -192,9 +192,9 @@ public static function newFromParameters( Parser $parser, PPFrame $frame, array // This is a "facet property", since its key is not a valid search parameter $facet_properties[] = $parameter_value; } elseif ( $key === "base query" ) { - // The "base query" needs special handling, because it may contain wikitext that should only be parsed - // when the search is loaded. - $expanded_value = $frame->expand( $parameter, PPFrame::RECOVER_ORIG ); + // The "base query" is fully expanded at config-store time so that template arguments + // (e.g. {{{Query|default}}}) are resolved to their actual passed values. + $expanded_value = $frame->expand( $parameter ); $search_parameters["base query"] = explode( '=', $expanded_value, 2 )[1] ?? ''; } else { // This is a "search term parameter"