Hi,

we have (apart from the others) two modules: clanok (story) and katalog (catalog). Story is usualy an article about music or musician, katalog is content type which holds information about CD record, album. Couple of days ago I have created reference, so story can be referenced by katalog and vice versa. However, today I could not reference one particular katalog by clanok. I am getting error saying This post can;t be referenced. I can reference other Katalog nodes, but not that particular one. Any idea what should I check or where could be the problem?

Thanks.
Attached you can find content types exports, hope it will give you an idea.

Comments

petiar’s picture

I have found another katalog node type which can not be referenced (the same issue). Can anybody assist? Thanks a lot.

Actually, I have found out something (at least) - this is only happening if the reference filed uses views. When I disabled the views for the prticular field, that error has disappeared.

yched’s picture

Category: bug » support

The field 'field_suvisiace_v_katalogu' uses a View to define which nodes can be references. Double check that this view returns all the nodes you'd expect to be referenceable.
Not much more I can do to help on this.

Until there's evidence of a bug, turning this into a support request.

andershal’s picture

Version: 6.x-2.0-rc10 » 6.x-2.0
Category: support » bug

I have a nodereference allowing all(approx. 1.200) image nodes to be referenced. When using a view I have to set the limit to "0" as in unlimited, and the result is a very slow check for allowed values.

One solution could be setting some kind of "AND nid IN(123,456,789)" filter, when the edit form is submitted. The nids in this list should be the ones selected by the user in the edit form.

yched’s picture

Version: 6.x-2.0 » 6.x-2.0-rc10
Category: bug » support

@andershal : Please don't hijack issues, Create new ones if needed. Also note that validation in final 2.0 already does "AND nid IN(123,456,789)"?

andershal’s picture

Guess I was a bit to quick! This has been resolved in the latest 2.0 release - see this issue: http://drupal.org/node/298651

andershal’s picture

@yched: Sorry... but I believe the original posters problem is solved with the latest 2.0 release.

newbuntu’s picture

I am getting the same error:"This post can't be referenced"

I just downloaded 6.2.1. It didn't help. I tried to trace the code and got lost somewhere inside _nodereference_potential_references_standard(). I saw all $field['referenceable_types'] were all false. I don't know why they are all false.

And I believe that's where everything starts to fail!

function _nodereference_potential_references_standard($field, $string = '', $match = 'contains', $ids = array(), $limit = NULL) {
  $related_types = array();
  $where = array();
  $args = array();

  if (is_array($field['referenceable_types'])) {
    foreach (array_filter($field['referenceable_types']) as $related_type) {
      $related_types[] = "n.type = '%s'";
      $args[] = $related_type;
    }
  }

  $where[] = implode(' OR ', $related_types);

  if (!count($related_types)) {
    return array();
  }
newbuntu’s picture

Well, in my case, I just went back and edited my type again. I don't know why "Content types that can be referenced: " were all unchecked. So I had to re-check the referencing type. It worked.

Is there any reason that can cause these fields to become "unchecked"? The uncertainty kind of bothers me...

Flying Drupalist’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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