Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've seen this error before on other issues reported for field collection, and I hope I'm hitting the right mark by posting here. I get the following error once try and create a rule that adds a list item to a field collections host entities fields when a new field collection is created:
DatabaseTransactionNoActiveException: in DatabaseConnection->rollback()
Here is an export of my rule:
{ "rules_update_studio_exclusions_list" : {
"LABEL" : "Update Studio Exclusions List",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"TAGS" : [ "Member", "Studio Exclusions", "Studios" ],
"REQUIRES" : [ "rules", "field_collection" ],
"ON" : [ "field_collection_item_insert" ],
"IF" : [
{ "entity_is_of_bundle" : {
"entity" : [ "field-collection-item" ],
"type" : "field_collection_item",
"bundle" : { "value" : { "field_studio_exclusion_set" : "field_studio_exclusion_set" } }
}
},
{ "entity_has_field" : {
"entity" : [ "field-collection-item:host-entity" ],
"field" : "field_studio_exclusion_set"
}
},
{ "entity_has_field" : {
"entity" : [ "field-collection-item:host-entity" ],
"field" : "field_studio_hidden"
}
},
{ "entity_has_field" : { "entity" : [ "field-collection-item" ], "field" : "field_studio" } }
],
"DO" : [
{ "list_add" : {
"list" : [ "field-collection-item:host-entity:field-studio-hidden" ],
"item" : [ "field-collection-item:field-studio" ]
}
},
{ "drupal_message" : { "message" : "The condition was true." } }
]
}
}
As far as I can tell, I am doing this right through the rules UI.
Comments
Comment #1
jmuzz CreditAttribution: jmuzz commented