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

Opened 4 years ago

Last modified 2 years ago

problem with posts_nav_link

Reported by: anonymousbugger Assigned to: markjaquith
Priority: normal Milestone:
Component: Template Version: 1.5.1.2
Severity: minor Keywords: bg|commit bg|has-patch
Cc:

Description (Last modified by skippy)

some weird bug with posts_nav_link makes a 'next page' randomly appear for some reason.

sometimes it appears... e.g. http://www.semiologic.com/cats/topics/it

sometimes it doesn't... e.g. http://www.semiologic.com/cats/topics/it/blogging/

from trial and error, it looks as if being at the 2nd level (out of three) in the category tree is problematic.

root - topics

  • it <-- problem
    • blogging <-- no problem
  • business <-- problem
    • marketing <-- no problem

from trial and error still, switching the number of posts to be displayed from 5 (current settings) to 20 makes the problem disappear. But that could also mean the problem will simply occur with more posts in that case.

feel free to email me (denis -|- at -|- semiologic -|- dot -|- com) if you'd like me to make the content of server-side variables in the page's source for you to spot the problem.

Attachments

track-789.sql (2.9 kB) - added by Denis-de-Bernardy on 06/30/05 20:48:23.
sample data to reproduce the bug
789.diff (0.9 kB) - added by Denis-de-Bernardy on 06/30/05 23:43:38.
789-better.patch (1.2 kB) - added by Denis-de-Bernardy on 07/01/05 00:13:57.

Change History

02/02/05 21:05:14 changed by anonymousbugger

  • Patch set to No.

06/30/05 11:23:12 changed by skippy

  • keywords set to bg|2nd-opinion.
  • owner changed from anonymous to skippy.
  • status changed from new to assigned.
  • description changed.

06/30/05 18:21:49 changed by markjaquith

Still a problem, Denis?

06/30/05 20:33:15 changed by Denis-de-Bernardy

no idea, this is like... so old. :)

i'll try to reproduce it, and I'll get back to you.

06/30/05 20:47:53 changed by Denis-de-Bernardy

  • version changed from 1.5 to 1.5.1.2.

it's still buggy, apparently.

Option is 5 posts per cat:

http://dev.semiologic.com/?cat=3 has 4 posts, and displays the link nonetheless.

http://dev.semiologic.com/?cat=3&paged=2 returns a 404

I'm attaching sample data (sql dump of wp_posts, wp_post2cat and wp_categories).

06/30/05 20:48:23 changed by Denis-de-Bernardy

  • attachment track-789.sql added.

sample data to reproduce the bug

06/30/05 21:03:32 changed by Denis-de-Bernardy

quick'n dirty fix:

$numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $fromwhere");

change to:

$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");

in posts_nav_link() and in next_posts_link().

while we're at it, where can I find a pointer to make and use diffs, so I can send you the change?

06/30/05 23:43:38 changed by Denis-de-Bernardy

  • attachment 789.diff added.

07/01/05 00:13:57 changed by Denis-de-Bernardy

  • attachment 789-better.patch added.

07/01/05 00:15:40 changed by Denis-de-Bernardy

789-better contains a fix to another problem I encountered with huge queries full of line breaks.

08/15/05 08:45:38 changed by markjaquith

  • keywords changed from bg|2nd-opinion to bg|2nd-opinion bg|dev-feedback.
  • milestone set to 1.6.

09/05/05 22:21:28 changed by markjaquith

  • keywords changed from bg|2nd-opinion bg|dev-feedback to bg|commit bg|has-patch.
  • owner changed from skippy to markjaquith.
  • status changed from assigned to new.

09/05/05 22:21:35 changed by markjaquith

  • status changed from new to assigned.

09/08/05 21:05:09 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [2855]) posts_nav_link fixes from Denis-de-Bernardy. fixes #789

11/30/06 19:41:47 changed by

  • milestone deleted.

Milestone 2.0 deleted