New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • Hello there!

    Sorry to bother you people again with this new thread, but I need to get this working. Although I posted this question already in another old thread I open this new one to have an adequate topic and in hope to get a hint.

    I'm using MODx 2.2.15 with the Login-Package 1.8.1, which finally after lot of researching seems to be working fine - except one thing (for now)!

    By using the Login.Register-snippet I'm not able to get any output off the "reg.error.message"-placeholder.

    I'm using this register-call:

    [[!Register?
        &postHooks=`mailAdmin`
        &submitVar=`registerbtn`
        &activationResourceId=`226`
        &activationEmailTpl=`mailRegistrierung`
        &activationEmailSubject=`Vielen Dank für Ihre Registrierung!`
        &submittedResourceId=`231`
        &usergroups=`Alumni`
        &validate=`nospam:blank,
      username:required:minLength=^6^,
      password:required:minLength=^6^,
      password_confirm:password_confirm=^password^,
      email:required:email,
      fullname:required`
        &placeholderPrefix=`reg.`
    ]]


    and inbetween my html-part I use this as the placeholder for the general-error-message:

    [[!+reg.error.message]]


    But this doesn't contain anything, even if I try to submit the form with blank input-fields.

    I also tried different variations of the placeholder, but none worked for me:

    [[!+error.message]]
    [[!+error.Message]]
    [[!+error]]
    [[!+errors]]
    [[!+errors.message]]
    [[!+errors.Message]]
    [[!+errormessage]]
    [[!+errorMessage]]
    [[!+errorsmessage]]
    [[!+reg.error.message]]
    [[!+reg.errorsMessage]]
    [[!+reg.error.Message]]
    [[!+reg.error]]
    [[!+reg.errors]]
    [[!+reg.errors.message]]
    [[!+reg.errors.Message]]
    [[!+reg.errormessage]]
    [[!+reg.errorMessage]]
    [[!+reg.errorsmessage]]
    [[!+reg.errorsMessage]]

    When I'm using the different error-placeholders for the several input fields, I get the desired output when the validation of this input-field fails:

    [[!+reg.error.fullname]]
    [[!+reg.error.username]]
    [[!+reg.error.email]]
    [[!+reg.error.password]]
    [[!+reg.error.password_confirm]]


    But I need the general-error-message to be checked if it is empty. When it's not empty I want to show a div in a lightbox-way in cojunction with some javascript, which holds the error messages likes this:

    [[!+reg.error.message:notempty=`
    <div class="lightbox-error-message">
    [[!+reg.error.fullname]]
    [[!+reg.error.username]]
    [[!+reg.error.email]]
    [[!+reg.error.password]]
    [[!+reg.error.password_confirm]]
    </div>
    `]]


    This works fine for the login-snippet, as well as for any other snippet within the login-package, except this register-snippet.

    So how do I get the reg.error.message-placeholder working?
    • Damn...i just realized that the same is happening when using the UpdateProfile-call:
      [[!UpdateProfile? 
      &preHooks=`bildUpload`
      &validate=`
      vorname:required,
      nachname:required,
      start:required,
      thema:required,
      abstract:required,
      email:email:required
      `]]


      The placeholder is always empty when validation fails...

      [[+error.message]]
      • Hm...i managed it by hard-coding the source of the two related source-files:

        /core/components/login/controllers/web/UpdateProfile.php
        /core/components/login/controllers/web/Register.php

        I added this code

        $this->modx->setPlaceholder('myError', 'myError');


        after every

        hasErrors()) {


        Then I was able to use my new created placeholder "myError" inside my resources/forms:

        [[+myError:notempty=`DISPLAY ERRORS IN LIGHTBOX-DIV - [[!+reg.error.fullname]], etc.`]]

        But I still don't understand why the normal general-error-message doesn't work sad


        • I know it's a bit late for you guys... but for anyone else, I found why this was blank - the placeholder was never set if validators had errors, it was only set for hook errors.

          Solution to add a blanket error message:

          /core/components/login/controllers/web/Register.php

          Add Line 65:
          'validationErrMsg' => 'There are errors in the form below.',

          (this can then be set at snippet level using &validationErrMsg=`Custom Validation Error Message`)

          Add Line 106:
          $this->modx->setPlaceholder($placeholderPrefix.'error.message',$this->getProperty('validationErrMsg'));



          lines in /core/components/login/controllers/web/UpdateProfile.php
          65 = 62
          106 = 206

          • Nice! Bookmarked - If you want to fork it on Github: https://github.com/splittingred/Login/tree/develop/core/components/login/processors

            splittingred (Shaun McCormick) is not very active in MODX develoment no longer.
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • Thanks for posting this @kctechsoln! I think I'm going to do a new project soon with a custom form, I hope with your provided info I won't run into those problems again!
              • Another thank you to @kctechsoln for posting the solution. This thread on the forum has just saved me a lot of time with a tight deadline looming.
                  If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                  email: andy@andytough.com | website: https://andytough.com
                • I've run into this problem as well - surely this should have been fixed by now...
                    Helen Warner
                    Number one pixel!
                    Proud to be linked with MODX at Crimson Pixel