1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00
This commit is contained in:
Ryan Cramer
2021-06-17 15:32:48 -04:00
parent b087149c40
commit 91d96a0317

View File

@@ -702,7 +702,7 @@ class Page extends WireData implements \Countable, WireMatchable {
if(is_object($value) && $value instanceof Page) {
// ok
$this->setParent($value);
} else if($value && !$this->_parent &&
} else if($value && !$this->_parent && (!$this->_parent_id || !$this->isLoaded) &&
($key == 'parent_id' || is_int($value) || (is_string($value) && ctype_digit("$value")))) {
// store only parent ID so that parent is lazy loaded,
// but only if parent hasn't already been previously loaded