civictheme_media_get_variables not returning anything for civictheme_remote_video media type

Created on 20 September 2024, 4 months ago

Problem/Motivation

Currently the utility function civictheme_media_get_variables() has a check at the start for an actual File, however this fails when querying a Remote Video media type, as it doesn't have an associated file.

Considering there is a specific "civictheme_remote_video" media type, I would assume the CivicTheme Media function to return useful data.

🐛 Bug report
Status

Active

Version

1.8

Component

Code

Created by

🇦🇺Australia Toby Wild

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

Comments & Activities

  • Issue created by @Toby Wild
  • 🇦🇺Australia sime Melbourne

    Marked https://www.drupal.org/project/civictheme/issues/3475985 🐛 No remote media displayed for field_c_p_attachments Active as a duplicate.

  • 🇦🇺Australia RichardGaunt Melbourne

    @sime

    This is our proposed fix.

    Update civictheme_media_get_variables to handle the OEmbed (remote video).
    
    We want to only return the properties that are useful for remote video:
    
    <ul>
      <li>name</li>
      <li>url</li>
      <li>created</li>
      <li>updated</li>
      <li></li>
    </ul>

    Do not return other properties.

    Does this align with your thinking?

  • 🇮🇳India joshua1234511 Goa

    OEmbed (remote video) is already handled similarly to other media components, with:

    civictheme_preprocess_media__civictheme_remote_video for Remote Video
    civictheme_preprocess_media__civictheme_video for Video.

    Is there a specific reason to use civictheme_media_get_variables() for this case?
    In the current setup, this function is used only for attachments (Documents), and an image which always include an associated file.

  • 🇦🇺Australia RichardGaunt Melbourne

    Yes the purpose is for this to be a utility to get values for a variety of different field types. As you say it only handles file type of media it would be good if it could be used for video

Production build 0.71.5 2024