Allow 'no result' caching in brightcove_load_video()

Created on 2 October 2019, over 5 years ago
Updated 23 January 2025, 3 months ago

If the getVideo() fails in the code below, nothing is cached.

This 'no result' state should be cached (temporarily), to prevent continual API requests for invalid videos.

    $video = NULL;
    brightcove_try(function () use ($client_entity, $video_id, &$video) {
      /** @var \Brightcove\API\CMS $cms */
      list($cms,) = brightcove_create_classes($client_entity);
      $video = $cms->getVideo($video_id);
    });
    if ($video) {
      brightcove_cache_set($cid, $video);
      return $video;
    }
🐛 Bug report
Status

Closed: outdated

Version

6.0

Component

Code

Created by

🇳🇿New Zealand jweowu

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