mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 01:04:16 +02:00
Fix issue processwire/processwire-issues#1157
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user