WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6539 closed defect (bug) (fixed)

404 page does not appear when using static home page

Reported by: natecook Owned by: ryan
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch tested
Focuses: Cc:

Description

If an installation is configured to have the home page set to a static page, with the "Front page" set but the "Posts page" unset, instead of the 404 template showing up when necessary, all pages are loaded and displayed.

Attachments (3)

query-404.diff (597 bytes) - added by natecook 7 years ago.
Patch for fix
6539.patch (646 bytes) - added by tenpura 7 years ago.
Patch for 2.5 branch. Typecasts $reqpage to string to make the conditional work properly.
6539-modified.patch (647 bytes) - added by azmeen 7 years ago.
Patch 6539.patch didn't work for me. Merged the additional equal sign fix from the query-404.diff patch and tested working on WordPress 2.5.1.

Download all attachments as: .zip

Change History (23)

@natecook7 years ago

Patch for fix

comment:1 @mtekk7 years ago

  • Keywords has-patch added

On r7591 I'm not seeing a error, if I enter garbage in the browser's navigation bar I get the 404 page as expected. Is there anything in particular that it should be doing?

comment:2 @zoombody7 years ago

I encountered this after upgrading from 2.3.3, and reproduced it on a clean 2.5 installation. The patch corrected the issue.

comment:3 @zoombody7 years ago

  • Keywords tested added

comment:4 @lloydbudd7 years ago

  • Milestone changed from 2.7 to 2.6

comment:5 @zoombody7 years ago

  • Milestone changed from 2.6 to 2.5.1

I'm not sure whether it's cool for a non-developer to change milestones, but here goes.

comment:6 @Nazgul7 years ago

  • Milestone changed from 2.5.1 to 2.6

Usually we milestone for the current development version (or the next one if no patch is attached) and once it's comitted and deemed important enough it will be backported for a maintenance release.

comment:7 @ryan7 years ago

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

(In [7605]) Explicit ID check so we don't fall through for empties. Props natecook. fixes #6539 for 2.6

comment:8 @ryan7 years ago

(In [7606]) Explicit ID check so we don't fall through for empties. Props natecook. fixes #6539 for 2.5

comment:9 @ryan7 years ago

  • Milestone changed from 2.6 to 2.5.1

This is one looked safe for 2.5.1, committed.

comment:10 @ryan7 years ago

(In [7622]) Revert [7605]. It breaks setting posts page. see #6539

comment:11 @ryan7 years ago

(In [7623]) Revert [7606]. It breaks setting posts page. see #6539

comment:12 @ryan7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:13 follow-up: @tenpura7 years ago

The patch typecasts $reqpage to integer temporarily only when 404. This way it won't break setting posts page.

comment:14 in reply to: ↑ 13 @tenpura7 years ago

The patch typecasts $reqpage to integer temporarily only when 404. This way it won't break setting posts page.

The patch typecasts $reqpage to string.

comment:15 @tenpura7 years ago

I updated 6539.patch. It does almost the same thing, but less code.

@tenpura7 years ago

Patch for 2.5 branch. Typecasts $reqpage to string to make the conditional work properly.

@azmeen7 years ago

Patch 6539.patch didn't work for me. Merged the additional equal sign fix from the query-404.diff patch and tested working on WordPress 2.5.1.

comment:16 @ryan7 years ago

  • Owner changed from anonymous to ryan
  • Status changed from reopened to new

comment:17 @ryan7 years ago

(In [7905]) Fix page 404 when page_for_posts is empty. see #6539

comment:18 @ryan7 years ago

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

(In [8099]) Fix page 404 when page_for_posts is empty. fixes #6539

comment:19 @ryan7 years ago

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

comment:20 @westi7 years ago

  • Milestone changed from 2.9 to 2.6
Note: See TracTickets for help on using tickets.