Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44126 closed defect (bug) (fixed)

Adding fields to comments_form args prevents checkbox displaying

Reported by: pross's profile pross Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.9.8 Priority: normal
Severity: normal Version: 4.9.6
Component: Comments Keywords: needs-testing fixed-major
Focuses: docs, privacy Cc:

Description

Steps to reproduce:

in a comments.php pass the $args to comments_form

comment_form( array(
        'fields' => array(
            'author' => 'Hello World!',
        ),
));

Because fields is now set the privacy checkbox will never display.

comment-template.php needs to check whether fields?cookies? is set.

Attachments (1)

44126.patch (586 bytes) - added by pross 6 years ago.

Download all attachments as: .zip

Change History (16)

This ticket was mentioned in Slack in #core by iandunn. View the logs.


6 years ago

#2 @desrosj
6 years ago

  • Component changed from Privacy to Comments
  • Focuses docs privacy added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.9.7

Thanks for the ticket, @pross. I tested this and I am able to reproduce.

I am going to add this to the dev note for themes that are providing arguments to comment_form(). If a theme is overriding the fields in core, I think this should be on them to add the new field. But we need to help them understand why and how. I did notice that the docblock is missing the new field, though.

We could also separate the display of this field into a different argument.

Going to mark 4.9.7 for now so that this gets looked at.

#3 @desrosj
6 years ago

  • Version set to 4.9.6

@pross
6 years ago

#4 @pross
6 years ago

Quick patch, still allows users to use comment_form_default_fields so they can still remove the cookies checkbox if need be.

#5 @desrosj
6 years ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

#6 @pbiron
6 years ago

  • Keywords needs-patch removed

#7 @pbiron
6 years ago

  • Keywords needs-testing added

#8 @SergeyBiryukov
6 years ago

Previously: #32312

Something similar to [32511] should probably be done here.

#9 @SergeyBiryukov
6 years ago

On second thought, 44126.patch makes more sense.

#10 @SergeyBiryukov
6 years ago

The patch should take [43370] and [43469] into account though.

This ticket was mentioned in Slack in #core by pbiron. View the logs.


6 years ago

#12 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 43518:

Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.

The comment_form_default_fields filter can be used to remove the checkbox.

Props pross, SergeyBiryukov.
Fixes #44126.

#13 @SergeyBiryukov
6 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

This ticket was mentioned in Slack in #core by jon_bossenger. View the logs.


6 years ago

#15 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 43524:

Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.

The comment_form_default_fields filter can be used to remove the checkbox.

Props pross, SergeyBiryukov.
Merges [43518] to the 4.9 branch.
Fixes #44126.

Note: See TracTickets for help on using tickets.