Closed (fixed)
Project:
Field collection
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2011 at 01:55 UTC
Updated:
15 Jul 2016 at 16:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alanburke commentedIts an issue for this module. Devel looks after core, but not contrib [for the most part]
There is a hook that can be implemented for normal fields, but I'm not sure how it works for a field collection.
Comment #2
bleen commentedfixing issue title
Comment #3
bleen commentedThis should do it...
Comment #4
cutesquirrel commentedAdded language synchronization between host entity and field_collection_item.
I modified the previous patch to include it.
Comment #5
tim.plunkettDon't hardcode 'node', grab the entity_type from the instance. Also rerolled to fix the implements comment and whitespace.
This works great on a basic test, but I wonder what would happen on nested field_collections. Can someone give that a try?
Comment #6
tim.plunkettI tested this with nested field collections. If I can get one person to test it, I'll commit it.
Comment #7
bleen commentedI just gave it a shot with nested field collections as well ... good to go
Comment #8
tim.plunkettAwesome!
http://drupalcode.org/project/field_collection.git/commit/dc409b3
Comment #10
aendra commentedI'm having issues with this when trying to generate node types with nested field collections.
I get the following error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_children_revision_id' cannot be null: INSERT INTO {field_data_field_children} (entity_type, entity_id, revision_id, bundle, delta, language, field_children_value, field_children_revision_id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => field_collection_item [:db_insert_placeholder_1] => 77 [:db_insert_placeholder_2] => 77 [:db_insert_placeholder_3] => field_relationships [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 76 [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 448 of /home/x/modules/field/modules/field_sql_storage/field_sql_storage.module).field_children is a field collection field inside another field -- field_relationships -- which is inside a content type Profile.
I'm also getting the same sort of error when I use Drush, for every field collection:
field_university is just a simple field collection with a text field and a date field.
When I use the UI, I get a rollback issue:
DatabaseTransactionNoActiveException: in DatabaseConnection->rollback()Any thoughts?
Edit: I've updated Entity API to the latest version and applied the patch here for EntityReference and am still getting Revision ID errors.
Devel Generate UI now crashes as follows:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_children_revision_id' cannot be null: INSERT INTO {field_data_field_children} (entity_type, entity_id, revision_id, bundle, delta, language, field_children_value, field_children_revision_id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => field_collection_item [:db_insert_placeholder_1] => 68 [:db_insert_placeholder_2] => 68 [:db_insert_placeholder_3] => field_relationships [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 67 [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 448 of /home/x/modules/field/modules/field_sql_storage/field_sql_storage.module).And drush genc spits out the following:
My best guess is that this is an issue introduced with the addition of revision support; might try the stable version of Field Collection instead, see if it's still affected.
Comment #11
steven.wichers commentedI also am having an issue with revisions when generating content. The problems I am having are similar to what is mentioned in #1827008: Devel generate does not save a generated field collection entirely. The difference would be that I have no translation modules enabled.
Looking at the database shows that everything gets generated correctly with the exception of the revision ID being set. If I manually set the revision ID to the correct number the generated field collections will show up. I am working around this problem by generating the content and then running:
After running this code and clearing cache the collections will appear.
Comment #12
mgiffordThis would be a nice feature...
Comment #13
joshf commentedThe attached patch fixes the revision id issue for me.
Comment #14
wizonesolutionsHrm, it was probably not the best to reopen this closed issue (it's confusing). However, it did fix the issue. +1. mgifford, did you test the patch? If so we can probably RTBC.
Comment #15
mgifford@wizonesolutions I haven't had a chance to test it unfortunately. I did briefly in SimplyTest.me and it still applies even though there's a new release from 3 months ago.
I'm not going to have time to test it..
Comment #16
AlxVallejo commentedTested the revision ID patch and it works, even with nested field collections. Nice work guys.
Comment #18
jmuzz commentedGreat. If there's any further problems with it please open a new issue.
Comment #20
delacosta456 commentedhi
please is this included in latest version of field collection?