Download & Extend

Nodereference Explorer can break Flexifield

Project:Flexifield
Version:6.x-1.0-alpha5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

My configuration

I've seen this behavior in both versions of Flexifield I've tried (6.x-1.0-alpha4 and 6.x-1.x-dev from June 29)

Other relevant version info (I do have many other modules installed, but I've only included what I think is the relevant info):
Drupal 6.12
CCK 6.x-2.4
Nodereference Explorer 6.x-1.1-beta2
AHAH Page Storage 6.x-1.1
AHAH Response 6.x-1.1
AHAH Script Ensurer 6.x-1.0
AHAH Style Ensurer 6.x-1.0
Using the supplied Garland theme with no modifications

I have nodetype "Segment" that contains the flexifield "Segment Guests". The "Segment Guests" flexifield is set up to allow an unlimited # of values and is based on just one nodetype "Guest appearance". Nodetype "Guest appearance" has just two CCK fields: 1) a Nodereference field called "Guests" referencing a nodetype called "Guest" using the "Nodereference Explorer" widget for input and 2) a simple text field called "Credentials". Both of those fields are limited to just one value per node.

The problem

With the above configuration, Flexifield will only ever save Segment Guest in the field despite the fact that I've set it to allow an unlimited # of values. I have the same problem even if I specify a certain # of values greater than 1. I see 2 different but closely related behaviors for the unlimited setting vs. specifying a # of values:

  • Unlimited values: The Edit Segment form loads and in the "Segment Guests" flexifield area there is only a "Guest appearance" form in the FIRST row. There IS a second row in the flexifield table (it even has a little draggable handle off on the left-hand side) but there's no form in that row. Interestingly, clicking "add another item" places a "Guest appearance" form in row #2 (the row that existed but was previously missing a form) AND adds a 3rd row to the table which correctly contains another "Guest appearance" form. Unfortunately, filling out these forms and saving them always results in only the values in the form from the first row being saved AND, if I'm attempting to save more than one value, an error:
    warning: array_merge_recursive() [function.array-merge-recursive]: recursion detected in C:\web\projects\drupal\sites\all\modules\ahah_response\ahah_response.module on line 43.
  • Allowed # of values greater than 1: The Edit Segment form loads and in the "Segment Guests" flexifield area there is, again, only a "Guest appearance" form in the FIRST row. There are the correct # of rows in the flexifield table based on however many values you said to allow, but there are no forms in those rows. Data from the form in row 1 does save just fine.

What happens if I don't use the Nodereference Explorer input widget?

Everything works great! I don't have to uninstall the module. Editing the "Guests" nodereference field in my "Guest appearance" nodetype (the nodetype on which my Flexifield is based) to use the "Autocomplete Text Field" input widget solves the problem. This, however, is not my preferred solution -- I'd prefer to let my users browse the guests so it would be great if this could be fixed.

Side benefit

An interesting benefit to getting the Nodereference Explorer input widget to work properly with Flexifield is that this problem (#350274: Flexifield and Popups Reference) with Popups Reference is circumvented. The "add new.." links display properly since I assume it's Nodereference Explorer that generates everything in that portion of the form.

Comments

#1

Version:6.x-1.0-alpha4» 6.x-1.0-alpha5

Yep, I see the bug on alpha5 of flexifield as well. I tried finding the source of the bug and haven't succeeded yet. I agree that Nodereference Explorer is a cool module, so getting this fixed would be nice.

#2

Thanks! And I really should have already mentioned what a great module this is. Meets my needs to a T. Many thanks, effulgentsia.

One more detail: It appears that the Nodereference Explorer widget need not be part of the flexifield to cause the problems. If it's on the form anywhere above the flexifield then the flexifield contents won't print.

#3

+1 subscribing

#4

subscribing too!