I have a nodereference field that seems to stop working after I click 'Add another item'...

The fields that are initially displayed work fine. But if I want to add another field, after clicking 'Add another item' it doesn't work (the little circle doesn't rotate and no results are displayed when entering text). Also, the original fields no longer work either - if I delete their values and try searching again, nothing happens...

Any ideas?

CommentFileSizeAuthor
#8 Multivalued_Fields.txt6.03 KBBWPanda
#8 Story.txt4.81 KBBWPanda
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

Searching for "javascript add another item" reports a few issues that may be related to your problem.

If none of those issues match, then we need a recipe to reproduce the problem. Do you see errors in Drupal logs? Apache logs? Javascript? Could it be caused by another module that breaks the autocomplete?

BWPanda’s picture

Project: Content Construction Kit (CCK) » Flexifield
Version: 6.x-2.6 » 6.x-1.x-dev
Component: nodereference.module » Code
Category: support » bug
Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active

I've discovered that the problem only occurs for fields within a flexifield, specifically autocomplete node reference fields in a flexifield.

Also, the problem seems to have changed: Javascript keeps working after the 'Add another item' button is clicked, but any previously entered values are replaced with a single space...

Moving to the FlexiField issue queue.

BWPanda’s picture

Title: Javascript stops working after clicking 'Add another item' » 'Add another item' button breaks fields in FlexiField

Changing title...

BWPanda’s picture

Title: 'Add another item' button breaks fields in FlexiField » 'Add another item' breaks autocomplete fields in a FlexiField

Ok, it seems this bug is limited to autocomplete fields - multivalued textfields work fine...

BWPanda’s picture

Looking at the code, it seems the problem lies somewhere just before $aBuiltForm = form_builder($_POST['form_id'], $aFormCopy, $aFormState); on line 275 of flexifield-widget.inc...
The #value of the fields in $aBuiltForm are not the same as what was entered before the form was re-built.

Not sure where exactly the problem lies or how to fix it...

effulgentsia’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not replicating the bug in my development environment. I sent BWPanda an email asking for more details, and will set the issue back to active when I can replicate the bug.

BWPanda’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the email effulgentsia! I may as well reply here, for the benefit of everyone else...

My dev site (where the problem occurs):
Drupal 6.14
AHAH Response 6.x-1.1
CCK 6.x-2.6
Flexifield 6.x-1.0-alpha5 & 6.x-1.x-dev (tried both)

Exports of my content types attached.
'Multivalued Fields' is the FlexiField content type, while 'Story' has the FlexiField field in it.

Creating a Multivalued Fields node works fine - the autocomplete fields don't muck up at all. It's only when creating a Story node that the problem occurs, and then only for the autocomplete fields.
The Node Reference field in Story that isn't part of the FlexiField works fine if that's the first thing you add, but if you start entering values in the FlexiField then try to use the other Node Reference field, it starts mucking up too...

Hope that helps!

BWPanda’s picture

FileSize
4.81 KB
6.03 KB

Oops, forgot to attach exports, sorry :)

effulgentsia’s picture

Status: Active » Fixed

Thanks. The attachments helped. This bug uncovered a bug in the ahah_response module. Please try again with version 1.2 of that module.

BWPanda’s picture

Status: Fixed » Active

Doesn't seem to have worked... Tried again on the story node, but same problem.
Also tried setting up the multivalued fields in the page content type, but again, same problem.

BWPanda’s picture

How's it going, any progress?

effulgentsia’s picture

Status: Active » Fixed

Please try again with latest dev of flexifield (get from CVS or wait until dev snapshot has later timestamp than this comment).

BWPanda’s picture

That seems to have done the trick - autocomplete fields in FlexiField working now!
Thanks a bunch effulgentsia!

Status: Fixed » Closed (fixed)

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

amclin’s picture

Status: Closed (fixed) » Active

I seem to be seeing the same issue. If I have any Text Fields with "autocomplete for existing field data" widget as part of a FlexiField, then the add another button doesn't work, and when saving a content item, the FlexiField data is not stored. I'm using the Nov 28 timestamp.