Skip to Content Skip to Menu

Fields being erased on profile save

9 years 5 months ago #264646 by bengallienne
Fields being erased on profile save was created by bengallienne
I am using Profile Pro with Community Builder and have found a bug where when saving your profile, it will set certain fields that aren't shown on the profile page to be empty in the database.

I have tried to track down the issue, and although it is because profile pro allows you to show certain fields for certain people, it is something that can be fixed in core.

It is certain field types that are emptied. The ones I know for certain are:
Drop Down (single select)
Email
Radio Buttons
Date
Web Address

There is probably a couple more that I don't use.

The only one I can find that I'm certain it does not affect is text field.

I followed Web Address and looked into the class CBfield_webaddress.

I then tracked it down to the function prepareFieldDataSave.

I did a var dump of $this either side of the line 2467 in cb.core.php shown below and on the die before, it had the correct in the object, and in the die afterwards, the fields were was empty.

$value = stripslashes( cbGetParam( $postdata, $col, '' ) );

That is in a loop that goes through all the comprofiler table columns and I believe because there is not value being set on the profile page, it defaults to the 3rd parameter '' (empty). It then updates this in the database further down the function.

The function cbGetParam being called is in LegacyFoundationFunctions.php on line 555.

I will also raise the issue with ProfilePro as well but currently the only fix is to either set the fields as text fields or add them to the profile page and hide them. Neither of which are good workarounds so any help would be appreiciated.

Thank you.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 5 months ago #264655 by krileon
Replied by krileon on topic Fields being erased on profile save
Disable CB Profile Pro entirely and see if issue persists. I can not confirm your issue on 2 installs. CB Conditional is very capable of showing and hiding fields correctly with optional value resetting (if the field has been hidden). We can't help you with a product we didn't develop so until it's out of the way entirely I don't know if it's the cause or not. My guess is CB Profile Pro show/hide jQuery is emptying the input instead of just disabling it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum