Skip to content

Commit

Permalink
BUGFIX: Fixed GridField::getModelClass() not to access protected prop…
Browse files Browse the repository at this point in the history
…erty.
  • Loading branch information
Sam Minnee committed Jan 10, 2012
1 parent 3c1d62a commit c0d891c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion forms/gridfield/GridField.php
Expand Up @@ -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.');
}
Expand Down

0 comments on commit c0d891c

Please sign in to comment.