I've created my own View with Node Hierarchy: Parent Node as an argument (I needed a table, instead of the list provided by Node Hierarchy). I've enabled Node Hierarchy: Actions as field, but for some users the actions are disabled. These users can edit the relevant nodes. Debugging indicates that $node is empty in theme_nodehierarchy_actions($node).

Comments

jonathan_hunt’s picture

Status: Active » Closed (fixed)

Actually a node object with nid alone is being received. Looks like my problem lies elsewhere in node_access().

jonathan_hunt’s picture

Status: Closed (fixed) » Active

Opened again. Found that with just the nid, node_access() wasn't properly testing edit perms for custom content types. The change below is working for me but the node_loads might be a bit heavy.

Index: modules/nodehierarchy/nodehierarchy_theme.inc
===================================================================
--- modules/nodehierarchy/nodehierarchy_theme.inc	(revision 18335)
+++ modules/nodehierarchy/nodehierarchy_theme.inc	(working copy)
@@ -98,6 +98,9 @@
  * Display node hierarchy action links (view, edit, move up, move down, etc.)
  */
 function theme_nodehierarchy_actions($node) {
+  if (empty($node->type)) {
+    $node = node_load($node->nid);
+  }
   global $user;
   drupal_add_css(drupal_get_path('module', 'nodehierarchy') .'/nodehierarchy.css');
jbylsma’s picture

Component: Code » Drupal/PHP Code
Status: Active » Fixed

I'm OK with the node_load, as node_access expects a populated $node object. Committed, better late than never.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.