Thank you so much, I wish *paid* support was as fast as you are.
I don't think it "fails", it's just doing what's it's programmed to do, but in my opinion it's extremely nasty for end users. They get lost at "blank pages with cryptic error messages" and ultimately leave the shopping.
Basically, let's see if I understand the
domain of the issue:
- OC comes with a functional, own 404 page.
- OC may enable SEO URLs.
- OC SEO URLs and own 404 don't cohexist and a blank page with ugly error message is shown.
I don't know whether it's by OC wanted design or by OC "bad" design or if it's an OE introduced issue.
Where it fails it's easy to see with a debugger.
Let's start from the main index.php. I am passing a demonstration, not existant URL:
http://www.domain.tld/99-bears .
Towards the end of the file there's some code that implements what I think it's one of the least known (yet awesome) OC features: the ability to "push" pre-actions and queue actions.
2014-07-03 11_22_42-Index.png (41.91 KiB) Viewed 5330 times
First a pre-action implementing the SEO URL controller is added (1), then the maintenance page (2) and finally the "real" page we want is scheduled to be processed by specifying it in the action (3).
What I'd expect is that the next line, the dispatch, would process the pre-actions, then the action and if the page is not found, it'd calle the specified second parameter (error/not_found.php).
This easily happens when OC has no SEO URL enabled, but when SEO URLs are enabled it implies the URL omitted the "route=" parameter and takes the bad SEO URL as it was a controller instead of just a missing page.
In fact, going ahead with the debugging, we go to factory.php's newAction and see that the "route" being added is indeed our willingly typed (for demonstration purposes) wrong URL:
2014-07-03 11_35_05-newAction.png (9.29 KiB) Viewed 5330 times
What happens next, the program flow goes to factory.php where there's this code:
2014-07-03 11_41_30-factory.png (23.26 KiB) Viewed 5330 times
As it's easily seen, it's building a "convention over configuration" URL consisting of a wannabe controller... but we got our 99-bears in it!
Therefore the next:
Code: Select all
if (file_exists( $file ) && is_file( $file ))
fails and then the control goes to:
Code: Select all
$i = strrpos( $route, '/' );
if ($i===FALSE) {
trigger_error("Cannot find controller class file for route '$route'");
exit;
}
where $i of course is FALSE and thus shows the awful blank page with error.
Now, all of this is behaving "as expected", in the sense that there's not a real code bug.
Yet on a macro scale, an end user who for any reason gets a typoed URL (or just an old Google result for a decommissioned product) or anything, he gets the ugly blank page instead of the "internet specifications correct page for when and URL is not found", that is the "graceful" OC 404 page.
I also see a "disconnect" in how the error code is managing the flow, because I'd expect something along the lines of code "failing in a graceful way" so that it returns to index.php and executes the "error/not_found" controller.
I hope to have been clear, if you still need credentials and stuff... I think the ones I gave you some time ago are still active for you.
Best regards and thanks for your patience!