<![CDATA[ reg.error.message not working - MODX Community Forums]]> https://forums.modx.com/thread/?thread=93000 <![CDATA[reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-508068
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?]]>
profilneurotiker Sep 04, 2014, 10:11 AM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-508068
<![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-553226 boomerang Aug 18, 2017, 01:11 PM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-553226 <![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-548910 andytough Feb 23, 2017, 10:21 PM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-548910 <![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-533971 profilneurotiker Nov 04, 2015, 07:43 AM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-533971 <![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-533773 https://github.com/splittingred/Login/tree/develop/core/components/login/processors

splittingred (Shaun McCormick) is not very active in MODX develoment no longer.]]>
mrhaw Oct 28, 2015, 10:15 AM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-533773
<![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-533748
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

]]>
kctechsoln Oct 27, 2015, 12:33 PM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-533748
<![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-508097
/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


]]>
profilneurotiker Sep 04, 2014, 06:40 PM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-508097
<![CDATA[Re: reg.error.message not working]]> https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-508086
[[!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]]]]>
profilneurotiker Sep 04, 2014, 02:31 PM https://forums.modx.com/thread/93000/reg-error-message-not-working#dis-post-508086