Closed (won't fix)
Project:
Previous/Next API
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2011 at 00:07 UTC
Updated:
17 Sep 2014 at 10:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
trothwell commentedconfirmed
Comment #2
trothwell commentedI'd just like to comment down that a fix i've been trying to work on actually defeats the purpose of this module so i'm not going to bother continuing to attempt a patch. Slim and fast queries is what the goal was.
I attempted to add a while loop with an inner join going through each entry until it finds the appropriate one. It just doesn't work entirely well. The only other thing i can think off is to add a rebuild on every cron run and have the cron run on a regular basis.
For anyone who is interested here is my first attempt (should be replicated to the prev function as well):
Comment #3
tribsel commentedthis is pretty serious, if you unpublish node, you break prev/next navigation, in my case. Because anonymous user does not have rights to view unpublished nodes, he gets redirected to login/register screen. One unpublished node makes this whole api useless.
Comment #4
askibinski commentedMy first thought is this could be solved by adding this functionality.
1. skip indexing unpublished nodes in the first place
when a node is unpublished:
2. remove a node from the prev_next table
3. replace his siblings with the new reference
tricky part might be when an old unpublished node is published:
4. find out where he belongs and basically undo steps 2 and 3.
But I guess there might be already a mechanism for #4.
Comment #5
aasarava commentedI put together this simple patch that seems to work in my testing.
Comment #6
dagmarThe patch works fine. Updated respecting coding standards and using git.
Comment #7
energee commentedFor Drupal 7 Branch
Comment #8
idflorin commentedThanks #7. It works for 7.x version.
Comment #9
gkom commentedI confirm that patch #7 works in 7.x. Thank you very much!
Comment #10
energee commentedYou're welcome!
Comment #11
bhosmer commentedIs this still an issue in the latest 6.x? If it is, feel free to reopen, although support for Drupal 6 is nearing an end.
Comment #12
garbo commentedThis still seems to be an issue for prev_next 7.2.x
EDIT: sorry, I was actually using prev_next 7.x.1
Comment #13
garbo commentedI just tested 7.2.x and I can confirm that this problem still presists in prev_next 7.2.x
Comment #14
garbo commentedThe patch from #7 seems to do the trick.
Comment #15
bhosmer commented@garbo:
Thanks for updating this issue. Could you perhaps roll the patch against 7.x-2.x and post it?