If i have a feature which is a dependency of a module I test with simpletest and I have more than one relation type exported to my feature, simpletest always breaks with

FieldException: Attempt to create an instance of field endpoints on bundle works_at that already has an instance of that field. in field_create_instance() (line 490 of

CommentFileSizeAuthor
#2 relation-features-1595678-2.patch623 bytesrosk0

Comments

chx’s picture

Status: Active » Closed (won't fix)

I am sorry but I am not willing to work with features. I literally quit a job that wanted me to work with that module. If you have a patch I am glad to commit it if it doesn't break other functionality.

rosk0’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (won't fix) » Needs review
StatusFileSize
new623 bytes

The issue here is that cache saw not clear after field instance were created. Reading field instance directly from DB fixes the issue.
Attached patch using this approach.

mikran’s picture

This same line has been changed in the past too and I think that change is not a real fix but rather a workaround. I'm afraid it breaks other things. So at the very least this needs tests first.

If this only occurs during tests then I'd check this core issue first: #1891356: D7: Reset drupal static caches when a module is enabled or disabled..