I think this bug has something to do with how similarterms retrieves the latest revision ID. If you've enabled "Create new revision" for a node type, then similarterms doesn't pick up the latest revision ID. When you add new terms to a node, they're only added to the latest revision, which means similarterms essentially ignores them.
I fixed the issue by changing line 85 of the file views/similarterms_handler_argument_node_nid.inc to the following
$vids[] = db_result(db_query("SELECT vid FROM {node_revisions} WHERE nid = %d ORDER BY vid DESC LIMIT 1", $nid));
Let me know if you'd like me to submit a patch.
Comment | File | Size | Author |
---|---|---|---|
#2 | similarterms-969034.patch | 951 bytes | Les Lim |
Comments
Comment #1
brad.bulger CreditAttribution: brad.bulger commentedwhy not just get the latest version id from node?
Comment #2
Les Lim#1 is the right way to go. Patch attached. I think this is straightforward enough that it doesn't have to go through the usual review, so setting to RTBC.
I'd also call this borderline critical, so bumping the status.
Comment #3
jjeff CreditAttribution: jjeff commentedPatch looks good. Thanks for this.
I'll probably be able to integrate and commit this tomorrow.
Comment #4
dsayswhat CreditAttribution: dsayswhat commentedI just arrived at the same conclusion - but didn't see this issue until too late. my problem was that the similarterms block was showing intermittently empty on random nodes, like described in #973670: Views block doesn't output any similar nodes and #959638: Block not appearing when expected.
If anyone is seeing empty similarterms blocks, the patch above should make all the difference.
If it's all right, I'll change the title to reflect both the symptom and the cause, for future reference.
Thanks for a great module, Jeff.
Comment #5
jjeff CreditAttribution: jjeff commentedPatch applied and new version (2.1) released!