1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-16 11:44:42 +02:00
This commit is contained in:
Ryan Cramer
2019-12-03 10:44:23 -05:00
parent 71e9c6114e
commit 3717224a5c
2 changed files with 21 additions and 17 deletions

View File

@@ -429,12 +429,16 @@ class PageTraversal {
} else {
$row = reset($rows);
$result = $pages->getById(array($row['id']), array(
'template' => $page->wire('templates')->get($row['templates_id']),
'parent_id' => $row['parent_id'],
'getOne' => true,
'cache' => $page->loaderCache
));
if($row && !empty($row['id'])) {
$result = $pages->getById(array($row['id']), array(
'template' => $page->wire('templates')->get($row['templates_id']),
'parent_id' => $row['parent_id'],
'getOne' => true,
'cache' => $page->loaderCache
));
} else {
$result = $pages->newNullPage();
}
}
return $result;