Skip to content

Commit

Permalink
BUGFIX hide_ancestor as string (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirish authored Feb 14, 2024
1 parent 1ee6d2f commit 3837181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Model/ImageSlide.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,26 @@ class ImageSlide extends Slide
];

/**
* @var string[]
* @var array
* @config
*/
private static $has_one = [
'Image' => Image::class,
];

/**
* @var string[]
* @var array
* @config
*/
private static $owns = [
'Image',
];

/**
* @var array
* @var string
* @config
*/
private static $hide_ancestor = [Slide::class];
private static $hide_ancestor = Slide::class;

/**
* @return FieldList
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function canView($member = null): ?bool
return $extended;
}

if ($this->Parent()->exists()) {
if ($this->Parent()) {
$parent = $this->Parent();
return $parent->canView($member);
}
Expand All @@ -152,7 +152,7 @@ public function canEdit($member = null)
return $extended;
}

if ($this->Parent()->exists()) {
if ($this->Parent()) {
$parent = $this->Parent();
return $parent->canEdit($member);
}
Expand Down

0 comments on commit 3837181

Please sign in to comment.