Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Example config:
Node types: Car, Part
Entity reference field parts on car.
Inline entity form (Multiple) "Parts" on "Car"
Flag "Working" on Car.
When adding a Part at the Car form, node type is required, otherwise the following error will appear:
Notice: Undefined index: type in flag_field_attach_form() (line 727 of flag.module).
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2109041.flag_.form-node-type.patch | 643 bytes | joachim |
#1 | ief-add-type-to-node-form.patch | 607 bytes | jgullstr |
Comments
Comment #1
jgullstr CreditAttribution: jgullstr commentedForgot patch
Comment #2
jgullstr CreditAttribution: jgullstr commentedComment #3
bojanz CreditAttribution: bojanz commentedI have no problem with committing that workaround to IEF, but I first want to ask the Flag team why they need to depend on a value from the node form in their field_attach_form implementation. Can't $entity->type be used instead?
Comment #4
joachim CreditAttribution: joachim commentedYou mean this bit:
My only hunch is that it could be because on node creation forms there is no node object. I don't remember if that's the case or not.
I'll take a patch, but ideally with tests to show it still works!
Comment #5
bojanz CreditAttribution: bojanz commentedWell nobody can call field_attach_form() without an $entity, so I don't know how there can be no node object.
I won't be supplying patches, just reporting that I detect possible code smell :)
Comment #6
joachim CreditAttribution: joachim commentedAh, right you are.
Patch without tests should be fine then -- though I was fishing for one from the OP rather than bojanz ;)
Comment #7
joachim CreditAttribution: joachim commentedComment #8
joachim CreditAttribution: joachim commentedComment #10
scuba_flyFixed flag link