Osticket: Search by phone number doesn't work in osticket 1.10 stable

Created on 27 Apr 2017  Â·  13Comments  Â·  Source: osTicket/osTicket

Prerequisites

  • [y ] Can you reproduce the problem in a fresh installation of the "develop" branch?
  • [n ] Do you have any errors in the PHP error log, or javascript console?
  • [y ] Did you check the osTicket forums?
  • [y ] Did you perform a cursory search to see if your bug or enhancement is already reported?

Description

Searching for a phone number fails.

Steps to Reproduce

For example: search a phone number in the user directory and the query returns 0 results.
The Organization directory is affected too, also the advanced search or the new ticket "lookup and create user" popup. osTicket 1.9.X doesn't have this limitation/problem.

Expected behavior: Searched item should be shown.

Actual behavior: No matched entry will be found.

Versions

Server Information
osTicket Version v1.10 (901e5ea) — Up to date
Web Server Software Apache
MySQL Version 5.6.34
PHP Version 5.6.30-he.0
PHP Extensions
gdlib Used for image manipulation and PDF printing
imap Used for email fetching
xml XML API
xml-dom Used for HTML email processing
json Improves performance creating and processing JSON
mbstring Highly recommended for non western european language content
phar Highly recommended for plugins and language packs
intl Highly recommended for non western european language content
fileinfo Used to detect file types for uploads
APCu Improves overall performance
Zend Opcache Improves overall performance
PHP Settings
cgi.fix_pathinfo "1" is recommended if AJAX is not working
date.timezone Europe/Berlin
Database Information and Usage
Schema db10594795-ostmf (localhost)
Schema Signature 98ad7d550c26ac44340350912296e673
Space Used 2.01 MiB
Space for Attachments 0.01 MiB
Timezone CET (Interpreted as Europe/Berlin)

Installed Language Packs

English (United States) —
en_US — include/i18n/en_US

Tested with recent versions of Chrome, Firefox and Safari.

Most helpful comment

You are welcome. I have tested the updated pull request and now also the search via the search button works as expected.

Thank you for fixing this! I'm sure many people will be happy about this fix.

My first assumption that the advanced search is also affected wasn't correct. I stroked through the corresponding passage. This was related to inconsistent testing from me. Short numerical strings will not be found and longer numerical strings will be found. But this behavior is also in 1.9.x.

I think all the problems in this issue are solved now and I will closed it.

All 13 comments

So I have never been able to search for phone numbers on the User tab. My two production installations are still running 1.9.7 and cannot search by phone #. I can search by name, organization, email. Strangely I can search by extension.

In my installations with 1.9.x (for example 1.9.11 or 1.9.15) it is possible without any modification:

search1

search2

I guess phone number search should be possible when it is mentioned in the gui:

search3

Other people I know who are using osticket as well can search by phone number in osticket 1.9.x. They are wondering too why this is not possible in osticket 1.10..

It would be nice when a developer could clarify this:

should the phone number search be possible in osTicket and it is planned to make it work again?

I'll see if I can get clarification on this today. Does Advance Search work for phone number? Maybe they just need to add an advanced search link to the right of that field.

@ntozier Yes and no. The advanced search in osticket 1.10 finds tickets when the phone number is in the ticket. But it doesn’t find any tickets when the phone number is only in the connected user or organization.

@mfelber I just wanted to add that since 1.10 I can't search custom fields or phone numbers anymore either. It worked fine in 1.9
I have posted over on the forums about it too, it's frustrating because my employees search for an account number that used to pull right up but now it doesn't find anything.

Looking at the history of the ajax for users search, it looks like the SQL query would return any value that was associated to the user and compare that to the search query, since it's been moved to the ORM structure it seems to have been limited.

https://github.com/osTicket/osTicket/blob/4010b27a5fd90ac08c9603636e6d65113c5ded51/include/ajax.users.php#L51-L61

@ntozier Have you already clarified something? We need the search for telephone number and it worked fine in our previous version 1.9.15

I have submitted a pull request (#3900) that should fix this issue. Please pull the changes, apply the changes, test the changes, and get back to me. Thanks.

I have tested the changes from the pull request and can confirm that the "background search" (which is used when you type something) in the user directory or user search popup will find now the corresponding entry:

search typing

But when you use the search button (seems to be a different search mode) the search still doesn't find anything (also when I use longer search terms like "0123456"):

search button

Thank you! I will look into this more!

Okay, I have updated the pull request! See if it works for you now!

You are welcome. I have tested the updated pull request and now also the search via the search button works as expected.

Thank you for fixing this! I'm sure many people will be happy about this fix.

My first assumption that the advanced search is also affected wasn't correct. I stroked through the corresponding passage. This was related to inconsistent testing from me. Short numerical strings will not be found and longer numerical strings will be found. But this behavior is also in 1.9.x.

I think all the problems in this issue are solved now and I will closed it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus4000 picture markus4000  Â·  3Comments

dmnc-net picture dmnc-net  Â·  3Comments

ghost picture ghost  Â·  6Comments

simonnzg picture simonnzg  Â·  5Comments

roman-1983 picture roman-1983  Â·  5Comments