Forums / Developer / ezselection datatype storing in data_text and '0' in data_float

ezselection datatype storing in data_text and '0' in data_float

Author Message

Sergi A

Thursday 25 March 2010 4:58:45 am

Hi!

I have a problem with a ezselection datatype field.. when i search it (with my own search-form i built in a template) i'm having problems with those items with a 0 assigned as data (item 0 of the selection)... a search on index=0 returns all items because data_float is 0 (and not null) for all the items... data_text is ok ("0", "1", "2"... correctly), but because ez finds a 0 on any data* field, it returns true..

anyway, also it's strange to store it in data_text, shouldn't it be stored in data_integer and all the rest (data_float, data_string) set to NULL ??

thanks!

Nicolas Pastorino

Thursday 25 March 2010 8:32:50 am

Hi Sergi,

Would you mind showing us your custom search-form template ? That will probably help us a bit.

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Sergi A

Monday 29 March 2010 8:43:06 am

Thanks Nicolas,

I just revised the template and found an error in my code... now it works :), but i still don't understand why there is a 0 value in the data_float field of the ezselection attribute.. i suppose it is normal, but it was very strange to me to see a null value in the data_int field but a 0 value in data_float one.

Cheers!

Sergi.

Fabien Mas

Tuesday 30 March 2010 9:01:48 am

Hi,

If you have several options selected, it will be stored as : ind1-ind2-ind3-... and it is not anymore a data_int

that's why it is stored in data_text

Cheers!

Fabien