I've noticed when using submission queue with a defined node in flexinode(both 4.5.0), the "Type" column is empty on the submission queue page. For story, page, and even image nodes...the column has the name of the correct respective node types for each submission in the queue. However, if I define a node type using flexinode, this column is left blank, although the submission itself is listed. Does ANYONE know how to make the flexinode "Type" name appear in the appropriate column?

thanks,
larry

Comments

larry’s picture

Hallooooooo.

--There are no Kangaroos in Austria--

larry’s picture

Perhaps a bit of code. This is from the queue module.

if ($user->uid == $node->uid || field_get($node->users, $user->uid)) {
$rows[] = array(array('data' => module_invoke($node->type, node_name, $node), 'class' => 'type'), array('data' => l($node->title, 'queue/'. $node->nid), 'class' => 'title'), array('data' => format_name($node), 'class' => 'name'), array('data' => queue_score($node->nid), 'class' => 'score'));
}
else {
$rows[] = array( array('data' => module_invoke($node->type, node_name, $node), 'class' => 'type'), array('data' => l($node->title, 'queue/'. $node->nid), 'class' => 'title'), array('data' => format_name($node), 'class' => 'name'), array('data' => l(t('vote'), 'queue/'. $node->nid), 'class' => 'score'));
}
}

I suspect the problem lies here. For some reason module_invoke is not picking up the flexinode type. Everything else with flexinode is working. I imagine I need an additional hook for the type to be viewed, but I do not know. Any ideas are GREATY appreciated.

thanks,
larry

--There are no Kangaroos in Austria--

larry’s picture

Hello,
It appears that I could not avoid what I had not looked forward to...spending a ridiculus amount of time solving a simple problem. I had hoped that someone knew the answer and could spare me. Alas, it was not meant to be. So, I solved the above problem and I hope this solution may help someone else. In the queue.module...

Change:

if ($user->uid == $node->uid || field_get($node->users, $user->uid)) {
      $rows[] = array(array('data' => module_invoke($node->type, node_name, $node), 'class' => 'type'), array('data' => l($node->title, 'queue/'. $node->nid), 'class' => 'title'), array('data' => format_name($node), 'class' => 'name'), array('data' => queue_score($node->nid), 'class' => 'score'));
    }
    else {
      $rows[] = array( array('data' => module_invoke($node->type, node_name, $node), 'class' => 'type'), array('data' => l($node->title, 'queue/'. $node->nid), 'class' => 'title'), array('data' => format_name($node), 'class' => 'name'), array('data' => l(t('vote'), 'queue/'. $node->nid), 'class' => 'score'));
    }
  }

to:

if ($user->uid == $node->uid || field_get($node->users, $user->uid)) {
      $rows[] = array(array('data' => node_invoke($node->type, node_name), 'class' => 'type'), array('data' => l($node->title, 'queue/'. $node->nid), 'class' => 'title'), array('data' => format_name($node), 'class' => 'name'), array('data' => queue_score($node->nid), 'class' => 'score'));
    }
    else {
      $rows[] = array( array('data' => node_invoke($node->type, node_name), 'class' => 'type'), array('data' => l($node->title, 'queue/'. $node->nid), 'class' => 'title'), array('data' => format_name($node), 'class' => 'name'), array('data' => l(t('vote'), 'queue/'. $node->nid), 'class' => 'score'));
    }
  }

That's it. You'll notice that ( array('data' => module_invoke($node->type, node_name, $node), 'class' => 'type') is now ( array('data' => node_invoke($node->type, node_name), 'class' => 'type')...using node_invoke instead of module_invoke. Simple. Yes. Absurd. Yes. But, I got to learn alot about Drupal hooks. Rock on.

larry

--There are no Kangaroos in Austria--