1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 01:04:16 +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)) { if($this->children()->has($item)) {
$this->children()->remove($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); $item->parent->remove($item);
} }
return $this; return $this;

View File

@@ -1422,9 +1422,8 @@ class PagesPathFinder extends Wire {
$this->admin = true; $this->admin = true;
} else { } else {
$template = $this->getResultTemplate(); $template = $this->getResultTemplate();
if(!$template) { if(!$template) return false; // may need to detect later
return false; // may need to detect later if(in_array($template->name, $config->adminTemplates, true)) {
} if(in_array($template->name, $config->adminTemplates, true)) {
$this->admin = true; $this->admin = true;
} else if(in_array($template->name, array('user', 'role', 'permission', 'language'))) { } else if(in_array($template->name, array('user', 'role', 'permission', 'language'))) {
$this->admin = true; $this->admin = true;