Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 4 years ago

#24171 closed defect (bug) (fixed)

Trashing a page selected as "Page on Front" produces homepage 404

Reported by: danielbachhuber's profile danielbachhuber Owned by: nacin's profile nacin
Milestone: 3.7 Priority: low
Severity: minor Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description (last modified by danielbachhuber)

Steps to produce:

  1. Create a new page called "My Home Page". Add some bacon ipsum.
  2. Assign the page as your static home page.
  3. Trash the page, but don't delete it.

Expected behavior: My homepage reverts to a list of my most recent posts

Actual behavior: 404 template is loaded.

In r6337, we started listing most recent posts when the page is deleted. However, there's a short circuit (added later) in wp_delete_post() to wp_trash_post(), which doesn't delete the option. This results in the homepage not being reset until the post is actually deleted.

I think the trashing behavior should be consistent with deleting behavior.

Related: #16379, #14403

Attachments (2)

24171.1.diff (769 bytes) - added by danielbachhuber 11 years ago.
24171.diff (2.1 KB) - added by nacin 11 years ago.

Download all attachments as: .zip

Change History (12)

#1 @danielbachhuber
11 years ago

  • Description modified (diff)

#2 @danielbachhuber
11 years ago

24171.1.diff is a POC of what I think should be happening (and throwing the unstick_post() in there for good riddance).

#4 @c3mdigital
11 years ago

  • Keywords has-patch added

Patch tested and works as intended.

#5 @SergeyBiryukov
11 years ago

#23455 was marked as a duplicate.

#6 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.7

#7 @nacin
11 years ago

It sure would be nice if this was DRY with wp_delete_post().

@nacin
11 years ago

#8 @nacin
11 years ago

I was going to commit this, then I thought about my comment — what about 24171.diff?

#9 @nacin
11 years ago

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

In 25686:

Reset "Page on Front" when such a page is trashed.

props danielbachhuber.
fixes #24171.

#10 @dlh
4 years ago

#23455 was marked as a duplicate.

Note: See TracTickets for help on using tickets.