Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help notice displayed on Privacy Policy page missing in Gutenberg #10448

Closed
garretthyder opened this issue Oct 9, 2018 · 7 comments · Fixed by #11604
Closed

Help notice displayed on Privacy Policy page missing in Gutenberg #10448

garretthyder opened this issue Oct 9, 2018 · 7 comments · Fixed by #11604
Assignees
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@garretthyder
Copy link
Contributor

Describe the bug
Original Core Trac Ticket - https://core.trac.wordpress.org/ticket/45057

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.

To Reproduce
Steps to reproduce the behavior:

  1. Install Clean WP
  2. Enable Gutenberg
  3. Navigate to Settings > Privacy and Create Privacy Page
  4. Edit Privacy Page in Classic Editor to see the notice.
  5. Switch to Gutenberg and note the lack of notice.

Expected behavior
The Privacy Policy guide notice should be displayed on the Privacy Policy page irrelevant of editor (Classic & Gutenberg) being used.

Screenshots
screen shot 2018-10-06 at 1 42 24 am
Classic Editor w/ Privacy Policy notice

screen shot 2018-10-06 at 1 43 02 am

Gutenberg Editor w/o notice

Browser Information is Irrelevant

Related - #6388

@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Oct 9, 2018
@danielbachhuber danielbachhuber added [Type] Bug An existing feature does not function as intended Backwards Compatibility Issues or PRs that impact backwards compatability labels Oct 9, 2018
@audrasjb
Copy link
Contributor

Hi,

Nice catch @garrett-eclipse :)
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.

privacy-policy-gutenberg

Cheers,
Jb

@garretthyder
Copy link
Contributor Author

Thanks @audrasjb

Other technical requirements, if the PHP admin_notice isn't just surfaced via Gutenberg and is instead rebuilt, that should be noted;

  • There needs to be a check for current_user_can( 'manage_privacy_options' )
  • The URL can be found under tools.php?wp-privacy-policy-guide=1 but will need to be run through admin_url() or similar.
  • The translatable text along with the accessibility text should match existing to avoid requiring additional translations.

For reference here's the PHP notice code;
https://github.com/WordPress/WordPress/blob/f7ba175491b725a5f3d636072c8b432774d38ae3/wp-admin/includes/misc.php#L1590-L1632

@gziolo
Copy link
Member

gziolo commented Oct 12, 2018

@aduth is working on Notices implementation in Gutenberg, related PR #9617.

@desrosj desrosj self-assigned this Oct 17, 2018
@garretthyder
Copy link
Contributor Author

Looks like PR #9617 got merged 🎉

Does that mean existing notices simply work so there's nothing more needed? Or what are the next steps to re-introducing the Privacy Policy guide notice?

Thank you

@aduth
Copy link
Member

aduth commented Oct 29, 2018

#9617 will not have done anything so far as reintegrating notices from classic editors. It is a refactoring of the JavaScript APIs for creating notices.

@garretthyder
Copy link
Contributor Author

Thanks for clarifying @aduth
So there's still some work to be done to integrate PHP notices into the new notices API component.

@aduth aduth self-assigned this Nov 7, 2018
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label Nov 16, 2018
@desrosj
Copy link
Contributor

desrosj commented Nov 16, 2018

I opened #11999 to move the notice to a new action hook so that it is actually output. This will allow the work in #11604 to pass the notice into the Notices API.

@desrosj desrosj added [Status] In Progress Tracking issues with work in progress and removed [Status] In Progress Tracking issues with work in progress labels Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants