Skip to content

TMS-1201: Add iframe-field for video fields#546

Merged
eebbi merged 1 commit intomasterfrom
TMS-1201
Oct 1, 2025
Merged

TMS-1201: Add iframe-field for video fields#546
eebbi merged 1 commit intomasterfrom
TMS-1201

Conversation

@eebbi
Copy link
Contributor

@eebbi eebbi commented Oct 1, 2025

Projekti: Tampereen kaupunki, konsernihallinto / Tietohallintoyksikkö: Tampere multisite support
Tiketin kuvaus: TMS-1201 Uusi Quickchannel-alusta sallituksi videolohkoon ja -komponenttiin
Task: https://hiondigital.atlassian.net/browse/TMS-1201

Description

Add new field for video-component that enables an iframe-video to be embedded.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@eebbi eebbi requested review from a team and Copilot October 1, 2025 06:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for iframe-based video embedding in video components by introducing a new iframe field alongside the existing oembed video field. This enhancement allows videos from platforms like Quickchannel that require iframe embedding instead of simple URL-based embedding.

Key changes:

  • Added a new video_iframe field to the video component for embedding iframe-based videos
  • Updated the video block template to conditionally render either oembed or iframe video content
  • Modified string interpolation syntax from ${key} to {$key} for consistency

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
partials/blocks/block-video.dust Updated template to support conditional rendering of iframe videos alongside existing oembed videos
lib/ACF/Fields/VideoFields.php Added new iframe field definition and updated string interpolation syntax
CHANGELOG.MD Added entry documenting the new iframe field feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

{! Skip embed target !}
<div id="{id|attr}"></div>
{?video_iframe}
{video_iframe|s}
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iframe content is being output with the |s filter which may not provide adequate sanitization for iframe HTML. Consider using a more restrictive filter or implementing specific iframe validation to prevent XSS attacks through malicious iframe content.

Suggested change
{video_iframe|s}
{video_iframe|kses}

Copilot uses AI. Check for mistakes.
Comment on lines +76 to +79
$video_iframe_field = ( new Field\Textarea( $strings['video_iframe']['label'] ) )
->set_key( "{$key}_video_iframe" )
->set_name( 'video_iframe' )
->set_instructions( $strings['video_iframe']['instructions'] );
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The iframe field is using a basic Textarea field without any validation or sanitization. Consider adding input validation to ensure only safe iframe code is accepted, such as validating the src domain or using a more restrictive field type.

Copilot uses AI. Check for mistakes.
@vloy vloy self-assigned this Oct 1, 2025
Copy link

@vloy vloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👔

@eebbi eebbi merged commit 33d6b5a into master Oct 1, 2025
3 of 5 checks passed
@eebbi eebbi deleted the TMS-1201 branch October 1, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants