From edf2efb517055894c8147833a3b700ef6e4294f3 Mon Sep 17 00:00:00 2001 From: fusionate Date: Thu, 16 Jan 2025 10:51:41 -0700 Subject: [PATCH] Voicemails - List: Restore search functionality. --- app/voicemails/voicemails.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index 435a3be647..28dab54440 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -119,7 +119,6 @@ $sql_search .= " or lower(voicemail_enabled) like :search "; $sql_search .= " or lower(voicemail_description) like :search "; $sql_search .= ") "; - $parameters['search'] = '%'.$search.'%'; } //prepare to page the results @@ -146,7 +145,10 @@ $sql .= "and voicemail_uuid is null "; } } - $sql .= $sql_search ?? ''; + if (!empty($sql_search)) { + $sql .= $sql_search; + $parameters['search'] = '%'.$search.'%'; + } $num_rows = $database->select($sql, $parameters, 'column'); //prepare to page the results