Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12737 closed defect (bug) (fixed)

is_front_page issue with no pages

Reported by: connorhd's profile Connorhd Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.2
Component: General Keywords: dev-feedback has-patch
Focuses: Cc:

Description

With no published pages the setting "show_on_front" is removed when the reading settings are changed, this causes show_on_front to always return false.

Attachments (3)

13846.2.diff (417 bytes) - added by Connorhd 14 years ago.
13846.diff (417 bytes) - added by Connorhd 14 years ago.
12737-hidden.diff (728 bytes) - added by sivel 14 years ago.
When no pages are present add a hidden input field so that the option is not blanked

Download all attachments as: .zip

Change History (7)

@Connorhd
14 years ago

@Connorhd
14 years ago

#1 @jane
14 years ago

  • Milestone changed from Unassigned to 3.0

#2 @sivel
14 years ago

  • Cc matt@… added
  • Keywords dev-feedback added

I think we are trying to patch the wrong thing here. The is_front_page function does the following check:

        // most likely case
        if ( 'posts' == get_option('show_on_front') && is_home() )
                return true;

That logic should catch this scenario. If it isn't then we need to find out what show_on_front is not set as 'posts' here and patch the code responsible for that failure.

@sivel
14 years ago

When no pages are present add a hidden input field so that the option is not blanked

#3 @sivel
14 years ago

  • Keywords has-patch added

New patch adds a hidden input field to options-reading.php when no published pages are present. This saves options.php from blanking show_on_front when saving.

Viper007Bond and I discussed fixing this for backwards compat and without the user going to options-reading.php and clicking "Save Changes" the option will still remain blank. I am open to suggestions, but really feel that fixing it in the is_front_page logic is the wrong place.

#4 @nacin
14 years ago

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

(In [14362]) When no pages are present add a hidden input field so that the show_on_front option is not blanked. Fixes is_front_page return value in an edge case. props sivel, fixes #12737, fixes #9105.

Note: See TracTickets for help on using tickets.