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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Forum Module /

Discuss the Forum Module.

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

Forum Trunk API Changes


Go to End


19 Posts   6125 Views

Avatar
mattclegg

Community Member, 56 Posts

14 May 2010 at 1:16pm

Edited: 15/05/2010 12:32am

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

Community Member, 127 Posts

15 May 2010 at 12:27am

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

Avatar
drye

Community Member, 49 Posts

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!

Go to Top