Jump to:

1036 Posts in 810 Topics by 315 members

Forum Module

SilverStripe Forums » Forum Module » Forum Trunk API Changes

Discuss the Forum Module.

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

Page: 1 2 3
Go to End
Author Topic: 4761 Views
  • mattclegg
    Avatar
    Community Member
    56 Posts

    Re: Forum Trunk API Changes Link to this post

    Hey Kalileo drye,

    I was having the same trouble with subnested urls but wrote this fix;

       public function getForumThread() {
          if(preg_match('/(?!(show)(\/).*)([0-9].*)(?!(?).*)/', $_SERVER['REQUEST_URI'], $id))
             return DataObject::get_by_id("ForumThread", $id[0]);
          else
             return false;
       }

    Im sure there's probably a cleaner way of doing it using SS functions -but it seems to work ok as a fix for 2.4

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    Hi Matt, it wasn't me who has seen this problem, it was "drye" - but thanks anyway!

  • drye
    Avatar
    Community Member
    49 Posts

    Re: Forum Trunk API Changes Link to this post

    mattclegg,

    Thank you for the fix. I've not tried it yet, but will very soon. I wonder if Will is working on a fix as well or if he would be willing to incorporate this fix into the code base.

    Thanks again!

    4761 Views
Page: 1 2 3
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.