WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 months ago

#35758 reopened defect (bug)

Reading Settings fallback option when none is selected at Front page displays

Reported by: Cybr Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4.1
Component: Query Keywords: bulk-reopened
Focuses: Cc:

Description

Hi,

I found a bug that makes the home page think it's a page. (I didn't look at the WP_Query variables.)

Here are the steps to replicate the issue:

  1. Go to /wp-admin/options-reading.php
  2. Delete the selected option at "Front page displays" through Developer Tools/Web Inspector.
  3. Save settings.
  4. Now no setting is selected.

The home page is a Posts Page but WP_Query doesn't recognize it as one, nor as a front page at all.

This causes all kinds of issues when plugins/themes rely on is_front_page().

Thanks!

Change History (5)

#1 follow-up: @swissspidy
3 years ago

  • Component changed from General to Query
  • Keywords reporter-feedback added

Can you tell us which values were exactly saved to the database after you deleted the option using the dev tools?

Seems like an unusual use case, as a regular user probably won't ever do such a thing, but perhaps we can improve handling of such cases.

#2 in reply to: ↑ 1 @Cybr
3 years ago

  • Keywords reporter-feedback removed

Replying to swissspidy:

Can you tell us which values were exactly saved to the database after you deleted the option using the dev tools?

var_dump( get_option( 'show_on_front' ) ); // string(0) ""

Seems like an unusual use case, as a regular user probably won't ever do such a thing, but perhaps we can improve handling of such cases.

That's right! But I did handle a support question (through Facebook) regarding this situation, and I just had to test it out. The user normally writes in RTL, and uses Google Chrome. So that might be something.

It looks like this already has been handled in some way, but it fails to do anything in this scenario, I assume because of line 65 with all the && cases, at least one of them holds false.
https://github.com/WordPress/WordPress/blob/master/wp-admin/options-reading.php#L56-L67

I hope this helps!

#4 @iseulde
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket has not seen any activity in over *two* years, so I'm closing it as "wontfix".

The ticket may lack decisiveness, may have become irrelevant, or may not have gathered enough interest.

If you think this ticket does deserve some attention again, feel free to reopen.

For bugs, it would be great if you could provide updated steps to reproduce against the latest version of WordPress (5.0.2 at the time of writing). Remember images or a video can be superior to explain a problem. At the very least, quickly test again to make sure the bug still exists.

If it’s an enhancement or feature, some extra motivation may help.

Thank you for your contributions to WordPress! <3

#5 @JeffPaul
3 months ago

  • Keywords bulk-reopened added
  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

A decision was made to reopen tickets that were closed in the bulk edit that this ticket was affected by. This ticket is being placed back into the Awaiting Review milestone so it can be individually evaluated and verified to determine if it is still relevant/valid or reproducible.

Note: See TracTickets for help on using tickets.