Closed (fixed)
Project:
Multifield
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2014 at 17:22 UTC
Updated:
3 Mar 2014 at 21:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidIt might help me debug this for you if I can see what was in the $node object, and what code you're using to save the node programatically.
Comment #2
sbilde commentedThis is the function for saving the new imported node.
And this is the node-object just right before 'node_save', which creates the error:
Heres an image of the 'backend' for the node-fields, where each MultiFields is pointed out: http://d.pr/i/cC44
Comment #3
dave reidTo answer the first part of setting to default value, it looks like it should be automatically handled by field_default_insert. I'll investigate what happens when creating a node via code.
Comment #4
dave reidOk I think I have this narrowed down. Basically, I think this would be fixed by the core patch in #1899498: Field default values do not get hook_field_presave() run on them. Until that patch lands, however, I think we could work around for now. So let's try this patch.
Comment #5
dave reidWith a test as well!
Comment #6
dave reidConfirmed and committed #5 to 7.x-1.x. http://drupalcode.org/project/multifield.git/commit/e341e3c
Thank for helping report the bug in the first place!
Comment #7
sbilde commented5: 2198697-field-default-value-presave.patch queued for re-testing.
Comment #8
sbilde commentedYou are awesome Dave! - That patch did the trick. - Now I just have to go through it, and try to understand it :) - Thanks for your great effort!
Comment #10
dave reid