Hi, I have a clean install of Drupal 4.7rc1 with the latest cvs of CCK. I created content type 1, and content type 2 with CCK.

1.) Field types: Text Field
2.) Field types: 2 Text Fields, 1 Node Reference, refering to content type 1. - Widget: Select List

I get the following error either creating or editing the node:

warning: array_pop(): The argument should be an array in /home/somebody/public_html/cvs/modules/cck/nodereference.module on line 175.

The link does not display.

When I switch the Widget to Autocomplete Text Field everything works: I am able to enter a content type 1 title and it saves and displays on the node without error.

Thanks for such a useful module.
DS

CommentFileSizeAuthor
#1 nodereference.patch583 byteserdemkose
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

erdemkose’s picture

FileSize
583 bytes

I have the same problem (Drupal 4.7RC2, nodereference.module 1.15).

In nodereference.module on line 175, PHP complains that $node_field['nids'] is not an array and it must be. So I have solved this problem for me, temprorarily, by making $node_field['nids'] an array.

Here is my modification: latest CVS is // $Id: nodereference.module,v 1.17 2006/04/11 13:45:57 JonBob Exp $
Line 153:

  if (FALSE === is_array($node_field['nids']) ) {
    $node_field['nids'] = array($node_field['nids']);        //make $node_field['nids'] an array
  }
  $node_field['nid'] = array_pop($node_field['nids']);  // this is OK now
JonBob’s picture

Status: Active » Fixed

I think this is fixed now; I can't reproduce it with the latest version. Reopen if it happens again.

Anonymous’s picture

Status: Fixed » Closed (fixed)