Search in support tickets

#208 – Can't search by field with multiselect type

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Tuesday, 09 January 2018 18:10 CET
hvtechnology
Hello,

I have created e field for City and the type of this field is Drop Down Multi-Select. I want to let users to select up to 3 cites for an ad. After ad is successfully created, it stores these three cities on database as text type with comma separated and in the same cell. The problem is that I can not search by city ads with more then one city. You will find examples on attachment.

Do you have any solution for this?

I think to make any edition on the query that loads the results of search module. Maybe to replace any '=' with 'LIKE' ?

Please help me!
Thank you!
Custom Fields
Joomla Version
3.8.3
PHP Version
5.6
Product
AdsManager
Product Version
3.1.11
Attachment
Tuesday, 09 January 2018 19:20 CET
loic
Hello,

Just to be sure, you wish to be able to select multiple city in the search field ?

Best regards.
 
Wednesday, 10 January 2018 09:37 CET
hvtechnology
Hello,

No, I want to select just one city on search field.

Thnx
Wednesday, 10 January 2018 16:43 CET
loic
Hello,

Ok, you wish to replace the dropdown in the search field by a textfield and change the SQL request to match the string.

I cannot give you a lot of pointer for that because that is not covered by the support.

the search field are generated by the file components/com_adsmanager/helpers/field.php, in the function showFieldSearch

The fields are displayed by using a switch, you need to find the type 'multiselect', you can change the type of the input there.

After that, in administrator/components/com_adsmanager/models/contents.php, find the function SQLFilter, the SQL condition is written here.

You will also need to find the correct type in the function.

Best regards.
 
Friday, 12 January 2018 11:21 CET
hvtechnology
Sorry men I reply this to wrong ticket. Please delete my above reply.
Friday, 12 January 2018 17:01 CET
loic
Hello,

Since this is a public, I strongly advice you to change the password of your server.

If you need to communicate those credentials, be sure that the ticket is private and not public.

You can change the status of the ticket by clicking on the button at the top of the page. Of course, you can only do that for your tickets.

Best regards.

 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.