Bug #62184
closedException using GIFBUILDER in css_styled_content texpic renderer
100%
Description
If the default rendering of tt_content.image was modified so an GIFBUILDER is used and an image has an link the system break at the try to run "imageLinkWrap".
Way to reproduce:
- Greate an image content element with one or more images
- Assign at least one image an link
- Put following in your typoscript:
tt_content.image.20.1 { file > file = GIFBUILDER file { format = png XY = [10.w],[10.h] 10 = IMAGE 10.file { import.data.cObject = TEXT import.data.cObject.data = register:ORIG_FILENAME import.data.cObject.wrap = file:|:uid treatIdAsReference = 1 maxW = {$styles.content.imgtext.maxW} maxW.override.field = register:maxImageWidth maxW.override.override.field = imagewidth maxH.override.field = imageheight } 20 = TEXT 20 { text.data.cObject = TEXT text.data.cObject.data = register:ORIG_FILENAME text.data.cObject.wrap = file:|:copyright fontSize = 11 fontColor = #000000 offset = 10,17 } } }
Now open the page and you got following Exception:
#1401732564: Invalid file identifier given. It must be of type string and not empty. "NULL" given. (More information) InvalidArgumentException thrown in file /var/www/vhosts/domain.tld/TYPO3/typo3_src-6.2.5/typo3/sysext/core/Classes/Resource/ResourceFactory.php in line 373.
I could fix this issue by adding the following lines to ContentObjectRenderer at line 5231 right after $imageResource = $gifCreator->getImageDimensions($theImage);
$imageResource['origFile'] = $theImage; $imageResource['originalFile'] = $theImage;
Updated by Sascha Schieferdecker about 10 years ago
I have a similar issue with an FCE, guess it's the same Core Problem:
10 = IMAGE 10.file = GIFBUILDER 10.file { XY = 708,450 format = jpg 10 = IMAGE 10.file.import = uploads/tx_templavoila/ 10.file.import.current = 1 10.file.import.listNum = 0 10.file.width = 708c 10.align = c,c 10.altText.field = field_big_alttext 10.titleText.field = field_big_alttext 20 = TEXT 20.text.field = field_big_copyright 20.fontFile = fileadmin/templates/gifbuilderfonts/arial.ttf 20.fontSize = 9 20.fontColor.field = field_copyright_color_big 20.offset = 3,446 treatIdAsReference = 1 } 10.imageLinkWrap = 1 10.imageLinkWrap.enable = 1 10.imageLinkWrap.typolink.parameter.field = field_link 10.imageLinkWrap.if.isTrue.field=field_link 10.altText.field = field_big_alttext 10.titleText.field = field_big_alttext 10.if.value.field = field_align_image_big 10.if.equals = cc
Uncaught TYPO3 Exception
#1401732564: Invalid file identifier given. It must be of type string and not empty. "NULL" given. (More information)
InvalidArgumentException thrown in file
/var/websites/ol_stadtmuseum/site/typo3/sysext/core/Classes/Resource/ResourceFactory.php in line 373.
50 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectFromCombinedIdentifier(NULL)
/var/websites/ol_stadtmuseum/site/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php:
01470: $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject((int)$imageFile);
01471: } else {
01472: $file = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObjectFromCombinedIdentifier($imageFile);
01473: }
01474: }
49 TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::imageLinkWrap("<img src="typo3temp/GB/_c__Domininghaus_csm_708x45…. Högl, um 1810. Foto: Gerlinde Domininghaus" />", NULL, array)
Updated by Michael Ganner about 10 years ago
I got the same Exception when setting imageLinkWrap to true in the TS below. T3 Version 6.2.9
file = GIFBUILDER file{ format = jpg quality = 100 XY = 300,185 10 = IMAGE 10{ offset = 0,0 file = fileadmin/templates/placeholder_contmenu.png file.import=uploads/media/ file.import.field=media file.import.override.field = media file.import.listNum=0 } #10.file.width=300 #10.file.height=185c } params = class="" #altText.field=title altText.field=abstract//title altText.crop=130|...|1 #titleText.field=title imageLinkWrap=0 imageLinkWrap { enable=1 typolink.parameter.data=field:uid typolink.title.field=title }
Updated by Gerrit Code Review almost 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37158
Updated by Xavier Perseguers almost 10 years ago
- Assignee set to Xavier Perseguers
- PHP Version set to 5.6
- Sprint Focus set to Stabilization Sprint
Updated by Gerrit Code Review almost 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37158
Updated by Stephan Großberndt almost 10 years ago
- Subject changed from Excention when use GIFBUILDER in css_styled_content texpic renderer to Exception using GIFBUILDER in css_styled_content texpic renderer
Updated by Daniel Wagner almost 10 years ago
One installation produced the same exception without GIFBUILDER but with imageLinkWrap.
Maybe we have problem with imageLinkWrap? it works if I set imageLinkWrap = 0.
poiImage = IMAGE
poiImage {
file.maxW = 80
file.maxH = 80
imageLinkWrap = 1
imageLinkWrap {
enable = 1
width = 1000m
height = 800
}
}
Updated by Gerrit Code Review almost 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37158
Updated by Gerrit Code Review almost 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38665
Updated by Xavier Perseguers almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2adb9eac1045595904064e8763afb258cb560d56.
Updated by Riccardo De Contardi over 7 years ago
- Status changed from Resolved to Closed