Bug #62184

Exception using GIFBUILDER in css_styled_content texpic renderer

Added by René Pflamm over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Category:
Content Rendering
Target version:
Start date:
2014-10-13
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

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:

  1. Greate an image content element with one or more images
  2. Assign at least one image an link
  3. 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;

Related issues

Related to TYPO3 Core - Bug #65378: Scaling/cropping images in GIFBUILDER does not work Closed 2015-02-27

Associated revisions

Revision 2adb9eac (diff)
Added by Xavier Perseguers almost 4 years ago

[BUGFIX] Invalid file identifier with GIFBUILDER

Reference to the original file is missing.

Resolves: #62184
Releases: master, 6.2
Change-Id: I0e8e9ced11c37544baee2ca40d4da647e12d485b
Reviewed-on: http://review.typo3.org/37158
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Stephan Großberndt <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>
Reviewed-by: Xavier Perseguers <>
Tested-by: Xavier Perseguers <>

Revision bebf919a (diff)
Added by Xavier Perseguers almost 4 years ago

[BUGFIX] Invalid file identifier with GIFBUILDER

Reference to the original file is missing.

Resolves: #62184
Releases: master, 6.2
Change-Id: I0e8e9ced11c37544baee2ca40d4da647e12d485b
Reviewed-on: http://review.typo3.org/37158
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-on: http://review.typo3.org/38665

History

#1 Updated by Sascha Schieferdecker over 4 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)

#2 Updated by Michael Ganner over 4 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
        }

#3 Updated by Gerrit Code Review about 4 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

#4 Updated by Xavier Perseguers about 4 years ago

  • Assignee set to Xavier Perseguers
  • PHP Version set to 5.6
  • Sprint Focus set to Stabilization Sprint

#5 Updated by Gerrit Code Review about 4 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

#6 Updated by Stephan Großberndt about 4 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

#7 Updated by Daniel Wagner about 4 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
}
}

#8 Updated by Xavier Perseguers almost 4 years ago

  • Target version set to 6.2.12

#9 Updated by Gerrit Code Review almost 4 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

#10 Updated by Gerrit Code Review almost 4 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

#11 Updated by Xavier Perseguers almost 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#12 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF