Open betterapp opened 2 weeks ago
Thank you for reporting this problem!
This is an open source project, and we rely on the community to help us diagnose and fix issues, as it is not possible to investigate and fix every issue reported to us via GitHub.
If possible, please create a pull request that fixes the problem you describe, along with appropriate tests. All pull requests will be promptly reviewed by the BrandOriented team.
Thank you very much!
if($request->headers->has('Access-Control-Allow-Headers')) {
$crossOriginHeaders['Access-Control-Allow-Headers'][] = $request->headers->get('Access-Control-Allow-Headers');
$crossOriginHeaders['Access-Control-Allow-Headers'] = implode(',', $crossOriginHeaders['Access-Control-Allow-Headers']);
}
if($request->headers->has('Access-Control-Request-Method')) {
$crossOriginHeaders['Access-Control-Allow-Methods'][] = $request->headers->get('Access-Control-Request-Method');
$crossOriginHeaders['Access-Control-Allow-Methods'] = implode(',', $crossOriginHeaders['Access-Control-Allow-Methods']);
}
It should looks like this:
if ($request->headers->has('Access-Control-Allow-Headers')) {
$crossOriginHeaders['Access-Control-Allow-Headers'] = explode(',', $crossOriginHeaders['Access-Control-Allow-Headers']);
$crossOriginHeaders['Access-Control-Allow-Headers'][] = $request->headers->get('Access-Control-Allow-Headers');
$crossOriginHeaders['Access-Control-Allow-Headers'] = implode(',', $crossOriginHeaders['Access-Control-Allow-Headers']);
}
if ($request->headers->has('Access-Control-Request-Method')) {
$crossOriginHeaders['Access-Control-Allow-Methods'] = $request->headers->get('Access-Control-Request-Method');
}
@labudzinski
Second thing.
Generate thumbnail will never work with new code after 3.0.12 tag.
if (AssetProvider::CIHUB_PREVIEW_THUMBNAIL === $thumbnail && 'ciHub' === $configReader->getType()) {
$defaultPreviewThumbnail = $this->getParameter('pimcore_ci_hub_adapter.default_preview_thumbnail');
$elementFile = $element->getThumbnail($defaultPreviewThumbnail);
}
....
$storagePath = $this->getStoragePath($elementFile,
$element->getId(),
$element->getFilename(),
$element->getRealPath(),
$element->getChecksum()
);
if (!$storage->fileExists($storagePath)) {
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
new AssetPreviewImageMessage($element->getId())
);
}
$response = $this->getNoThumbnailResponse();
As You can see $storagePath
use thumbnail path for preview configuration $elementFile
but this is generated only in local controller.
Thumbnail is never generated in this path because this dispatch method
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
new AssetPreviewImageMessage($element->getId())
);
does not know anything about this path and we always get image from
$response = $this->getNoThumbnailResponse();
@labudzinski
Any update ? In next week we need to have this working because of demo. I need to know what is the progress and if it will be not fixed then I will use some patch direct in client instance.
@labudzinski I sent you an email a few days ago, perhaps you are on summer vacation?
Pimcore version(s) affected
11.2.6
Description
Pimcore: 11.2.6 CI-HUB API: 3.0.21
When I try to list assets (images) in CI-HUB plugin for inDesign I do not see thumbnails.
What I see is:![image](https://github.com/BrandOriented/PimcoreCiHubConnector/assets/7449124/21308c5c-3a85-40ad-ba75-ac05a01ed558)
There is 500 error on nginx access for getting thumbnails
nginx.logs:
And I see CRITICAL PHP error
php.log
PHP Code:
@labudzinski
How to reproduce
List assets in CI-HUB plugin for inDesign
Possible Solution
No response
Additional Context
No response