We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24374
    • 322 Posts
    I've set up all the Login pages as instructed for integration with Discuss. They're all working, except for Confirm Registration. I've got this on the Register Page:

    [[!Register?
        &submitVar=`registerbtn`
        &activationResourceId=`12`
        &activationEmailTpl=`lgnActivateEmailTpl`
        &activationEmailSubject=`Thanks for Registering!`
        &submittedResourceId=`425`
        &usergroups=`Forum Members:Member`
        &validate=`nospam:blank,
      username:required:minLength=^6^,
      password:required:minLength=^6^,
      password_confirm:password_confirm=^password^,
      fullname:required,
      email:required:email`
        &placeholderPrefix=`reg.`
    ]]
    


    followed by the form. On submission, it goes to the right URL for Confirm Registration, but I get the 404 Not Found error message, and the user's info is not entered in the database. If I disable this line in the ConfirmRegistration snippet:
    $output = $controller->run($scriptProperties);

    then the page loads fine, except of course that the registration process does not finish. Since the page loads fine with the snippet disabled, then there is obviously no problem finding this page, so what page exactly is it that is not being found? Is the ConfirmRegistration page trying to access some page internally that is generating the error? I've checked the logs and don't see any URL that is trying to be accessed (other than the Confirm Registration page itself, when the snippet is not disable) that has a 404 attached to it.

    Also, when I click the submit button, this error message appears in the MODX error log:
    [2014-12-30 21:00:59] (ERROR @ /index.php) Could not get table class for class: modAccess
    [2014-12-30 21:00:59] (ERROR @ /index.php) Could not get table name for class: modAccess
    [2014-12-30 21:00:59] (ERROR @ /index.php) Error 42000 executing statement: 
    Array
    (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 27' at line 1
    )
    
    


    ALSO, the confirm script does send out the email, but the activation link is missing:

    blahblah,
    
    Thanks for registering! To activate your new account, please click on the following link:
    
    
    After activating, you may login with your password and username:
    
    Username: blahblah
    Password: blahblah123
    
    If you did not request this message, please ignore


    I'm running Revo 2.3.2, with all the latest versions of Discuss, Formit, and Login [ed. note: rainbowtiger last edited this post 9 years, 3 months ago.]
      • 3749
      • 24,544 Posts
      It sounds like you might be confusing the three pages involved. I say that because the user is not supposed to go from the registration form to the ConfirmRegister page.

      I call the three pages:

      ConfirmRegister page
      Thank You for Registering page
      Registration Confirmed page

      I wrote a blog post on this, but I can't find it. wink

      - The first one is the page the link in the email goes to. It contains the ConfirmRegister snippet, which registers and logs the user in, an immediately forwards to the third one. This is the &activationResourceId

      - The second is the page the user goes to after submitting the Registratrion form. It says "expect an email". This is the &submittedResourceId

      - The third one is the one the user is forwarded to from the ConfirmRegister page. It's not referenced in the Register tag, it's the (optional) redirectTo property in the ConfirmRegister tag.

      The missing link in the email suggests a problem with the &activationEmailTpl -- in this case a problem with the placeholders in the Tpl chunk, though it could possibly be caused by forwarding the user to from the form to the ConfirmRegister page.

      If the user goes to the ConfirmRegister page without having come from the custom link in the email, they immediately get forwarded to the error page, which sounds like what's happening.

      BTW, the Subscribe extra wraps all this for you and handles much of it automatically, as well as (optionally) letting the user make selections that store their interests and lead to User Group memberships.
        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
        • 24374
        • 322 Posts
        Quote from: BobRay at Dec 31, 2014, 04:27 AM
        It sounds like you might be confusing the three pages involved. I say that because the user is not supposed to go from the registration form to the ConfirmRegister page.

        I call the three pages:

        ConfirmRegister page
        Thank You for Registering page
        Registration Confirmed page

        Actually, the problem was that I hadn't noticed the difference between the Confirm Register page and another needed page, Activate Registration (activationResourceId); this is what was generating the page not found error, because I had an ID in there for a page that didn't exist. I hadn't set up this page, and that's where the ConfirmRegister script belongs, not in what I was calling the "Confirm Registration" page, which as you mention should just be some text saying an email has been sent. The terminology was confusing me ("confirm" versus "activate"). So there are actually four pages involved, the final one being "Registration Complete" (or, technically, "Registration Activated"), which is also just a message appearing after the activation link is clicked and the person goes to the ConfirmRegistration page, which is just a pass-through page that the user doesn't see. What was confusing was that the Youtube tutorial didn't show any parameters for the ConfirmRegister snippet, and I think you really need the redirectTo parameter in there, otherwise the user DOES see the ConfirmRegister page, which shows no message at all.

        So I've got:

        Register -> Confirm Registration (notice that email has been sent) -> Activate Registration ("ConfirmRegister" snippet, user doesn't see this) -> Registration Complete (notice that user is now fully activated).
          • 3749
          • 24,544 Posts
          You don't actually need the &redirectTo property. You can just add a success message on the ConfirmRegister page in addition to the tag and use the &errorPage property. The user will be forwarded to the error page on failure and will see the success message on success as the ConfirmRegister page finishes loading.

          That said, the way you're doing it (with &redirectTo) makes more sense, imo.

            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
            • 38669
            • 51 Posts
            rainbowtiger. Can you paste the final code of the snippets that confirm activation?

            I am having the same problem (though it used to work tongue) and it has been so long since I created this page it will take me hours to relearn it all.

            Much appreciation in advance.

            FWIW, here's what I have now:

            require_once $modx->getOption('login.core_path',null,$modx->getOption('core_path').'components/login/').'model/login/login.class.php';
            $login = new Login($modx,$scriptProperties);
            
            
            $controller = $login->loadController('ConfirmRegister');
            $output = $controller->run($scriptProperties);