Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Forum Module

Discuss the Forum Module.

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

Forum Trunk API Changes


Reply

19 Posts   4814 Views

Avatar
mattclegg

14 May 2010 at 1:16pm (Last edited: 15 May 2010 12:32am), Community Member, 56 Posts

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

Avatar
Kalileo

15 May 2010 at 12:27am Community Member, 127 Posts

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

Avatar
drye

15 May 2010 at 12:31am Community Member, 49 Posts

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!