1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-17 12:10:45 +02:00

Fix issue where findRaw could get error when returning referencs where none existed

This commit is contained in:
Ryan Cramer
2022-01-16 12:43:04 -05:00
parent 883b0ab438
commit 48f3db2b0c

View File

@@ -952,6 +952,7 @@ class PagesRawFinder extends Wire {
$this->ids(true); // converts this->ids to CSV string
$idsCSV = &$this->ids;
if(empty($idsCSV)) return;
$colSQL = $getAllCols ? '*' : '`' . implode('`,`', $getCols) . '`';
if(!$getAllCols && !in_array('pages_id', $getCols)) $colSQL .= ',`pages_id`';
@@ -1282,10 +1283,14 @@ class PagesRawFinder extends Wire {
$database = $this->wire()->database;
$pageFields = array();
if(empty($this->ids)) return;
foreach($this->wire()->fields as $field) {
if($field->type instanceof FieldtypePage) $pageFields[$field->name] = $field;
}
if(empty($pageFields)) return;
foreach($this->values as $id => $data) {
$this->values[$id]['references'] = array();
}