-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataObject\Document] getChildren & getSiblings shouldn't load the listing #13899
Conversation
Review Checklist
|
@dvesh3 Why is only the getChildren() method changed of the Document Model and not the getSiblings() method? |
And why isn't changed the Asset model to be consistent? |
@@ -597,7 +594,7 @@ public function getChildren(bool $includingUnpublished = false): array | |||
$list->setCondition('parentId = ?', $this->getId()); | |||
$list->setOrderKey('index'); | |||
$list->setOrder('asc'); | |||
$this->children[$cacheKey] = $list->load(); | |||
$this->children[$cacheKey] = $list; | |||
} else { | |||
$this->children[$cacheKey] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dvesh3 The return type doesn't allow an array. Should be also a listing. Or should we return null if no Listing is possible?
$listing = $target->getChildren(); | ||
$listing->setData(array_merge($listing->getData(), [$newElement])); | ||
$target->setChildren($listing); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also used for Assets. So we must change it also there.
@blankse thanks for the review. yes, we missed few points here so i'll create a follow up PR. thanks! |
…low up to #13899 (#14008) * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * Update models/Asset.php Co-authored-by: Sebastian Blank <[email protected]> * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 * [Elements] getChildren & getSiblings shouldn't load the listing - follow up to #13899 Co-authored-by: Sebastian Blank <[email protected]>
Changes in this pull request
Resolves #11737
Additional info