Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX: Fixed GridField::getModelClass() not to access protected prop…

…erty.
  • Loading branch information...
commit c0d891cc0b5a58ed91d558109b189c70f17a800c 1 parent 3c1d62a
@sminnee sminnee authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 forms/gridfield/GridField.php
View
5 forms/gridfield/GridField.php
@@ -123,7 +123,10 @@ public function setModelClass($modelClassName) {
*/
public function getModelClass() {
if ($this->modelClassName) return $this->modelClassName;
- if ($this->list && $this->list->dataClass) return $this->list->dataClass;
+ if ($this->list && method_exists($this->list, 'dataClass')) {
+ $class = $this->list->dataClass();
+ if($class) return $class;
+ }
throw new LogicException('GridField doesn\'t have a modelClassName, so it doesn\'t know the columns of this grid.');
}
Please sign in to comment.
Something went wrong with that request. Please try again.