Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Unhandled URL-path results in an user warning in ModelAsController #2467

Closed
th3hamm0r opened this Issue Sep 30, 2013 · 3 comments

Comments

Projects
None yet
5 participants

If you call call an action of a page with a long dir-path after the actual action, silverstripe throws a 404 error page (which is good), but also creates an user warning which spams the log.

We could reproduce this by calling the index-action of the home page, eg:
/home/index/test/test/test/test/test

Now we get following error:

[User Warning] popCurrent called on ModelAsController controller, but it wasn't at the top of the stack
GET /home/index/test/test/test/test/test

It looks like the line

return $this->httpError(404, "I can't handle sub-URLs of a $this->class object.");

in the RequestHandler::handleRequest() bypasses some important stack operations.

If we remove the "index/" path from the above URL, it does work.

@simonwelsh simonwelsh added the 3.1 label Mar 15, 2014

Contributor

mediabeastnz commented Jun 24, 2014

This is happening quite a lot on a few sites I manage.

Owner

wilr commented Jul 1, 2014

Working on this now.

Contributor

axllent commented Jul 1, 2014

Thanks Will. It would be good if that warning wasn't logged as an error on a live website for a simple 404. It just tends to spam the error log with non-relevant stuff as @th3hamm0r said.

wilr added a commit to dnadesign/silverstripe-cms that referenced this issue Jul 1, 2014

FIX ensure controller stack is updated when execution halted by an ex…
…ception.

See: silverstripe/silverstripe-framework#2467

popCurrent would be incorrectly not pop a controller from the controller stack if an exception was throw from inside the handleRequest() method.

This change captures the exception, ensures the controller is popped from the stack and passes the exception along.

@wilr wilr closed this Jul 1, 2014

@patricknelson patricknelson referenced this issue in dljoseph/silverstripe-maintenance-mode Oct 8, 2015

Closed

Error on when using DisableRedirect #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment