Hello everybody.
I have an entity/bundle with these settings:
Entity: Ticket
Bundle: Ticket
Fields:
…
field_ref_ticket_cateogory
Field Type: Entity Reference
Target Entity: Ticket Category
Target Bundle: Ticket Category
Widget: Entity Form Inline
Edit a Ticket entity
field_ref_ticket_cateogory loaded normally
But on submit: it's not saved.
If I change the target type to Node, it works fine.
I debugged and found that inline_entity_form.module > inline_entity_form_process_entity_form()
http://drupalcode.org/project/inline_entity_form.git/blob/refs/heads/7.x...
if (empty($form_state['triggering_element']['#ief_submit_all']) && !in_array($triggering_element_name, array('ief_add_save', 'ief_edit_save'))) {
// …
}
This condition checking always return TRUE.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | inline_entity_form_submit_fixed.patch | 1.49 KB | TuTToWeB |
| #6 | inline_entity_form-submit_button_not_found-1860912-4.patch | 820 bytes | aptorian |
| #5 | inline_entity_form-submit_button_not_found-6916094-4.patch | 820 bytes | aptorian |
Comments
Comment #1
duynguyen commentedComment #2
bojanz commentedWhat's the entity type on which you have the reference field?
I'm guessing that this fails:
because your form doesn't have $form['actions']['submit'].
Comment #3
duynguyen commentedThank! now it worked
Comment #4
aptorian commentedIEF should probably try to check where the submit button is, because some modules, such as Entity Construction Kit, places the submit button at $form['submit'] rather than $form['actions']['submit']. In my case, I have a parent entity that references a collection of required child entities, embedded in its creation form with an inline entity form. The save button doesn't work without manually adding the #ief_submit_all property to the submit button.
Comment #5
aptorian commentedComment #6
aptorian commentedof course I copied the wrong number for the issue... for correctness' sake
Comment #7
minoroffense commentedComment #8
bojanz commented!empty implies isset.
Committed a fix.
Comment #10
huynhquangto@gmail.com commentedHave some error when click button submit.
ex: Notice: Undefined index: #ajax in ajax_form_callback() (line 379 of .../public_html/includes/ajax.inc).
Comment #11
kaizerking commentedThis still not working, Latest dev version
create content type "A" there are no fields only title
create entity reference in field collection target entity type node
selected 'A' single value.
create a new field collection and create the content type A and save the field collection, the content type 'A' is not saved.
Comment #12
TuTToWeB commentedStill not working for ECK Entities.
Create new entity with ECK module
Add a IEF Widget into another enitity bundle (in my case, drupal commerce order), single value
Filling the form, but nothing is being save
Comment #13
bojanz commented@#11 and #12
Field Collection and ECK integration are the job of those specific modules. You are free to open issues in their own issue queues.
ECK received IEF integration in #1689726: Add support for Inline Entity Form, you need the ECK 7.x-2.x-dev in order to use it.
Comment #14
TuTToWeB commentedNot true. It is actually an IEF bug.
I did some debugging today in my own in order to solve the problem and it is because of the #ief_submit_all flag.
My guess: I think the hook_field_widget_form is being called before that the calling function adds its ['action']['submit'].
In order to fix this (provisionally), I've add a flag to the whole form, called ['#ief_form'] and I've added a form_alter as following
This seems to work for me
Comment #14.0
TuTToWeB commentedNew update
Comment #15
aaronbaumanTuTToWeB if you're still having this problem and you want your patch to be considered, you should re-open this issue with status "needs review"
Otherwise you should clarify why you supplied a patch for a closed issue.
Comment #16
oni.zerone commentedHello, the bug is still here,
i'm working with IEF 7.x-1.6 and ECK 7.x-2.0-rc8 and the inline entity form still not save entity when insert from ief.
Comment #17
nancydruRead #15 and open a new issue referencing this one.