feat: #3624729 One media reference field for the episode audio

Issue: #3624729 One media reference field for the episode audio

What this changes

The podcast episode carried two audio fields, field_audio (a local file upload) and field_audio_url (a link). An editor had to choose between them with nothing saying which one the page would render, and the two were bound to two separate components in the Canvas full template, one of which rendered empty on every episode.

This replaces both with the pattern Drupal already has for this: one media reference field, where the editor picks the bundle from the media library, the way Video and Remote video already work.

  • field_audio becomes an entity reference to media, targeting the audio and remote_audio bundles.
  • field_audio_url is removed, storage and instance.
  • The default form display uses the Media Library widget.
  • The full view display renders the referenced media with entity_reference_entity_view, so each bundle renders through its own media display (a local file gives an <audio controls> player, a remote one gives the provider's embed) without the node display needing to know which bundle it got.
  • The Canvas node.podcast.full content template walks node → media → file for the local case, and drops the component that was bound to the removed link field.
  • Test content gains an audio media entity, and all twelve episodes reference it.

Blocked on varbase_media_base #3624670

The remote_audio bundle comes from varbase_media_base #3624670. field.field.node.podcast.field_audio declares a config dependency on media.type.remote_audio, so #3624670 has to land before this can apply or before the pipeline's test stage can pass. That is why this MR is a draft.

Still to do on this branch

  • The BDD feature files still exercise the removed field: tests/features/02-04-episode-with-audio-url.feature fills in "Audio URL" and asserts on #edit-field-audio-url-0-uri, and tests/features/01-01-podcast-content-type.feature names the field too. They need rewriting against the media reference field before the 🧪 Automated Functional Testing job can pass.

Known limitation, not solved here

Canvas can only render a field through an SDC, and Vartheme BS5 ships no audio component. So inside the Canvas full template the local audio still renders through the video component (a <video> element in a 21:9 frame), and a remote-audio episode renders nothing there. A follow-up issue on Vartheme BS5 for a proper audio component is needed, alongside #3622961.

Verification

Done manually on a fresh Drupal CMS + Varbase Starter install:

  • The recipe applies cleanly to a freshly installed Varbase Starter site.
  • field_audio is entity_reference to media with target bundles audio,remote_audio; field_audio_url is absent.
  • The test-content recipe applies and all 12 episodes resolve to a real audio media entity, with no dangling references.
  • The local audio media entity renders <audio controls><source src="…varbase-example-episode.wav" type="audio/wav"></audio> through its own default display.
  • The Canvas template's media → file walk resolves to the right file URL.

Locally, the pipeline's validate stage (composer, yaml, recipe) passes green with gitlab-ci-local. The test stage is not runnable until #3624670 lands.

AI-Generated: Yes

Checkpoints

  • Code changes
  • Manual testing on a fresh install
  • Automated functional test coverage updated for the new field
  • Green pipeline
  • Documentation
  • Release notes
  • Reviewed by a human
  • Code review by maintainers
Edited by Rajab Natshah

Merge request reports

Loading
Loading