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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Patched newsletter module (for 2.4.2)


Go to End


21 Posts   4178 Views

Avatar
sebastiankozub

Community Member, 59 Posts

5 November 2010 at 7:19am

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);

Avatar
dendeffe

Community Member, 135 Posts

5 November 2010 at 7:33am

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.

Avatar
swaiba

Forum Moderator, 1899 Posts

5 November 2010 at 7:43am

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.

Avatar
moloko_man

Community Member, 72 Posts

22 December 2010 at 10:22am

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');
			}
		}
	}

Avatar
moloko_man

Community Member, 72 Posts

23 December 2010 at 6:11am

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.

Go to Top