The attached patch adds support for Views Fusion to Node Relativity. Fusing two or more views, Views Fusion makes it possible to display related nodes in the same tabular view. Views Fusion support did already exist for the nodefamily module and for CCK Node Reference fields, but to my knowledge it didn't exist for Node Relativity yet.

I've tested the patch on Node Relativity 5.x-2.x-dev.

It would be great if this functionality could make it into the next release of Node Relativity.

Cheers,
Remco

CommentFileSizeAuthor
relativity_views_fusion.patch1.27 KBrkj

Comments

goose2000’s picture

Wow, thank you. I'll give it a try today...

John

goose2000’s picture

I went and got the file 'relativity-5.x-2.x-dev.tar.gz' and tried to do the patch but
it doesn't like something:

patching file relativity.txt
Hunk #1 FAILED at 47.
Hunk #2 succeeded at 1451 with fuzz 2 (offset 1306 lines).
1 out of 2 hunks FAILED -- saving rejects to file relativity.txt.rej

I keep trying...

edit:
DUUUHHH because it is to be applied to the 'relativity_views.inc' file!
Man I need to start taking harder drugs - lol.

edit2:
got it to patch fine... now off to try it...

C:\patchstuff\relativity>patch --o TEST relativity_views.inc fusion.patch.txt
patching file relativity_views.inc

darius’s picture

John,

if you can test this and then write a short comment, I'll commit the patch asap.

Darius

goose2000’s picture

Ok back now, and am happy to report that this patch is working with views fusion support, very neat. Personally this was the deal breaker for me to NOT use Node Relativity because there was no way to use it to produce relational database tables (using views). Crazy but true. Now this will help do that.

My fused view worked fine - (basically 2 different content types) came together correctly. One thing I wish NR had was an option in the view building for 'Relativity: Parent ID' So, in some testing views, you could easily compare & see a child node belonged to the correct parent. I may look at that, maybe that would be easy?

There are some quirks, drawbacks with views fusion in the readme:

Restrictions & Problems
-----------------------
* Argument Handlers for fused views are not supported! You may only use argument handlers
on the primary view.
* Some fields don't work properly with views_fusion. Currently known to not work are:

* CCK fields for multiple fields, which are set to "group multiple values"

So understand this before going too far too deep. This patch gives you 2 options to build your fused view,

node relativity relation: parent - child
node relativity relation: child - parent

Thank You Guys - Node Relativity & Views Fusion! An early Christmas present for me 8)

John

Christefano-oldaccount’s picture

#163758 has been marked as a duplicate of this issue.

bryanpflug’s picture

Have implemented patch, and set up two views - one for parent nodes, and one for child nodes. In my situation, I have two node types - one for 'activity' (a CCK type) and one for 'book pages'. There are zero or more book pages (the child) for each activity. Book pages are thus defined in relativity as 'Any' parental ordinality, and 'none' allowable child node types. Activities are defined in NR as parental ordinality 'none', and allowable child node type 'book page'. This all seems to work for establishing and navigating through relationships exclusive of views.

