Opened 7 years ago

Closed 7 years ago

Last modified 6 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 Owned by: westi
Priority: normal Milestone:
Component: Administration Version: 2.0
Severity: major Keywords: Pages show at most 404 bg|has-patch bg|2nd-opinion
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 7 years ago.
Patch for 2.0.2 to fix this
2578.for.trunk.diff (455 bytes) - added by westi 7 years ago.
Patch for trunk to fix this

Download all attachments as: .zip

Change History (11)

  • 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

westi7 years ago

Patch for 2.0.2 to fix this

westi7 years ago

Patch for trunk to fix this

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

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

  • Keywords bg|2nd-opinion added

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.

comment:6   ryan7 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

  • 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

comment:8   ryan7 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

  • Milestone 2.0.3 deleted

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.