- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
At this time we will need a D10 version of the patch please.
Did not code review.
- 🇦🇺Australia mstrelan
I'm not entirely convinced about this, it seems like it could be disruptive. Here's my two cents:
-
+++ b/core/lib/Drupal/Component/Utility/UrlHelper.php @@ -50,7 +50,7 @@ public static function buildQuery(array $query, $parent = '') { - elseif (!isset($value)) { + elseif (!isset($value) || strlen($value) == 0) {
We should use a strict comparison here, either
strlen($value) === 0
or$value === ''
. -
+++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -423,7 +423,7 @@ private function verifyLinkEscaping() { - $this->assertSession()->responseContains($link); + $this->assertRaw($link->__toString());
assertRaw is deprecated
-
+++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -495,7 +495,7 @@ private function doUser() { - $this->assertSession()->pageTextContains($message); + $this->assertRaw($message->render());
Same again here.
-
+++ b/core/modules/search/tests/src/Functional/SearchBlockTest.php @@ -93,7 +93,7 @@ public function testSearchFormBlock() { - Url::fromRoute('search.view_' . $entity_id, [], ['query' => ['keys' => $terms['keys']], 'absolute' => TRUE])->toString(), + Url::fromRoute('search.view_' . $entity_id, [], ['query' => ['keys' => ''], 'absolute' => TRUE]) . '=',
Are we losing coverage for something else here?
-
+++ b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php @@ -99,7 +99,7 @@ public function testBasicPagination() { - $this->assertEquals('?status=All&type=All&langcode=All&items_per_page=5&order=changed&sort=asc&title=&page=2', $link->getAttribute('href')); + $this->assertEquals('?status=All&type=All&langcode=All&items_per_page=5&order=changed&sort=asc&title&page=2', $link->getAttribute('href'));
This seems like an odd side effect. I'd think in this case you would want to either leave it as it was, or remove the empty query param.
-
+++ b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php @@ -24,6 +24,7 @@ public function providerTestBuildQuery() { + [['foo' => ''], 'foo', 'Simple parameters are properly added.'],
Why don't we explicitly mention empty strings here. Simply parameters is pretty meaningless.
-
- Status changed to Needs review
over 1 year ago 1:16pm 26 March 2023 - 🇮🇳India ameymudras
Fixing the test failure with above patch. But we still need to address #20 completely
The last submitted patch, 22: 3040048-22.patch, failed testing. View results →
- Status changed to Needs work
over 1 year ago 4:59am 13 April 2023 - 🇮🇳India sahil.goyal
for the comment 4 we are not losing any test coverage only expected URL is sufficient to fix the failing test so, The = sign was removed because it caused the assertion to fail, but it did not affect the functionality being tested. other points mentioned in #20 has been addressed earlier.
- 🇺🇸United States luke.leber Pennsylvania
Added a related issue for a real issue encountered in contrib-land.
- 🇺🇸United States luke.leber Pennsylvania
Ugh...removed related issue -- noticed that it already exists in referencing issues. Need another coffee.
- First commit to issue fork.
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,265 pass, 1 fail - @sakthi_dev opened merge request.
- last update
over 1 year ago 29,228 pass, 3 fail - last update
over 1 year ago 29,282 pass, 1 fail - last update
over 1 year ago 29,282 pass, 1 fail - Status changed to Needs review
over 1 year ago 2:21pm 19 April 2023 - 🇮🇳India sakthi_dev
Url::fromRoute() was generating = if empty query key is passed.
$this->assertEquals( $this->getUrl(), Url::fromRoute('search.view_' . $entity_id, [], ['query' => ['keys' => $terms['keys']], 'absolute' => TRUE])->toString(), 'Submitted to correct URL.' );
Please review.
- Status changed to Needs work
over 1 year ago 2:25pm 21 April 2023 - 🇺🇸United States smustgrave
MR has a valid test failure.
Issue summary also needs some updating. What's the proposed solution.
- First commit to issue fork.
- 🇮🇳India sakthi_dev
@smustgrave, Could you please suggest what can be done here?
$terms = ['keys' => '']; $this->drupalGet(''); $this->submitForm($terms, 'Search'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusMessageContains('Please enter some keywords', 'error'); // Confirm that the user is redirected to the search page, when form is // submitted empty. $this->assertEquals( $this->getUrl(), Url::fromRoute('search.view_' . $entity_id, [], ['query' => ['keys' => ''], 'absolute' => TRUE])->toString(), 'Redirected to correct URL.' );
This test case is getting failed as we are passing the search term as empty. Here the search works on the GET request like ?filter='test' as the test case is passing the empty terms to query by default it takes ?keys=. Could you please suggest what am I missing here?