We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    This is a semi-complicated setup I have here, so read all of it before you reply. smiley

    On http://symphonicheaven.com/wii/, for example, if you are logged in, it will show a checkbox to add the game to your Wishlist (or Collection if the game has been released).

    Since I need to hide this for non-logged in visitors, I use Member Check (called uncached)...

    [!MemberCheck? &groups=`Registered Users` &chunk=`wlpeDawn` &default=`notLogin`!]


    ...which calls WLPE (cached, due to a issue in MODx 0.9.6’s parser)...

    [[WebLoginPE? &type=`profile` &messageTpl=`MessagePE` &profileTpl=`listDawn` &customFields=`wishdotnw` &inputHandler=`:userWishDotnw:wishdotnw:checkbox:()`]]


    I have a feeling the stuff around...

    $generalElementsArray = array('fullname','email','phone','mobilephone','dob','gender','country','state','zip','fax','photo','comment');


    ...is causing the issues. It looks like it updates those fields, even if they aren’t included in the template. Which would explain my issue.

    ...and the profile template is...

    <div class="add_padding"><div class="add_to">
    <form enctype="multipart/form-data" id="wlpeUserProfileForm" action="[~[*id*]~]" method="POST">
    
    [+form.wishdotnw+] <img src="/mysymphonic/add/wishlist.png" class="img_wishlist" alt="Add to your Wishlist!" title="Add to your Wishlist!" align="absmiddle">
    <p></p>
    
    <div align="center">
      <button type="submit" id="wlpeSaveProfileButton" name="service" value="saveprofile">Save</button>
    </div>
    </form>
    </div></div>


    It displays as expected, and grabs the fields that have already been "checked", and even correctly accesses the database and "checks" off the field in my profile.

    The issue is that it deletes the data in the web_users table, except for the name (not fullname) and the photo URL. The only thing I can guess is that Scotty didn’t expect someone to use WLPE like this, and coded it so it touches those fields no matter what, even if they don’t exist in the profile template.

    Anyone know how to fix this? I really want to have this feature on my website, but this bug is squashing it right now...

    EDIT: I noticed this code...

    $generalElementsArray = array('fullname','email','phone','mobilephone','dob','gender','country','state','zip','fax','photo','comment');


    Maybe this is what’s causing the issue. Since it seems like it updates those fields, even if they don’t exist...
      My Snippets
      -> PopUpChunk v1.0
      • 3749
      • 24,544 Posts
      I’m not familiar with the innards of WLPE, but it looks like you’re just saving a new user profile which replaces the old one. The empty fields get saved as empty fields.

      Maybe you could find a way to fill those fields from the existing profile before the save.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 28033
        • 925 Posts
        Quote from: BobRay at May 16, 2008, 11:18 AM

        I’m not familiar with the innards of WLPE, but it looks like you’re just saving a new user profile which replaces the old one. The empty fields get saved as empty fields.

        Maybe you could find a way to fill those fields from the existing profile before the save.

        EDIT: Yep, they need to be done under type="hidden". Maybe this might be a good thing to make note of for users, since it’s not apparent that WLPE will delete data w/out it...

        EDIT 2: Also, for fields like the Country selector, you need to create a CSS class w/ display: none, then put them in a DIV later w/ that class. That’s the easiest way I found to hide them. smiley
          My Snippets
          -> PopUpChunk v1.0
          • 10313
          • 375 Posts
          Hello, is this issue still current? I think I have the same problem here. I’m using the latest bugfix release 1.3.1 of WebLoginPE.

          As I don’t want the user to completely change his own profile but only the password, I changed the wlpProfileTpl to just show the two hidden fields for identifying purposes and the two fields password and password.confirm. Changing password works fine, but all other profile information gets lost.

          So I still have to put all information that I dont want to get lost into hidden fields?

          Martin
            • 28033
            • 925 Posts
            Quote from: FuryDE at Oct 10, 2008, 04:49 AM

            Hello, is this issue still current? I think I have the same problem here. I’m using the latest bugfix release 1.3.1 of WebLoginPE.

            As I don’t want the user to completely change his own profile but only the password, I changed the wlpProfileTpl to just show the two hidden fields for identifying purposes and the two fields password and password.confirm. Changing password works fine, but all other profile information gets lost.

            So I still have to put all information that I dont want to get lost into hidden fields?

            Martin

            AFAIK, yes. I dunno why the hell Scotty coded it to check those default fields even if they weren’t given.

            I dunno if this is tied to the registration issues I’m having now (basically, WLPE will register *any* user, even if their data is incorrect, like some fields not being included).
              My Snippets
              -> PopUpChunk v1.0