- Status changed to Needs work
almost 2 years ago 6:53pm 7 February 2023 - πΊπΈUnited States cboyden
These patches are working on a Panopoly child distribution. However, there is an issue with the Behat test step.
Here's the new step that's being added to check that the GET parameter is empty when the system is set to use the path instead of query parameters:
/** * @Then /the (?i)get(?-i) argument "(?P<argument>[^"]*)" should match "(?P<value>[^"]*)"$/ */ public function getArgumentMatches($argument, $value) { $url = $this->getSession()->getCurrentUrl(); $query_string = parse_url($url, PHP_URL_QUERY); parse_str($query_string, $query); if (!isset($query[$argument])) { $query[$argument] = ''; } if ($query[$argument] !== $value) { throw new \Exception("GET argument '{$argument}' with value '{$query[$argument]}' doesn't match '{$value}'"); } }
And here's the scenario in the test that checks for it:
@api @panopoly_search Scenario: Performing a search with results Given I am on the homepage And I run drush "vdel" "panopoly_search_keys_mode -y" And "panopoly_test_page" content: | title | body | created | status | | fxabR86L Page 1 | Test page 1 | 01/01/2001 11:00am | 1 | | fxabR86L Page 2 | Test page 2 | 01/02/2001 11:00am | 1 | | X9A1YXwc Page 3 | Test page 3 | 01/03/2001 11:00am | 1 | And I run drush "cron" When I fill in "fxabR86L" for "Enter your keywords" in the "Search" region And I press "Search" in the "Search" region Then I should see "Search Results" And I should see "2 items matched fxabR86L" And I should see "Filter by Type" And I should not see "X9A1YXwc" And the URL should match "/search/site/fxabR86L$" And the GET argument "search" should match ""
The problem is that in PHP 8.1, the test code hits a runtime error:
8192: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /panopoly_test/behat/steps/panopoly_test.behat.inc line 1165
It looks like we either need a separate test step to check that a GET parameter is missing, or we need to do something different if there are no query string parameters at all, or if the one we're checking for is missing.
- Status changed to Needs review
almost 2 years ago 9:24pm 8 February 2023 - πΊπΈUnited States dsnopek USA
Here's a patch that fixes the PHP error in my testing.
-
dsnopek β
committed 1c9645a5 on 7.x-1.x
Issue #3300552 by dsnopek: Allow search keywords in GET arguments (...
-
dsnopek β
committed 1c9645a5 on 7.x-1.x
- Status changed to Fixed
about 1 year ago 11:47pm 28 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.