Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45057 closed defect (bug) (fixed)

Help notice displayed on Privacy Policy page missing in Gutenberg

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: desrosj's profile desrosj
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch fixed-5.0
Focuses: privacy Cc:

Description

When a page is set to be the Privacy Policy page a help notice containing a link to the Privacy Policy guide is displayed in the editor.

When viewing this page in the Gutenberg editor the notice is missing leaving the only reference to the guide found in the Privacy Settings.

It would be nice to have this notice supported as part of 5.0.

Attachments (8)

Screen Shot 2018-10-06 at 1.42.24 AM.png (241.2 KB) - added by garrett-eclipse 6 years ago.
Classic Editor w/ Privacy Policy notice
Screen Shot 2018-10-06 at 1.43.02 AM.png (262.0 KB) - added by garrett-eclipse 6 years ago.
Gutenberg Editor w/o notice
privacy-policy-gutenberg.png (162.8 KB) - added by audrasjb 6 years ago.
45057.diff (1.7 KB) - added by desrosj 6 years ago.
Screen Shot 2018-11-16 at 10.12.34 PM.png (531.2 KB) - added by desrosj 6 years ago.
45057.2.diff (1.7 KB) - added by desrosj 6 years ago.
45057.3.diff (1.4 KB) - added by desrosj 6 years ago.
Leave the inline class on the notice.
45057.4.diff (556 bytes) - added by desrosj 6 years ago.

Download all attachments as: .zip

Change History (28)

@garrett-eclipse
6 years ago

Classic Editor w/ Privacy Policy notice

@garrett-eclipse
6 years ago

Gutenberg Editor w/o notice

This ticket was mentioned in Slack in #core-privacy by garrett-eclipse. View the logs.


6 years ago

This ticket was mentioned in Slack in #core-editor by garrett-eclipse. View the logs.


6 years ago

#3 @audrasjb
6 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.0

https://github.com/WordPress/gutenberg/issues/10448#issuecomment-428521883

Here is a prototype of what should be done for this specific page.

  • I just added a .is-warning notice with the text currently used in Classic Editor.
  • Sorry, my WordPress instance was localized in fr_FR, but I guess it should be enough to see the desired result.

Technical issues that should be solved:

  • We need to check if we are in the privacy policy page (the ID of the page is stored under wp_page_for_privacy_policy item in wp_option table) to append the notice.
  • We need to get the URL of the privacy policy page to append it in the notice.

This ticket was mentioned in Slack in #core-privacy by garrett-eclipse. View the logs.


6 years ago

This ticket was mentioned in Slack in #core-editor by gziolo. View the logs.


6 years ago

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


6 years ago

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


6 years ago

#8 @desrosj
6 years ago

  • Owner set to desrosj
  • Status changed from new to assigned

This notice is added using the edit_form_after_title action hook. This hook does not exist in the new editor, and there is no alternative offered.

GB PR-11604 is aimed at consuming all notices output to the screen using the admin_notices action hook (above the editor title in the classic editor).

The best way forward for fixing this is to move output of the help notice to the admin_notices action hook when using the new editor and leave the legacy behavior for those using the classic editor (potentially in the classic editor plugin).

I opened GB PR-11999 for Gutenberg. After that is merged, it can be ported to core.

@desrosj
6 years ago

#9 @desrosj
6 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

45057.diff moves the notice to the admin_notices hook.

Screen Shot 2018-11-16 at 10.12.34 PM.png is the result when testing with GB PR-11604 applied. That PR is still un-merged.

#10 @swissspidy
6 years ago

Note that instead of if ( ! $post ) { $post = get_post(); } you could just write $post = get_post( $post );

@desrosj
6 years ago

#11 @desrosj
6 years ago

Both GB-11604 and GB-11999 have both been merged into the plugin as of 4.5.

Version 0, edited 6 years ago by desrosj (next)

@desrosj
6 years ago

Leave the inline class on the notice.

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


6 years ago

#13 @SergeyBiryukov
6 years ago

  • Keywords commit added; needs-testing removed

Tested 45057.3.diff, works as expected with the latest build of Gutenberg from GitHub.

The only thing I'd change is Default is null to Default null as per the coding standards.

Last edited 6 years ago by SergeyBiryukov (previous) (diff)

#14 @youknowriad
6 years ago

Tested the patch now that the packages are updated, and it works great

#15 @mcsf
6 years ago

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

In 43920:

Block Editor: Show privacy help notice on Privacy Policy page.

When editing a page set to be the Privacy Policy page, display a help notice
containing a link to the Privacy Policy guide.

This changeset ports this functionality to the new Block Editor.

Props desrosj.
Fixes #45057.

#16 @youknowriad
6 years ago

  • Keywords fixed-5.0 added; commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

#17 @desrosj
6 years ago

Just for reference, [43920] will need to be reversed in the Classic Editor plugin. I have an open pull request for that.

@desrosj
6 years ago

#18 follow-up: @desrosj
6 years ago

Found a scenario where the notice displays incorrectly. When viewing pages in the admin, if the first post in the table is the privacy policy, the notice will display. 45057.4.diff fixes this.

#19 in reply to: ↑ 18 @SergeyBiryukov
6 years ago

Replying to desrosj:

Found a scenario where the notice displays incorrectly. When viewing pages in the admin, if the first post in the table is the privacy policy, the notice will display. 45057.4.diff fixes this.

Could you create a 5.0.3 ticket for this?

#20 @desrosj
6 years ago

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

In 44291:

Block Editor: Show privacy help notice on Privacy Policy page.

When editing a page set to be the Privacy Policy page, display a help notice
containing a link to the Privacy Policy guide.

Merges [43920] to trunk.

Fixes #45057.

Note: See TracTickets for help on using tickets.