71335[BUGFIX] Make file paths absolute in GIFBUILDER
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Stefan Bürk +1
-
Verified V +2 Done
- Benni Mack +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 3
Review log 3037
Show 912 earlier messages
-
Simon Schaufelberger uploaded patch set 1 09/28/21, 00:03
-
core-ci voted on patch set 1 V +1 09/28/21, 00:17 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17244
-
Andreas Kienast voted on patch set 1 CR +1 09/28/21, 09:54
-
Stephan Großberndt voted on patch set 1 CR +1 09/28/21, 10:32
-
Stefan Bürk voted on patch set 1 CR +1 09/28/21, 10:44
-
Benni Mack commented on patch set 1 09/28/21, 14:25
-
Stefan Bürk commented on patch set 1 CR 0 09/28/21, 14:38
ContentObjectRenderer.php:4019ReplyDoes not really matter. If gdlib is not enabled, the gifBuild() is not called. Anyway should be checked if $theImage is not empty before prepanding the publicPath. Either here or than in the if then after calling $gifBuild() getImageDimensions() checks for file exist and return null if file not found/created. -
Simon Schaufelberger uploaded patch set 2 09/28/21, 16:05
-
Simon Schaufelberger uploaded patch set 3 09/28/21, 16:08
-
Simon Schaufelberger commented on patch set 3 09/28/21, 16:08
ContentObjectRenderer.php:4019Replybetter now? -
core-ci voted on patch set 2 V +1 09/28/21, 16:23 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17274
-
core-ci voted on patch set 3 V +1 09/28/21, 16:33 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17275
-
Stefan Bürk commented on patch set 3 09/28/21, 17:18
ContentObjectRenderer.php:4019ReplyNot really, as there are more local scoped variables now there, which blows up the code without need for it. May you mind to use following code as the if() {} part if you aggree with it ? ``` if ($file === 'GIFBUILDER') { $gifCreator = GeneralUtility::makeInstance(GifBuilder::class); if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) { $gifCreator->start($fileArray, $this->data); $theImage = $gifCreator->gifBuild(); if (!empty($theImage)) { // Use absolute path to retrieve image dimension to mitigate path inconsistence in cli context, // but use the relative path for further processing. $imageResource = $gifCreator->getImageDimensions(Environment::getPublicPath() . '/' . $theImage); $imageResource['origFile'] = $theImage; } } } ``` That would archieve following: * retrieve dimensions only if gdlib is active .. * .. and image build was successfull * return corrently null instead of a broken/unusefull $imageResource * use lesser lines and elimated/prevent unneded code And as such incorperate comment from Benny (if I understood his point correctly) and mine combined. -
Simon Schaufelberger uploaded patch set 4 09/29/21, 11:23
-
Simon Schaufelberger commented on patch set 3 09/29/21, 11:24
thanks for the code improvement!ContentObjectRenderer.php:4019ReplyDone -
core-ci voted on patch set 4 V +1 09/29/21, 11:37 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17310
-
Stefan Bürk voted on patch set 4 CR +1 09/29/21, 11:51
-
Stefan Bürk commented on patch set 4 V +1 09/29/21, 13:20
From my point it is good now. Not sure if it was what Benny had in mind. -
Andreas Kienast voted on patch set 4 CR +1 09/30/21, 12:11
-
Benni Mack commented on patch set 4 09/30/21, 12:13
Reply
Can someone point me to the place where getImageDimensions() does not work if $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'] is disabled? -
Stefan Bürk commented on patch set 4 09/30/21, 12:31
Reply
getImageDimensions() is unrelated to gdlib. It simply returns null if no image found, which is the case as gifBuild is only executied if gdlib is enabled. It simply check if provided file exists, has a regexp and if ext is allowed. If not, it returns null, otherwise an array. So if image is not build, executing it should not be neccessesary. Old code created anyway at least an array with origFile = '' if gif was not build / no image file name returned. Rethinking, not sure if this "should" be kept. Otherwise if $imageResource is not set there is a fallback below - maybe empty array with empty origFile should be kept ? And better do the empty check and conditional based path prefixing for getImageDimension() call as argument tenary ? -
Simon Schaufelberger commented on patch set 4 10/04/21, 09:44
Benni, can I get a clear decision from you about how it should be implemented now? if requested I would also add an additional test case for disabled image processing -
Benni Mack voted on patch set 4 CR +1 10/04/21, 14:18
-
Simon Schaufelberger commented on patch set 4 10/11/21, 10:57
I can confirm that this issue only occurs in composer mode and I don't know how to cover this with proper tests as the current test also works without the changes. -
Simon Schaufelberger uploaded patch set 5 10/13/21, 16:20
-
core-ci voted on patch set 5 V -1 10/13/21, 16:25 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18061
-
Simon Schaufelberger uploaded patch set 6 10/13/21, 20:57
-
core-ci voted on patch set 6 V +1 10/13/21, 21:13 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18076
-
Simon Schaufelberger uploaded patch set 7 10/19/21, 13:54
-
Simon Schaufelberger commented on patch set 7 10/19/21, 13:55
now with a proper test case that confirms the wrong behavior in cli and composer mode -
Simon Schaufelberger commented on patch set 7 10/19/21, 13:58
Reply
-
core-ci voted on patch set 7 V +1 10/19/21, 14:07 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18316
-
Benni Mack voted on patch set 7 V +1 CR +1 10/21/21, 14:35
-
Stefan Bürk commented on patch set 7 V +1 CR +1 10/21/21, 14:56
Reply
Done -
Benni Mack voted on patch set 7 V +2 CR +2 10/21/21, 15:12
-
Benni Mack merged patch set 8 10/21/21, 15:12
-
Benni Mack wrote 11/11/21, 12:59
Created a revert of this change as Ieb696908e5226d57eedeef7cb5fa8cd7b7ec4ea6
ContentObjectRenderer.php:4019