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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Complex tables, Push error Options


Go to End


3 Posts   1123 Views

Avatar
Hamish

Community Member, 712 Posts

28 April 2008 at 8:45am

Hi all,

Just dipping my toes into Silverstripe for the first time. To learn, I'm trying to create a very simple 'job 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

Avatar
Blackdog

Community Member, 156 Posts

28 April 2008 at 10:07am

Post your code

Avatar
Hamish

Community Member, 712 Posts

28 April 2008 at 10:52am

Ah, found the issue myself.

I was calling 'getCMSFields_forPopup' in the table constructor, but had the function getCMSFields() instead of getCMSFields_forPopup() in the dataobject. Using the correct name solved the problem.

Thanks