Closed betterapp closed 8 months ago
There is a problem that for GET Request application does not return CORS. So question is: Should CORS be defined on Application Level (like in OPTIONS request) or on server level ?
Second thing.
In documentation we can read:
Bundle Configuration Configure the default thumbnail, which is used by CI HUB to display the preview of your Pimcore Assets:
# Default configuration for "PimcoreCIHubAdapterBundle"
pimcore_ci_hub_adapter:
# Default image/document thumbnail settings.
default_preview_thumbnail:
# Defaults:
format: PNG
width: 300
height: 300
frame: true
forceResize: true
Attention: This configuration is overwritten by any image thumbnail configuration with the name of "galleryThumbnail" in the Pimcore Back-End.
but when we try download image from inDesign and use original image
indesign plugin make such request to pimcore: GET /datahub/rest/jysk/asset/download?id=25&thumbnail=galleryThumbnail
we see thumbnail=galleryThumbnail parameter
but in the code: vendor/bo-hub/ci-hub-api-bundle/src/Controller/AssetController.php line: 446
we see:
$thumbnail = (string) $this->request->get('thumbnail');
if (!Thumbnail\Config::getByAutoDetect($thumbnail)) {
throw new InvalidParameterException(['thumbnail' => 'Thumbnail [' . $thumbnail . '] does not exist']);
}
$defaultPreviewThumbnail = $this->getParameter('pimcore_ci_hub_adapter.default_preview_thumbnail');
if (!empty($thumbnail) && $element instanceof Image) {
if (AssetProvider::CIHUB_PREVIEW_THUMBNAIL === $thumbnail && 'ciHub' === $configReader->getType()) {
$elementFile = $element->getThumbnail($defaultPreviewThumbnail);
} else {
$elementFile = $element->getThumbnail($thumbnail);
}
} else {
$elementFile = $element;
}
if we do not have defined galleryThumbnail on pimcore side then it will throw exception so image will not be returned. Then what for is default configuration if it is used only if thumbnail if defined in pimcore ?
Does not have any sense.
In this case when we want download only thumbnails: for image list we do not get images. If we want to get thumbnails we need to define galleryThumbnail.
If we want download original image we also get galleryThumbnail. This is wrong. inDesign plugin in this case should make a request without thumbnail parameter.
Now it use thumbnail parameter for thumbnails and for origin file.
@labudzinski is it possible that we can talk about it via call ?
It was fixed on 3.0.9
Pimcore version(s) affected
11
Description
I have CI-HUB plugin installed in inDesign. Have configured the connection between inDesign and Pimcore
When I walk throw assets folder I have two issue:
1. Image thumbnails are not downloaded.
On server side I see only OPTIONS requests:
After my last fix (https://github.com/BrandOriented/PimcoreCiHubConnector/pull/21) CI-HUB Connector now send correct 204 response but still no thumbnails and images at all
In our logs we see: OPTIONS request for this image but nothing more
[04/Mar/2024:09:44:50 +0100] "OPTIONS /datahub/rest/jysk/asset/download?id=23 HTTP/1.1" 204 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
How to reproduce
Test it
Possible Solution
Is this a bug in inDesign plugin or still something wrong on PHP site
Additional Context
No response