forms: Fix advanced search on fields with a `name`

Previously, advanced search was bugged in such a way that the advanced search on a field without a `name` value would result in a hit of all the tickets.

Fixes osTicket/osTicket-1.8#288