When rendering an uncached node with a media acquia dam file, media_theme_suggestions_media is making calls out to Acquia DAM.
The hook media_theme_suggestions_madia calls to the media_acquia_dam when the media module adds suggestions based on the source plugin ID. When the module calls $source = $media->getSource(); it instantiated the media_acquiadam media entity class.
The problem is the plugin constructor calls the assetMetadataHelper service to set the MetadataXmpFields but to set this metadata it calls the acquia dam to get the ActiveXmpFields
The suggestion based on the source plugin is: media__source_acquiadam_asset
An example list of suggestions is:
- "media__full"
- "media__acquia_dam_image"
- "media__acquia_dam_image__full"
- "media__source_acquiadam_asset"
Comment | File | Size | Author |
---|---|---|---|
#5 | media_acquiadam-plugin_construct_call_acquiadam-3131412-5.patch | 10.62 KB | MauHG |
| |||
#2 | media_acquiadam-plugin_construct_call_acquiadam-3131412-2.patch | 10.66 KB | MauHG |
|
Comments
Comment #2
MauHG CreditAttribution: MauHG commentedPatch to move the call to acquiadam API from media plugin to metadata helper service.
Comment #3
jhedstromComment #4
jhedstromThis is looking good. The solution of only setting the xmp metadata when it's requested will speed things up quite a bit I think.
Just one tiny bit of feedback on the code so far:
This commented out item can probably just be removed instead.
Comment #5
MauHG CreditAttribution: MauHG commentedjhedstrom thanks for the feedback. Here is an updated patch.
Comment #6
jhedstromThis is a good catch! Without this failed authentication repeats for each image or asset. I think this should be good to go.
Comment #8
jmoreira CreditAttribution: jmoreira at Acquia commentedComment #9
jmoreira CreditAttribution: jmoreira at Acquia commented