I just updated views to 6.x-2.7, and noticed that the function in CCK settings for a nodereference field. Under "Advanced - Nodes that can be referenced (views)", I previously had set views for some of my fields. Now with the update, my views seem intact, but when I edit or add a node, I only see a list of checkboxes without the node title for these views (see screenshot, under "Communities"). I didn't update CCK, so I'm thinking this is related to the Views update?

Thanks for any help!

CommentFileSizeAuthor
views_screenshot.png52.55 KBmichellezeedru

Comments

dawehner’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.7 » 6.x-2.x-dev
Component: Miscellaneous » nodereference.module

I think this is definitive an issue with cck. I guess they do something wrong.

markus_petrux’s picture

Status: Active » Fixed

I think this issue was fixed in latest CCK release. In fact, it was the trigger to pack a new release.

stoptime’s picture

I just encountered this same issue after upgrading Views, and wound up rolling Views back to 6.x-2.6 since it looks like you need to apply a patch for userreference module (which I use) at the same time you upgrade CCK to 2.6. Anyways, after rolling back my "view used to select.." problem went away.

liquidcms’s picture

yup, upgrading cck fixed this for me as well.. but broke other things like nested fieldgroups.

so, if you are tied to an old version of cck (perhaps until complete version of cck 3 is released) you could try what i did which was to just re-theme theme_nodereference_select() to add the title back in

michellezeedru’s picture

This is my situation as well (tied to CCK 3 with multi-groups in use). Liquidcms, would you mind spelling out how I would do this: "re-theme theme_nodereference_select() to add the title back in".

Thanks!

michellezeedru’s picture

This is my situation as well (tied to CCK 3 with multi-groups in use). Liquidcms, would you mind spelling out how I would do this: "re-theme theme_nodereference_select() to add the title back in".

Thanks!

liquidcms’s picture

i cheated somewhat and used simplehtmldom class.. you could likely recode with out that and just some regex

in template.php

function mytheme_nodereference_select($element) {
  // simplehtml parser
  $path = drupal_get_path('module', 'chec_a'); 
  require_once($path ."/simplehtmldom/simple_html_dom.php");
  
  $html = str_get_html($element['#children']);
  
  $output = '<div class="form-item" id="edit-field-resource-collection-nid-nid-wrapper">
  <label for="edit-field-resource-collection-nid-nid">Collection: </label>
  <select name="field_resource_collection[nid][nid]" class="form-select" id="edit-field-resource-collection-nid-nid" >';
   
  
  foreach ($html->find('option') as $e) {
    // get selected item so it can be restored
    $selected = ($e->getAttribute('selected'))?'selected=\"selected\" ':'';
    $val = $e->getAttribute('value');
    if ($val) {
      $node = node_load($val);
      $output .= "<option $selected value=\"$val\">$node->title</option>";
    }
    else {
      $output .= "<option $selected value=\"\">- None -</option>";
    }
  }
  
  $output .= '</select></div>';
  
  return $output;

}

Status: Fixed » Closed (fixed)

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

OliverColeman’s picture

Upgrading to the latest CCK 3.x-dev release seems to have fixed the issue for me (upgraded from release on 2009/10/15 to release on 2010/01/25).

michellezeedru’s picture

Thanks for the heads up Oliver. Upgrading to latest CCK 3.x-dev resolved this issue for me as well.