mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 01:34:31 +02:00
Fix issue processwire/processwire-issues#443
This commit is contained in:
@@ -798,11 +798,16 @@ abstract class FieldtypeMulti extends Fieldtype {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only allow matches using templates with the requested field
|
// only allow matches using templates with the requested field
|
||||||
$sql = 'pages.templates_id IN(';
|
$templates = $field->getTemplates();
|
||||||
foreach($field->getTemplates() as $template) {
|
if(count($templates)) {
|
||||||
$sql .= ((int) $template->id) . ',';
|
$sql = 'pages.templates_id IN(';
|
||||||
|
foreach($templates as $template) {
|
||||||
|
$sql .= ((int) $template->id) . ',';
|
||||||
|
}
|
||||||
|
$sql = rtrim($sql, ',') . ')';
|
||||||
|
} else {
|
||||||
|
$sql = 'pages.templates_id=0';
|
||||||
}
|
}
|
||||||
$sql = rtrim($sql, ',') . ')';
|
|
||||||
$query->where($sql); // QA
|
$query->where($sql); // QA
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user