Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#2578 closed defect (bug) (fixed)

Setting "Show at most N posts" to 0 appears to break Page display (with a 404)

Reported by: gt4329b's profile gt4329b Owned by: westi's profile westi
Milestone: Priority: normal
Severity: major Version: 2.0
Component: Administration Keywords: Pages show at most 404 bg|has-patch bg|2nd-opinion
Focuses: Cc:

Description

To duplicate:

  • go to "Options"->"Reading" and set the "Show at most # posts" value to "0"
  • attempt to view any Page on the main site; the Page should fail with a "404"
  • set the "Show at most # posts" setting back to a non-zero value; verify that the same Page now displays properly

As I understand it, the "Show at most" setting should only affect posts, not pages; regardless, it certainly shouldn't be causing 404 errors.

Attachments (2)

2578.for.2.0.2.diff (461 bytes) - added by westi 16 years ago.
Patch for 2.0.2 to fix this
2578.for.trunk.diff (455 bytes) - added by westi 16 years ago.
Patch for trunk to fix this

Download all attachments as: .zip

Change History (11)

#1 @westi
16 years ago

  • Keywords bg|needs-patch added
  • Milestone set to 2.1
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

I can confirm this really breaks things on 2.0.2

I get the "Not Found" search box on the front page (using the default theme)
I see 404's for the category archives and date archives
For Pages I just get the Edit This link

Similar behaviour on trunk except pages 404

I will look at writing a Patch against 2.0.2 and trunk that addresses this so that pages still work with this setup

@westi
16 years ago

Patch for 2.0.2 to fix this

@westi
16 years ago

Patch for trunk to fix this

#2 @westi
16 years ago

  • Keywords bg|has-patch added; bg|needs-patch removed

Ok Looking through the code the issue here is the post paging code in get_posts is used even when we are trying to get a Static Page.

The attached patches should fix this one against 2.0.2 and one against trunk.

#3 @davidhouse
16 years ago

I don't think we should allow 0 for that setting...

#4 @davidhouse
16 years ago

  • Keywords bg|2nd-opinion added

#5 @westi
16 years ago

Wether or not we allow 0 the patch still stands as we don't need to do Paging for static pages - we only expect one results from the query.

#6 @ryan
16 years ago

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

(In [3649]) Don't try to do paging for single page queries. Props westi. fixes #2578

#7 @westi
16 years ago

  • Milestone changed from 2.1 to 2.0.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Marking as candidate for 2.0.3 - This is already fixed in trunk and has-patch for 2.0.3

#8 @ryan
16 years ago

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

(In [3752]) Don't try to do paging for single page queries. Props westi. fixes #2578

#9 @(none)
15 years ago

  • Milestone 2.0.3 deleted

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.