Closed (fixed)
Project:
Entity Browser
Version:
8.x-1.x-dev
Component:
Display plugins
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2015 at 18:30 UTC
Updated:
1 Sep 2015 at 17:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jonhattanComment #3
jonhattanComment #4
slashrsm commentedI can confirm I am able to reproduce this. It proves how broken is current Modal display. :)
At NYC camp we had a discussion about it and kind of agreed that it would probably make sense to display an iframe in modal. It is not the nicest solution, but will probably cause the least problems on the long run. D7 does the same thing and it works just fine. This bug might be fixed if we end up going down this route (validation works fine in iframe display).
Thoughts?
Comment #5
jonhattanI have no idea where to start with showing an iframe in a modal. Any clue is appreciated.
My script kiddie plan was to compare with entity_embed and try to come up with a fix...
Comment #6
slashrsm commentedThis might be a good source of initial information:
https://www.drupal.org/node/1989646
Comment #7
jonhattanThis CR helps to clean up a bit the link generation, but that's all.
The problem is with the dialog submission: the modal display ajaxifies the Select button, and the ajax callback just update the selected entities and closes the dialog, no matter validation errors https://github.com/drupal-media/entity_browser/blob/8.x-1.x/src/Plugin/E...
I'm trying several things, one of those is ensuring validation
Drupal\entity_browser_entity_form\Plugin\EntityBrowser\Widget\EntityForm::validatein a similar way as it's done in the sibling submit() method, with no luck still.I suspect validation is done and we have some validation errors that need to pick somehow in the ajaxified submit callback. Still investigating ...
btw, the best source of info about ajax and forms I've found so far is
core/modules/system/tests/modules/ajax_test.Comment #8
jose reyero commentedIt seems the ajax callback doesn't check for errors and always closes the form.
This patch prints out the form again if there are any errors. (Reusing the same wrapper used by the DropDown widget selector).
Comment #9
slashrsm commentedCommitted.