Jump to:

3372 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Week

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

Page: 1 2
Go to End
Author Topic: 1972 Views
  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Week Link to this post

    well calling $this->seminardate before the object has written could be the issue as that function is run 'before' you save your object, so $this->seminardate may not exist. You might have to use onAfterWrite to update it instead

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: Week Link to this post

    It leads to no js error but does not write at all

    Victor

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Week Link to this post

    ah well of course im guessing issue there is of course you can calling this function 'after' the write - the write saves it to the database, so can you see the problem you need to call write() so it updates it in the afterWrite - but that calls afterWrite which calls write again and we loop on and on!

    Looking at some code, onBeforeWrite() might be what you want and I think the error was you are not calling parent::onBeforeWrite(); in that function at the end. Try that and see what happens

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: Week Link to this post

    Nivanka wrote:


    you can get the date from the dataobject which you create and add 7 days to it, and try to work with time epochs it will be the best,

    Thanks! I have seen it. It is too complicated for me so far. But at some moment I will look either diary or event_calendar and probably both

    Victor

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