In access_code_user_profile_form_validate(), the target form element affected by form_set_error is incorrect. In the code the target is set to user_access_code. It should be "access_code" for the form error responses to work properly. Set as it is now, the access code field is not highlighted when an error is triggered on validation.

Comments

hyperlinked’s picture

UPDATE: Please disregard the patch attached to this comment. There were some edits that didn't make it into that patch that were supposed to be in there. The version attached to comment #2 is the correct one.
---
This patch is actually for multiple issues. I needed to use this module and some of the functionality that other people were asking for were also ones that I needed myself so I made some improvements to this module.

This patch addresses the following issues:
2265509 - this one: Changes the incorrect "user_access_code" reference to "access_code" in the validation function
1716150 - Email integration requested: Added [user:access_code] and [user:access_code_expiration] as tokens to be used in new user welcome emails
2178513 - Error creating user without access code: Fixes database error caused by saving a user without an access code
1979620 - 2038 Epoch date error: New user will fail validation if the expiration date is set beyond 2037.
1822172 - Default expiration date: Allows you to set a default expiration date that is between 1 day and 10 years from now.

Additionally I've added the following:

Ajax button to automatically generate an access code that matches your desired access code settings.

A check to ensure that an added access code is unique was added. If it doesn't, then the new user fails validation.

Module configuration page to allow you to set certain options required by the changes listed above. The configuration page allows you to:

  • Set a prefix to append to your access code
  • Set a format for randomly generated codes (numbers, letters, or alphanumeric)
  • Set a desired length for randomly generated codes
  • Set default expiration date interval

This is my first patch. Feedback and corrections of etiquette and procedure are welcome.

hyperlinked’s picture

StatusFileSize
new14.45 KB
hyperlinked’s picture

Priority: Major » Normal

glekli’s picture

Status: Active » Fixed

Thank you, hyperlinked. Nice work! I have committed all your updates, with some minor refinements, and released a new version.

hyperlinked’s picture

Status: Fixed » Closed (fixed)

Thanks for the commit. Verified.