AudioFieldPluginBase requires concrete class rather than interface for URL

Created on 16 November 2023, about 1 year ago

Similiar to this issue: https://www.drupal.org/project/audiofield/issues/3199946 β†’

But when you're using a CDN, which generates CDN-based URLs for files, the module breaks with this error:

TypeError: Drupal\audiofield\AudioFieldPluginBase::__construct(): Argument #8 ($file_url_generator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\cdn\File\FileUrlGenerator given, called in /path/to/web/modules/contrib/audiofield/src/AudioFieldPluginBase.php on line 90 in Drupal\audiofield\AudioFieldPluginBase->__construct() (line 68 of /path/to/web/modules/contrib/audiofield/src/AudioFieldPluginBase.php)

πŸ› Bug report
Status

Active

Version

1.13

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jason_purdy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jason_purdy
  • πŸ‡ͺπŸ‡ΈSpain enchufe Spain

    As a workaround I've created a patch to make the AudioFieldPluginBase and WavesurferAudioPlayer classes support both DrupalCoreFileUrlGenerator and DrupalCoreFileUrlGenerator. And, as this patch fixes a problem that only affects in a specific scenario, I have added the CDN module as a dependency.

  • Status changed to RTBC 2 months ago
  • πŸ‡©πŸ‡ͺGermany mfrosch

    Patch works for me.
    Also using a CDN.

Production build 0.71.5 2024