QUALITY PATCH

ACSD-58131: When a 0-byte image is placed in the media gallery directory…

When a 0-byte image is placed in the media gallery directory, the old media gallery fails to render any images. Quality patch ACSD-58131 for magento/module-cms applies to Magento Open Source and Adobe Commerce 2.4.4 to 2.4.7-p10.

Categories
Content
Components
magento/module-cms
Origin
adobe-commerce-support
Since QPT
1.1.68

Issue

When a 0-byte image is placed in the media gallery directory, the old media gallery fails to render any images. The updated system now skips invalid 0-byte files, displays valid images as expected, and logs a warning for each invalid file. [2024-05-02T14:00:39.616459+00:00] report.WARNING: The image empty2.jpg is invalid and cannot be displayed in the gallery. [] []

Steps to reproduce

1. Go to Stores > Configuration > Advanced > System > Media Gallery. 1. Set Enable Old Media Gallery to Yes. 1. Place a few images in the pub/media/wysiwyg directory. 1. Create a 0-byte image in the same directory using touch pub/media/wysiwyg/empty_image.png. 1. Add an image from the wysiwyg directory via Page Builder under any content (for example, a CMS Block): 1. Create a new block. Go to Content > Elements > Blocks and click Add New Block. 1. Edit the content section using Page Builder. 1. Under Layout, drag a new Row to the stage. 1. Expand Media and drag an Image placeholder into the row. 1. Click Select from Gallery. 1. Select the wysiwyg directory if it's not selected by default.

Adobe's page lists 2.4.4 - 2.4.7-p6 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.5.0.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-58131. On Cloud, add ACSD-58131 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-58131/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-cms
Packages across compatible versions (1): magento/module-cms

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.