Skip to content

Commit

Permalink
Prevent deprecation notice when AdminInterface.isCurrentChild is impl…
Browse files Browse the repository at this point in the history
…emented
  • Loading branch information
jorrit committed Sep 29, 2020
1 parent 77acce4 commit e0eadb1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Admin/AbstractAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2435,12 +2435,16 @@ public function isCurrentChild(): bool
*/
public function getCurrentChildAdmin()
{
foreach ($this->children as $children) {
foreach ($this->children as $child) {
// NEXT_MAJOR: Remove method_exists check and delete elseif case
if (method_exists($children, 'isCurrentChild') && $children->isCurrentChild()) {
return $children;
} elseif ($children->getCurrentChild()) {
return $children;
if (method_exists($child, 'isCurrentChild')) {
if ($child->isCurrentChild()) {
return $child;
}
} else {
if ($child->getCurrentChild()) {
return $child;
}
}
}

Expand Down

0 comments on commit e0eadb1

Please sign in to comment.