Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Pages with id 404 do not obey widget visibility rules #2542

Open dllh opened 9 years ago

dllh commented 9 years ago

Repro:

  1. Find or contrive to set up a site that has a page with the id 404.
  2. Create a widget and update its visibility settings so that it should display on this page.

You'd expect the widget to display, but it doesn't because it's possible also to designate rules for the 404 error page. The code that interprets the rules checks for the major condition of 'page' and the minor of '404', which is satisfied for both the 404 page and the page with the id 404. The logic goes something like this:

  1. Is the current major condition we're checking a page condition? (Yes.)
  2. Is the minor condition '404'? (Yes for both the error page and the page with id 404.)
  3. Is the current page the 404 error page? (Yes for the error page, no for the page with id 404 that you intended to show the widget on.)
  4. Don't show the widget on the page with id 404 because it is not the 404 error page.

The proper fix for this is probably to use something other than a numeric value when saving/checking the 404 error page condition, but there may be cases in the wild in which people have defined conditions for the 404 page, and it'd be lousy to break those, so I'm not really sure what the proper fix is if we want to avoid such breakage.

jeherve commented 7 years ago

This should be fixed in #6333

carladoria commented 7 years ago

Also reported here: 375063-chat

jeherve commented 6 years ago

It seems the problem is back: https://www.dropbox.com/s/yx73sd3rksy4yil/test-page-id-404-video.mp4?dl=0 804771-zen

stale[bot] commented 6 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

scottnelle commented 5 years ago

Hi friends. I wanted to mention that this issue is still present in Jetpack 5.2.1 on WordPress.com VIP Go. I'd still love to see a fix for it, even though it's marked as stale. Thanks!

stale[bot] commented 4 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.