Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using GridFieldExpandableForm forbidden in ModelAdmin? #15

Open
JustinTBrown opened this issue Jun 11, 2017 · 0 comments
Open

Using GridFieldExpandableForm forbidden in ModelAdmin? #15

JustinTBrown opened this issue Jun 11, 2017 · 0 comments

Comments

@JustinTBrown
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant