GridField Fatal Error in Front End

Showing 1-3 of 3 messages
GridField Fatal Error in Front End GerrySilva 8/19/12 1:24 AM
Dear Experts

Do we have a more comprehensive tutorial on how to use the GridField in the front end?
The editable form is being displayed with the table in the same page.

Also, it works well in back end CMS but error in front ed during an "Add".
The code is unable to generate the "Cancel" button in the front end.
See code below.

Thanks for your help in advance,

Base SS 3.0.1 version

Using GridField in front end Form Method
    function Form() {

        $formName = 'Form';
        $config = GridFieldConfig_RecordEditor::create(25);
        $config->addComponents(new GridFieldExportButton());
        $itemsInGrid = MyClass::get(); // get a list of object you want to show
        $gridField = new GridField("MyClass", "List of MyClass", $itemsInGrid, $config);
        $fields = new FieldList($gridField);
        $actions = new FieldList();
        $form = new Form($this, $formName, $fields, $actions);
        return $form;

Fatal Error message when clicking the "Add" button

9    0.4158    17641832    GridField->handleRequest( )    ..\RequestHandler.php:186
10    0.4161    17642064    GridFieldDetailForm->handleItem( )    ..\GridField.php:649
11    0.4194    17659392    RequestHandler->handleRequest( )    ..\GridFieldDetailForm.php:82
12    0.4202    17658632    GridFieldDetailForm_ItemRequest->edit( )    ..\RequestHandler.php:168
13    0.4202    17658632    GridFieldDetailForm_ItemRequest->ItemEditForm( )    ..\GridFieldDetailForm.php:254
14    0.4231    17684008    GridFieldDetailForm_ItemRequest->Breadcrumbs( )    ..\GridFieldDetailForm.php:303

I have to temporarily comment out this section during my prototyping to make GridField work in the front end.

// Add a Cancel link which is a button-like link and link back to one level up.
$curmbs = $this->Breadcrumbs();
if($curmbs && $curmbs->count()>=2){
    $one_level_up = $curmbs->offsetGet($curmbs->count()-2);
    $text = "
    <a class=\"crumb ss-ui-button ss-ui-action-destructive cms-panel-link ui-corner-all\" href=\"".$one_level_up->Link."\">
    actions->push(new LiteralField('cancelbutton', $text));
Re: [silverstripe-dev] GridField Fatal Error in Front End Hamish Friedlander 8/19/12 3:55 PM

Thanks for reporting this. Just a note that this list isn't the right place to raise bug reports, although discussing issues using the APIs is fine. This looks like a bug though - that code snippet looks OK to me at first glance.

Can I get you to raise this as a bug on Ideally can you also attach your whole Page class (or whatever class this Form method is from), not just a snippet - there is already code that checks to see if the Breadcrumbs method exists & avoids calling it, so there might be something else in the class that is causing an issue.

Hamish Friedlander

You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To view this discussion on the web visit
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Re: [silverstripe-dev] GridField Fatal Error in Front End Gerry Silva 8/20/12 1:54 AM


Thank you for your prompt reply.
As requested, I have raised a ticket related to this bug.

Many thanks,
Gerry Silva