When I try to change the settings for a field collection field I get the following error.

Attempt to update field Tabs failed: Cannot add index field_tabs_revision_id to table field_data_field_tabs: index already exists..

Where field_tabs is the field's name I gave it.

It even happens when I only try to change the help text. Although I also use the modules Field collection Tab formatter I believe it's a Field Collection issue. When I disable and uninstall Field collection Tab formatter, the problem remains.

Some test results:

  • On a fresh Drupal install this module works fine.
  • When I deleted all nodes where the field collection had content, updating the field settings succeeded. When I add some content again to a node's field collection, updating the field settings also succeeds.

Might this be related to the update of the Field collection module in March? Content added before that date gives problems?

Perhaps someone can give me some advice where to look. My work around is now to delete and create all related nodes again. It are not that many nodes, but it worries me.

Earlier I posted this issue at the Field collection Tab formatter issue page node/2281951

Comments

thirdboxcar’s picture

I am also having this issue (I have it with changing settings in the Field Collection Fieldset formatter), and also have older data in my field collections. Deleting the content and re-adding it sounds like a giant nightmare on my site, I'm hoping there's an alternative fix!

parwan005’s picture

Hi,
I am not able to see this issue that you reported. I create new field collection field, which has 2 fields in it. When i try to update it, it works fine.
I am trying this with fresh drupal installation.
Can you please help in reproducing this one?

ecvandenberg’s picture

You can reproduce this issue as follows:

  • Fresh Drupal install version 7.28.
  • Install Entity API 7.x-1.5.
  • Install Field collection 7.x-1.0-beta5.
  • Create a content type with a field collection and add some content to it.
  • Now try updating field collection settings. This is working fine.
  • Update Field collection 7.x-1.0-beta5 to Field collection 7.x-1.0-beta7.
  • Pay attention to the database update notes. Something about adding an index.
  • Now updating field collection settings is not working anymore.
  • If you delete the nodes with content in a Field collection prior to the module update and add a new node with a field collection, all works fine.

I do hope this helps finding a solution. I have a couple of sites using Field collection with lots of data. It is a great module!

NancyDru’s picture

Priority: Normal » Major

I am getting this reusing an existing field in which I wish to change the label.

NancyDru’s picture

TEP’s picture

Title: Field settings can not be changed » Drupal helping systems
Version: 7.x-1.0-beta7 » 7.x-1.x-dev
Component: Code » Documentation
Assigned: Unassigned » TEP
Category: Bug report » Support request
Priority: Major » Critical
Issue tags: +45, +041027

Jeeses

ecvandenberg’s picture

Sorry TEP, I don't understand your comment and changes made. What has this issue to do with the Drupal helping system, documentation and support?

jmuzz’s picture

Title: Drupal helping systems » Field settings can not be changed
Version: 7.x-1.x-dev » 7.x-1.0-beta7
Component: Documentation » Code
Assigned: TEP » Unassigned
Category: Support request » Bug report
Priority: Critical » Major
Issue tags: -45, -041027

@TEP you shouldn't assign yourself to issues unless you plan to work on them.

If you make any changes to an issue please explain your reasoning.

jmuzz’s picture

Status: Active » Postponed (maintainer needs more info)

I tried the steps in #3, only I updated from beta5 to the latest dev. I increased the cardinality of the field collection field and the field it contained and the settings form was submitted without error.

Does this still happen in the latest version? If so, how can it be tested for?

jmuzz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Les Lim’s picture

Just adding a little clarifying info here, since I just dealt with the same issue. At some point prior to the 7007 update, someone had manually added the 'value' index to field_collection field tables directly in SQL. However, Drupal keeps track of column indexes in the {field_config} table, and since the index had not been added using the Schema API, the field_config data had not been updated. That mismatch between what Drupal thought was indexed and what was actually indexed prevented the field from being updated through the UI.

That's not the fault of Field Collection, though. We fixed it by using `db_drop_index()` to remove the manually added column indexes, then editing and re-saving the field.