ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: radu81 on August 22, 2015, 05:31:33 pm

Title: Bug in Custom fields
Post by: radu81 on August 22, 2015, 05:31:33 pm
I have another problem with custom fields, I have a select box with some fields which is mandatory during registration, but users can still register without choosing a field. I think is a bug ;)
In the image below you can see the field is set to be be visible during registration and needed to be completed
Title: Re: Bug in Custom fields
Post by: emanuele on August 23, 2015, 01:52:08 am
A bug report is not a feature request. :P

Seriously, yes, this is something reported since the previous life, I thought this one was fixed a while ago, but I guess it slipped through... :-\
The "problem" is that a select box (and a maybe a set of checkboxes too? I don't remember.) is always considered "selected" because there is a "default selected option" (the radio buttons on the left of the inputs), that, even if it's not set, it's still considered to be set.
Title: Re: Bug in Custom fields
Post by: Jorin on August 23, 2015, 01:58:28 am
I see. Is it possbile to write code that checks if this field is once changed during registration?
Title: Re: Bug in Custom fields
Post by: emanuele on August 23, 2015, 02:07:04 am
The first step is to give an explicit option not to have a default, because at the moment you can use a trick, but it's not enough to be enforced at registration (I think).
The moment you have not set a default value, then you can force it to be selected at registration.

I don't have code handy, I should be able to have a look before night. ;)
Title: Re: Bug in Custom fields
Post by: Jorin on August 23, 2015, 02:25:57 am
I understand. My thought was to force the user to change the field from default option to another (or to the default option again). So ElkArte would be sure the user changed the field option.
Title: Re: Bug in Custom fields
Post by: emanuele on September 20, 2015, 11:39:22 am
Tracked: https://github.com/elkarte/Elkarte/issues/2239

If possible without too many efforts for 1.0.6, otherwise 1.1. ;D
Title: Re: Bug in Custom fields
Post by: emanuele on December 09, 2015, 04:23:24 pm
https://github.com/emanuele45/Dialogo/commit/6d010104884895e1121f29a36587353b06ebaa70

Any test is welcome! O:-)
Title: Re: Bug in Custom fields
Post by: radu81 on December 09, 2015, 05:57:53 pm
Thanks for tracking this ;) I'll test it tomorrow

edit: there will be a 1.0.6 release with this included?
Title: Re: Bug in Custom fields
Post by: emanuele on December 10, 2015, 02:18:02 am
There is a tracking for a 1.0.6:
https://github.com/elkarte/Elkarte/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.0.6
it will contain the code I posted.

But the code is not really that tested, so it may or may not work.
For example, one thing I forgot to test, is how (if) it works in the profile area... :-\
Title: Re: Bug in Custom fields
Post by: radu81 on January 15, 2016, 05:37:28 am
After a couple of weeks I can say it works, all new registered users have custom fields completed. Thanks!
Title: Re: Bug in Custom fields
Post by: emanuele on January 15, 2016, 06:43:27 am
Great! :D