From 52b83892154fb0f2f20ccf64f2fc23f40442022f Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 28 Jul 2017 06:52:23 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#319 where Page::setAndSave() was only working with custom fields and not with DB native properties --- wire/core/Page.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wire/core/Page.php b/wire/core/Page.php index 2fc9e32f..a2b5eda3 100644 --- a/wire/core/Page.php +++ b/wire/core/Page.php @@ -2369,6 +2369,9 @@ class Page extends WireData implements \Countable, WireMatchable { if(!is_null($field)) { if($this->hasField($field)) { return $this->wire('pages')->saveField($this, $field, $options); + } else if(is_string($field) && (isset($this->settings[$field]) || parent::get($field) !== null)) { + $options['noFields'] = true; + return $this->wire('pages')->save($this, $options); } else { return false; }