Details
-
Bug
-
Resolution: Fixed
-
Medium
-
2.5.27, 3.3.15, 4.0.2
-
None
Description
The ibexa:images:normalize-paths will stop processing when reacing empty ezimage fields. That is objects contains ezimage attributes where the user have not uploaded any image.
In that case, the data_text column will be NULL and you'll get the following error
In NormalizeImagesPathsCommand.php line 171: DOMDocument::loadXML() expects parameter 1 to be string, null given
There following code don't take into account that data_text might be null : https://github.com/ezsystems/ezplatform-kernel/blob/v1.3.14/eZ/Bundle/EzPublishCoreBundle/Command/NormalizeImagesPathsCommand.php#L171
How to reproduce
- Comment out the following lines https://github.com/ezsystems/ezpublish-kernel/blob/7.5/eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php#L29-L36.
- Create an image content, but do not upload any image - see remark below.
- Revert Flysystem.php to original state
- Run console command php bin/console ibexa:images:normalize-paths
Remarks (MSz): The last version of the image content item needs to be empty. So at least one previous version of the content item needs to contain an image file. Completely blank image content items do not reproduce the issue.