• Welcome to Simple Machines Community Forum. Please login or sign up.
October 24, 2021, 10:04:17 AM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


Profile fields defaulting

Started by colby2152, May 10, 2011, 04:32:54 PM

Previous topic - Next topic

colby2152

I have drop down profile fields with a default option.  The problem with this is that when a user edits their profile consecutive times then it reverts to the default setting.  I would like this not to happen.  The default should only be used when the user has never modified such field.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

I know bumping threads is shunned here, but this has not received a response in three days.  To clarify the first post, I have several profile fields with drop-down choices.  Each drop-down choices has a default (blank).  The default is actually just a wrapper of italics code because I don't want a space, and I need the default to show as nothing.  This profile field shows up in the topic view, PM and profile page.  For some reason, the following happens AFTER a user edits their profile and saves their profile... say they decide to edit it again and save it (generally happens when people are toying around with their signature)... after the first save, all of the profile fields with drop-down choices revert to the default.  It only becomes an issue when the user saves the profile edits once again.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

This problem is plaguing my forum. :-[
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

Kays

Hi, have you got a screenshot of how you've got those fields setup. Or a test account maybe?

Any errors in the error log?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Sir Osis of Liver


Just a guess, but sounds like the database values for the dropdown options are not being requested when the form reloads, so those items revert to default (blank), and that's what's saved to the db on the second edit.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

colby2152

Quote from: Krash. on May 14, 2011, 11:48:06 PM

Just a guess, but sounds like the database values for the dropdown options are not being requested when the form reloads, so those items revert to default (blank), and that's what's saved to the db on the second edit.

Krash, that sounds logical.  How do I force an entire profile save and load?
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

Sir Osis of Liver


Are you using a mod, or did you code it yourself?  It appears that the form saves the new values to db correctly, but when it reloads it does not retrieve the saved values for the dropdown options.  It's half right.  Don't know enough about MySQL functions to help much, but if you attach the code, maybe someone else can jump in and find the problem.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

CapadY

What happens when you disable the use of SMF-cache ?

I've had something like this before and it was solved after disabling the cache.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

colby2152

Quote from: CapadY on May 22, 2011, 03:52:19 AM
What happens when you disable the use of SMF-cache ?

I've had something like this before and it was solved after disabling the cache.

How do I disable the cache?
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

CapadY

Admin - Configuration - Server settings - Chache

And don't forget to empty the cache after disabling it.

Admin - Maintenance - Forum maintenance - Default, the last option.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

colby2152

Quote from: CapadY on May 22, 2011, 02:02:24 PM
Admin - Configuration - Server settings - Chache

And don't forget to empty the cache after disabling it.

Admin - Maintenance - Forum maintenance - Default, the last option.

Thanks, but apparently the cache was already disabled.  Could this mean there is another issue?  I just emptied the cache, but I am not sure if the problem has been resolved.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

This is still a very annoying problem.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

I have tried all suggestions and still nothing...
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

Xarcell

I have seen this problem before.

If you create a blank field as a default selection, and then edit your profile and change only one of those fields, all others will revert to default.

2 ways to avoid this. 1.) Don't use a blank field. 2.) tell your user's that when they change a profile field, they must change(re-select) all of them.

On my forum I use things like "other" as a default field. Rather than leave it blank.

colby2152

Quote from: Xarcell on June 13, 2011, 09:36:49 PM
I have seen this problem before.

If you create a blank field as a default selection, and then edit your profile and change only one of those fields, all others will revert to default.

2 ways to avoid this. 1.) Don't use a blank field. 2.) tell your user's that when they change a profile field, they must change(re-select) all of them.

On my forum I use things like "other" as a default field. Rather than leave it blank.

Actually, my default selection is a "blank" in the form of two italic BBC codes {i}{/i}.
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

I notice that when I edit my profile, there is a blank space at the top of the drop-down.  This isn't part of my selection choices for the profile field.  Somehow, this rogue blank is appearing and causing the issues?
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

I take it there is no solution?
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

colby2152

I edited a profile to pick a selection in the drop-down.  It registers to the database so that the profile is updated, but the following screen (see attached GIF) shows that it is reset.  Notice the empty option in the drop-down.  I don't even have this as an option in my custom profile field selection.

ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

live627

The blank means no selection.

colby2152

Quote from: live627 on July 09, 2011, 05:17:07 PM
The blank means no selection.

Yeah... I know... But why are the fields defaulting to that after a value is selected?
ProFSL.com - Pro Fantasy Sports Leagues - Advanced fantasy sports leagues, contests, free chances at cash/prizes, and sports discussion.

Need a server? I am happy to advocate this hosting solution - hands on customer service and reliability is relieving!!!

Advertisement: