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.

All other Modules /

Discuss all other Modules here.

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

Diary Module Problem with Previous/Next month

Go to End

3 Posts   1937 Views


Community Member, 15 Posts

7 April 2009 at 6:36am

I'm not sure if this should be in this forum or the widget forum but here goes.

I wondered if anyone else had the same problem and found a a solution.

When I press on the "Previous" or "next" to change the month of the diary widget I get an error:

[Notice] Use of undefined constant month - assumed 'month'
GET /silverstripe/my-diary/setMonth/?month=1235862000&back=my-diary

Line 320 in C:\wamp\www\silverstripe\diary\code\DiaryHolder.php

311 		Session::set("EventType",$_GET['name']);
312 		$cal = DataObject::get_one('DiaryHolder');
313 		Director::redirect($cal->URLSegment . "/");
314 	}
316 	/*
317 	 * Set the month for the calendar widget
318 	 */
319 	function setMonth(){
320 		Session::set("CalMonth",(int)$_GET[month]);
321 		Director::redirect($_GET['back']."/");
322 	}
324 	/*
325 	 * Events RSS Feed Link
326 	 */


    * DiaryHolder_Controller->setMonth(HTTPRequest)
      Line 162 of Controller.php
    * Controller->handleAction(HTTPRequest)
      Line 107 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
      Line 19 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
      Line 262 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
      Line 106 of Director.php
    * Director::direct(/my-diary/setMonth/)
      Line 115 of main.php


Community Member, 15 Posts

20 April 2009 at 7:00pm

Edited: 20/04/2009 7:02pm

I contacted the module's author and he gave me this fix, which worked.

it seems like a little bug which fires on your server, it is WAMP I think.

anyway to prevent it replace the line number 320 with the following.



Community Member, 400 Posts

29 April 2009 at 4:16am

Sorry for not being able to reply to this earlier, anyway thanka Varberg for posting my solution on the forum.