Permalink
Browse files

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

…erty.
  • Loading branch information...
1 parent 3c1d62a commit c0d891cc0b5a58ed91d558109b189c70f17a800c @sminnee sminnee committed Jan 10, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 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.');
}

0 comments on commit c0d891c

Please sign in to comment.