We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30585
    • 833 Posts
    Never mind my last post. For some strange reason, the server is denying permission to edit or replace the file even after making it world-writable for the purpose.
    Being on a very restrictive host, I will need to talk to the hosting guys to change the file permission or at least delete it so I can replace it altogether.

    But I’m pretty sure this issue is solved with your great help.

    Thanks very much for digging deeper. I’m gonna change the title of the post to resolve any moment.

    Thanks again goldsky. Now I can turn my focus to different things.
      A MODx Fanatic
      • 30585
      • 833 Posts
      I was able to successfully update register.php as you recommended and I’m now happy to report that the registration snippet is now sending activation emails.

      Much thanks again goldsky for all your great help. I’m sure many will find it helpful as well.

      Cheers
        A MODx Fanatic
        • 11055 ☆ A M B ☆
        • 3,112 Posts
        ur welcome.

        I’m actually gonna use this also.
        So by helping you, it resolves my future problem. laugh
          Rico
          Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
          MODx is great, but knowing how to use it well makes it perfect!

          www.virtudraft.com

          Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

          Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

          Maintainter/contributor of Babel

          Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
          • 13808
          • 61 Posts
          Alright - I’ve been on this one for 5 solid hours - time to ask for some help. undecided

          I’ve just installed Login 1.5.2-pl on Revolution 2.0.8-pl.

          Trying immediately to do an uncustomised ’out-of-the-box’ registration, no email ever arrives and I get the following error in the logs:
          [2011-02-27 00:05:31] (ERROR @ /index.php) modUserProfile: Attempt to set NOT NULL field internalKey to NULL

          This looks like exactly the issue you guys have been having and patched your way over. Though it looks like my versions are a little way along, I notice the linked bug (2870) is still open which would indicate this still applies. Then I found this post: http://modxcms.com/forums/index.php/topic,59228.msg337170.html#msg337170 which (I think) mentions that there’s a work around in 1.5.1 which is earlier than what I’m running. So, for a start, I’m confused with these seemingly conflicting bits of information.

          So I started investigating:
          Starting at line 41 of moduserprofile.map.inc.php I found this block:
              'internalKey' => 
              array (
                'dbtype' => 'int',
                'precision' => '10',
                'phptype' => 'integer',
                'null' => false,
                'default' => 0,
                'index' => 'unique',
              ),


          I tried changing the default from ’0’ to ’NULL’ (without quotes), but the error kept coming. Was that bit of my work correct?

          Anyway, next I see the call for the change to "$activationEmail = $user->get(’email’);", but I can’t for the life of me find where this should be changed. Is it in a file somewhere or in a snippet or what? I wonder if it’s been changed in 1.5.1 and that’s why I can’t find it...?

          And when the final part needs to be added to register.php, does this mean adding it into my ’Register’ snippet or into a file? Where abouts?

          Hoping these are ’silly’ questions and it’s easy to help.

          Thanks in advance for anything that anyone is able to contribute!
            • 11055 ☆ A M B ☆
            • 3,112 Posts
            Let’s ignore the Mapping.

            What is your snippet call?
              Rico
              Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
              MODx is great, but knowing how to use it well makes it perfect!

              www.virtudraft.com

              Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

              Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

              Maintainter/contributor of Babel

              Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
              • 13808
              • 61 Posts
              After it didn’t work out-of-the-box, I got started configuring because that’s where it going to end up anyway. Here’s my customised details. I did later strip everything right back to a register call with only the successMsg (i.e. using nothing not supplied as part of the package), but it didn’t make any difference.

              Snippet call is:
              [[!Register?&successMsg=`You have been registered!`&submittedResourceId=`6`&activationttl=`1440`&activationResourceId=`5`&activationEmailSubject=`Welcome to MarriageStarter`&activationEmailTpl=`Email_Account_Confirm`&excludeExtended=`login-register-btn`]]


              My Email_Account_Confirm snippet contains
              <p>[[+prefnamea]] & [[+prefnameb]],</p>
              
              <p>Thanks for registering! To activate your new account, please click on the following link:</p>
              
              <p><a href="[[+confirmUrl]]">[[+confirmUrl]]</a></p>
              
              <p>After activating, you may login with your username ([[+username]]) and the password you provided.</p>
              
              <p>If you did not request this message, please ignore it.</p>
              
              <p>Thanks,<br />
              <em>The Admin Team</em></p>


              The call itself is definitely working because I’m forwarded to the submittedResouceId and the user is created in an unactivated state. It’s just that no emails ever arrive. I’ve tested that the server seems to be able to send mail using a small PHP script and it arrives as expected within seconds of the script running.

              Thanks for getting involved goldsky!
                • 11055 ☆ A M B ☆
                • 3,112 Posts
                Try to set the snippet parameters to have spaces, first:
                [[!Register? &successMsg=`You have been registered!` &submittedResourceId=`6` &activationttl=`1440` &activationResourceId=`5` &activationEmailSubject=`Welcome to MarriageStarter` &activationEmailTpl=`Email_Account_Confirm` &excludeExtended=`login-register-btn`]]
                

                Or with RTE off:
                [[!Register? 
                &successMsg=`You have been registered!` 
                &submittedResourceId=`6` 
                &activationttl=`1440` 
                &activationResourceId=`5` 
                &activationEmailSubject=`Welcome to MarriageStarter` 
                &activationEmailTpl=`Email_Account_Confirm` 
                &excludeExtended=`login-register-btn`
                ]]
                

                Add &submitVar=`login-register-btn`
                Remove &excludeExtended=`login-register-btn`

                Do you get any error on MODX’s error log?
                Have you also set the email settings on the MODX’s System Settings part?


                My Email_Account_Confirm snippet contains
                It’s called chunk, not snippet.
                  Rico
                  Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                  MODx is great, but knowing how to use it well makes it perfect!

                  www.virtudraft.com

                  Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                  Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                  Maintainter/contributor of Babel

                  Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                  • 13808
                  • 61 Posts
                  I switched the RTE off and made the changes suggested (one per line), but that stopped the form being processed at all, so I pulled them all back up into the one line with spaces. I doubled checked my mail settings to ensure that use SMTP was switched off. I registered again and the email arrived as it should. Perfect! Thank you!

                  So, to try to explore what went wrong for anyone else who might find this topic, I rewound step by step to see what breaks things. In the end, I’ve made it all the way back to the start and can’t make it break again. I have the call without spaces in the RTE so that ’&’ becomes ’&amp;’. I’ve removed the submitVar variable and added the excludeExtended. It all still works. This is great, but frustrating in terms of making sure it doesn’t happen again. We just need to put this one down to a user error I think.

                  Thank you for your help goldsky - I’m sorry it didn’t yield something useful.

                  As far as the error log - there are a couple of things.

                  I still get an error every time a user is created:
                  [2011-02-27 15:02:20] (ERROR @ /index.php) modUserProfile: Attempt to set NOT NULL field internalKey to NULL

                  ...but everything seems to be intact.

                  For what it’s worth, I do also get the following error when I delete the users I’m creating during testing:
                  [2011-02-27 15:04:14] (ERROR @ /connectors/security/user.php) Could not get table name for class: modAccess
                  [2011-02-27 15:04:14] (ERROR @ /connectors/security/user.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` = 19' at line 1
                  )

                  ...but the user goes away.
                    • 11055 ☆ A M B ☆
                    • 3,112 Posts
                    Try change this part:
                    $scriptProperties[’quoteId’] = !empty((int) $_GET[’quoteId’]) ? (int) $_GET[’quoteId’] : ’’;

                    to be this
                    $scriptProperties[’quoteId’] = !empty($_GET[’quoteId’]) ? intval($_GET[’quoteId’]) : ’’;
                      Rico
                      Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                      MODx is great, but knowing how to use it well makes it perfect!

                      www.virtudraft.com

                      Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                      Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                      Maintainter/contributor of Babel

                      Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.