938 Posts in 271 Topics by 291 members
Forum Module
SilverStripe Forums » Forum Module » Forum Trunk API Changes
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | ||
| Author | Topic: | 3434 Views |
-
Re: Forum Trunk API Changes

14 May 2010 at 1:16pm Last edited: 15 May 2010 12:32am
Hey
Kalileodrye,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
-
Re: Forum Trunk API Changes

15 May 2010 at 12:27am
Hi Matt, it wasn't me who has seen this problem, it was "drye" - but thanks anyway!
-
Re: Forum Trunk API Changes

15 May 2010 at 12:31am
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!
| 3434 Views | ||
| Go to Top |


