Skip to content

Commit

Permalink
fix(form): search criteria when using keywords
Browse files Browse the repository at this point in the history
Fix wrongly constructed query in case of keywords being used. It caused that also forms which should not be visible where shown.
  • Loading branch information
VladoTTX authored and btry committed May 24, 2022
1 parent 2e18634 commit 23ab7a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public static function getFormList(int $rootCategory = 0, string $keywords = '',
// Searching for all forms without category restriction
$onlyDefault = PluginFormcreatorEntityconfig::getUsedConfig('default_form_list_mode', Session::getActiveEntity());
if ($onlyDefault == PluginFormcreatorEntityconfig::CONFIG_DEFAULT_FORM_LIST_DEFAULT) {
$where_form['WHERE']['is_default'] = 1;
$where_form['WHERE']['AND']['is_default'] = 1;
}
}

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

0 comments on commit 23ab7a3

Please sign in to comment.