- Issue created by @adrianopulz
- Assigned to Shreya_98
- Issue was unassigned.
- Status changed to Needs review
11 months ago 5:30am 26 October 2023 - ๐ฎ๐ณIndia Shreya_98
Hi @adrianopulz,
I have fixed this issue and also created MR for this issue . please replace The 'internal:/' URL is a reference to the internal path '/', which typically represents the homepage of your Drupal site. In other words, it's setting the fallback URL to the site's homepage.Thank you!
- ๐ง๐ทBrazil adrianopulz Florianรณpolis
Thanks for your fork @shreya_th!
The problem is for URLs created from the Request, URLs from the route will not be a problem. You added try/catch to the URL created from the route when the display['display_options']['path'] is set. We need the fallback only in the createFromRequest() call.
I've added a patch with the change example. I don't think we need to change the block of code using the UrlFromRoute.
- Status changed to Needs work
5 months ago 7:59pm 10 April 2024 - Status changed to Postponed: needs info
5 months ago 12:48pm 22 April 2024 - ๐บ๐ธUnited States smustgrave
That snippet of code has been removed in another fix. Can you confirm this is still an issue.
- Status changed to Closed: outdated
4 months ago 3:07pm 22 May 2024 - Status changed to Needs work
2 months ago 10:57am 3 July 2024 - ๐ณ๐ฑNetherlands Johan den Hollander
Hate to be reopening this issue, but the issue is still there using the latest 7.x release.
We worked around the issue for now by modifying the code to be as follows:
use Symfony\Component\Routing\Exception\ResourceNotFoundException; protected function getExposedFormActionUrl(FormStateInterface $form_state): Url { $request = \Drupal::request(); try { $url = Url::createFromRequest(clone $request); $url->setAbsolute(); return $url; } catch (ResourceNotFoundException $e) { return Url::fromRoute('<front>')->setAbsolute(); } }
A patch will follow, I expect this code needs some better attention.
- ๐จ๐พCyprus Alex Bukach
Alex Bukach โ made their first commit to this issueโs fork.
- Status changed to Needs review
2 months ago 6:31pm 3 July 2024 - Status changed to Needs work
2 months ago 1:02am 4 July 2024 - ๐บ๐ธUnited States smustgrave
MR should be against 7.0.x but letโs add test coverage also
- Status changed to Postponed: needs info
10 days ago 12:02am 29 August 2024 - ๐บ๐ธUnited States smustgrave
Could the steps be flushed out.
I added a view block that's used better exposed filters to 404 page and not getting any error.
On 10.3
- ๐จ๐ญSwitzerland idflood
I've got the same issue. I've defined a global "search" exposed form in block, which is added to the header of the website. Then on all 404 pages it shows the same error.
I've tried the patch in #12 and it went nicely, even if I'm still using the 6.x version. The patch fixed the issue, at least there is now no more errors.