Complex tables, Push error

1 view
Skip to first unread message

Hamish Campbell

unread,
Apr 23, 2008, 10:37:03 PM4/23/08
to SilverStripe Development
Hi all,

Just dipping my toes into Silverstripe for the first time. To learn,
I'm trying to create a very simple applicants database. I've got an
ApplicantsHolder page which can have a number of Applicant DataObjects
(ie 1 to many).

The applicant object has two text fields (FirstName, LastName) and a
'CalendarDateField' DateofBirth.

So far so good - it builds fine and I can create the page and add
applicants to the complex field in the CMS, however the date field
doesn't show up in the table, and when I try to edit the record I get
the following message in the popup:

Fatal error: Call to a member function push() on a non-object in C:
\lighttpd\htdocs\sapphire\forms\ComplexTableField.php on line 264

Any clues? Cheers


Ingo Schommer

unread,
Apr 27, 2008, 5:30:40 PM4/27/08
to SilverStripe Development
hey hamish,

can you paste your ComplexTableField constructor and the DataObject
classes you're using (with http://pastie.caboo.se perhaps?)

cheers
ingo

Hamish Campbell

unread,
Apr 27, 2008, 6:17:52 PM4/27/08
to SilverStripe Development
Certainly.

Applicant: http://pastie.caboo.se/187756

ApplicantHolder: http://pastie.caboo.se/187759

Thanks!
> > Any clues? Cheers- Hide quoted text -
>
> - Show quoted text -

Hamish Campbell

unread,
Apr 27, 2008, 6:30:16 PM4/27/08
to SilverStripe Development
So, of course as soon as I post that I realise that I've misnamed a
field - in the Applicant dataobject I had mis-capitalised DateOfBirth
in the getCMSFields call.

That fixed the issue with the date not appearing in the table, however
I still get the error in the popup.
> > - Show quoted text -- Hide quoted text -

Hamish Campbell

unread,
Apr 27, 2008, 6:47:50 PM4/27/08
to SilverStripe Development
Ah ah! Solved it myself - was calling the _forPopup version, but of
course I had no "getCMSFields_forPopup" function in the dataobject.
After renaming getCMSFields it worked a dream.

It's starting to click now. :)
Reply all
Reply to author
Forward
0 new messages