I have a site configured with 2 languages (Portuguese, Brazil and Spanish) and domain as language selector.
If I leave blank the 404 page, it doesn't work correctly, system throw me this error:
El sitio web encontró un error inesperado. Vuelva a intentarlo más tarde. (Unexpected error.)
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /http://public.local.site.com/system/404" in Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest() (line 159 of vendor/symfony/http-kernel/EventListener/RouterListener.php).
However, if I configure any corect path as 404 path, system run correctly.
If I disable language detection by domain, system run correctly too.
I attach 2 images with the configuration screenshot.
[I'm not sure if it's a system bug or a language bug or any others]
Comment | File | Size | Author |
---|---|---|---|
#12 | drupal-2649698-12-domain-language-404-test.patch | 6.47 KB | gapple |
#8 | drupal-2649698-8-domain-language-404.patch | 7.38 KB | gapple |
404_2.png | 38.24 KB | estoyausente | |
404page.png | 34.47 KB | estoyausente |
Comments
Comment #2
laxman.ghavte CreditAttribution: laxman.ghavte as a volunteer and at Faichi Solutions Pvt Ltd commentedComment #3
gappleThe problem occurs in
DefaultExceptionHtmlSubscriber::makeSubrequest()
, due to the value passed in viaUrl::fromRoute('system.404')->toString()
. With domain-based language negotiation the url is prefixed with the protocol + domain, which messes up this check:and results in a forward slash being prefixed to the absolute url.
Comment #4
gappleComment #5
Leksat CreditAttribution: Leksat at Amazee Labs commentedI just met this bug. #3 fixes it! And the code looks good.
Comment #6
estoyausenteFor me it's ok too. Code run nice and bug seems solved.
Comment #7
alexpottLooks like this should have an automated test to ensure we don't break this in the future.
Comment #8
gappleI used CustomPageExceptionHtmlSubscriberTest as a reference, and added a test for when the
url_generator
service returns an absolute URL.Comment #9
gappleComment #11
Leksat CreditAttribution: Leksat at Amazee Labs commentedThe buggy code was removed in #2595695: 4xx handling using subrequests: no longer able to vary by URL
Probably this issue can be closed now.
Comment #12
gappleLets try just the test, to make sure it's resolved and doesn't break in the future...
Comment #17
colorfulCoder CreditAttribution: colorfulCoder commentedTriaging this issue during Vienna 2017 with @Anna_Radulovski
Changing the version to 8.5.x-dev because all changes should be applied to 8.5.x and backported to 8.4.x. I got this advice from @realityloop.
Comment #18
anna.radulovski CreditAttribution: anna.radulovski commentedWe are working on this issue with @Emmezali.
There's no "brazilean" language, there's Brazilian Portuguese that can be chosen as Portuguese, Brazil.
We updated the issue summary accordingly.
Comment #19
colorfulCoder CreditAttribution: colorfulCoder commentedRetesting the patch on version 8.5.0 failed (as can be seen in comment #12.
This needs to be fixed before we can close this issue.
TO DO: fix patch so it runs without errors.
Comment #30
pameeela CreditAttribution: pameeela commentedIt's been confirmed this was fixed in #2595695: 4xx handling using subrequests: no longer able to vary by URL which also includes tests, so I'm closing this as a duplicate.