Skip to content

Commit

Permalink
DirectorDatafield: Properly cache category in getCategory()
Browse files Browse the repository at this point in the history
Makes `getCategoryName()` work.
  • Loading branch information
nilmerg committed May 12, 2022
1 parent 69a7c37 commit 9ec08cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Director/Objects/DirectorDatafield.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public function getCategory()
if ($this->category) {
return $this->category;
} elseif ($id = $this->get('category_id')) {
return DirectorDatafieldCategory::loadWithAutoIncId($id, $this->getConnection());
$this->category = DirectorDatafieldCategory::loadWithAutoIncId($id, $this->getConnection());
return $this->category;
} else {
return null;
}
Expand Down

0 comments on commit 9ec08cf

Please sign in to comment.