1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-16 03:34:33 +02:00
This commit is contained in:
Ryan Cramer
2021-04-29 09:42:06 -04:00
parent e416ee505b
commit 81213fbb9d

View File

@@ -459,6 +459,12 @@ class ProcessPageList extends Process implements ConfigurableModule {
*
*/
public function ___find($selectorString, Page $page) {
if($page->id === $this->wire()->config->trashPageID && !preg_match('/\bsort=/', $selectorString)) {
$sortfield = $page->sortfield();
if(!$sortfield || $sortfield === 'sort') {
$selectorString = trim("$selectorString,sort=-modified", ',');
}
}
return $page->children($selectorString);
}