Skip to content

Commit 1677aa5

Browse files
authored
fix referecne filter for multi fields (#11412)
1 parent 1a6b866 commit 1677aa5

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

components/ILIAS/DataCollection/classes/Fields/Reference/class.ilDclReferenceFieldModel.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,29 @@ public function getRecordQueryFilterObject(
6666
$filter_value = "",
6767
?ilDclBaseFieldModel $sort_field = null
6868
): ?ilDclRecordQueryObject {
69-
global $DIC;
70-
$ilDB = $DIC['ilDB'];
71-
7269
$n_ref = $this->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE);
7370

7471
$join_str
7572
= " LEFT JOIN il_dcl_record_field AS filter_record_field_{$this->getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = "
76-
. $ilDB->quote($this->getId(), 'integer') . ") ";
73+
. $this->db->quote($this->getId(), 'integer') . ") ";
7774
$join_str .= " LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id) ";
7875

7976
$where_str = " AND ";
8077

8178
if ($filter_value == 'none') {
8279
$where_str .= "("
8380
. "filter_stloc_{$this->getId()}.value IS NULL "
84-
. " OR filter_stloc_{$this->getId()}.value = " . $ilDB->quote("", 'text')
85-
. " OR filter_stloc_{$this->getId()}.value = " . $ilDB->quote("[]", 'text')
81+
. " OR filter_stloc_{$this->getId()}.value = " . $this->db->quote("", 'text')
82+
. " OR filter_stloc_{$this->getId()}.value = " . $this->db->quote("[]", 'text')
8683
. ") ";
8784
} else {
8885
if ($n_ref) {
8986
$where_str
90-
.= " filter_stloc_{$this->getId()}.value LIKE "
91-
. $ilDB->quote("%$filter_value%", 'text');
87+
.= " filter_stloc_{$this->getId()}.value LIKE " . $this->db->quote("%\"$filter_value\"%", 'text');
9288
} else {
9389
$where_str
9490
.= " filter_stloc_{$this->getId()}.value = "
95-
. $ilDB->quote($filter_value, 'integer');
91+
. $this->db->quote($filter_value, 'integer');
9692
}
9793
}
9894

0 commit comments

Comments
 (0)