From 3ba72d450850828536c2c7bfca5176bc79dca279 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 14 May 2020 16:08:21 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1157 --- wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module b/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module index 5f7f0a33..6829d108 100644 --- a/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module +++ b/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module @@ -2048,18 +2048,21 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod $message .= ' - ' . $this->_('Cannot be published until errors are corrected'); } } - + + $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);