Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Diary Module Problem with Previous/Next month

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1564 Views
  • Varberg
    Avatar
    Community Member
    15 Posts

    Diary Module Problem with Previous/Next month Link to this post

    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
    Source

    311       Session::set("EventType",$_GET['name']);
    312       $cal = DataObject::get_one('DiaryHolder');
    313       Director::redirect($cal->URLSegment . "/");
    314    }
    315    
    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    }
    323    
    324    /*
    325     * Events RSS Feed Link
    326     */

    Trace

    * 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

  • Varberg
    Avatar
    Community Member
    15 Posts

    Re: Diary Module Problem with Previous/Next month Link to this post

    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.

    Session::set("CalMonth",(int)$_GET['month']);

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: Diary Module Problem with Previous/Next month Link to this post

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

    1564 Views
Page: 1
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.