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

Newsletter Module


Go to End


5 Posts   1170 Views

Avatar
voodoochile

Community Member, 52 Posts

23 November 2010 at 12:02pm

Hi All

i have been using the newsletter module for a couple of sites i am currently building, seems to be going ok on both sites.
on one of the sites i am using the subscription form so people can sign themselves up to receive the news letter.
when you submit the form i get the following back. DataObject::get_by_id passed a non-numeric ID #, when i go into the admin area the user has been created and is in a default group, i tried setting up a new group role etc and the submission is still put in a default group.
i'm suspecting that the form is not finding a newsletter type and group to associate the user to.
have i set this up wrong? can anyone help please?

Avatar
Willr

Forum Moderator, 5523 Posts

23 November 2010 at 9:27pm

Edited: 23/11/2010 9:27pm

Is this with the latest daily build of the newsletter? (http://silverstripe.org/assets/modules/trunk/newsletter-trunk-r113848.tar.gz)

If you're still having troubles with it register the bug over at open.silverstripe.org or email the module maintainer.

Also - do you have the full backtrace of that error you get, might make debugging easier.

Avatar
voodoochile

Community Member, 52 Posts

24 November 2010 at 11:57am

Hi Will

thanks for your reply, i guess i was short on info for you.
Using SS 2.4.2 with the latest daily build trunk-r113848 (have learnt to do this first) also read some other posts from a couple of weeks ago that resolved some questions but not this one.

here is the error complete

[User Warning] DataObject::get_by_id passed a non-numeric ID #
POST /newsletter/Form
Line 2924 in C:\Inetpub\mydomain\sapphire\core\model\DataObject.php

Source
2915 $tableClasses = ClassInfo::dataClassesFor($callerClass);
2916 $baseClass = array_shift($tableClasses);
2917 return DataObject::get_one($callerClass,"\"$baseClass\".\"ID\" = $id", $cache);
2918
2919 // This simpler code will be used by non-DataObject classes that implement DataObjectInterface
2920 } else {
2921 return DataObject::get_one($callerClass,"\"ID\" = $id", $cache);
2922 }
2923 } else {
2924 user_error("DataObject::get_by_id passed a non-numeric ID #$id", E_USER_WARNING);
2925 }
2926 }
2927
2928 /**
2929 * Get the name of the base table for this object
2930 */
Trace
DataObject::get_by_id passed a non-numeric ID #
Line 2924 of DataObject.php
DataObject::get_by_id(NewsletterType,)
Line 253 of SubscriptionPage.php
SubscriptionPage_Controller->doSubscribe(Array,Form,SS_HTTPRequest)
Line 300 of Form.php
Form->httpSubmission(SS_HTTPRequest)
Line 137 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 155 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
ModelAsController->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
Director::direct(newsletter/Form)
Line 127 of main.php

i hope this helps.

Avatar
Willr

Forum Moderator, 5523 Posts

24 November 2010 at 9:52pm

Just pushed another update (r114130) to newsletter trunk which fixed the ID issue on my end. Also tidied up some of the validation.

Could you try out that revision and let me know how you get on!

Avatar
voodoochile

Community Member, 52 Posts

25 November 2010 at 8:19pm

Great stuff Will

the new trunk solved the issue... thanks for your help on this