DirectorDatafield: Properly cache category in `getCategory()`

Makes `getCategoryName()` work.
This commit is contained in:
Johannes Meyer 2021-12-14 09:04:56 +01:00
parent bf591093d8
commit 9919b65fc5
1 changed files with 2 additions and 1 deletions

View File

@ -74,7 +74,8 @@ class DirectorDatafield extends DbObjectWithSettings
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;
}