From ac626a5794f6ac73f3133876c67438c50cc3e088 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 25 Jun 2021 13:46:00 -0400 Subject: [PATCH] Add additional clarification to a couple of Page class exception error messages --- wire/core/Page.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/Page.php b/wire/core/Page.php index a0e42e6d..9241c861 100644 --- a/wire/core/Page.php +++ b/wire/core/Page.php @@ -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($this->template && $this->template->id != $tpl->id && $this->isLoaded) { 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; $this->trackChange('template', $this->template, $tpl); @@ -2013,7 +2013,7 @@ class Page extends WireData implements \Countable, WireMatchable { $this->trackChange('parent', $this->_parent, $parent); if(($this->_parent && $this->_parent->id) && $this->_parent->id != $parent->id) { 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; }