1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-21 14:02:59 +02:00

Fix issue processwire/processwire-issues#319 where Page::setAndSave() was only working with custom fields and not with DB native properties

This commit is contained in:
Ryan Cramer
2017-07-28 06:52:23 -04:00
parent 0c42013c45
commit 52b8389215

View File

@@ -2369,6 +2369,9 @@ class Page extends WireData implements \Countable, WireMatchable {
if(!is_null($field)) { if(!is_null($field)) {
if($this->hasField($field)) { if($this->hasField($field)) {
return $this->wire('pages')->saveField($this, $field, $options); 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 { } else {
return false; return false;
} }