SearchCustomData wi...
 
Notifications
Clear all

SearchCustomData with more than one search operation

5 Posts
2 Users
0 Reactions
684 Views
(@bennik)
Posts: 7
Active Member
Topic starter
 

I have usefiles with more than one custom attribute.
Example
type: level
maxplayers: 6

I want to filter for exactly type "level" and maxplayers "6".
I tried it this way

List<SearchCustomData> searchData = new List<SearchCustomData>();
searchData.Add(new SearchCustomData(
				"type", eSearchOperator.Equals, 
				"level"));

			searchData.Add(new SearchCustomData(
				"maxplayers", eSearchOperator.Equals, 
				"6"));

If I search just for one of those two it works. But not in combination.

It this possible at all?
I checked what kind of sql query is generated at the end and it looks to me that the way the query is build it can't work.

SELECT * FROM `combu_UserFile` WHERE ShareType = 0 
AND (Id IN (SELECT DataId FROM `combu_UserFile_CustomData` WHERE
 (DataKey = 'type' AND DataValue = 'level') AND (DataKey = 'maxplayers' AND DataValue = '6'))) ORDER BY lastmodified DESC LIMIT 15

 

 

 

 

 
Posted : 24/03/2021 8:05 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

You are right, the above query cannot work, so that means that nobody else used it to filter for more than one field or at least I didn't receive a report about it.

I will fix it and get back to you with a new code for that server method.

Thanks for the report.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 25/03/2021 8:11 pm
(@bennik)
Posts: 7
Active Member
Topic starter
 

Any news on this?

 
Posted : 19/05/2021 7:46 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Sorry for delay, it's a very busy time at office. What Combu version are you running? Since there isn't the possibility to filter UserFile by custom data in the current stable version 3.2.2, did I send a temporary version explicitly to you for testing purpose?

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 22/06/2021 7:55 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Hi, I've just released the version 3.2.3, unfortunately it's not available from autoupdater so you'll have to uncompress the zip from the new package and upload to server (remember to make a backup of your current server files, and keep your current /lib/config.php or don't upload it from the uncompressed folder; you could eventually publish it in a new folder if you already have apps using the current version).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 10/01/2022 7:56 pm
Share: