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

event calendar - signups


Reply


22 Posts   4716 Views

Avatar
UncleCheese

Forum Moderator, 4096 Posts

3 February 2010 at 9:15am

Well I guess you should be less concerned about whether it's in the database and more about whether it's in Silverstripe. The point is that this is failing:

DataObject::get_one("RegistrationPage");

So something isn't right. Make sure a registration page object exists.

Avatar
janulka

Community Member, 80 Posts

4 February 2010 at 6:46am

well, ok, I removed this line:

function canCreate() {return false;}

created manually RegistrationPage, then put the line back again.

now all testworkshops show up, together with Register Link. The "register now" link is passing the workshop name and times dropdown perfectly to registration form.

But after I fill out the form and press "Register" button, I am getting this error:

[Warning] DataObject::get_by_id passed a non-numeric ID #RegistrationForm
POST /new-registrationpage/RegistrationForm

Line 2570 in /home/dinhurlg/public_html/sapphire/core/model/DataObject.php

Source

2561             $tableClasses = ClassInfo::dataClassesFor($callerClass);
2562             $baseClass = array_shift($tableClasses);
2563             return DataObject::get_one($callerClass,"`$baseClass`.`ID` = $id");
2564
2565             // This simpler code will be used by non-DataObject classes that implement DataObjectInterface
2566          } else {
2567             return DataObject::get_one($callerClass,"`ID` = $id");
2568          }
2569       } else {
2570          user_error("DataObject::get_by_id passed a non-numeric ID #$id", E_USER_WARNING);
2571       }
2572    }
2573
2574    /**
2575     * Get the name of the base table for this object
2576     */

Trace

* DataObject::get_by_id passed a non-numeric ID #RegistrationForm
Line 2570 of DataObject.php
* DataObject::get_by_id(Workshop,RegistrationForm)
Line 88 of RegistrationPage.php
* RegistrationPage_Controller->Workshop()
Line 94 of RegistrationPage.php
* RegistrationPage_Controller->RegistrationForm(HTTPRequest)
Line 159 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 129 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 29 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/new-registrationpage/RegistrationForm)
Line 118 of main.php

Avatar
UncleCheese

Forum Moderator, 4096 Posts

4 February 2010 at 7:15am

Make sure there's a valid ID being passed through the URL..

Avatar
janulka

Community Member, 80 Posts

4 February 2010 at 8:01am

I am pretty lost now, I have no idea where to go from here..

TestWorkshop (page ID is 25)

"Register now" link has href="/NewRegistrationPage/25"

Then, as I said, correct workshop title and corresponding times appear in registration form, so from my i-do-not-know-php point of view, the workshop ID is passed through URL.. but from the same point of view, it is not passed further to be sent by this form?

Line 88:

return DataObject::get_by_id("Workshop",Director::urlParam('Action'));

in the "trace" below, it shows following:

* DataObject::get_by_id(Workshop,RegistrationForm)
Line 88 of RegistrationPage.php

Why is it giving "RegistrationForm" instead of 25?

Avatar
janulka

Community Member, 80 Posts

4 February 2010 at 8:19am

well, I am not sure if I am doing this right..

BUT

the form is sent further to /new-registrationpage/RegistrationForm

then the 'Action' part of URL is no longer my ID "25", but in fact, "RegistrationForm". Am I understanding this right? :)

anyway, how to get the workshop ID further to this "/new-registrationpage/RegistrationForm" link?

Avatar
janulka

Community Member, 80 Posts

11 March 2010 at 9:52pm

Hello again,

I am still stuck this same place as one month ago, plz help with this one?

Thank you.

Avatar
irisseven

Community Member, 8 Posts

23 March 2010 at 11:10pm

Hi all, hopefully there is a quick fix to this.
I am using SS 2.3.2 and believe I have all the prerequisite modules correctly installed.
I am using the WorkshopRegistration.zip files from this forum but am getting this error when I try to create a new Workshop page.

Fatal error: Call to a member function toDropdownMap() on a non-object in /Applications/MAMP/htdocs/cardinal/mysite/code/WorkshopDateTime.php on line 35

the offending line of code looks like this:
         

new CheckboxSetField('Presenters','Presenters',DataObject::get('StaffMember')->toDropdownMap()),

any help would be greatly appreciated!

Avatar
UncleCheese

Forum Moderator, 4096 Posts

24 March 2010 at 1:32am

Never, ever, ever run a method directly off a DataObject::get()..

$set = DataObject::get(...);
$map = $set ? $set->toDropdownMap() : array();