Problem/Motivation

We noticed this error:

Error: Call to a member function save() on null in /app/web/modules/contrib/dropzonejs/modules/eb_widget/src/Plugin/EntityBrowser/Widget/InlineEntityFormMediaWidget.php on line 178 #0 [internal function]: Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\InlineEntityFormMediaWidget->submitEdit(Array, Object(Drupal\Core\Form\FormState))

This happens because \Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\DropzoneJsEbWidget::getFiles adds whatever it gets from \Drupal\dropzonejs\DropzoneJsUploadSave::createFile to $files.

A case when this might happen if size validation failed.

Proposed resolution

Check if the entity was created.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3083640-check-created-entity-2.patch605 bytesPrimsi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Primsi created an issue. See original summary.

Primsi’s picture

Status: Active » Needs review
FileSize
605 bytes

Small patch that should address this.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Not sure if we can add a test for this, would probably have to set the max file size very low?

Primsi’s picture

  • Primsi committed 0a9c56f on 8.x-2.x
    Issue #3083640 by Primsi, Berdir: Check before adding the result of...

  • Primsi committed 72bf009 on 8.x-1.x
    Issue #3083640 by Primsi, Berdir: Check before adding the result of...
Primsi’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.