Needs review
Project:
Previous/Next API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 Feb 2015 at 00:50 UTC
Updated:
23 Feb 2017 at 11:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dysproseum commentedCreated a patch to address the issue. The module will now remove a node from the prev_next_node table when it is unpublished, and reassign nodes that linked to it.
Also, when a node is published again, it will be re-added to the prev_next_node table, and become re-included in links to other content.
Testing example:
Comment #2
dysproseum commentedComment #3
dysproseum commentedUpdated patch to match coding standards.
Comment #4
dysproseum commentedUpdated patch to unset prev_nid and next_nid values when their NID values become unpublished.
Prevents an issue that can leave links to unpublished nodes in some cases.
Comment #5
xumepadismal commentedUpdated patch fixes issue when the node is being *inserted* as unpublished
Comment #6
tim-dielsTested latest patch and works like expected. Good job!
Comment #23
rob c commentedNeeds reroll.
Comment #24
marttir commentedThe patch from #2774825 would conflict with the one in #5.
Since I'm in a bit of a hurry, I took the liberty of rolling both up into this patch against current 2.x-dev.
The first and second hunks of #5 were skipped; the second one seems to do what _prev_next_modify_pointing_nodes() already did, but with reverse lookup. Reviewer might want to take an extra look at this just to make sure.
With quick testing, references are updated as expected when unpublishing/publishing nodes in the middle of a chain, when adding a new node at the end of the chain, and when adding a published node in the middle of the chain.
Comment #25
marttir commentedComment #30
pribeh commentedHi, thanks for your efforts here. Have you been able to incorporate any of @dysproseum's efforts into this patch?
https://www.drupal.org/node/2464065
Comment #31
marttir commented#24 includes @dysproseum's efforts from this issue, as well as @ethan.han777's efforts from #2774825.
@dysproseum's cron patch from #2464065 is not included here as it's kind of an unrelated issue: links to unpublished nodes should never occur with #24, but they may happen if other modules use too much magic when publishing/unpublishing nodes. Also, since the cron patch only adds a bit of code, rerolling it seems straightforward.
Comment #32
marttir commented