We are unable to index nodes by title. The option is selected in the config, but when the cron runs the prev/next nids that it finds are based on nid, and not by title as they should be.

I walked through the code and noticed something peculiar about the function _prev_next_add. Lines 207-292 are simply repeating the same execution as lines 119-205 in the same function. The code in question is iterating over an array of content types and executes the same code as 119-205. It does this for every node it is processing.

This loop and subsquent writes to the database appear to be overwriting the correct values with the wrong values. The first chunk of code, lines 119-205, correctly identify the next and prev nids and writes them to the db. Then this loop runs, and overwrites them.

When I comment out lines 207-292 and reindex the data, the prev/next IDs are perfectly accurate. Also reindexing the data was considerably faster since it was no longer looping over each content type and repeating the same db writes.

I am extremely confused as to what lines 207-292 are attempting to do. The comment says "Update the other nodes pointing to this node", but I do not see how it is doing that, or why it would need to. The code only ever acts upon the $nid that is passed to the function, it does not attempt to get a list of nids that would be pointing to $nid.

Maybe this is cruft code that needs to be removed?

At any rate, removing the code works and my prev/next values are now accurate.

Comments

royl-development created an issue.

pribeh’s picture

Any input from the module author on this? I'm curious as well. Thanks!