Hello,

I just saw that the nodereferrer field holds only nodes that are published, is this the behaviour it should have?

I'm using this in combination with the nodereferrer_create, so maybe the issue is for their.

I used the patched version, not the 6.x-dev, so maybe this is addressed in the development release, but I'm not sure about this.

Does someone has an idea?

TIA,
Fossie

Comments

pztrick’s picture

edit>>
decided my problem was quite different, so opened my own issue.

andypost’s picture

Current state -dev so fixes and patches are welcome

I see no reason to include unpublished else try views

andypost’s picture

Status: Active » Postponed (maintainer needs more info)
sylvaticus’s picture

I have the same problem here.. I use nodereferrer to list reviewes of article. In this case I want keep my reviews unplublished but still show them to the admins.
So I suggest that in the internal query that nodereferrer perform instead of having a "published" filter it adds a "published or admin" one, to allow admins to see the records.

dwightaspinwall’s picture

Category: bug » feature
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.4 KB

Simple patch that pulls the publish check (status=1) so all referencers appear.

dwightaspinwall’s picture

On second thought, I have little confidence in my patch in #7 and recommend instead using a module like Viewfield (http://drupal.org/project/viewfield) for advanced display of referencees in a node's view.

BTW, thanks for a great module Andy.

stinky’s picture

Subscribe.
I too would like nodereferrer to work with unpublished content. I'll try viewfield, but I don't think it's going to accomplish what I need.

christianchristensen’s picture

StatusFileSize
new2.45 KB

Without breaking the API it is possible to also control the published (status) filter. This should cover being able to filter by published, unpublished, or both. Please see patch.

andypost’s picture

#9 seem reasonable but still no UI present

christianchristensen’s picture

Could you direct me where to the UI portion - I thought this was an API call; views handlers actually behave fine b/c they build the SQL in the handler and have the status as part of the views options.

christianchristensen’s picture

Could you direct me where to the UI portion - I thought this was an API call; views handlers actually behave fine b/c they build the SQL in the handler and have the status as part of the views options.

andypost’s picture

Status: Needs review » Needs work

@christianchristensen I mean that you could implement this as settings for field. A checkbox is enough.

Also is_null() make no sense because $is_puplished have default value and also better to use isset()

glennpratt’s picture

Re-roll with requested changes.

I rewrote it to be a little more explicit, since I think NULL should result in default behavior (i.e. return only published nodes).

  switch ($published) {
    case -1:
      $filter_publish = '';
     break;
    case (0 === $published):
      $filter_publish = 'AND n.status = 0 ';
      break;
    default:
      $filter_publish = 'AND n.status = 1 ';
glennpratt’s picture

Missed an extra space in the SQL. Boo to concatenated SQL strings.

glennpratt’s picture

Status: Needs work » Needs review

Shoot, forgot to set status. We've been running live with the patch in #15 since I posted it.

rokr’s picture

This features is needed! Just investigated why nodereferrer stopped working (showing up) after i unpublished about 2000 nodes.
+1

cheers, Ronald