Skip to content

Commit

Permalink
[FIX] Bug with getDocumentChildren() and getAllChildren() in version …
Browse files Browse the repository at this point in the history
…3.1.10 #2089.
  • Loading branch information
Seiger committed Jun 8, 2023
1 parent 16d1956 commit 5643a1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -3884,6 +3884,7 @@ public function getDocumentChildren(
}

$documentChildren = SiteContent::query()->withTrashed()->where('site_content.parent', $parentid);

if ($published !== 'all') {
$documentChildren = $documentChildren->where('site_content.published', $published);
}
Expand All @@ -3898,6 +3899,7 @@ public function getDocumentChildren(
}
if (!is_array($fields)) {
$fields = array_filter(array_map('trim', explode(',', $fields)));
$fields = array_map(fn($value): string => (strpos($value, '.') === false ? 'site_content.'.$value : $value), $fields);
$documentChildren = $documentChildren->select($fields);
}
// modify field names to use sc. table reference
Expand Down

0 comments on commit 5643a1e

Please sign in to comment.