mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Fix issue processwire/processwire-issues#1824
This commit is contained in:
@@ -861,11 +861,11 @@ class PagesRawFinder extends Wire {
|
||||
protected function findCustom() {
|
||||
if(count($this->customFields)) {
|
||||
// one or more custom fields requested
|
||||
if($this->ids === null) {
|
||||
if($this->ids === null && !empty($this->selector)) {
|
||||
// only find IDs if we didn’t already in the nativeFields section
|
||||
$this->setIds($this->findIDs($this->selector, false));
|
||||
}
|
||||
if(!count($this->ids)) return;
|
||||
if(empty($this->ids)) return;
|
||||
foreach($this->customFields as $fieldName => $field) {
|
||||
/** @var Field $field */
|
||||
$cols = isset($this->customCols[$fieldName]) ? $this->customCols[$fieldName] : array();
|
||||
@@ -1144,11 +1144,12 @@ class PagesRawFinder extends Wire {
|
||||
$this->wire($finder);
|
||||
$options = $this->options;
|
||||
$options['indexed'] = true;
|
||||
$pageRefRows = $finder->find($pageRefIds, $pageRefCols, $options);
|
||||
$pageRefRows = count($pageRefIds) ? $finder->find($pageRefIds, $pageRefCols, $options) : array();
|
||||
|
||||
foreach($this->values as $pageId => $pageRow) {
|
||||
if(!isset($pageRow[$fieldName])) continue;
|
||||
foreach($pageRow[$fieldName] as $pageRefId) {
|
||||
if(!isset($pageRefRows[$pageRefId])) continue;
|
||||
$this->values[$pageId][$fieldName][$pageRefId] = $pageRefRows[$pageRefId];
|
||||
}
|
||||
if(!$this->getMultiple && $field->get('derefAsPage') > 0) {
|
||||
|
Reference in New Issue
Block a user