1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +02:00

Add additional clarification to a couple of Page class exception error messages

This commit is contained in:
Ryan Cramer
2021-06-25 13:46:00 -04:00
parent 5e663ccf13
commit ac626a5794

View File

@@ -1982,7 +1982,7 @@ class Page extends WireData implements \Countable, WireMatchable {
if(!$tpl instanceof Template) throw new WireException("Invalid value sent to Page::setTemplate"); if(!$tpl instanceof Template) throw new WireException("Invalid value sent to Page::setTemplate");
if($this->template && $this->template->id != $tpl->id && $this->isLoaded) { if($this->template && $this->template->id != $tpl->id && $this->isLoaded) {
if($this->settings['status'] & Page::statusSystem) { if($this->settings['status'] & Page::statusSystem) {
throw new WireException("Template changes are disallowed on this page"); throw new WireException("Template changes are disallowed on page $this->id because it has system status");
} }
if(is_null($this->templatePrevious)) $this->templatePrevious = $this->template; if(is_null($this->templatePrevious)) $this->templatePrevious = $this->template;
$this->trackChange('template', $this->template, $tpl); $this->trackChange('template', $this->template, $tpl);
@@ -2013,7 +2013,7 @@ class Page extends WireData implements \Countable, WireMatchable {
$this->trackChange('parent', $this->_parent, $parent); $this->trackChange('parent', $this->_parent, $parent);
if(($this->_parent && $this->_parent->id) && $this->_parent->id != $parent->id) { if(($this->_parent && $this->_parent->id) && $this->_parent->id != $parent->id) {
if($this->settings['status'] & Page::statusSystem) { if($this->settings['status'] & Page::statusSystem) {
throw new WireException("Parent changes are disallowed on this page"); throw new WireException("Parent changes are disallowed on page $this->id because it has system status");
} }
if(is_null($this->parentPrevious)) $this->parentPrevious = $this->_parent; if(is_null($this->parentPrevious)) $this->parentPrevious = $this->_parent;
} }