Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Profile Extender fields blank when editing profile

Hi,

After you've set whatever you wanted in the custom fields added to your profile using the Profile Extender plugin, if you go back to the profile edit page, the fileds are blank again. There previous value isn't retrieved.
This can be quite annoying for users, and also for admins who need to change something on a user's profile from the dashboard; the edit menu appears with the fields blank, so you have to actually open the user's profile in a new tab and copy the existing info back into the fields.

Screenshots:


Fill out these custom fields and save... go back to Profile, they appear as expected... go back to Edit Profile, the three fields are blank again just like in the picture


In the dashboard: edit a user... the three fields are blank, even if the user has entered something on their profile

«13

Comments

  • Ok, the values should be getting stored in the config.php, have you checked to see if they are being saved ?

  • AccentAccent
    edited September 2014

    Um, they aren't, but I suspect there's a misunderstanding here...? The labels — "Line 1", "Line 2" and "Line 3" — are what I set them to be, and do indeed appear in config.php. What's missing is the value inside the fields, even after a user's set them. I don't think all three values of every member's profile would be stored in config.php? that seems like a huge amount of data to store there instead of in the database. (The values are stored in the database, by the way.)

    For instance, if I go to my profile and set "Line 1" to be a link to my website and save the changes, it'll work as expected and the link will be displayed on my profile... but then if I go back to edit my profile, the "Line 1" field will be blank again, so if I want to keep the link as it is I have to enter it again. Otherwise the blank value will override it.

  • The labels — "Line 1", "Line 2" and "Line 3" — are what I set them to be

    oh, yes those are the values that get stored in the config.php , the name of the field. That is what I thought you could not save...

  • Yup, it worked! Thanks @Bleistivt‌ !!

  • peregrineperegrine MVP
    edited September 2014

    Damn, I was just testing and was going to post change you suggested. @Bleistivt - you're too fast.

    works in 2.1.3

    I would have clicked speedy :)

    I suppose you will add to github.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • all works! thanks! but fix it please in downloadable plugin zip file.

  • Hi Y'All,
    Just had a new user register. There are three custom, dropdown profile fields and all are set to Yes for required, on registration and in profiles yet his profile shows none of them.
    What's up?
    Thanks,
    Jim

  • @JimD You should open a new thread for something like this.

    Maybe the user set them to empty after registration. Can you reproduce this with a test account?

  • @Bleistivt‌ Yes, I can reproduce it! If the new user does not select an item from the dropdowns but rather just accepts the default first choices (which were suitable for this new user), nothing is chosen. I registered as a new user and did not choose something and the fields are blank.
    I suppose I could put "Choose" as the first choice, forcing someone to choose!

  • Nope, that didn't work. It seems that the registrant must choose something other than the first choice for all three profile fields. I chose only one of the three and nothing was saved.

  • peregrineperegrine MVP
    edited November 2014

    .

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited November 2014

    @JimD said:

    Yes, I can reproduce it! If the new user does not select an item from the dropdowns but rather just accepts the default first choices (which were suitable for this new user), nothing is chosen. I registered as a new user and did not choose something and the fields are blank.

    you might want to take the Profile Extender version 3.01 out of the Master version.
    seems to have fixed it when I copied it over PE 3.0 in vanilla 2.1.6. nor sure if other stuff breaks but that is fixed.

    I put my options in with a blank line

    and required the fields on registration.

    the validation worked and forced me to select a field prior to registration

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • edited December 2014

    I was having this same issue, but the line 229 fix above is now allowing them to save.

    However, a couple of suggested additional fixes:

    The URLs on lines 132 - 138 for Twitter, Facebook, and LinkedIn should all start with https:// instead of http://

    Also, if the data entered in the Profile's Twitter field does NOT start with @, then the URL for the Twitter field in the Profile actually puts one A ref inside another, like so:

    <a rel="nofollow" href="http://twitter.com/foobar"><a href="/forums/profile/foobar">@foobar</a></a>

    The "inside" a is what's followed by the browser, and in the above case, if the Twitter handle and the forum username don't match, the link will be a 404.

    However, if the data entered in the Profile's Twitter field DOES start with @, then the URL for the Twitter field in the Profile contains an unneeded @ in the URL, and an extra @ in the display text, like this:

    <a rel="nofollow" href="https://twitter.com/@foobar">@@foobar</a>

    For now, I worked around by editing line 132 to read:

    $Fields['Twitter'] = Anchor($Value, 'https://twitter.com/'.$Value);

    Which just spits out whatever is in that field without worring about the @.

    Not sure if (or how) I'm supposed to report this on github, so figured I'd toss it here. If I should have put it somewhere else, please enlighten me and I'll do that moving forward.

    Thanks!

  • I am using 3.1 version of the plugin and apparently line 229 is already fixed, but still I can see blank profile fields in Edit Profile. Any idea what can be the problem?

  • The issue was line 229 in version 3.1 where it uses incorrect key $Sender->Data("User.UserID") whereas it should be $Sender->User->UserID (got it from somewhere else in same code); correct statement for line 229 should be as below:

    $this->UserFields = Gdn::UserModel()->GetMeta($Sender->User->UserID, 'Profile.%', 'Profile.');

  • peregrineperegrine MVP
    edited January 2015

    @vanfan said:
    I am using 3.1 version of the plugin and apparently line 229 is already fixed, but still I can see blank profile fields in Edit Profile. Any idea what can be the problem?

    The issue was line 229 in version 3.1 where it uses incorrect key $Sender->Data("User.UserID") whereas it should be $Sender->User->UserID (got it from somewhere else in same code); correct statement for line 229 should be as below:

    $this->UserFields = Gdn::UserModel()->GetMeta($Sender->User->UserID, 'Profile.%', 'Profile.');

    where is version 3.1 located?

    edit: never mind.

    it was probably a typo. I guess you meant 3.01.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • rbrahmsonrbrahmson ✭✭✭

    How do I reorder the profile fields?
    The problem is that we've added several fields, and now a new one needs to be added, but the plugin adds it to the bottom while we need it to be the third field. I wish there was a drag-n-drop function, but any other solution would be fine.
    Please help...

  • @rbrahmson said:
    How do I reorder the profile fields?
    The problem is that we've added several fields, and now a new one needs to be added, but the plugin adds it to the bottom while we need it to be the third field. I wish there was a drag-n-drop function, but any other solution would be fine.
    Please help...

    The sort is determined by the order in which the configuration was saved. You can change the sort order by changing the order of the configurations 'ProfileExtender.Fields' in /conf/config.php.

    This isn't ideal, of course. I would suggest adding a sort to the field array and then use the existing jQuery module (nested sortable) on the settings screen.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.