Skip to content

Commit

Permalink
Fixed issue #18287: Question List: Filtering doesn't work on type des…
Browse files Browse the repository at this point in the history
…cription (#2597)
  • Loading branch information
gabrieljenik committed Sep 28, 2022
1 parent 86e62a9 commit 128cc26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/models/Question.php
Expand Up @@ -1056,13 +1056,18 @@ public function search()
$criteria->compare("t.sid", $this->sid, false, 'AND');
$criteria->compare("t.parent_qid", 0, false, 'AND');
//$criteria->group = 't.qid, t.parent_qid, t.sid, t.gid, t.type, t.title, t.preg, t.other, t.mandatory, t.question_order, t.scale_id, t.same_default, t.relevance, t.modulename, t.encrypted';
$criteria->with = array('group' => array('alias' => 'g'), 'questionl10ns' => array('alias' => 'ql10n', 'condition' => "language='" . $this->survey->language . "'"));
$criteria->with = [
'group' => ['alias' => 'g'],
'questionl10ns' => ['alias' => 'ql10n', 'condition' => "language='" . $this->survey->language . "'"],
'question_theme' => ['alias' => 'qt', 'condition' => "extends=''"]
];

if (!empty($this->title)) {
$criteria2 = new CDbCriteria();
$criteria2->compare('t.title', $this->title, true, 'OR');
$criteria2->compare('ql10n.question', $this->title, true, 'OR');
$criteria2->compare('t.type', $this->title, true, 'OR');
$criteria2->compare('qt.description', $this->title, true, 'OR');
/* search exact qid and make sure it's a numeric */
if (is_numeric($this->title)) {
$criteria2->compare('t.qid', $this->title, false, 'OR');
Expand Down

0 comments on commit 128cc26

Please sign in to comment.