mirror of
https://github.com/processwire/processwire.git
synced 2025-08-23 23:02:58 +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
|
$this->ids(true); // converts this->ids to CSV string
|
||||||
$idsCSV = &$this->ids;
|
$idsCSV = &$this->ids;
|
||||||
|
if(empty($idsCSV)) return;
|
||||||
$colSQL = $getAllCols ? '*' : '`' . implode('`,`', $getCols) . '`';
|
$colSQL = $getAllCols ? '*' : '`' . implode('`,`', $getCols) . '`';
|
||||||
if(!$getAllCols && !in_array('pages_id', $getCols)) $colSQL .= ',`pages_id`';
|
if(!$getAllCols && !in_array('pages_id', $getCols)) $colSQL .= ',`pages_id`';
|
||||||
|
|
||||||
@@ -1282,10 +1283,14 @@ class PagesRawFinder extends Wire {
|
|||||||
$database = $this->wire()->database;
|
$database = $this->wire()->database;
|
||||||
$pageFields = array();
|
$pageFields = array();
|
||||||
|
|
||||||
|
if(empty($this->ids)) return;
|
||||||
|
|
||||||
foreach($this->wire()->fields as $field) {
|
foreach($this->wire()->fields as $field) {
|
||||||
if($field->type instanceof FieldtypePage) $pageFields[$field->name] = $field;
|
if($field->type instanceof FieldtypePage) $pageFields[$field->name] = $field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($pageFields)) return;
|
||||||
|
|
||||||
foreach($this->values as $id => $data) {
|
foreach($this->values as $id => $data) {
|
||||||
$this->values[$id]['references'] = array();
|
$this->values[$id]['references'] = array();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user