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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user