Closed (fixed)
Project:
Field collection
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jun 2011 at 21:18 UTC
Updated:
26 Jul 2011 at 08:11 UTC
Jump to comment: Most recent
Comments
Comment #1
chriscalip commentedComment #2
thebuckst0p commentedSame issue. Any ideas?
Comment #3
munkyonline commentedLooks like the same issue described here: http://drupal.org/node/1205670 and http://drupal.org/node/1197094
Comment #4
faktor commentedI know it isn't clear solution, but I just apply comment to an exception on line 191 - field_collection.module. Maybe I find some errors I caused. But looks like it works now.
Comment #5
fagoI've committed a fix, please try the next dev snapshot.
Comment #6
Anonymous (not verified) commentedWell... it avoids the error message but it keeps emptying my form collection after the submit in the administration page. I created the field collection in a user form, so the user type his information in the registration form, everything is perfect until the administrator submit the form after setting the account in active.
I don't really know what it is about, cause the information are not remove from the database, just from the form.
Thanks for the commit by the way, do you think it's because I use it in the user form ? Do I am the only one in this case ?
Comment #7
kugta commentedThe error message disappeared indeed. But instead the form breaks after submiting (blank page) in my case. I don't find any error messages in the server error log.
While the "error message" problem appeared only after editing the node, the page break is appearing after node creation as well.
Comment #8
Anonymous (not verified) commentedOk guys I think I got it, the presave function seems to erase the whole items in the form instead of putting the 'value' key only. As I'm not very used to git I will just post the code here :
function field_collection_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
foreach ($items as &$item) {
// In case the entity has been loaded / created, save it and set the id.
if (isset($item['entity'])) {
if (!empty($item['entity']->is_new)) {
$item['entity']->setHostEntity($entity_type, $entity, LANGUAGE_NONE, FALSE);
}
$item['entity']->save(TRUE);
$item['value'] = $item['entity']->item_id;
}
}
}
In my case it works, tell me about you !
Comment #9
stevectorI found these errors went away when I updated both Field Collection and Entity to the latest in the dev branches.
Comment #10
mariagwyn commentedditto on #9.
Comment #11
kugta commentedI also found that the error is disappeared, but I had this issue simultaneously http://drupal.org/node/1187010 so I couldn't see it working. Thanks for the update.
Comment #12
fagoOps, that's already fixed - see #5.