Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,14 @@ private function optimizedConcatNotLike(
$path = implode('/', $pathParts);
$queryColumn = $type === 'asset' ? '`filename`' : '`key`';

//special case for the root folder: "/" is the whole tree, so excluding it excludes everything.
//Only the root row itself is left over when its children are excluded, and that is the one row with an empty key.
if ($fullpath === '/') {
return $onlyChildren
? '(`path` = "/" AND ' . $queryColumn . ' = "")'
: '1 = 0';
}

if ($onlyChildren) {
return '`path` NOT LIKE "' . $fullpath . '/%"';
}
Expand Down
Loading