From 580da37a2fc996371a791dcd24e2c611577d62f8 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 13 Nov 2020 11:45:44 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1278 --- wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module b/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module index 5d1922a2..e4da06a7 100644 --- a/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module +++ b/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module @@ -496,6 +496,13 @@ class ProcessPageAdd extends Process implements ConfigurableModule, WirePageEdit throw new WireException($this->errors('string')); } + if($this->parent->template->name === 'admin' && $this->wire()->page->id != $this->parent->id) { + $process = $this->parent->process; + if($process && wireInstanceOf($process, 'ProcessPageType')) { + $this->wire()->session->location($this->parent->url . 'add/'); + } + } + if(count($this->parent->template->childTemplates) == 1) { // only one type of template is allowed for the parent $childTemplates = $this->parent->template->childTemplates;