Updating video breaks when description changed to null

Created on 7 March 2022, about 3 years ago
Updated 14 November 2024, 5 months ago

Problem/Motivation

If a video is out of sync with Brightcove, you get this message:

There is a newer version of this video on Brightcove, you may want to update the local version before editing it.

There's a specific scenario where, if you update, and there's a description in Drupal but no description in Brightcove, you get this error:

OriginalTypeError: Argument 1 passed to Drupal\brightcove\Entity\BrightcoveCmsEntity::setDescription() must be of the type string, null given, called in /var/www/docroot/modules/contrib/brightcove/src/Entity/BrightcoveVideo.php on line 1596 in Drupal\brightcove\Entity\BrightcoveCmsEntity->setDescription() (line 64 of /var/www/docroot/modules/contrib/brightcove/src/Entity/BrightcoveCmsEntity.php). Drupal\brightcove\Entity\BrightcoveCmsEntity->setDescription(NULL) (Line: 1596)

This is because the API can return null for description but the setDescription method requires a string.

https://apis.support.brightcove.com/playback/references/playback-api-vid...

https://git.drupalcode.org/project/brightcove/-/blob/3.x/src/Entity/Brig...

This is a Major priority issue because it will crash your queue runner repeatedly and potentially silently.

Steps to reproduce

Have Brightcove video in Drupal. Have description only in Drupal. Try to update.

Proposed resolution

Update setDescription param to include null.

Remaining tasks

Merge patch.

User interface changes

N/A

API changes

N/A

Data model changes

Potentially null descriptions.

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States charginghawk

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024