Problem/Motivation

After #2878835: Add hook function for altering prepareEntities function in eb_widget, the media bundle can be changed during in a call to MediaEntityDropzoneJsEbWidget::prepareEntities. However, MediaEntityDropzoneJsEbWidget::submit, even after calling prepareEntities, will still use the original bundle to get the source field. Let's fix that.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

VladimirMarko created an issue. See original summary.

VladimirMarko’s picture

Status: Active » Needs review
StatusFileSize
new1.6 KB
berdir’s picture

Status: Needs review » Needs work

We should also update \Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\InlineEntityFormMediaWidget::submitEdit() so that those two places are consistent. having both the event and the hook now is a bit weird :/

What we're doing would work with the event too, only problem is that we have to create a new media entity. But you released with the new hook, although just as an alpha I think.

Instead of updating the event in two places, we could also move the event invocation to prepareEntities(), Then it would only be needed in one place, like the hook.

primsi’s picture

I am not sure about that in InlineEntityFormMediaWidget. Given that the user already filled up fields via ief field, it's a bit strange if we change stuff afterwards. The hook gets called for InlineEntityFormMediaWidget too, yes... not sure if we want to change that.

VladimirMarko’s picture

Status: Needs work » Closed (won't fix)