Skip to content

Commit

Permalink
Ensure object is hierarchical in HierarchicalSectionTableWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaskill committed Jan 30, 2024
1 parent e86fb7e commit 2b7bea2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

// From 'charcoal-object'
use Charcoal\Object\HierarchicalCollection;
use Charcoal\Object\HierarchicalInterface;

// From 'charcoal-admin'
use Charcoal\Admin\Property\Display\HierarchicalDisplay;
Expand Down Expand Up @@ -80,7 +81,8 @@ protected function setupDisplayPropertyValue(
) {
parent::setupDisplayPropertyValue($object, $property);

if ($this->display instanceof HierarchicalDisplay) {
if (($object instanceof HierarchicalInterface) &&
($this->display instanceof HierarchicalDisplay)) {
$this->display->setCurrentLevel($object->hierarchyLevel());
}
}
Expand Down

0 comments on commit 2b7bea2

Please sign in to comment.