Problem/Motivation
I can't figure out how to reproduce, but I was getting this error:
TypeError: Argument 1 passed to Drupal\Core\Cache\CacheableMetadata::applyTo() must be of the type array, null given, called in /app/web/modules/custom/file_download_link/modules/file_downoad_link_media/src/Plugin/Field/FieldFormatter/FileDownloadLinkMedia.php on line 176 in Drupal\Core\Cache\CacheableMetadata->applyTo() (line 135 of /app/web/core/lib/Drupal/Core/Cache/CacheableMetadata.php) #0
Proposed resolution
FileDownloadLinkMedia::viewElements() needs to be updated. In line 171, $elements[] must be changed to $elements[$delta].
Remaining tasks
Write patch.
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | file-download-link--media-cache--3109937--2.patch | 956 bytes | danflanagan8 |
Comments
Comment #2
danflanagan8Patch as described in intro. Very tiny.
Comment #4
danflanagan8