Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Patched newsletter module (for 2.4.2)

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 2590 Views
  • sebastiankozub
    Avatar
    Community Member
    40 Posts

    Re: Patched newsletter module (for 2.4.2) Link to this post

    I install the patch and it helped in Admin and I can see saved newsletter now, but still can't subscribe from subscription form on Subscribtion Page. I stiill get user_error("DataObject::get_by_id passed a non-numeric ID #$id", E_USER_WARNING);

  • dendeffe
    Avatar
    Community Member
    135 Posts

    Re: Patched newsletter module (for 2.4.2) Link to this post

    Yeah, it's not perfect and there are some problems with the signup forms. The quickest way around that is probably building a custom form/function…

    Are you using the rc version from SVN? That fixes most things I fixed and probably some other things as well.

    I'm going to use a small custom-built SS-newsletter system at the moment. Mainly because the Newsletter module uses Member and this gives troubles when a subscriber is on more than one newsletter.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Patched newsletter module (for 2.4.2) Link to this post

    I think de-coupling from the member record is perfect. I've just added a user type that the only decoration on the member is a has_one to the data.

  • moloko_man
    Avatar
    Community Member
    72 Posts

    Re: Patched newsletter module (for 2.4.2) Link to this post

    I'm running 2.4.3 and downloaded the "Latest trunk build" Newsletter module #114346 and I'm also getting the wonderful User Warning error "[User Warning] DataObject::get_by_id passed a non-numeric ID #1"

    I only receive it when I submit the form to register for the newsletter. I have custom built the form and the trace is saying its the following line thats the problem:

    $member->Groups()->add($group);

    I guess I'm wondering if this problem was fixed and I downloaded an older module, or if I'm pulling in the group wrong.

    Here is my form action:

    function SignUpAction($data, $form) {
          // check to see if they have signed up already
          $defaultGroupID = 4;
          $member = new Member();
          $form->saveInto($member);
          if(DataObject::get_one('Member', "Email = '". $member->getField("Email") ."'")) {
             // email exists don't let them sign up again
             Director::redirect('email-exists');
          } else {
             // sign them up
             //print_r($data);
             $member->write();
             if($group = DataObject::get_one('Group', "ID = $defaultGroupID")) {
                $member->Groups()->add($group);
                Director::redirect('thank-you');
             } else {
                Director::redirect('registration-error');
             }
          }
       }

  • moloko_man
    Avatar
    Community Member
    72 Posts

    Re: Patched newsletter module (for 2.4.2) Link to this post

    I moved $member->write(); into the if($group =...) statement and cleaned up my code and everything works now.
    Not sure what it was exactly but its working nicely now.

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