Details
-
Bug
-
Resolution: Unresolved
-
High
-
None
-
5.4.2
-
None
Description
We have some physically missing images on the server.
If we create a new draft on an object that have a missing image (but have an image attribute with data), the prefix "/images/" is left out on the path to the image on the attribute. I guess this happens because it's not on the server.
If we then try to update the draft, we get an exception, and after further investigation the exception is thrown when ezpublish tries to read the draft
Exception:
/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/IOService.php at line 386
Message: Argument '$id' is invalid: Prefix images not found in 1673393-6-nor-NO/9788291187891.jpg
Code for reproduduction:
$contentService = $this->repository->getContentService();
$draft = $contentService->createContentDraft($contentInfo);
$contentUpdateStruct = $contentService->newContentUpdateStruct();
$contentUpdateStruct->initialLanguageCode = $contentInfo->mainLanguageCode;
$contentUpdateStruct->setField('image', 'path/to/file.jpg');
$draft = $contentService->updateContent($draft->versionInfo, $contentUpdateStruct);
The contentService->updateContent throws the exception.