1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 16:54:44 +02:00

Add PR #262 - Fix potentially missed else conditionals

This commit is contained in:
netcarver
2023-03-09 10:26:06 -05:00
committed by Ryan Cramer
parent dafceffc6f
commit edcfa915d8
2 changed files with 3 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;