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.

All other Modules /

Discuss all other Modules here.

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

NewsletterRole/Newsletter Members


Go to End
Reply


11 Posts   2072 Views

Avatar
yurigoul

Community Member, 202 Posts

10 February 2010 at 2:08am

Edited: 10/02/2010 4:18am

EDIT3: You also have to change one HTTPRequest into a SS_HTTPRequest. Am back in business, try to put it life next and see how it holds

EDIT2: Sorry, the error persists, when you create a new newsletter draft it appears ok but opening it again creates the same error ... sorry no ninja php skills here

EDIT: this error only appeared before I changed all the references to Database:: after that it is ok - so far... isn't there a way to route all calls to Database:: to SS_Database:: in order to be able to use old modules?

Okay; some new errors when loading a template (error loading page). I am going through the code that is in the newsletter module, changed all the Database:: to SS_Database:: but so far no luck, must be other things that are interfering with it:

500//ERROR [User Warning]: DataObject::get_by_id passed a non-numeric ID #
IN POST /_waldner4/admin/newsletter/shownewsletter/1
Line 2832 in /Users/yurigoul/Sites/_waldner4/sapphire/core/model/DataObject.php

Source
======
2823:            $tableClasses = ClassInfo::dataClassesFor($callerClass);
2824:            $baseClass = array_shift($tableClasses);
2825:            return DataObject::get_one($callerClass,"\"$baseClass\".\"ID\" = $id", $cache);
2826:
2827:            // This simpler code will be used by non-DataObject classes that implement DataObjectInterface
2828:         } else {
2829:            return DataObject::get_one($callerClass,"\"ID\" = $id", $cache);
2830:         }
2831:      } else {
* 2832:         user_error("DataObject::get_by_id passed a non-numeric ID #$id", E_USER_WARNING);
2833:      }
2834:   }
2835:
2836:   /**
2837:    * Get the name of the base table for this object
2838:    */

Trace
=====
user_error(DataObject::get_by_id passed a non-numeric ID #,512)
line 2832 of DataObject.php

DataObject::get_by_id(Newsletter,)
line 514 of NewsletterAdmin.php

NewsletterAdmin->getNewsletterEditForm()
line 143 of NewsletterAdmin.php

NewsletterAdmin->shownewsletter(SS_HTTPRequest)
line 193 of Controller.php

Controller->handleAction(SS_HTTPRequest)
line 135 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 283 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.php

Director::direct(/admin/newsletter/shownewsletter/1)
line 122 of main.php

Avatar
MarcusDalgren

Community Member, 288 Posts

10 February 2010 at 2:21am

You could try creating an empty class that extends SS_Database.

class Database extends SS_Database {}

Maybe you have to put a __construct() in there that calls the parent but otherwise that might work.

Avatar
yurigoul

Community Member, 202 Posts

13 February 2010 at 2:04am

A new version of the Newsletter Module was released by Normann and it is 2.4 ready:

http://www.silverstripe.org/newsletter-module/

The only thing not working now is the trick to add the newsletter module subscription form and that trick is still working in 2.3.5 and it has to do with user defined forms. I have send an email to willr to ask him about it.

Details are at the end of this discussion: http://silverstripe.org/all-other-modules/show/270155?showPost=278861

Go to Top