Commit 68e83524 authored by git's avatar git Committed by Primsi

Issue #2882419 by VladimirMarko: Reset $source_field after event call in...

Issue #2882419 by VladimirMarko: Reset $source_field after event call in MediaEntityDropzoneJsEbWidget::submit
parent 3d73794e
......@@ -187,6 +187,7 @@ class MediaEntityDropzoneJsEbWidget extends DropzoneJsEbWidget {
/** @var \Drupal\dropzonejs\Events\DropzoneMediaEntityCreateEvent $event */
$event = $this->eventDispatcher->dispatch(Events::MEDIA_ENTITY_CREATE, new DropzoneMediaEntityCreateEvent($media_entity, $file, $form, $form_state, $element));
$media_entity = $event->getMediaEntity();
$source_field = $media_entity->get('bundle')->entity->getTypeConfiguration()['source_field'];
// If we don't save file at this point Media entity creates another file
// entity with same uri for the thumbnail. That should probably be fixed
// in Media entity, but this workaround should work for now.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment