Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » url_handlers problem

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2149 Views
  • joern
    Community Member
    28 Posts

    url_handlers problem Link to this post

    I play something with the url_handlers and I have a problem…
    I get the following error when I test my URLs:

    [User Warning] popCurrent called on ModelAsController controller, but it wasn't at the top of the stack
    GET /explore/record-name/comments/add/12/?flush=1
    Line 454 in /sapphire/core/control/Controller.php

    /explore/record-name/ -> class Record extends Page

    in Record_Controller:

    public static $url_handlers = array(
        ''   => 'index' // works
       ,'comments' => 'showComments' // works
       ,'POST comments/$Action' => 'commentAction'
       ,'comments/$Action/$ID' => 'editComment'

    I try to access the following urls:
    /explore/record-name/comments => with index
    /explore/record-name/comments/add => commentAction
    /explore/record-name/comments/edit/$ID => editComment
    /explore/record-name/comments/delete/$ID => editComment

    I hope you can help me…

    I have almost forgotten. I use silverstripe 2.4 beta

  • Wade
    Community Member
    6 Posts

    Re: url_handlers problem Link to this post

    Don't know if you still need help with this but I had the same problem with my url handlers.

    I finally found that i had forgotten to add the methods to the allowed actions list.

  • moloko_man
    Community Member
    72 Posts

    Re: url_handlers problem Link to this post

    Not sure if this is the same problem as I'm having, but I'm trying to do a similar thing with the URL. However, I want to have domain.com/myPage/show/ID/otherID/itemID
    it could go one or two more deeper, but I'm just trying to get the $ItemID part figured out.

    @Wade, how did you end up using the allowed actions list?


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.