We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24013
    • 7 Posts
    I realize that if the snippet works for everyone else, but not me, it’s probably not a problem with the snippet.

    Notwithstanding, I have spent a good 6 hours just trying to get the register snippet to simply register a basic user into a usergroup. I’ve never had a problem before, but with REVO 2.1.1-pl and Login 1.6.2-pl forms copy/pasted from the rtfm and from the sample form on package install do absolutely nothing! Only one page load out of the 6 hours showed any error message when a field was left blank. Even with no validation though, nothing works and I don’t know where else to look. Has anyone had an issue like this??
      44+ MODXed sites and counting...
      • 3749
      • 24,544 Posts
      Can you paste your snippet tag(s) here?

      Can you create users and place them in to groups manually in the Manager?
        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
        • 24013
        • 7 Posts
        Yes, I can place them in manually.

        I’ve tried this:
        [[!Register?
            &submitVar=`registerbtn`
            &activationResourceId=`32`
            &activationEmailSubject=`Thanks for Registering!`
            &usergroups=`Members`  
        &validate=`nospam:blank, email:required:email`    
        &placeholderPrefix=`reg.`
        ]]
         <style>
         	.register label { display:block; clear: both; }
         </style>
        <div class="register">
            <div class="registerMessage">[[!+reg.error.message]]</div>
             
            <form class="form" action="[[~[[*id]]]]" method="post">
                <input type="hidden" name="nospam" value="[[!+reg.nospam]]" />
                 
                <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
                    <span class="error">[[!+reg.error.username]]</span>
                </label>
                <input type="text" name="username" id="username" value="[[!+reg.username]]" />
                 
                <label for="password">[[%register.password]]
                    <span class="error">[[!+reg.error.password]]</span>
                </label>
                <input type="password" name="password" id="password" value="[[!+reg.password]]" />
                 
                <label for="fullname">[[%register.fullname]]
                    <span class="error">[[!+reg.error.fullname]]</span>
                </label>
                <input type="text" name="fullname" id="fullname" value="[[!+reg.fullname]]" />
                 
                <label for="email">[[%register.email]]
                    <span class="error">[[!+reg.error.email]]</span>
                </label>
                <input type="text" name="email" id="email" value="[[!+reg.email]]" />
                 
                <br class="clear" />
                 
                <div class="form-buttons">
                    <input type="submit" name="registerbtn" value="Register" />
                </div>
            </form>
        </div>
        
        
        


        And this:
        [[!Register? &successMsg=`Thanks for registering!`]]
         
        <div class="register">
            <div class="registerMessage">[[!+reg.error.message]]</div>
             
            <form class="form" action="[[~[[*id]]]]" method="post">
                <input type="hidden" name="nospam" value="[[!+reg.nospam]]" />
                 
                <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
                    <span class="error">[[!+reg.error.username]]</span>
                </label>
                <input type="text" name="username" id="username" value="[[!+reg.username]]" />
                 
                <label for="password">[[%register.password]]
                    <span class="error">[[!+reg.error.password]]</span>
                </label>
                <input type="password" name="password" id="password" value="[[!+reg.password]]" />
                 
                <label for="password_confirm">[[%register.password_confirm]]
                    <span class="error">[[!+reg.error.password_confirm]]</span>
                </label>
                <input type="password" name="password_confirm" id="password_confirm" value="[[!+reg.password_confirm]]" />
                 
                <label for="fullname">[[%register.fullname]]
                    <span class="error">[[!+reg.error.fullname]]</span>
                </label>
                <input type="text" name="fullname" id="fullname" value="[[!+reg.fullname]]" />
                 
                <label for="email">[[%register.email]]
                    <span class="error">[[!+reg.error.email]]</span>
                </label>
                <input type="text" name="email" id="email" value="[[!+reg.email]]" />
                 
                <br class="clear" />
                 
                <div class="form-buttons">
                    <input type="submit" name="login-register-btn" value="Register" />
                </div>
            </form>
        </div>


        The first one doesn’t even try to validate the form. Neither one adds a user to the db at all.
          44+ MODXed sites and counting...
          • 3749
          • 24,544 Posts
          Sorry, I don’t see anything obvious that’s wrong. The Register snippet is installed, right?
            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
            • 24013
            • 7 Posts
            Found the problem!

            Although it doesn’t make any sense, the issue was that the page caching was ignoring the uncached snippet call and form fields. This is a fresh install, but about 15 supporting snippets were added. I set up 2 other fresh installs and tested it after installing Login. Using the code above it worked fine. So I tried again on the site in question.

            Tonight I noticed that submitting the form after clearing the cache gave me one chance to get a proper validation and submission of the form. After that, the fields were cached again and it wouldn’t work beyond that one try. Setting the page itself as uncached allowed me to submit the registration. The validation worked fine and I received the activation email.

            I’ll submit this bug tomorrow, but I’m not sure it can be duplicated. It took about 11 hours to debug this and it turned out to be so simple, although unnecessary.

            Thanks for your help!!

            Paul
              44+ MODXed sites and counting...
              • 3749
              • 24,544 Posts
              I’m glad you found the problem. Thanks for reporting the bug. cool
                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
                • 24013
                • 7 Posts
                So as it turns out, it may not be a bug afterall. I thought I had it resolved yesterday, but it stopped working again. I think I now know the issue for real this time, but I’m not positive how it started.

                It appears that either the code from the rtfm may have a latin charset or CodeMirror corrupted the data. I began the process of wiping our development site clean after making a backup. I installed JUST Login and it appeared to work fine. So then rather than re-create each page (since the site is complete with the exception of the login functionality), I was going to just copy/paste just the content and chunks into the new db and reinstall all of the snippets and plugins one-at-a-time to troubleshoot.

                Upon reaching the modx_site_content portion of the .sql file, I noticed this in the Restraition page:

                <h4>testing</h4> <style> .register label { display:block; clear: both; } </style>[[!Register? &submitVar=`registerbtn`   &activationResourceId=`32`    &activationEmailTpl=`lgnActiveateEmailTpl`    &activationEmailSubject=`Thanks for Registering!`    &submittedResourceId=`33`    &usergroups=`Members`    &validate=`nospam:blank,  username:required:minLength=^6^,  password:required:minLength=^6^,  password_confirm:password_confirm=^password^,  fullname:required,  email:required:email`    &placeholderPrefix=`reg.`]] <div class="register">    <div class="registerMessage">[[!+reg.error.message]]</div>         <form class="form" action="[[~[[*id]]]]" method="POST">        <input type="hidden" name="nospam" value="[[!+reg.nospam]]" />                  <h3>Personal Information</p>        <label for="fullname">[[%register.fullname? &namespace=`login` &topic=`register`]]            <span class="error">[[!+reg.error.fullname]]</span>        </label>        <input type="text" name="fullname" id="fullname" value="[[!+reg.fullname]]" />                 <label for="email">[[%register.email]]            <span class="error">[[!+reg.error.email]]</span>        </label>        <input type="text" name="email" id="email" value="[[!+reg.email]]" />        <label for="phone">[[%register.phone]]            <span class="error">[[!+reg.error.phone]]</span>        </label>        <input type="text" name="phone" id="phone" value="[[!+reg.phone]]" />        <label for="address">[[%register.address]]            <span class="error">[[!+reg.error.address]]</span>        </label>        <input type="text" name="address" id="address" value="[[!+reg.address]]" />        <label for="city">[[%register.city]]            <span class="error">[[!+reg.error.city]]</span>        </label>        <input type="text" name="city" id="city" value="[[!+reg.city]]" />        <label for="state">[[%register.state]]            <span class="error">[[!+reg.error.state]]</span>        </label>        <input type="text" name="state" id="state" value="[[!+reg.state]]" />        <label for="zip">[[%register.zip]]            <span class="error">[[!+reg.error.zip]]</span>        </label>        <input type="text" name="zip" id="zip" value="[[!+reg.zip]]" /> 	 <h3>Login Information</h3>        <label for="username">[[%register.username]]            <span class="error">[[!+reg.error.username]]</span>        </label>        <input type="text" name="username" id="username" value="[[!+reg.username]]" />                 <label for="password">[[%register.password]]            <span class="error">[[!+reg.error.password]]</span>        </label>        <input type="password" name="password" id="password" value="[[!+reg.password]]" />                 <label for="password_confirm">[[%register.password_confirm]]            <span class="error">[[!+reg.error.password_confirm]]</span>        </label>        <input type="password" name="password_confirm" id="password_confirm" value="[[!+reg.password_confirm]]" />                <br class="clear" />                 <div class="form-buttons">            <input type="submit" name="registerbtn" value="Register" />        </div>    </form></div>


                That immediately got my attention and rather than overwrite just one table, I decided to overwrite everything after clearing out all of the  characters. I don’t really know how they got there, but they didn’t show anywhere except the sql dump.

                After clearing out those characters, so far everything appears to be working just fine.

                This was a crazy journey, but not one that should get me again in the future. smiley

                Thanks again Bob for your help.
                  44+ MODXed sites and counting...