Skip to content

Using GridFieldExpandableForm forbidden in ModelAdmin? #15

@JustinTBrown

Description

@JustinTBrown

I'm attempting to use ExpandableForm on my ModelAdmin's managed model. Not on a relation of managed model which the current documentation gives an example for. When I click on a record's row, I get a popup error, "Forbidden". Here's the getEditForm in the model admin:

  public function getEditForm($id = null, $fields = null) {
    $form = parent::getEditForm($id, $fields);
    $gridFieldName = $this->sanitiseClassName($this->modelClass);
    $gridField = $form->Fields()->fieldByName($gridFieldName);

    $expandedFields = new FieldList(array(
      new TextField('Content'),
    ));
    $gridField->getConfig()->addComponent(new GridFieldExpandableForm($expandedFields));

    return $form;
  }

And here's what I'm getting in my browser's console:

Artist/EditForm/field/Artist/expand/31 Failed to load resource: the server responded with a status of 403 (Forbidden)

Any ideas what's going wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions