1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 00:37:02 +02:00
This commit is contained in:
Ryan Cramer
2020-11-13 11:45:44 -05:00
parent 1af600fdd1
commit 580da37a2f

View File

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