Skip to main content
Topic: Small bug in search members with dropdown custom fields (Read 5369 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Small bug in search members with dropdown custom fields

Reply #15

I did that edit but I still got an error (I searched for field "RE" into "Provincia", I click on the other dropdown field "Regione")

Code: [Select]
Unknown column 'cfdcust_cust_region.value' in 'order clause'
File: ../sources/subs/Memberlist.subs.php
Riga: 261

Nota: la versione del tuo database è 1.0.2.
sorry for my bad english

Re: Small bug in search members with dropdown custom fields

Reply #16

Stop finding bugs!!!! :P
I imagined something like this may happen, but hoped not... well it seems I really have to find a proper fix... O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: Small bug in search members with dropdown custom fields

Reply #17

I can live with this, I only found 2 errors in my log in a few months, if is solved into 1.1 version and require time to fix into 1.0.x there is no problem for me to wait the new release ;)
sorry for my bad english

Re: Small bug in search members with dropdown custom fields

Reply #18

I'm joking of course, this should be solved in 1.0.7, not later. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Small bug in search members with dropdown custom fields

Reply #19

I forgot to post it here, the correct fix is https://github.com/emanuele45/Dialogo/commit/c4740db0f32e56483bc948a5320f0aca7a5d97b2

So if you want to test it out, revert the changes I suggested and apply just these two:
Code: (find) [Select]
foreach ($input_fields as $field)
Code: (replace with) [Select]
foreach (array_keys($this->_search_fields) as $field)
and:
Code: (find) [Select]
					$customJoin[] = 'LEFT JOIN {db_prefix}custom_fields_data AS cfd' . $curField . ' ON (cfd' . $curField . '.variable = {string:cfd' . $curField . '} AND cfd' . $curField . '.id_member = mem.id_member)';
$query_parameters['cfd' . $curField] = $curField;
$fields += array($customCount++ => 'IFNULL(cfd' . $curField . '.value, {string:blank_string})');
Code: (replace with) [Select]
					$customJoin[] = 'LEFT JOIN {db_prefix}custom_fields_data AS cfd' . $field . ' ON (cfd' . $field . '.variable = {string:cfd' . $field . '} AND cfd' . $field . '.id_member = mem.id_member)';
$query_parameters['cfd' . $field] = $curField;
$fields += array($customCount++ => 'IFNULL(cfd' . $field . '.value, {string:blank_string})');
Bugs creator.
Features destroyer.
Template killer.

Re: Small bug in search members with dropdown custom fields

Reply #20

 ;D yep no more errors when clicking on those fields but the search is broken, I searched for "RE" into "provincia field" and look the results:

Re: Small bug in search members with dropdown custom fields

Reply #21

Would you mind attaching the file?
It looks like it searches in the name and email with it shouldn't.
Bugs creator.
Features destroyer.
Template killer.

Re: Small bug in search members with dropdown custom fields

Reply #22

I used a clean file memberlist.controller.php from the last version of elkarte and I did the edits you suggest below. I attach the file, I checked the results from my search and I confirm that the search is probably made into all fields, not just username and email. I found some users without "RE" characters into username or email, but into the custom field "Vehicle" or "Region (regione)"

Re: Small bug in search members with dropdown custom fields

Reply #23

Okay, this time seems better, would you try the attached one? O:-)

Re: Small bug in search members with dropdown custom fields

Reply #24

the search works well now, if I click on "provincia" field no error, but if I click on "Regione" I got this:
Code: [Select]
Unknown column 'cfdcust_cust_region.value' in 'order clause'
File: /../public/sources/subs/Memberlist.subs.php
Riga: 261

Nota: la versione del tuo database è 1.0.2
probably because there is nothing to sort in that field, "RE" province is in the same region for all users ;)
sorry for my bad english

Re: Small bug in search members with dropdown custom fields

Reply #25

Darn was a typos!... (Well, actually not exactly a typo, more a "I forgot to replace a thing" kind of thing.)

Re: Small bug in search members with dropdown custom fields

Reply #26

the search works, but still errors on both fields:
Code: [Select]
The database value you're trying to insert does not exist: cfdcust_cust_provin
and
Code: [Select]
The database value you're trying to insert does not exist: cfdcust_cust_region
sorry for my bad english

Re: Small bug in search members with dropdown custom fields

Reply #27

Well... now I'm pretty sure it's fixed... I hope! xD

Sorry for all the bouncing, but custom fields are a bit of a pain and Spuds is tha Master! :P
See if the attached gives the expected results. **fingers crossed**!!

Re: Small bug in search members with dropdown custom fields

Reply #28

It works, thank you for your help. Don't forget to include it into last release ;)
sorry for my bad english

Re: Small bug in search members with dropdown custom fields

Reply #29

YAY! :D
Bugs creator.
Features destroyer.
Template killer.