1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 09:14:58 +02:00
This commit is contained in:
Ryan Cramer
2020-05-14 16:08:21 -04:00
parent 4620c2ebff
commit 3ba72d4508

View File

@@ -2049,17 +2049,20 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
}
}
$restored = false;
if($this->input->post('restore_page') && $this->page->isTrash() && $this->page->restorable()) {
if($formErrors) {
$this->warning($this->_('Page cannot be restored while errors are present'));
} else if($this->wire('pages')->restore($this->page, false)) {
$message = sprintf($this->_('Restored Page: %s'), '{path}') . $numChanges;
$restored = true;
} else {
$this->warning($this->_('Error restoring page'));
}
}
$this->wire('pages')->save($this->page, $options);
if($restored) $this->wire('pages')->restored($this->page);
$message = str_replace('{path}', $this->page->path, $message);
$this->message($message);