We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Pls confirm you've changed the resource *name* as I asked, UpdateProfile. Last time you said it was update-profile, which is different.

    After that, delete all code there and put the standard snippet. Also, pls look in your error log for any errors.

    Still a blank page, right? We have to do some debugging i think.
      • 46886
      • 1,154 Posts
      Ok here is some advice on troubleshooting, from BobRay:

      If it's not clear if the code is running or not, I like to start with this one-liner at the top of the snippet or plugin code:

      1 $modx->log(modX::LOG_LEVEL_ERROR, '[snippet name] is executing');


      If nothing gets written to the error log, it's not executing.

      You can also duplicate or move the message around to see if the various parts of the code are executing.

      I felt before the sample code should be the best way while troubleshooting, but a stripped down code might be better at first also, if you know how to strip it down. I was thinking about the register code which I know works. I never used all the various form stuff in the sample you provide, at least i don't remember using it, one way or another.

      So keeping it to the very basics for now is probably wise.
        • 46886
        • 1,154 Posts
        Also, here is my code, I just checked it and it worked. Its got some extra stuff that would need to be pulled out though, like the Avatar stuff, well maybe it doesn't need to come out, not sure. Anyway, confirmed to work for me.

        [[!UpdateProfile? 
        &postHooks=`postHook.DiscussUpdateProfile` 
        &preHooks=`avatarUpload`
        &useExtended=`1`
        &excludeExtended=`email:required:email,display_name,show_email,show_online,Profile_Photos,use_display_name,signature,signature:allowTags,login-updprof-btn`
        &validate=`nospam:blank,`']] 
        [[!DiscussUpdateProfileLoader]]
        
        <h1>Update Profile</h1>
                <br class="clear" />
        <div class="update-profile">
            <div class="updprof-error">[[+error.message]]</div>
        [[+login.update_success:is=`1`:then=`[[%login.profile_updated? &namespace=`login` &topic=`updateprofile`]]`]]
            
            <form class="form" enctype="multipart/form-data" action="[[~[[*id]]]]" method="post">
                <input type="hidden" name="nospam" value="" />
                <!--Current Location-->
                <label for="current_location">Current Location: 
                    <span class="error">[[+reg.error.current_location]]</span>
                </label>
                <input type="text" name="current_location" id="current_location" value="[[+current_location]]" />
                <br class="clear" />
                <!--Display name-->
        <li style="border-bottom:1px dashed #7e7e7e;"><label for="display_name">Display Name <span class="error">[[!+up.error.display_name]]</span></label>
        <input type="text" name="display_name" id="display_name" value="[[+up.display_name]]" />
         <!--Use displayname-->
        <label for="use_display_name"> Use Display Name in Forums<span class="error">[[!+up.error.use_display_name]]</span></label>
        <input type="hidden" name="use_display_name" id="use_display_name_hidden" value="0" />
        <input type="checkbox" name="use_display_name" id="use_display_name" value="1" [[!+up.use_display_name:FormItIsChecked=`1`]] /></li>
                <br class="clear" />
                <!--Signature-->
        <li style="border-bottom:1px dashed #7e7e7e;"><label for="signature">Signature<span class="error">[[!+up.error.signature:stripTags=`p,b,strong,i,a,ul,li`]]</span></label>
        <textarea name="signature:allowTags" id="signature">[[!+up.signature]]</textarea></li>
          
                <br class="clear" />
                <br class="clear" />
          <!--Show email-->
        <li style="border-bottom:1px dashed #7e7e7e;"><label for="show_email">Show Email in Forums <span class="error">[[!+up.error.show_email]]</span></label>
        <input type="hidden" name="show_email" id="show_email_hidden" value="0" />
        <input type="checkbox" name="show_email" id="show_email" value="1" [[!+up.show_email:FormItIsChecked=`1`]] />
          
          <!--Show online status-->
          <label for="show_online">Show Online Status <span class="error">[[!+up.error.show_online]]</span> </label>
        <input type="hidden" name="show_online" id="show_online_hidden" value="0" />
        <input type="checkbox" name="show_online" id="show_online" value="1" [[!+up.show_online:FormItIsChecked=`1`]] /></li>
                <br class="clear" />    
        <li style="border-bottom:1px dashed #7e7e7e;"><div class="label"><img src="[[+Profile_Photos:phpthumbof=`w=80&h=80&zc=1`]]" /></div>Choose Your Avatar <span class="error">[[+fi.error.Profile_Photos]]</span>
                <div class="input"><input id="Profile_Photos" name="Profile_Photos" type="file" value="[[+fi.Profile_Photos]]" maxlength="100000" /></div>
                </div>
                  <p class="note">Filesize must not exceed 2mb and 250X250 pixels.</p> 
                  <p>After saving go to your profile and refresh the page to see your avatar.</p></li>
        </ul>
                <br class="clear" />
                <div class="form-buttons">
                    <input type="submit" name="login-updprof-btn" value="Save" />
                </div>
            </form>
        </div>