Problem
The migration/update path calculates missing file sizes from the media URL instead of using the storage driver.
Current code:
src/EntityManager/MediaManager.php:189 checks getFileSize()
src/EntityManager/MediaManager.php:191 calls filesize($version->getUrl())
Impact
This is fragile for non-local storage:
- remote URLs may not work with
filesize() at all
- storage backends are bypassed even though the same method already uses the storage driver to download files for SHA1 calculation
- migrations can leave versions without size information or fail unpredictably depending on the backend
Expected behavior
- obtain file size through the storage layer
- avoid direct filesystem assumptions when the version points to remote storage
- add coverage for at least one non-local storage scenario
Problem
The migration/update path calculates missing file sizes from the media URL instead of using the storage driver.
Current code:
src/EntityManager/MediaManager.php:189checksgetFileSize()src/EntityManager/MediaManager.php:191callsfilesize($version->getUrl())Impact
This is fragile for non-local storage:
filesize()at allExpected behavior