Fix an edge case in sorting
This commit is contained in:
parent
437a52e90e
commit
3276d4b611
@ -26,14 +26,24 @@ class Directory extends Entry implements \ArrayAccess, \IteratorAggregate
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($this->children as $key => $entry) {
|
foreach ($this->children as $key => $entry) {
|
||||||
|
// In case of generated pages, the name might be empty.
|
||||||
|
// Thus we are falling back to other solutions, otherwise the page would disappear from the tree.
|
||||||
$name = $entry->getName();
|
$name = $entry->getName();
|
||||||
|
|
||||||
if ($name == 'index' || $name == '_index') {
|
if (!$name) {
|
||||||
$buckets['index'][$key] = $entry;
|
$name = $entry->getTitle();
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$name) {
|
if (!$name) {
|
||||||
|
$name = $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$name) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name == 'index' || $name == '_index') {
|
||||||
|
$buckets['index'][$key] = $entry;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user