#48431 closed defect (bug) (fixed)
Privacy policy notice should not be visible on Draft Admin List page.
Reported by: | chetan200891 | Owned by: | garrett-eclipse |
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | 4.9.6 |
Component: | Privacy | Keywords: | has-screenshots has-patch commit |
Focuses: | ui, administration | Cc: |
Description
On fresh install, When privacy policy page in draft mode and if you see draft pages from admin list page. Privacy policy notice is visible on Draft Admin List page. It should not be there, it should be only on edit page. Also that is overriding on help tab.
Attachments (3)
Change History (16)
#2
@
5 years ago
- Component changed from Administration to Privacy
- Focuses privacy removed
- Keywords has-patch commit added
- Milestone changed from Awaiting Review to 5.4
- Owner set to garrett-eclipse
- Status changed from new to accepted
- Version set to 4.9.6
Thanks for the patch @chetan200891 and good eye.
Testing this seems to only occur when the Privacy Policy page is in draft and the only page listed on the draft listing.
Your patch applies cleanly and addresses the issue nicely, thank you marking for commit and moving to 5.4.
#3
@
5 years ago
- Keywords needs-refresh added; commit removed
Hey @chetan200891 ! Thanks for pointing this out and the patch. I'm removing the commit for now for a bit of extra discussion first.
The current 48431.diff works fine (could have used strict comparison but that's easily changed).
Since there can only be 1 Privacy Policy page at a time and we always keep its ID at the wp_page_for_privacy_policy
option I believe it would be better to bind this notice only to that ID + editing (post.php) page if that's possible.
This way the notice will only show up under these specific circumstances instead of excluding unwanted side-effects like the Draft list view.
Would you like to see if that would work and come up with an new patch?
#6
@
5 years ago
Thanks for the refresh @chetan200891! 48431.1.diff Works as expected and I think that this way there won't be any extra side effects from this as it's targeted only to specific edit/ID now :-).
@garrett-eclipse take a look as well if you like, I'm ok for a commit tag here.
#7
@
5 years ago
- Keywords commit added
Thanks for catching that @xkon and the quick refresh @chetan200891 this looks to be a more bullet-proof approach.
My testing looks good here as it no longer appears on the draft list and still appears on both block editor and classic editor when on the Privacy Policy page.
Marking for commit.
#10
@
4 years ago
I'm still seeing this issue with 5.4.1 – I have a page marked as "Privacy Policy Page" in the pages overview, and it is marked as published, but this notice is still shown when editing. The post-ID of the page is 3 so it was not the first page created as far as I can tell.
#11
follow-up:
↓ 12
@
4 years ago
Hello @benjibee from your comment it sounds like you're seeing the notice when editing the page itself and not on the listing of pages or drafts? If so then that's intended behaviour, the notice should be present when editing the actual page itself. This issue specifically was flagged because the notice was shown outside the editor on the listing of draft pages.
If I've misunderstood please elaborate and potentially provide screenshots.
Thank you
#12
in reply to:
↑ 11
@
4 years ago
@garrett-eclipse You're right, I commented too hastily, excuse me. I didn't imagine this was expected behavior and assumed it was in error. As others may feel the same, could you point me to the nearest filter to disable this warning, please? Thank you :)
#13
@
4 years ago
No worries @benjibee, there's a related ticket (#44981) to make the notice dismissible by the user and pertain that. In the meantime you can remove the admin_notices action tied to the WP_Privacy_Policy_content::notice() as follows;
<?php remove_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) );
*May need to be wrapped in an admin_init action due to load order.
Created patch.