As the title suggests this bug is caused by the views fusion module, but since I don't see a way to fix it without modifying code in views_node.inc, I decided to assign it to the Views-project.

Let's start with an explanation of the problem. Suppose you've created two views, one shows a list of nodes of type A and the other a list of nodes of type B. Both lists have only one column, the node title, which is displayed as a link to that node. When you would fuse these views using views_fusion the result is a combined list of nodes of both type A and B, every row showing two titles of related nodes. We would expect each title to link to the corresponding node, but unfortunately both titles will now link to the node of type A.

Since we have chosen the option "as link", the handler "views_handler_field_nodelink" (or "views_handler_field_nodelink_with_mark") is called. This function constructs the link, but will always use the property nid of the data object that is passed to it for the node ID. This is incorrect, because in a fused view the 'tablename' in the $fielddata-array is not 'node', but 'vXXnode'. In this case the property 'vXXnode_nid' of the data object should be used to retrieve the node ID.

I have no idea how this bug can be solved without modifying views_node.inc, but maybe fago has a suggestion on this?

Anyway, the attached patch fixes the problem. I don't know of any side-effects.

Cheers,
Remco

Comments

Farreres’s picture

Priority: Normal » Critical

I have experienced the same problem.

If views fusion creates a problem, it is views fusion that must correct it. I don't think touching other modules is the way to go, sorry. Perhaps this patch solves one problem, but it creates another. A better solution should be found.

Farreres’s picture

I am sorry. I have seen another thread on the same subject, which seems to point there is some error in views code, and suggests a change also in this same file.

http://drupal.org/node/140857 pointint to http://drupal.org/node/142714 which offers a solution.

sun’s picture

Status: Needs review » Closed (duplicate)