Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#46255 closed defect (bug) (duplicate)

"Need help putting together your new Privacy Policy page?" notice always shown if Privacy Policy is the first page created

Reported by: filippo.toso Owned by:
Priority: normal Milestone:
Component: Privacy Version: 4.9.6
Severity: minor Keywords:
Cc: Focuses: ui, administration

Description

Hi,

if the first page returned by get_post() is the Privacy Policy page, the "Need help putting together your new Privacy Policy page?" notice will be always shown.

This happens due to the following row in WP_Privacy_Policy_Content::notice():

$post = get_post( $post );

This method is called by admin_notices action without parameters. This means that get_post returns the first post. If this post is the Privacy Policy, the notice will be always shown. I suggest adding the following check at the beginning of the method:

if ( ! $post ) {
    return;
}

Change History (3)

This ticket was mentioned in ​Slack in #core-privacy by desrosj. ​View the logs.


8 years ago

#2 @garrett-eclipse
8 years ago

  • Focuses ui privacy added
  • Keywords reporter-feedback added
  • Version 5.0.3 → 4.9.6

Thanks for the report @filippo.toso sadly I've been unable to reproduce on a clean install.

Can you test with a fresh 5.1 instance and provide steps to reproduce as well as screenshots and URL paths for the admin screens this is affected so I can try to recreate and investigate the problem.

Appreciated

#3 @garrett-eclipse
7 years ago

  • Component Administration → Privacy
  • Focuses administration added; privacy removed
  • Keywords reporter-feedback removed
  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Closing this ticket as it was reproduced and resolved in #48431 which is pending a commit (hopefully in 5.4). The patch there restricts the display to the 'post' edit screen and supports classic & block editors. Thank you again for the report @filippotoso

Note: See TracTickets for help on using tickets.