Oddly this was working locally but not on our dev environment, but what is happening is When I try to add a Brandfolder asset to a media field on a paragraph, I am able to load the media library modal, search for and select an image and hit insert selected.

The field will show the throbber momentarily and then nothing will be attached. If i look in the watchdog I see the following errors:

There was an error saving a new media entity for Brandfolder attachment !attachment_id.

Drupal\Core\Entity\EntityMalformedException: Could not map attachment ID [REDACTED] to an asset. in brandfolder_media_presave() (line 1447 of /svn/web/modules/contrib/brandfolder/brandfolder.module).

I have tried on a couple of fields with the same result. I have also tried selecting different assets assuming perhaps there was something wrong with the asset.

Environment Details:
Drupal 8.9.19
PHP 7.4.21
Mysql 5.7.30

Comments

mikeohara created an issue. See original summary.

mikeohara’s picture

Followup it is happening on my local now as well as my dev environement.

ndewhurst’s picture

@mikeohara thanks for filing the issue and helping dig into it. For anyone else encountering this, we found that it only occurs when the "Queue thumbnail downloads" option is enabled for the relevant media type. There is a bug in the sequencing of events when ingesting new Brandfolder attachments and creating Drupal file records; generating the thumbnail synchronously makes that a non-issue.
As a workaround, you can disable the "Queue thumbnail downloads" option until we roll out a fix for the underlying issue.

ndewhurst’s picture

Assigned: Unassigned » ndewhurst
Status: Active » Needs work
mikeohara’s picture

Thank you! This work around has unblocked me in this case. Looking forward to the permanent fix!

  • ndewhurst committed 28d4c425 on 2.0.x
    Issue #3258074 Entity and file creation, thumbnails, etc.
    
    More robust...
ndewhurst’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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