#48943 closed defect (bug) (fixed)
`comment_form()` expects optional "email" field to be passed.
Reported by: | Mat Lipe | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.3.1 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | Comments | Keywords: | has-patch |
Focuses: | template | Cc: |
Description (last modified by )
Ticket #47975 introduced a requirement to the comment_form
template tag of a passed field['email']
argument.
When using comment_form
without passing field['email']
to the $args
parameter you get the following notice level error.
Undefined index: email \wp-includes\comment-template.php:2440
I have confirmed the issue does not exist on WP 5.2.4.
I have included a patch which simply checks for the existence of the email
array key before using it.
Attachments (2)
Change History (9)
#1
@
5 years ago
I should point out this only happens when the fields
is provided as an argument without the "email" key. If you do not provided fields
the defaults fill in the "email" key for you and this error does not occur.
#5
@
5 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 46885:
#7
@
5 years ago
- Keywords needs-refresh removed
Ah nice, thanks Sergey, you beat me by committing it directly :D
@mat-lipe welcome to WordPress Trac and thank you for your patch!
Please note that the patch should be generated against trunk/wordpress-develop. Here is the GitHub mirror to clone wordpress-develop
sources: https://github.com/WordPress/wordpress-develop :-)
Patch the /wp-includes/comment-template.php file