Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


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

th3hamm0r opened this Issue · 3 comments

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:

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

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


Working on this now.


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 wilr referenced this issue from a commit in dnadesign/silverstripe-cms
@wilr wilr FIX ensure controller stack is updated when execution halted by an ex…

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.