New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error when a DS redirects to 404 #1539
Comments
I can't reproduce on a 2.3.1 install.
|
Neither can I. Also,
|
Yes
Just a plain 404 Page
No
No
5.3.13
644 Check out these links. First one doesn't exist. http://xandercms.mcas.ro/en/no-page-here/ This is a page with a |
Does the error exist without the Language Redirect extension? |
I don't have Language Redirect. I'm using Frontend Localisation. It doesn't redirect like the former did. |
Regardless, does the error persist with the extension disabled? Just trying to see if there is a conflict. |
You don't happen to have that DS attached to the 404 page as well do you? Looking at the database query log it looks like the 404 page is found correctly, but then the DS is executed again. |
bump |
Will check tomorrow (around 9:00 AM GMT). I don't have file access at the moment. |
I stumbled on the same error and it happened when I had the same |
And to completely recreate the scenario, the reason that DS failed was because URL parameters were not passed to the DS when the original 404 occurred.
Possible solution suggested by @creativedutchmen was to pass the whole path to the 404 page anyway so the It'd work, but it could get pretty messy very quickly. Consider if you had a URL What if we just caught the recursion? |
I vote for just catching the recursion. |
@brendo the reason to suggest the parameters to be added to the 404 page is to be able to tailor 404 pages for different pages. For instance, a 404 because a blog post was not found could show similar posts, while a 404 on an author profile could show related authors. I initially misunderstood the problem, I thought this was what he wanted to achieve. So I agree it is not a solution to the recursion. However, having the URL information in the XML could be very useful. edit: ah, yes, ofcourse Nils beat me to it... |
In case of my situation of this error, I wanted to take care only about one, content returning, DS. But the scenario-based 404 (e.g. blog, products etc.) sounds very interesting. I try to add: Ok, besides catching the recursion, what about to delegate the page's original params to the 404 page by Symphony's functions (e.g. The URL of 404 page would stay the same as the original page URL - which is nice that way - and wouldn't have to be further processed. Edit: The former URL in XML is fine. |
Well, its kind of weird to recreate those params, if they did not returned anything before ... but the developer could do some proper action with that I guess ... or maybe its silly ... nah, sorry, thinking aloud :/ Anyway, I am sure you do the right thing :) |
So while fixing this issue tonight I noticed something. If you are redirected from a page that throws a 404, the |
Ok, a debrief:
Any ideas? |
That sounds to me as if you resolved everything that needed to be resolved. |
Almost, but those who are using Datasources on their 404 page that throw 404's will still be in a spot. At the moment I can't think of a solution for this scenario. We 'could' look to see if a recursive exception has been set, and conditionally throw the |
My 2 cents: If you need "highly customized" 404 pages, you can still use normal pages and build an extension to set a 404 header for these pages under certain conditions. |
Good point, maybe I'm overthinking it :) And FYI, the original issue in the first post has been resolved, the |
What about only enabling the Data Source redirection on normal pages, not on error pages. I doesn't make sense to redirect to a 404 page when you are already on it – so I would catch this case in the Data Source class before the actual recursion happens.* We could then notify the developer about the attempt to redirected to the error page in the Symphony logs. Something like:
* Something like |
[2.3.1] I have a Datasource that will redirect to 404 if no entries found and Symphony throws a fatal error:
http://postimage.org/image/s2b99jtyz/
Ideas?
The text was updated successfully, but these errors were encountered: