All video embeds are removed from teasers

Created on 2 March 2024, 10 months ago
Updated 18 September 2024, 3 months ago

Problem/Motivation

I have many blog posts that include video embeds at the top, that I want to appear in the trimmed version. Other types of media (documents, images) do appear within the trimmed post, but video content (both local and remote) just gets skipped over, but text from after the video does show up in the trimmed version.

I would expect that the video(s) would appear in the trimmed / Teaser if the text after appears in it.

Using Drupal 10.2.3 on Apache webserver, PHP 8.2.16.

Steps to reproduce

  1. Select a content type that has a body filed type "Text (formatted, long, with summary)" and create a new node
  2. Embed a video near the top of the new node body, remote or local or both.
  3. Add some text after the video(s) and save.
  4. Look at the Teaser view -- e.g. in a View or Teaser preview. The video content will have been removed but the text after it may be in the Teaser, depending on how many characters the trimmed limit is set to.

Remote video like this is removed:

<drupal-media data-entity-type="media" data-entity-uuid="c88d434d-9776-4635-80e9-4747746e4336">&nbsp;</drupal-media>

And local video like this is also removed:

<drupal-media data-entity-type="media" data-entity-uuid="920e4c52-ff87-4607-95e8-c9cd5fdca44b">&nbsp;</drupal-media>

Oddly, the trimmed HTML includes this wrapper around the missing videos (remote first, then local):

<div>
            <div class="field field--name-field-media-oembed-video field--type-string field--label-hidden field--item">
</div>
</div>
<div>
  
  
  <div class="field field--name-field-media-video-file-1 field--type-file field--label-visually_hidden">
    <div class="field--label sr-only">Video file</div>
              <div class="field--item">
      
  
</div>
          </div>

</div>

@ressa confirms the issue at https://www.drupal.org/forum/support/post-installation/2024-02-27/choose... β†’

Proposed resolution

Expected behavior: Video media elements that are included in the body should appear in the Teaser / trimmed output, subject to the trimmed length limit.

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
TextΒ  β†’

Last updated 17 days ago

Created by

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

Comments & Activities

Production build 0.71.5 2024