Skip to content

Commit 593f568

Browse files
committed
Bug: Search using tags_type without tags was not working
1 parent 3984c7c commit 593f568

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/Controllers/TicketsController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ public function register_search_fields(Request $request)
10691069
$search_URL = route(Setting::grab('main_route') . '.search');
10701070

10711071
// Check all fields
1072-
$a_fields = array_merge($this->a_search_fields_numeric, $this->a_search_fields_text, $this->a_search_fields_date, $this->a_search_fields_text_special, ['department_id', 'list']);
1072+
$a_fields = array_merge($this->a_search_fields_numeric, ['tags_type'], $this->a_search_fields_text, $this->a_search_fields_date, $this->a_search_fields_text_special, ['department_id', 'list']);
10731073
foreach ($a_fields as $field){
10741074
if($request->filled($field)){
10751075
// Add field to search
@@ -1102,7 +1102,12 @@ public function register_search_fields(Request $request)
11021102
}
11031103

11041104
$search_URL.= '/' . $field . '_type/' . $search_fields[$field . '_type'];
1105-
}
1105+
}
1106+
1107+
// Register tags_type although "tags" itself is not registered
1108+
if ($field == 'tags_type' and !isset($search_fields['tags']) and in_array($request->{$field}, ['has_not_tags', 'has_any_tag'])){
1109+
$search_fields[$field] = $request->{$field};
1110+
}
11061111

11071112
// Register date type and add in URL
11081113
if (in_array($field, $this->a_search_fields_date) and $request->filled($field . '_type')){

0 commit comments

Comments
 (0)