Hi,
I've used the Drupal 7 port in one of the other issues to create my own implementation of prev/next. I stumbled upon a problem with the index not correctly being updated when a node is deleted. hook_delete is called before a node is deleted, so the node is still in the node table. The _prev_next_add() function will search the node table to update nodes that point to the "to be" deleted node. In my case the "to be" deleted node is again found as the node to point to.
In example:
I have node 1, 2, 3 and 4. I delete node 3. Node 2 and 4 should be updated to point to each other. However, node 3 is still found in the node table. The results is that I have a prev/next link showing "[node:title]" with the URL node/3 on both page 2 and 4.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | prev_next-reindex_after_remove-1372754-02.patch | 766 bytes | xumepadismal |
Comments
Comment #1
gkom commentedThis also happens in the current 7.x-1.x-dev. Has anybody managed to fix this?
Comment #2
xumepadismal commentedHere is the patch. It writes removed NIDs to _SESSION instead of instant re-indexing and makes re-index on hook_init.
Comment #3
xumepadismal commentedComment #4
bhosmer commentedRTBC. Also, related to #1986930 and added to that patch.
Comment #5
bhosmer commentedDoes anyone want to re-roll this for the 7.x-2.x branch? It doesn't apply cleanly now.
Comment #6
bhosmer commented