I can't get this module to work at all. I've tried both the June 4th and 6th release on both a local and external server. Is this a bug or am I missing something? I'm trying to show a list of nodes using node reference as the parent node.

warning: Invalid argument supplied for foreach() in C:\wamp\www\groupone\sites\default\modules\views_hierarchy\views_hierarchy.theme.inc on line 84.

Comments

timefor’s picture

Component: Code » Documentation
Category: bug » task
Priority: Critical » Normal

I found the problem, the node reference must be the first item on the fields list. We need some documentation on this. I've been playing with it for hours. Still trying to get the bottom level showing. I can see two levels now.

joachim’s picture

Component: Documentation » Code
Category: task » bug
Status: Active » Postponed (maintainer needs more info)

> I found the problem, the node reference must be the first item on the fields list.

It really doesn't. Or oughtn't.

It must be *there*, but then you pick it in the settings.

joachim’s picture

Status: Postponed (maintainer needs more info) » Active

Okay I've figured it out.

It's nothing to do with ordering of the field.

You must have had 'group multiple values' enabled on the noderef field -- if you do that then it adds no data to the View query but handles querying for its data internally.

So there are several things to do to fix:

1. add documentation for noderef fields
2. add validation checking for this
3. fix the condition that the code can get to _views_hierarchy_build_row_recursive() with the array of data empty!

I'll do 1, but 2 and 3 should wait until Crell and I figure out the merger with views_tree, as this may turn out not to need fixing.

zetxek’s picture

I'm having this issue, having the noderef field added to the view, and with the "group" option enabled on it. I still get the error on line 84... any idea any other thing that has to be setted up in a special way?

zetxek’s picture

I'm having this issue, having the noderef field added to the view, and with the "group" option enabled on it. I still get the error on line 84... any idea any other thing that has to be setted up in a special way?

blainelang’s picture

I am also getting this error trying to use it with my module which has presented a view to views that is of just one table. In that table I have an id and pid (parent id) field and I want to create a hierarchical view. There is no table to link to for a relationship.

Using just the one table is generating the error noted in this issue where $hierarchy_rows is null.

My issue may be in the view definition - can anyone provide me some direction and is it possible to use this on a single table?