Ticket #6539 (closed defect (bug): fixed)

Opened 4 years ago

Last modified 4 years ago

404 page does not appear when using static home page

Reported by: natecook Owned by: ryan
Priority: normal Milestone: 2.6
Component: General Version: 2.5
Severity: normal Keywords: has-patch tested
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

query-404.diff Download (597 bytes) - added by natecook 4 years ago.
Patch for fix
6539.patch Download (646 bytes) - added by tenpura 4 years ago.
Patch for 2.5 branch. Typecasts $reqpage to string to make the conditional work properly.
6539-modified.patch Download (647 bytes) - added by azmeen 4 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.

Change History

Patch for fix

  • 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?

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

  • Keywords tested added
  • Milestone changed from 2.7 to 2.6
  • 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.

  • 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   ryan4 years ago

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

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

comment:8   ryan4 years ago

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

comment:9   ryan4 years ago

  • Milestone changed from 2.6 to 2.5.1

This is one looked safe for 2.5.1, committed.

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

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

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:13 follow-up: ↓ 14   tenpura4 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   tenpura4 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.

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

tenpura4 years ago

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

azmeen4 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.

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

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

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

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

  • Milestone changed from 2.5.2 to 2.9

Milestone 2.5.2 deleted

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