Problem/Motivation
The VideoDerivative and VideoPoster value objects accept any string as URL, and the field formatters have no failure handling around provider calls. When a provider returns a malformed value, for example an upstream SDK error payload, it is rendered verbatim into the src and poster attributes, and a throwing provider breaks the whole render.
Steps to reproduce
- Let a provider return a non-URL string as derivative or poster URL.
- Render the file: the string ends up as the
<source src>orposterattribute.
Proposed resolution
Validate URLs in the value object constructors (core UrlHelper based; absolute or root-relative, protocol-relative rejected) and throw \InvalidArgumentException for anything else. Let the formatters catch provider failures, log them to a new video_style logger channel, and degrade gracefully: deliver the local file, skip the poster, or use the stored thumbnail.
Remaining tasks
Review and merge the prepared fix.
User interface changes
None
API changes
VideoDerivative and VideoPoster constructors now throw \InvalidArgumentException for invalid URLs. New internal UrlValidator value object and new logger.channel.video_style service.
Data model changes
None
Comments
Comment #3
dpacassi