Jump to:

5520 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Versioning the Member object

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

Page: 1
Go to End
Author Topic: 261 Views
  • MonkeyBen
    Avatar
    Community Member
    25 Posts

    Versioning the Member object Link to this post

    I have a SilverStripe website where I would like to keep track of changes to a members profile. If I add the Versioned extension to the Member class (well the CustomMember class) will that cause any problems to the the Members functions, e.g. login in, or viewing the admin section?

  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    Re: Versioning the Member object Link to this post

    I have no idea what side effects applying versioned to Member might cause.

    As an alternative I'd add an onAfterWrite instead that save the changes...

    public function onAfterWrite() {
       parent::onAfterWrite();

       $arrChanged = $this->getChangedFields(true,1);

       if (count($arrChanged)) {
          //create a MemberHistory log here?
       }
    }

  • MonkeyBen
    Avatar
    Community Member
    25 Posts

    Re: Versioning the Member object Link to this post

    That's the method the website is using at the moment, I'm just wondering if versioning would be cleaner and give an option of rolling back changes.

    261 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.