Closed (fixed)
Project:
Inline Entity Form
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jun 2015 at 08:49 UTC
Updated:
21 Aug 2015 at 16:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
slashrsm commentedInitial implementation attached. It is based of #2491527-13: [Drupal8] IEF FieldWidget merge & refactor. Patch from that issue needs to be applied in order to test this patch.
There are two known issues:
Comment #3
webflo commentedNeeds re-roll because i committed the schema from #2481919-9: Adds schema for inline_entity_form.
Comment #4
floretan commentedHere's a re-rolled patch. Note that this patch depends on the patch from comment #16 #2491527: [Drupal8] IEF FieldWidget merge & refactor.
I was able to use it without any noticeable side-effects.
Comment #6
floretan commentedI was able to use it without any noticeable side-effects.Sorry, spoke too soon.There's an error due to undefined method updateRowWeights() on InlineEntityFormMultiple when using a multiple-valued widget within a single-valued widget (a gallery with images for example). The validation handler "inline_entity_form_required_field" is also missing.
Comment #7
slashrsm commentedThis was actually caused by the refactor patch. See #2491527-17: [Drupal8] IEF FieldWidget merge & refactor for fix.
Thank you for testing!
Comment #8
slashrsm commentedQuoting @floretan (originally posted in #2491527-18: [Drupal8] IEF FieldWidget merge & refactor:
Comment #9
slashrsm commentedI _think_ that I noticed a comment somewhere in the codebase that basically says "we assume required field for single widget". This is also how D7 version works. As soon as there are required fields on inline entity (which is 99% of cases I guess) validation forces you to fill them in. We can either keep this behaviour in D8 or allow non-required reference fields to use this widget. In the latter case we'd also need to re-think the workflow part.
Comment #10
slashrsm commentedI tried to reproduce this. My setup:
- D8 latest cehckout
- IEF, media_entity, media_entity_image and media_entity_slideshow (all latest checkout)
- configured my content type and media bundles similar to how you did it (node -> "slideshow" media bundle -> "image" media bundle)
- slideshow field uses single IEF widget
- image field uses multiple IEF widget
I tried many different execution paths (create node with image slideshow, edit it with no changes, edit it with changes, save with image IEF left open, save with image IEF closed and saved) and was unable to reproduce error you mentioned. Could you try to get some more context? Maybe by putting a breakpoint at the line of error message and seeing where exactly this happens (on which media entity, ...).
Comment #11
slashrsm commentedComment #12
floretan commentedThank you, I'll do some more testing to identify these edge cases more precisely.
Comment #17
slashrsm commentedComment #18
slashrsm commentedReroll.
Comment #19
slashrsm commentedFew more things added:
- renamed to "Simple" as discussed in #2532810: Decide on final widget UX
- widget is now correctly displayed even for multivalue fields
- validation is now correctly handled for required fields
There are still some problems when saving mutivalue field values. I suspect that this happens for the same reason as problem nr. 2 that I mentioned in #1.
Comment #20
slashrsm commentedProblem that I mentioned in #19 should be fixed now. I also started to work on tests but then noticed a problem that I described in #2510274-9: Add ability to select form Display Mode so I couldn't finish them.
Comment #21
slashrsm commentedAnother small fix.
Comment #22
woprrr commented@slashrsm I ve tried your last patch and I loose the single widget. The field is in cardinality 1.
Comment #23
slashrsm commentedWidget will only appear on required fields that target one bundle only. Please make sure you meet this requirements.
Comment #24
woprrr commentedAfter actually test it works well to use the simple widget. However I identify two other bugs.
1 / When you create a node A with the field that uses simple widget we have a second boolean "create a review" arrives duplicate of the parent entity see screenshot (IEF-001).
2 / When I created my content I normally submits the form, I have my entity created by IEF against my parent entity record is not see screen 2 and 3. Here are the VM to test the sample: https://dag2.ply.st/admin/content
Comment #25
woprrr commentedComment #28
slashrsm commentedReroll.
Comment #30
slashrsm commentedComment #32
slashrsm commentedAfter discussing this with @bojanz on IRC I decided to commit it. Otherwise we could end in a reroll hell. Let's tackle remaining bugs in follow-up tickets.
@woprrr could you open bug reports about your findings?