Comments

mpaler created an issue. See original summary.

mpaler’s picture

chrisolof’s picture

Status: Active » Needs work

Nice! A few suggestions:

- Document your hook with a simple working example in system.api.php.

- Fix spelling of "overide" on this line:
// Enable other modules to overide core email validation.
Maybe something like // Allow modules to override. would suffice.

- Maybe: rename $validation to $valid to better indicate the boolean nature of the variable.

chrisolof’s picture

mpaler’s picture

@chrisolof thanks for the suggestions. Adjust patch attached.

mpaler’s picture

Adjust api documentation.

cilefen’s picture

Status: Needs work » Needs review
th_tushar’s picture

StatusFileSize
new1.63 KB
new1007 bytes

Fixed coding standards and variable usage issue.

Status: Needs review » Needs work

The last submitted patch, 8: hook_valid_email_address_alter-2966195-8.patch, failed testing. View results

joseph.olstad’s picture

Please do not be alarmed by "composer Command Failed" - this is not an indication of a problem with the patch.
It occurs since approximately may 4th, there is a known testrunner issue. @mixologic (responsible for the testrunner) is on vacation
#2970950: D7 test runner not working since may 4th 2018 'Composer command failed'
Hopefully @mixologic gets back from his vacation soon.

joseph.olstad’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: hook_valid_email_address_alter-2966195-8.patch, failed testing. View results

joseph.olstad’s picture

Status: Needs work » Needs review
smulvih2’s picture

Tested patch in #8, works well!

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

Has tests, passes tests, RTBC.

poker10’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new3.79 KB
new3.43 KB

@joseph.olstad Where does it have tests? I do not see any in the patch #8.

I have tested and checked the patch and found a lot of coding style issues - most of them in the system.api.php. Fixed these problems and added a new test to see if the altering works (see interdiff).

I see this proposed changes as very usefull, so hopefully it can be moved forward.

Let's check the testbot.

joseph.olstad’s picture

@poker10 , yes you're correct and thanks for adding the tests!

poker10’s picture

Adding another related issue.

If we add the hook proposed by this issue, we do not need to complicatedly solve these related issues (possibly with 3rd party libraries), because each site having problem with this will be able to set its own validation in place. This will add a great flexibility.

poker10’s picture

Issue tags: +Needs change record
klonos’s picture

Status: Needs review » Needs work

Thanks @poker10 tests LGTM 👍

However, if I'm reading https://www.drupal.org/docs/develop/standards/coding-standards#cast right, then this line:
$valid = (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);

Should be like this instead:
$valid = (bool) filter_var($mail, FILTER_VALIDATE_EMAIL);

While at it, the docblock for hook_valid_email_address_alter() could use some love, to bring lines up to the allowed length of 80 chars where it is possible.

klonos’s picture

Issue tags: +DrupalSouth
ravi.shankar’s picture

Status: Needs work » Needs review
StatusFileSize
new3.79 KB
new1.36 KB

Addressed comment #20, please review.

mcdruid’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

Draft CR: https://www.drupal.org/node/3324391 n.b. we'll want to update this with a link to the API docs after the patch is committed.

  • mcdruid committed d11a4b1 on 7.x
    Issue #2966195 by mpaler, poker10, ravi.shankar, chrisolof, klonos:...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everybody!

(n.b. I've not checked but I doubt the API docs are regenerated quickly enough that the link for the CR will be available yet... that's still a todo for when it's published with the release, if it's not been done before).

poker10’s picture

It seems like it is already available in the API docs: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_valid_email_address_alter/7.x. I have updated the CR and added the link here.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.