I’m currently trying to implement a front-end user management in MODX.
All works fine except for new users registration. For this I use Login + Bob Ray’s ClassExtender to manage additional data at user level.
[[!Register? &submitVar=`loginRegisterBtn` &activation=`0` &usergroupsField=`usrgrp` &validate=`nospam:blank, username:required:minLength=^6^, password:required:minLength=^6^, password_confirm:password_confirm=^password^, fullname:required, email:required:email` &submittedResourceId=`127` &useExtended=`0` &placeholderPrefix=`reg.` &postHooks=`ExtUserRegisterPosthook` ]] <div class="register"> <div class="registerMessage">[[!+reg.error.message]]</div> <form class="form" action="[[~[[*id]]]]" method="post"> <input type="hidden" name="nospam" value="[[!+reg.nospam]]" /> ... <div class="form-buttons"> <input type="submit" name="loginRegisterBtn" value="Register" /> </div> </form> </div>
The issue is that &postHooks doesn’t seem to trigger anything (I put some debug function inside ExtUserRegisterPosthook, and it is not called by Login).
I found on a previous topic that form button name and values could be an issue for ExtUserRegisterPosthook, but my form configuration seems quite aligned with the code of the snippet:
$submission = isset($_POST[‘loginRegisterBtn’]) && ($_POST[‘loginRegisterBtn’] == ‘Register’);
So, if anyone has any idea I would appreciate!
MODX Revolution 2.8.3-pl