- Issue created by @dburiak
- Status changed to Needs review
over 1 year ago 7:34am 31 March 2023 - Status changed to Needs work
over 1 year ago 7:20pm 31 March 2023 - ๐บ๐ธUnited States smustgrave
Could you provide a test-only patch showing the issue?
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Third issue from the security code.
Another reason to handle mild information disclosure in public
- ๐ฌ๐งUnited Kingdom catch
The front page shouldn't be a 404, so why does it not have a route match here?
- ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
+++ b/core/modules/language/src/Plugin/Block/LanguageBlock.php (date 1680247911739) @@ -87,7 +87,7 @@ - $url = $route_match->getRouteObject() ? Url::fromRouteMatch($route_match) : Url::fromRoute('<front>'); + $url = $route_match->getRouteObject() && !$this->pathMatcher->isFrontPage() ? Url::fromRouteMatch($route_match) : Url::fromRoute('<front>');
I think the ternary here is getting too complicated and needs more documentation.
So something like:
if ($this->pathMatcher->isFrontPage() || !$route_match->getRouteObject()) { // If on front page or there is no route match, for example when creating // blocks on 404 pages for logged-in users with big_pipe enabled, use the // front page. $url = Url::fromRoute('<front>'); } else { $url = Url::fromRouteMatch($route_match); }
would be easier to reason about.
- ๐ฌ๐งUnited Kingdom catch
Let's update the comment to explicitly say that we're skipping the route match both on 404s and the front page.
- First commit to issue fork.
- @mahima_mathur23 opened merge request.
- Status changed to Needs review
over 1 year ago 7:00am 7 April 2023 - ๐บ๐ธUnited States smustgrave
Was previously tagged for tests which still need to happen.
- Status changed to Needs work
over 1 year ago 11:55am 18 April 2023 - ๐ฏ๐ตJapan umekikazuya
Patch #2 ๐ [regression] Language switcher block returns links to node on the frontpage Fixed has been confirmed to be working properly on Version 9.5.7."
- ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
Was previously tagged for tests which still need to happen.
Here is the test-only patch showing the issue.
Without patching, the test will fail of cause.
- last update
over 1 year ago 30,322 pass - Status changed to Needs review
over 1 year ago 12:53pm 24 April 2023 - last update
over 1 year ago 30,316 pass, 1 fail - ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
The #16 test patch missed one line for calling the test function.
Here is the new patch. The last submitted patch, 18: drupal-3351458-18.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 2:09pm 3 May 2023 - ๐บ๐ธUnited States smustgrave
@Mingsong thanks for the tests but it helps to prepend tests-only to the end of the patches.
But we also need a full patch or MR to show the fix works on the tests.
Will need an issue summary update as the last MR doesn't match the proposed solution.
- ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
Thanks @Stephen,
I don't have the permission to commit or rebase the MR branch. We need someone can do that to move things forward.
- ๐บ๐ฆUkraine dburiak
The summary is updated. Also, the full patch is attached.
- Status changed to Needs review
over 1 year ago 7:40am 16 May 2023 - last update
over 1 year ago 30,328 pass, 1 fail The last submitted patch, 23: 3351458.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 11:55pm 16 May 2023 - ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
#23 patch test failed, due to 'subdirectory' multiple site.
1) Drupal\Tests\language\Functional\LanguageSwitchingTest::testLanguageBlock
The anchors have the correct attributes that will link to the correct home page in that language.
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
0 => Array &1 (
'hreflang' => 'en'
'data-drupal-link-system-path' => ''
- 'href' => '/'
+ 'href' => '/subdirectory/'
)
1 => Array &2 (
'hreflang' => 'fr'
'data-drupal-link-system-path' => ''
- 'href' => '/fr'
+ 'href' => '/subdirectory/fr'
)
)/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:79
/var/www/html/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php:160
/var/www/html/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php:86 - last update
over 1 year ago 30,335 pass, 1 fail - last update
over 1 year ago 30,335 pass, 1 fail - ๐ฎ๐ณIndia harpreet16
I tried running the LanguageSwitchingTest test on local using command vendor/bin/phpunit modules/language/tests/src/Functional/LanguageSwitchingTest.php but couldn't get the error as indicated in the test failure for patch added in #23 ๐ [regression] Language switcher block returns links to node on the frontpage Fixed . Instead I am getting 1 failure as follows with Drupal 9.5.7, PHP 8.1.18 & MYSQL 5.7.41:
1) Drupal\Tests\language\Functional\LanguageSwitchingTest::testLanguageBlock
The language links labels are in their own language on the language switcher block.
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
Array &0 (
0 => 'English'
- 1 => 'franรยงais'
+ 1 => 'franรงais'
)/opt/drupal/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/opt/drupal/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:79
/opt/drupal/web/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php:161
/opt/drupal/web/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php:86
/opt/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728Could someone help me with how to replicate this. However the functionality works fine with the patch.
- ๐ซ๐ฎFinland sthomen
Something must have mangled the encoding for the patch in #23. When I fixed the cedilla'd c (and finally figured out how to run functional tests) in my local copy of the patch file, everything passed.
I've attached my fixed patch file, and hopefully it won't get mangled again.
- last update
over 1 year ago 29,441 pass, 1 fail - ๐น๐ญThailand AlfTheCat
I'm using a node as front page on D10 and it's throwing 404 errors when switching languages on the homepage.
This is a 9.x issue, should people subscribe here for a D10 fix too?
Also, should this not be a major issue since it's breaking homepages in many cases?
Thanks!
- Status changed to Needs review
about 1 year ago 5:55pm 25 October 2023 - Status changed to Needs work
about 1 year ago 6:59pm 25 October 2023 - ๐บ๐ฆUkraine dburiak
The doTestHomePageLinks test method is updated to fix the subdirectory multisite case for the PHPUnit testing run.
- last update
about 1 year ago 29,686 pass - Status changed to Needs review
about 1 year ago 4:45pm 16 November 2023 - ๐บ๐ธUnited States smustgrave
can you include an interdiff of the change you made please.
- last update
about 1 year ago 30,573 pass - ๐บ๐ธUnited States smustgrave
Triggering tests for 11.x as that's the main development branch,
Hiding older patches.
- Status changed to RTBC
about 1 year ago 4:30pm 17 November 2023 - ๐บ๐ธUnited States smustgrave
Highlighted in the IS the fix is in the patch, but just FYI it's encouraged going forward that all fixes should be an MR as patches are being phased out.
4:12 34:12 Running- last update
about 1 year ago 30,341 pass - Status changed to Fixed
about 1 year ago 9:42am 20 November 2023 - ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
Committed and pushed 9e7ff4623a to 11.x and 2ebbc8a1bf to 10.2.x. Thanks!
-
alexpott โ
committed 9e7ff462 on 11.x
Issue #3351458 by dburiak, Mingsong, Mahima_Mathur23, sthomen,...
-
alexpott โ
committed 9e7ff462 on 11.x
-
alexpott โ
committed 2ebbc8a1 on 10.2.x
Issue #3351458 by dburiak, Mingsong, Mahima_Mathur23, sthomen,...
-
alexpott โ
committed 2ebbc8a1 on 10.2.x
Automatically closed - issue fixed for 2 weeks with no activity.