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

Opened 6 years ago

Last modified 5 years ago

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

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

Change History

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

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

westi6 years ago

Patch for 2.0.2 to fix this

westi6 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   ryan6 years ago

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

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

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

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

comment:8   ryan6 years ago

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

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