We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45766
    • 78 Posts
    Hi!

    I made a form where user can update their profile at the frontend.
    Us use the UpdateProfile snippet from the Login Extra.

    Now i would like to use the classExternder extra for adding some fields to the users Profile instead of using the extended Fields. The Fields exist and from the backend i can fill them.

    So far so good!

    BUT wehen i would like to use the new fields withe the UpdateProfile Snippet it will add some extended Fields instead using the fields classExtender made.

    Here is how i tried it
    [[!ExtUserUpdateProfile]]
    [[!UpdateProfile? &postHooks=`userToGroup`]]
    <!-- html, header, some html-tags -->
    <form class="form profilPages" action="[[~[[*id]]]]" method="post">
      <div class="formGroup">
        <label for="evzContactPerson">Contact Person</label>
          <input type="text" name="evzContactPerson" id="evzContactPerson" value="[[+evzContactPerson]]" data-value="[[+contactPerson]]" />
          <span class="error">[[+error.evzContactPerson]]</span>
          <i class="fa-clipboard fa fillForm"></i>
      </div>
      <button>Update</button>
    </form>
    <!-- ... some html ... -->
    


    Here is the definition of the field:
    <field key="evzContactPerson" dbtype="varchar" precision="255" phptype="string" null="true"/>
    


    Here is what works (at the manager):
    <div class="x-form-item x-tab-item">
      <label class="x-form-item-label" style="width:auto; font-weight:bold; float:none; font-size:12px">evz Contact Person</label>
    
      <div class="x-form-item x-tab-item">
        <input type="text" name="evzContactPerson" value="[[+evzContactPerson]]" class="x-form-text x-form-field"
                />
      </div>
    </div>
    

    This question has been answered by andytough. See the first response.

      • 38783
      • 571 Posts
      You need to add &useExtended=`0` to your code.

      [[!ExtUserUpdateProfile]]
      [[!UpdateProfile?
      &postHooks=`userToGroup`
      &useExtended=`0`
      ]]
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 45766
        • 78 Posts
        outch… Thanks!

        BUT

        I can read now the fields. But can not save the changes i made. Success Message appears, but nothing is written to the Database
          • 45766
          • 78 Posts
          Tried it without my postHook, makes no difference. Default User fields like full name are possible to save
            • 38783
            • 571 Posts
            Have you changed the name of the 'submit' button? Changing its name can cause this problem.

            Also, looking at this line of code...

            <input type="text" name="evzContactPerson" id="evzContactPerson" value="[[+evzContactPerson]]" data-value="[[+contactPerson]]" />
            


            On a form I have that works OK I do not have the data-value="" part. I am not familiar with it, but if it is required should it also read [[+evzContactPerson]]

            <input type="text" name="evzContactPerson" id="evzContactPerson" value="[[+evzContactPerson]]" data-value="[[+evzcontactPerson]]" />
            


            In my form I make also include ! for the value, so it is uncached.

            [[!+evzContactPerson]]
              If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

              email: [email protected] | website: https://andytough.com
              • 45766
              • 78 Posts
              Hm, no. I tried:

              rename the Button AND rename the Button and call the placeholder uncached
              Result: the extended fields have been filled again (even though i did not delete &useExtended=`0`)

              Try to get the placeholder uncached [[!+abc // Without renaming the button
              Result: no difference. Nothing will be saved

              The data-src is right. Its possible for the user to fill the filed with some default text, stored in the data-src
                • 38783
                • 571 Posts
                Is the user added to the group specified in the userToGroup snippet when you submit the form?

                Could you try temporarily removing the data-value="[[+contactPerson]]" just to rule it out as a possible source of the problem?

                It might also be worth moving &useExtended=`0` up one line so it reads...

                [[!ExtUserUpdateProfile]]
                [[!UpdateProfile?
                &useExtended=`0`
                &postHooks=`userToGroup`
                ]]


                Is anything showing up in the error logs?
                  If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                  email: [email protected] | website: https://andytough.com
                  • 45766
                  • 78 Posts
                  No matter what order. stays the same result. even if i remove my postHook. Stays the same :/
                    • 17301
                    • 932 Posts
                    Check your database does the table its recording to actually exist? if not just create it and you should be good smiley
                      ■ email: [email protected] | ■ website: https://alienbuild.uk

                      The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                      • 45766
                      • 78 Posts
                      Database? There is a Database? ;p

                      I can edit and save the new fields from the manager. So i think this should be fine.

                      the Problem only exists if i would like to edit and save them from the frontend using ExtUserUpdateProfile and UpdateProfile