diff --git a/wire/core/InputfieldWrapper.php b/wire/core/InputfieldWrapper.php index 181d3cbb..cc84c8f8 100644 --- a/wire/core/InputfieldWrapper.php +++ b/wire/core/InputfieldWrapper.php @@ -549,7 +549,7 @@ class InputfieldWrapper extends Inputfield implements \Countable, \IteratorAggre } if($this->children()->has($item)) { $this->children()->remove($item); - } if($this->getChildByName($item->attr('name')) && $item->parent) { + } else if($this->getChildByName($item->attr('name')) && $item->parent) { $item->parent->remove($item); } return $this; diff --git a/wire/core/PagesPathFinder.php b/wire/core/PagesPathFinder.php index 71f6dd99..66bff1d2 100644 --- a/wire/core/PagesPathFinder.php +++ b/wire/core/PagesPathFinder.php @@ -1422,9 +1422,8 @@ class PagesPathFinder extends Wire { $this->admin = true; } else { $template = $this->getResultTemplate(); - if(!$template) { - return false; // may need to detect later - } if(in_array($template->name, $config->adminTemplates, true)) { + if(!$template) return false; // may need to detect later + if(in_array($template->name, $config->adminTemplates, true)) { $this->admin = true; } else if(in_array($template->name, array('user', 'role', 'permission', 'language'))) { $this->admin = true;