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

Comments

danflanagan8 created an issue. See original summary.

danflanagan8’s picture

Patch as described in intro. Very tiny.

  • danflanagan8 committed dedbf7e on 8.x-1.x
    Issue #3109937 by danflanagan8: FileDownloadLinkMedia applies cache tags...
danflanagan8’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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