1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +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) { if(is_object($value) && $value instanceof Page) {
// ok // ok
$this->setParent($value); $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")))) { ($key == 'parent_id' || is_int($value) || (is_string($value) && ctype_digit("$value")))) {
// store only parent ID so that parent is lazy loaded, // store only parent ID so that parent is lazy loaded,
// but only if parent hasn't already been previously loaded // but only if parent hasn't already been previously loaded