Search in support tickets

#965 – advanced search by ad_vectormap

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, 28 September 2021 10:01 CEST
Edu2021
In advanced search I can select several provinces. It seems very logical to me because you can search in your province and surroundings. But the sql that it generates does it with "LIKE".

SELECT adext. *, A.id FROM .... WHERE ... AND (a.ad_vectormap LIKE '% [{"code": "ES-M", "name": "Madrid"}, {"code" : "ES-TO", "name": "Toledo"}, {"code": "ES-GU", "name": "Guadalajara"}]% ') AND ... GROUP BY a.id
this sql should look something like this:
AND (a.ad_vectormap IN ('% {"code": "ES-M", "name": "Madrid"}%', '% {"code": "ES-TO", "name": "Toledo "}, '% {" code ":" ES-GU "," name ":" Guadalajara "}%')
to collect the three provinces.

If it is not possible, how to make the election of the provinces only be able to choose one?
Custom Fields
Joomla Version
3.10.2
PHP Version
7.4.20
Product
AdsManager
Product Version
3.2
Wednesday, 29 September 2021 09:21 CEST
loic
Hello,

You are free to custom the code if you like, however it is not part of the support.

Regarding you message, I need to take a look at the code.
The vector map plugin hasn't needed a change in a long time, so I will run some test.

Best regards.
 
Wednesday, 29 September 2021 13:57 CEST
Edu2021
Thanks.
It is simply that in advanced search you can choose two or more provinces, but in the search it does not filter ads that are in those provinces, but rather it filters by ads that all the selected provinces owe. And it is impossible.
Friday, 01 October 2021 09:45 CEST
loic
Hello,

Ok, if it does that then this is clearly an issue.

I will take a look.

Best regards.
 
Friday, 01 October 2021 17:20 CEST
loic
Hello,

Ok there is a mistake in the plugin.

Open the file images/com_adsmanager/plugins/vectormap/plug.php

And replace, line 167:
//$values = json_decode($value);
$values = $value;


By
$values = json_decode($value);
//$values = $value;


Best regards.
 
Thursday, 07 October 2021 14:04 CEST
Edu2021
Perfect. It works.
Thanks.
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.