Problem/Motivation
There are other modules out there that provide forms for adding email addresses. However, it is impractical for this module to provide custom solutions for all the possible modules available.
Also, it's entirely likely that a site might have custom forms and email address fields that people want checked.
Proposed resolution
Modify the admin form and the code to provide a generic way for specifying the form and email address field, such that the admin can specify any form they want to verify the email address on. This requires specifying both the form ID and the field ID the email address is in.
Remaining tasks
Fix the issueCreate a patchReview the patchCommit the patch
User interface changes
The admin UI will need to be modified to allow this.
API changes
To be determined.
Data model changes
To be determined.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | interdiff-2426859-4-6.txt | 3.68 KB | oadaeh |
| #6 | email_verify-flexible_form_verification-2426859-6-D7.patch | 8.9 KB | oadaeh |
| #11 | interdiff-with-w-2426859-6-11.txt | 5.33 KB | oadaeh |
| #11 | interdiff-2426859-6-11.txt | 8.06 KB | oadaeh |
| #11 | email_verify-flexible_form_verification-2426859-11-D7.patch | 10.17 KB | oadaeh |
Comments
Comment #1
oadaeh commentedI've started working on this.
Comment #2
oadaeh commentedMoving to the new current development branch.
Comment #3
oadaeh commentedUpdating issue description and attribution.
Comment #4
oadaeh commentedThe attached patch provides a mechanism for achieving the desired results.
Comment #5
oadaeh commentedI feel I should add that a side benefit with the patch is that you can also exclude forms and/or fields by not including them in the list.
Comment #6
oadaeh commentedUpdated patch that:
Comment #7
oadaeh commentedHere's the interdiff.
Comment #8
oadaeh commentedComment #9
kristen polThis feature is super useful. I've reviewed the code:
Is it possible to go to the settings page and change it before running updatedb? If so, then the new variable should be used here even though 99.999% of the time it would be empty.
Minor: space missing after foreach.
Might there be other "cancel" actions that should be ignored? Since any form can be added now, this is hard to know. Would it be better to just check the 'op' is 'submit'? Are their forms we should be handling where that is not the case?
Minor: space missing after foreach.
Check field exists before using it?
Use if (!empty($error))?
Should this just be:
form_set_error($field, $error)?
email_verify_get_forms_and_fields
which gets the data from the variable and makes into a keyed array, e.g.
and then use those in the 2 functions that need to look at this data. Then it will be there if other functions need at it as well down the road.
Comment #10
oadaeh commentedWhile the idea has merit, the suggested implementation won't work for anyone who wants to verify two or more fields in a single form.
Worse, however, is that while attempting to implement this, I discovered it doesn't handle Field API fields. And while I'm at it, I should also make sure it handles multi-value fields.
Comment #11
oadaeh commented1: Yes. I suppose. Done.
2 and 4: Fixed.
3: The reason for it's existence was to not validate a bad email address, when the user is being canceled. That is extremely frustrating. However, in this new context, that doesn't necessarily make as much sense, so I changed it.
5: Okay.
6: Yes, that's probably a better choice.
7: No, because $error is the message that is displayed to the user (and why your #6 makes more sense).
8: Okay, I came up with a solution kind of does what you say, but in a different way. The external function returns an array of fields for a given form ID, rather than the whole structure. I can't think of a reasonable situation where the whole thing would be needed at any one time.
I also addressed the Field API form field elements and multi-value fields.
Comment #12
Patrick Storey commentedI tested the patch in comment #11, I was able to turn the module on for a form and it caught an invalid domain email address that I entered to test.
I proceeded to removed that form, from the "FORMS TO CHECK" section of admin/config/system/email_verify. Cleared caches and tested an invalid domain email address on the form and it did pass. Proving that the form is no longer being checked by the email verify module.
Usability here seems intuitive and easy.
This has passed testing.
Comment #14
oadaeh commentedThis has been committed to the 2.x dev branch. Thanks for the reviews and testing.
Comment #15
oadaeh commentedComment #16
kristen polThanks!
Comment #17
oadaeh commented