WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#14403 closed defect (bug) (fixed)

Trashing all pages can lead to users being trapped with a front page 404

Reported by: markel Owned by: westi
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0
Component: UI Keywords: has-patch
Focuses: Cc:

Description

If a user sets a page as the front page of their site in Settings > Reading, and then deletes all of the pages from their site, the option to change the front page back to the default is hidden (since no pages exist) and it's not obvious what to change in order to get the selector back.

The selector should either not be hidden when it is configured to use a static page, or the option should be returned to default upon trashing the page that was selected.

Steps to reproduce:

  1. Create a page.
  2. Set the page to be the front page of the site in Settings > Reading.
  3. Trash the page.
  4. Navigate back to Settings > Reading. You cannot restore the front page to the recent posts option and visitors to the site are greeted by the 404 page.

Attachments (1)

14403.diff (637 bytes) - added by nacin 5 years ago.
Simple patch.

Download all attachments as: .zip

Change History (9)

comment:1 @nacin5 years ago

  • Milestone changed from Awaiting Review to 3.1
  • Severity changed from normal to minor

If you simply press "Save" on Settings > Reading, it should restore the setting. A pleasant side effect of [14362].

Realistically, like what it does in [15227], if we end up with no pages but we're not currently show_on_front, we should just update the option right away, in addition to spitting out an input=hidden field to update it on save.

@nacin5 years ago

Simple patch.

comment:2 @nacin5 years ago

  • Keywords has-patch added

comment:3 @westi5 years ago

  • Owner set to westi
  • Severity changed from minor to normal
  • Status changed from new to accepted

This is less than awesome :-(

comment:4 @mrmist5 years ago

Related #15208

comment:5 @automattor5 years ago

(In [16816]) Update show_on_front to posts if there are no pages, just in case. see #14403.

comment:6 @nacin5 years ago

  • Milestone changed from 3.1 to Future Release

Moving to future. #15208 might be a better long-term solution.

comment:7 @MikeHansenMe3 years ago

  • Keywords close added

This seems to be fixed in 3.5-beta-1 . I created a page "Home" and went to settings->reading and selected "Home" as the front page. Then deleted the page and went back to settings->reading and it showed "-Select-" for the front page with no errors. When visiting the site it does show the not found page. This is the behavior I expected. Proposing we close this ticket.

comment:8 @SergeyBiryukov3 years ago

  • Keywords close removed
  • Milestone changed from Future Release to 3.1
  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.