VideoPlayerFormatter wrongfully not accessible for "video_upload" widget

Created on 4 April 2024, 9 months ago
Updated 23 April 2024, 8 months ago

Problem/Motivation

I'm in the process of upgrading an older Drupal 9 website to Drupal 10. One of the requirements for this is to update the Video-module from 8.x-1.5-alpha1 to at least 3.0.2 for Drupal 10 support.

After successfully updating both (Drupal Core 10.2.5 and Video 3.0.5), I noticed that all video players were gone. After some digging, I found out that during another issue the following code:

      $widget_id = $widget->getBaseId();
      if($widget_id == 'video_upload'){
        return TRUE;
      }

was wrongfully changed to:

      if ($widget) {
        $widget_id = $widget->getBaseId();
        if($widget_id == 'video_embed') return TRUE;
      }

Notice that video_upload was changed to video_embed and due to this change, the VideoPlayerFormatter wrongfully isn't selectable anymore for as a formatter for the video_upload-widget.

In that specific commit, the following files had been changed:

  • src/Plugin/Field/FieldFormatter/VideoEmbedPlayerFormatter.php
  • src/Plugin/Field/FieldFormatter/VideoEmbedThumbnailFormatter.php
  • src/Plugin/Field/FieldFormatter/VideoPlayerFormatter.php
  • src/Plugin/Field/FieldFormatter/VideoPlayerListFormatter.php

So I think it's safe to say that this is just a matter of a wrong copy/paste (from any of the embed formatters to the VideoPlayerFormatter formatter.

Proposed resolution

Change video_embed back to video_upload.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇧🇪Belgium michaelsoetaert

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024