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);
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.
- Previous 10 entries
- 1
- 2
- Page 33(current)
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.
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.
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');
}
}
}
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.
- Previous 10 entries
- 1
- 2
- Page 33(current)