Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » event calendar - signups

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 4461 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: event calendar - signups Link to this post

    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.

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: event calendar - signups Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: event calendar - signups Link to this post

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

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: event calendar - signups Link to this post

    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?

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: event calendar - signups Link to this post

    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?

  • janulka
    Avatar
    Community Member
    80 Posts

    Re: event calendar - signups Link to this post

    Hello again,

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

    Thank you.

  • irisseven
    Avatar
    Community Member
    8 Posts

    Re: event calendar - signups Link to this post

    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!

  • UncleCheese
    Avatar
    4085 Posts

    Re: event calendar - signups Link to this post

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

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

    4461 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.