Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade here. These earlier versions are no longer being updated and have security issues.

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

peregrine
«1

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    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.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    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‌ !!

    peregrine
  • 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.

    Bleistivtvrijvlinder
  • 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?

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    vrijvlinder
  • @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!

    Bleistivt
  • 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.

    hgtonightBleistivt
  • FerrariSteveFerrariSteve Seattle
    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!

    persistent
  • 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.');

    vrijvlinder
  • 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 "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    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...

  • hgtonighthgtonight ∞ · New Moderator

    @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.

    rbrahmson
  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Thanks @hgtonight, that is indeed a workaround, far from elegant I'd say. Obviously not your fault.

  • MrVladMrVlad New
    edited August 2015

    Hello !

    I had a similar issue, and the solution provided by @Bleistivt provided a functionnal workaround for me. However, even after changing line 229 as described, the issue remains when a user registers : Nothing appears in his profile and database 'gdn_usermeta' remains the same.

    If a user edits his profile, then the changes are successfully commited. Does anyone had the same issue ? If so, is there any known solution ? I'll try to look into the code in order to solve the problem (I'm not so good with php though :/).

  • Following my previous post : There is no database update triggered when a user sign up, which is in my case a serious issue. In order to fix this, would you recommand editing an existing function in profile extender (I was thinking using 'RegisterValidation_Handler') or creating a new one ? I'm quite lost so all of this might sound very confused ^^

  • @MrVlad What version of Vanilla? This has likely been fixed with 2.2

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    peregrine
  • MrVladMrVlad New
    edited August 2015

    @Bleistivt I'm running v2.1.11 at the moment, thx for the tip :), I'll try to download the latest version and see if I can fix the plugin from that !

    Just to let you know: I'm currently trying to find the best event hook that I can use to, once the user registration is completed, update gdn_usermeta with the data from the registration form ... quite a hard task for me, but i'm not desperate ^^

  • It's working now :D (at least that part) ! Thx a lot !

  • MrVladMrVlad New
    edited August 2015

    Well ... of course there are more issues ! After uploading my plugin (I was testing with wamp before that), the issue is back :( !

    What I did, following @Bleistivt advice, was looking in 2.2b code and use a couple of function from there :

    • function userModel_afterInsertUser_handler ($Sender, $Args)
    • function userModel_afterSave_handler($Sender, $Args)

    with

    • function updateUserFields($UserID, $Fields)

    The probleme is: When I use afterInsertUser_handler, on the server, $Args do NOT contains the data for profile extender fields. So, I thought of using another event hook and when I tried userModel_beforeInsertUser_handler, I sucessfully retreive the data from profile extender fields BUT the information related to the user (ID, etc.) is, of course, not here.

    Then, I tried to create a global variable '$newUserMeta', store the profile extender data inside it using userModel_beforeInsertUser_handler hook, and merge it with '$Args' in afterInsertUser_handler ... which results in an unbelievable mess. Which I don't understand because everything works fine on locale (using parts from 2.2's code).

    After that, I set up some logs too see if the functions from 2.2 are triggered, and they are, in both case (locale and server). So the issue is really with the content of '$Args' with afterSave_handler ...

  • After 10 days of wandering ... my mental health is having a hard time. It works with Wamp, so it must be related to server configuration (I guess), but I have ZERO knowledge in that area ...

    Should I press the reset button for vanilla (if there's one ^^)?

  • I'm having the same problem that MrVlad has. When a user registers and fills out forms created via Profile Extender, that data disappears immediately afterwards.

  • edited September 2015

    I'm having the same problem. When a new user registers, the extra registration forms provided by Profile Extender does not get saved into their user profile.

    Could it have something to do with the fact that this line seems to be commented out by default on line 13 in class.profileextender.plugin.php?

    // 'RegisterPermissions' => array('Plugins.ProfileExtender.Add'),

«1
Sign In or Register to comment.