Refactor VideoSerializationHandler for asset properties - #481
Refactor VideoSerializationHandler for asset properties#481dpfaffenbauer wants to merge 4 commits into
Conversation
Refactored video asset serialization to use private methods for duration, width, and height retrieval with error handling.
|
🚫 CI & merge-readiness guardrail failed — this PR has been converted to draft. A PR can only be merged when it has no conflicts with the base branch and all CI checks pass.
When fixed, press Ready for review to re-run the checks. |
There was a problem hiding this comment.
Pull request overview
This PR refactors VideoSerializationHandler so that the duration, width, and height of a video asset are read through dedicated private methods that wrap the getter calls in try/catch and log errors instead of letting exceptions propagate during serialization. It follows the existing pattern already used by getImageThumbnail() in the same class.
Changes:
- Replace direct
$asset->getDuration()/getWidth()/getHeight()calls ingetAdditionalSystemFields()with calls to new private helpers. - Add
getDuration(),getWidth(), andgetHeight()helpers that catchExceptionand log a failure message.
Comments suppressed due to low confidence (1)
src/Service/Serializer/AssetTypeSerializationHandler/VideoSerializationHandler.php:109
$videois undefined here — the parameter of this method is named$asset. In the catch path this accesses an undefined variable and then callsgetId()onnull, which throws anErrorthat is not caught bycatch (Exception), so the error-logging path itself crashes. Use$asset->getId().
$video->getId() .
Updated error logging to use asset ID instead of video ID for consistency.
|




Refactored video asset serialization to use private methods for duration, width, and height retrieval with error handling.
Changes in this pull request
Resolves pimcore/platform-version#245
Additional info