Open bigsatchmo opened 3 years ago
AdditionalConfiguration.php
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['processors']['DeferredBackendImageProcessor']);
@dkd-friedrich Notice: Possibly related to your Projects troubles. We should check that issue under EXT:solr 11.5.x.
Instead of globally disabling the DeferredBackendImageProcessor
, I use this simple composer patch:
--- a/Classes/Domain/Index/IndexService.php
+++ b/Classes/Domain/Index/IndexService.php
@@ -194,6 +194,10 @@
$itemChangedDate = $item->getChanged();
$itemChangedDateAfterIndex = 0;
+ // Disable the DeferredBackendImageProcessor during indexing,
+ // @see https://github.com/TYPO3-Solr/ext-solr/issues/2828
+ unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['processors']['DeferredBackendImageProcessor']);
+
try {
$this->initializeHttpServerEnvironment($item);
$itemIndexed = $indexer->index($item);
We solved this in a different way. We don't build a final URL which will be indexed. Instead we index the raw data and use f:image
ViewHelper. That way one needs way less code and config and is more flexible. E.g. the cropping, alt etc. from the reference are used. And one can apply custom cropping without the need to re index.
Our TypoScript:
image = FILES
image {
references {
table = tx_sitepackage_domain_model_machine
uid.field = uid
fieldName = images
}
maxItems = 1
renderObj = TEXT
renderObj {
data = file:current:uid
}
}
And Fluid: <f:image src="{document.image}" maxWidth="500" treatIdAsReference="1"/>
. That's probably also way more future proof.
The only downside: The image file path is not searchable, and the file content will not be indexed via tika or something like that. But that's probably not a requirement anyway.
Elegant workaround @DanielSiepmann One more drawbacks (for some of my usecases):
Describe the bug When adding an IMAGE Element on a indexer configuration in TypoScript and start the indexer via backend module, the images are rendert with an backend module URL instead of a image url.
To Reproduce Steps to reproduce the behavior:
add the use of a image relation like
Expected behavior getting a image url of a processed image
Used versions (please complete the following information):
Quick Fix is to remove the DeferredBackendImageProcessor from config
https://github.com/TYPO3/TYPO3.CMS/blob/307591705fb46fb00fd83a95bcb436011edf3f62/typo3/sysext/core/Configuration/DefaultConfiguration.php#L278