From 4d27ac74aff1ca47db53510bf07e9d083635175b Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Sat, 23 May 2026 15:14:02 +0300 Subject: fix: correct Phase-0 findings from promotion PR review (3 issues) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. TestDouble signatures: indexExists() and getIndexStats() in VyOSElasticModernFulltextStorageEngineTestDouble were missing the nullable host parameter added in E7/E8, causing a PHP fatal on 'arc unit --everything'. 2. buildSpec() zero-query sort bug: the falsy check (!$query->getParameter('query')) incorrectly treats the string '0' as empty (PHP falsy), enabling date-sorted path for a real search term. Changed to explicit null/empty-string checks to match the existing must-clause guard on line 316. All 22 unit tests now pass. 🤖 Generated by [robots](https://vyos.io) --- src/engine/VyOSElasticModernFulltextStorageEngine.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php') diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php index 4c14ce0..7fc7fd7 100644 --- a/src/engine/VyOSElasticModernFulltextStorageEngine.php +++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php @@ -410,7 +410,8 @@ abstract class VyOSElasticModernFulltextStorageEngine ), ); - if (!$query->getParameter('query')) { + $sort_query_string = $query->getParameter('query'); + if ($sort_query_string === null || $sort_query_string === '') { $spec['sort'] = array( array('dateCreated' => 'desc'), ); -- cgit v1.2.3