Skip to content

Commit 23ab7a3

Browse files
VladoTTXbtry
authored andcommitted
fix(form): search criteria when using keywords
Fix wrongly constructed query in case of keywords being used. It caused that also forms which should not be visible where shown.
1 parent 2e18634 commit 23ab7a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/form.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public static function getFormList(int $rootCategory = 0, string $keywords = '',
748748
// Searching for all forms without category restriction
749749
$onlyDefault = PluginFormcreatorEntityconfig::getUsedConfig('default_form_list_mode', Session::getActiveEntity());
750750
if ($onlyDefault == PluginFormcreatorEntityconfig::CONFIG_DEFAULT_FORM_LIST_DEFAULT) {
751-
$where_form['WHERE']['is_default'] = 1;
751+
$where_form['WHERE']['AND']['is_default'] = 1;
752752
}
753753
}
754754

@@ -768,7 +768,7 @@ public static function getFormList(int $rootCategory = 0, string $keywords = '',
768768
$keywords = trim($keywords);
769769
if (!empty($keywords)) {
770770
$keywordsWithWilcards = $DB->escape(PluginFormcreatorCommon::prepareBooleanKeywords($keywords));
771-
$where_form['AND'][] = [
771+
$where_form['WHERE']['AND'][] = [
772772
'OR' => [
773773
new QueryExpression("MATCH($table_form.`name`, $table_form.`description`)
774774
AGAINST('$keywordsWithWilcards' IN BOOLEAN MODE)"),

0 commit comments

Comments
 (0)