I had a parent view ('Activities' that did what I wanted, but once I tried fusing it (trying both parent-child and child-parent options) the parent view would no longer display anything except the header. I'm a bit unclear about how the child view should actually be structured (list, filtered node type, arguments, etc), so suspect this may be the problem, but in the absence of more info, don't know where to dig, and it's a big field! Have removed all 'group' fields from both places, per documentation. Any ideas?

owahab’s picture

I think comment #6 is related to your two views. Can someone else confirm this behavior?

gabocas’s picture

Hi...I installed the patch without troubles, but when I implemented a views fusion with the relation parent-child, I founded this error:

user warning: Unknown column 'v8node_created_orderby' in 'order clause' query: SELECT DISTINCT(node.nid), DATE_FORMAT(FROM_UNIXTIME(node.created), '%Y%m0%H%m') AS node_created_orderby, node.title AS node_title, node.changed AS node_changed, node_data_field_edad.field_edad_value AS node_data_field_edad_field_edad_value, node_data_field_estudio.field_estudio_value AS node_data_field_estudio_field_estudio_value, node.created AS node_created, node_state.state AS node_state_state, v8node.nid AS v8node_nid, DATE_FORMAT(FROM_UNIXTIME(node.created), '%Y%m0%H%m') AS v8v8node_created_orderby, v8node_state.state AS v8node_state_state, v8node_data_field_reporte_0.field_reporte_0_value AS v8node_data_field_reporte_0_field_reporte_0_value FROM node node LEFT JOIN content_field_edad node_data_field_edad ON node.vid = node_data_field_edad.vid LEFT JOIN content_field_estudio node_data_field_estudio ON node.vid = node_data_field_estudio.vid LEFT JOIN node_state node_state ON node.vid = node_state.vid INNER JOIN relativity relativity_parent ON node.nid = relativity_parent.parent_nid LEFT JOIN node v8node ON relativity_parent.nid = v8node.nid LEFT JOIN node_state v8node_state ON v8node.vid = v8node_state.vid LEFT JOIN content_type_reportes v8node_data_field_reporte_0 ON v8node.vid = v8node_data_field_reporte_0.vid WHERE (node.type IN ('orden')) AND (node.uid = '1') AND (v8node.type IN ('reportes')) AND (v8node.uid = '1') ORDER BY node_created_orderby ASC, v8node_created_orderby ASC LIMIT 0, 10 in /home/telerad1/public_html/clientes/includes/database.mysql.inc on line 172.

Can anybody help me?

Thanks in advance!

oadaeh’s picture

I applied this to the 5.x-2.4 release, and it worked as advertised. It didn't do what I wanted, but it did do what it was supposed to do. :^)

@BryanPflug: I saw what you are describing when I had a view that showed nothing, i.e.: had an empty set. Make sure both views display something before fusing them.

xjm’s picture

Tracking.

aren cambre’s picture

Hi, what is holding this up from being implemented in a released module?

socialnicheguru’s picture

subscribing

tortoise’s picture

Status: Reviewed & tested by the community » Needs work

I seem to be having the same problem as gabocas in #8. I too tried to fuse two views using a parent-child relationship, and got

user warning: Unknown column 'v1relativity_parent_node_title' in 'order clause' query: SELECT relativity.parent_nid, relativity_parent_node.title, relativity_parent_node.nid AS pnid, count(node.nid) AS num_nodes, relativity_parent_node.title AS relativity_parent_node_title, v1relativity.parent_nid AS v1node_nid, v1relativity_parent_node.title, v1relativity_parent_node.nid AS v1pnid, count(v1node.nid) AS v1num_nodes, v1relativity_parent_node.title AS v1v1relativity_parent_node_title FROM node node LEFT JOIN relativity relativity ON node.nid = relativity.nid LEFT JOIN node relativity_parent_node ON relativity.parent_nid = relativity_parent_node.nid INNER JOIN nodefamily nodefamily_parent ON node.nid = nodefamily_parent.parent_nid LEFT JOIN node v1node ON nodefamily_parent.child_nid = v1node.nid LEFT JOIN relativity v1relativity ON v1node.nid = v1relativity.nid LEFT JOIN node v1relativity_parent_node ON v1relativity.parent_nid = v1relativity_parent_node.nid WHERE (node.status = '1') AND (node.type IN ('practice_round','round_08','round_09')) AND (relativity_parent_node.nid IS NOT NULL) AND (v1node.status = '1') AND (v1node.type IN ('practice_puzzle')) AND (relativity_parent_node.nid IS NOT NULL) GROUP BY relativity_parent_node.title, relativity_parent_node_title ORDER BY relativity_parent_node_title ASC, v1relativity_parent_node_title ASC in /home/tortcur8/public_html/mh2/includes/database.mysql.inc on line 174.