Skip to main content
Topic: "Custom" Profile Fields are Weird (Read 2402 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

"Custom" Profile Fields are Weird

So some of the default "custom" profile fields do odd things in 1.1 based on default values.

Personal text  gets saved as "Default Personal Text" or something like that and then shows up that way all over the forum if you don't set a value but update something else like setting an avatar.  The annoyingly when you change the default (to say nothing like it should be) it doesn't update all the people who got assigned the default value through updating some other part of the profile.

Gender shows up in the profile area (even when viewed by guests) even if the user doesn't set because it defaults to undisclosed.  Then if you modify it to have no default value it literally gets a default of "no default" which again causes it to show up everywhere with a value of "no default" which doesn't have an icon.  Manually deleting the "no default" from the databases fixed an empty/broken gender field from showing up in every profile.


Re: "Custom" Profile Fields are Weird

Reply #1

You must have a gender!  :D

 

Re: "Custom" Profile Fields are Weird

Reply #2

Apparently.  And it must be shown to the world at large as "undisclosed" or "no default".

Re: "Custom" Profile Fields are Weird

Reply #3

The default should be an attack helicopter :D
LiveGallery - Simple gallery addon for ElkArte

Re: "Custom" Profile Fields are Weird

Reply #4

Tracked at https://github.com/elkarte/Elkarte/issues/3151
Bugs creator.
Features destroyer.
Template killer.

Re: "Custom" Profile Fields are Weird

Reply #5

@scripple would you mind give a try to this changes and see if they work?
In sources/subs/Profile.subs.php:
Code: (find) [Select]
			));

$context['custom_fields'][] = array(
Code: (replace with) [Select]
			));
$context['custom_fields_required'] = $context['custom_fields_required'] || $row['show_reg'];

if ($area !== 'register' && ($value === '' || $value === 'no_default'))
{
continue;
}
$context['custom_fields'][] = array(

and, if you want to be picky (but it should make any difference), remove the line:
Code: [Select]
$context['custom_fields_required'] = $context['custom_fields_required'] || $row['show_reg'];

The idea is to change the behaviour so that:
1) if it is the registration form and the field is set to be shown, show it,
2) if it is not the registration form and the field is set not to have a default value, then hide it.

there may be some edge case I missed, not unusual, that's where your help comes in. :)
Bugs creator.
Features destroyer.
Template killer.

Re: "Custom" Profile Fields are Weird

Reply #6

Sorry but this was so long ago I fixed it and don't even recall how.

Re: "Custom" Profile Fields are Weird

Reply #7

I didn't realize it was that much... :-[
Bugs creator.
Features destroyer.
Template killer.