We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25308
    • 46 Posts
    Quote from: odeclas at Mar 28, 2011, 11:17 AM

    That Login call needs backticks ` not apostrophes ’
    [[!Login? &loginResourceId=`13` &successMsg= `You are now logged in` &logoutResourceId=`1`]]  


    Neither call is using pre-hooks, FWIW. If you’re trying to use these calls as pre-hooks on another Register/Login call, I don’t think that will work.

    Re: Login - question about visitor registration customization
    Hmmm,... still on the right track but it’s still not working. Now the form is rendering and is adding the customers to the correct user group "customers". However, the confirmation email it sends is blank and it is not redirecting to the specified page to let the customer know their profile has been submitted and a confirmation email has been sent.

    My id# for my profile submitted page(&submittedResourceId): [[~29]]
    My id# for my corfirmm registration page (&activationResourceId): [[~23]]

    Here is my code:
    [[!Register?
        &submitVar=`registerbtn`
        &activationResourceId=`23`
        &activationEmailTpl=`myActivationEmailTpl`
        &activationEmailSubject=`Thanks for registering!`
        &submittedResourceId=`29`
        &usergroups=`customers`
    ]]


    Anything off about what I did? Must be,.. it’s not working correctly.It’s probably staring me right in the face. If that is ok,... is there a work around to make it work?
      • 22019
      • 390 Posts
      If you’ve literally copied that code in, then go to Page Settings and uncheck the ’Rich Text’ option. Then save the resource and refresh it. Replace all the ’& amp ;’ with ampersands:

      [[!Register?
          &submitVar=`registerbtn`
          &activationResourceId=`23`
          &activationEmailTpl=`myActivationEmailTpl`
          &activationEmailSubject=`Thanks for registering!`
          &submittedResourceId=`29`
          &usergroups=`customers`
      ]]


      And finally check that the submit button on your form has a name of ’registerbtn’.
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 25308
        • 46 Posts
        Quote from: odeclas at Mar 31, 2011, 10:13 AM

        If you’ve literally copied that code in, then go to Page Settings and uncheck the ’Rich Text’ option. Then save the resource and refresh it. Replace all the ’& amp ;’ with ampersands:

        [[!Register?
            &submitVar=`registerbtn`
            &activationResourceId=`23`
            &activationEmailTpl=`myActivationEmailTpl`
            &activationEmailSubject=`Thanks for registering!`
            &submittedResourceId=`29`
            &usergroups=`customers`
        ]]


        And finally check that the submit button on your form has a name of ’registerbtn’.

        Thanks for the response. I switched out the ampersands and made sure the register button is called "registerbtn" as you suggested. This time it redirected me to my home page but it still sent me a blank email for registration confirmation. ?

        Here’s my register button:
        <div class="form-buttons">
                    <input name="registerbtn" type="submit" value="Register" />
                </div>


        I did notice something weird however. After I toggled the rich content editor to off I changed that ampersands to real ampersands and not the code symbol for it. I saved the document and toggled the rich text editor back on. The form looked fine. The I switched the rich text editor back to off to check something else.... I noticed that some of the ampersands reverted back to the code version and some didn’t. I changed them again and retried the process of toggling between the editor and the plain view to have the same thing happen again. Even after copying the one ampersand in the plain view and replacing the code symbol versions it still reverted back the the code symbol again after saving it and toggling between the editor. So is this just a glitch in the TinyMCE editor or is there something fishy with my &usergroups field? I can at least get the glitch to repeat. Though I did try replacing the ampersands in the plain text editor with no result. ; (

        [[!Register?
            &submitVar=`registerbtn`
            &activationResourceId=`23`
            &activationEmailTpl=`myActivationEmailTpl`
            &activationEmailSubject=`Thanks for registering!`
            &submittedResourceId=`29`
            &usergroups=`customers`
        ]]


          • 22019
          • 390 Posts
          Your form on submission should be going to resource 29. Is that your home page? It sounds like it’s found an error, and you have your error_page system setting set to 1. If you are receiving an email to the person who’s registering, with the correct subject but no content, then it sounds like you have mistyped the name of the activation email chunk - do you have a new user created (and added to the customers usergroup) awaiting activation? Is resource 23 published?

          You might want to post the entire Content field of the resource (Register call and form) here.

          The rich-text thing is a TinyMCE issue/bug, I wouldn’t worry about it. One way of getting round this in the future is to put your snippet call in a chunk, and include the chunkname in the content, instead of the snippet itself. A bit tedious, but more foolproof. Or simply toggle off rich-text for pages as default.



            Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
            • 25308
            • 46 Posts
            Quote from: odeclas at Mar 31, 2011, 12:02 PM

            Your form on submission should be going to resource 29. Is that your home page? It sounds like it’s found an error, and you have your error_page system setting set to 1. If you are receiving an email to the person who’s registering, with the correct subject but no content, then it sounds like you have mistyped the name of the activation email chunk - do you have a new user created (and added to the customers usergroup) awaiting activation? Is resource 23 published?

            You might want to post the entire Content field of the resource (Register call and form) here.

            The rich-text thing is a TinyMCE issue/bug, I wouldn’t worry about it. One way of getting round this in the future is to put your snippet call in a chunk, and include the chunkname in the content, instead of the snippet itself. A bit tedious, but more foolproof. Or simply toggle off rich-text for pages as default.

            Resource [[~29]] is my "Thank you for registering a confirmation message has been sent to your email account" page.

            Interesting. It looks like I’m going to look further into the debugging calls. You were correct about it trying to redirect me to an error page. I created an error page and set the system settings to that page id. Blammo,... the form sent me right there upon submission.

            I also duplicated the emailtpl and renamed it. This time the confirmation email was sent correctly.THANK YOU!!! That’s a big leap for me. It also added my trial registration user to the correct user group "customers". It did before but I’m glad to see that hasn’t changed.

            Yes resource 23 is published. This is my registration confirmation page with the [[!ConfirmRegister]] call.

            Here’s my current user registration form:
            [[!Register?
                &submitVar=`registerbtn`
                &activationResourceId=`23`
                &activationEmailTpl=`jayTpl`
                &activationEmailSubject=`Thanks for registering!`
                &submittedResourceId=`29`
                &usergroups=`customers`
            ]]
            <table border="1" width="550" align="center">
            <tbody>
            <tr>
            <td>
            <table border="0" width="80%" align="center">
            <tbody>
            <tr>
            <td>
            <h2>Customer Registration
            <hr />
            </h2>
            <p style="color: #cc0000;">*Required Fields</p>
            
            <div class="register">
            <div class="registerMessage">[[+error.message]]</div>
            <br /><form class="form" action="[[~[[*id]]]]" method="post">
                    <label for="username">*[[%register.username? &namespace=`login` &topic=`register`]]
                        <span class="error">[[+error.username]]</span>
                    </label>
                    <br />
                    <input id="username" name="username:required:minLength=6" type="text" value="[[+username]]" />
                     
            <label for="password"><br />
                    *[[%register.password]]
                        <span class="error">[[+error.password]]</span>        </label>
                    <br />
                    <input id="password" name="password:required:minLength=6" type="password" value="[[+password]]" />
                     
            <label for="password_confirm"><br />
                    *[[%register.password_confirm]]
                        <span class="error">[[+error.password_confirm]]</span>        </label>
                    <br />
                    <input id="password_confirm" name="password_confirm:password_confirm=`password`" type="password" value="[[+password_confirm]]" />
                     
                    <label for="fullname"><br />
                    *[[%register.fullname]]
                        <span class="error">[[+error.fullname]]</span> </label>
                    <br />
                    <input id="fullname" name="fullname:required" type="text" value="[[+fullname]]" />
                    <br />
                    <label for="email">*[[%register.email]]
                        <span class="error">[[+error.email]]</span>
                    </label>
                    <br />
                    <input id="email" name="email:email" type="text" value="[[+email]]" />
                    <br />
            		<label>Phone#: <span class="error">[[+error.phone]]</span> <br />
            		<input name="phone" type="text" value="[[+phone]]" /></label>
                    <br />
                    <label>Alt. Phone#: <span class="error">[[+error.alt_phone]]</span> <br />
            		<input name="alt_phone" type="text" value="[[+alt_phone]]" /></label>
                    <br />
                    <label>Business: <span class="error">[[+error.business]]</span> <br />
            		<input name="business" type="text" value="[[+business]]" /></label>
                    <br />
                <label>Would you like to receive promotions on special deals? <span class="error">[[+error.notifications]]</span> <br />
                <select name="promotions">
               <option value="yes">Yes</option>
               <option value="no">No</option>
            </select></label>
            <br />
            <input name="product:blank" type="hidden" />
            <input name="reference_number" type="hidden" />
            <input name="time_line" type="hidden" />
            <input name="represenative" type="hidden" />
            <input name="notes" type="hidden" />
            <br />
            <br class="clear" />
            <div class="form-buttons">
                        <input name="registerbtn" type="submit" value="Register" />
                    </div>
            </form>
            </div>
            </td>
            </tr>
            </tbody>
            </table>
            </td>
            </tr>
            </tbody>
            </table>
            <p> </p>


            Thank you for all of your help odeclas! I really appreciate that you’re taking the time to help me.
              • 22019
              • 390 Posts
              Apologies for tardy reply, but it looks like your only issue now is that on submission it generates an error (after sending the email, creating the user). The most obvious answer is that resource 29 isn’t published, or is in a restricted resource group, or has some problem with a snippet on it.

              Try checking the MODX error log (under Reports > Error) and see what it says.
                Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                • 25308
                • 46 Posts
                Quote from: odeclas at Apr 01, 2011, 05:57 AM

                Apologies for tardy reply, but it looks like your only issue now is that on submission it generates an error (after sending the email, creating the user). The most obvious answer is that resource 29 isn’t published, or is in a restricted resource group, or has some problem with a snippet on it.

                Try checking the MODX error log (under Reports > Error) and see what it says.

                Hey Odeclas,... no need to apologize! I’m just glad you’re helping me at all. Thank you very much. I wouldn’t be this far in the process without you.

                yup,.. resource 29 is published. I cleared out the error log and tried a registration again to see what errors it produced.
                The log came up with:
                 [2011-04-01 06:55:58] (ERROR @ /index.php) modUserProfile: Attempt to set NOT NULL field internalKey to NULL
                [2011-04-01 06:56:21] (ERROR @ /index.php) `'1'` is not a valid integer and may not be passed to makeUrl()
                [2011-04-01 06:56:21] (ERROR @ /index.php) Attempted to redirect to an empty URL.
                [2011-04-01 06:56:59] (ERROR @ /index.php) `'1'` is not a valid integer and may not be passed to makeUrl()
                [2011-04-01 06:56:59] (ERROR @ /index.php) Attempted to redirect to an empty URL.
                [2011-04-01 06:57:15] (ERROR @ /index.php) `'13'` is not a valid integer and may not be passed to makeUrl()
                [2011-04-01 06:57:15] (ERROR @ /index.php) Attempted to redirect to an empty URL.


                Upon checking on my snippet calls I noticed that once again I used apostrophes instead of back tics around my resource ids. The redirect is working now. I can’t even tell you how happy that makes me.

                Now I only have one glitch in my process that is left. When I go to the confirm registration page (from my email) I placed a link on that page to go directly to the login page. When I go to login page it acts like I’m already logged in and shows the "logout" link. Is this a caching issue?

                After I’d done with this I’m definitely making a tut to help anyone else in need of this info!
                  • 22019
                  • 390 Posts
                  It’s probably saying that you’re already logged in as the admin user (the user you are using to access the backend). The session cookies tend to bleed into each other and make testing difficult if you only use one browser.

                  Try registering using a different browser (or flush sessions in the manager - although that will log you out of the backend), you should see that issue go away.
                    Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                    • 25308
                    • 46 Posts
                    Quote from: odeclas at Apr 01, 2011, 09:26 AM

                    It’s probably saying that you’re already logged in as the admin user (the user you are using to access the backend). The session cookies tend to bleed into each other and make testing difficult if you only use one browser.

                    Try registering using a different browser (or flush sessions in the manager - although that will log you out of the backend), you should see that issue go away.

                    Hmm... unfortunately no dice. I flushed my sessions in the manager, switched to the explorer browser and retried the registration process. It took me to the login page but still acted like I was logged in by only showing me the logout link. Is it possible that the confirm registration link is somehow logging the user in at the same time? I’ll try adding in the profile snippet call to see who it thinks I am. At least that will give me a small clue as to what’s going on. (I hope)
                      • 22019
                      • 390 Posts
                      Don’t bother with Profile for now - just add [[+modx.user.username]] somewhere on the page and it will display the currently logged in user.
                        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86