Bug #90103
closed<ce:link.clickEnlarge in the Partial /media/types/image.html => fatal-error when called with argument "dimensions: {width: data.imagewidth, height: data.imageheight}"!?
0%
Description
In the database the tt_content elements "imagewidth" and "imageheight" have type "int(10)".
When you debug the data in the partial "media/type/image.html" [<f:debug>{dimensions}</f:debug> you'll see that the type of {data.width} and {data.height} is "double" and NOT "integer" like the DB-Fields!?
Building the dimension-argument for the partial="Media/Type/Image" like
<f:render partial="Media/Type/Image" arguments="{file: img, dimensions: {width: data.imagewidth, height: data.imageheight}, data: data, settings: settings}" />
the dimensions.width and .height will be integer and not double because data.imagewidth and data.imageheight are integer.
When you now set the checkbox for the image-zooming you'll get this error-message:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Argument 1 passed to TYPO3\CMS\Core\TypoScript\TypoScriptService::convertPlainArrayToTypoScriptArray() must be of the type array, null given, called in /html/typo3/typo3_src-9.5.13/typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Link/ClickEnlargeViewHelper.php on line 78 | TypeError thrown in file /html/typo3/typo3_src-9.5.13/typo3/sysext/core/Classes/TypoScript/TypoScriptService.php in line 65. Requested URL: http://p474869.mittwaldserver.info/akk/?no_cache=1
So I tried this:
I modified the tt_content elements "imagewidth" and "imageheight" in the database to type "*double(12,0)*".
Result: NO ERROR any more!!!
So what's to do?
Either corrections in the ClickEnlargeViewHelper or change the db-datatypes of "imagewidth" and "imageheight" to double(12,0)
Files
Updated by Riccardo De Contardi almost 5 years ago
- Status changed from New to Needs Feedback
- Assignee changed from Benjamin Kott to Kurt Kunig
@Kurt Kunig
With "deleted" you mean that this issue is no longer necessary? If it is so let me know and I'll close it.
Plus, I have seen the "double" with <f:debug>{dimensions}</f:debug>
but I am not able to reproduce the error... could you post a step-by-step guide? Including the extension you used for the enlarging (if any)? - Of course if it is still necessary, I mean :)
Thank you.
Updated by Kurt Kunig almost 5 years ago
Sorry the mistake is still there. I thought so but I put a link to the image, so the zoom didn't play a role.
I'm searching for that mistake for one and a half day and I cannot find what's wrong!?
Calling the partial media/type/image.html that way:
<f:render partial="Media/Type/Image" arguments="{file: img, dimensions: {width: data.imagewidth, height: data.imageheight}, data: data, settings: settings}" />
:::
<ce:link.clickEnlarge image="{file}" configuration="{settings.media.popup}">
<f:render partial="Media/Rendering/Image" arguments="{file: file, dimensions: dimensions, settings: settings}" />
</ce:link.clickEnlarge>
the above mentioned error comes up.
without zooming:
<f:render partial="Media/Rendering/Image" arguments="{file: file, dimensions: dimensions, settings: settings}" />
it is okay.
Updated by Riccardo De Contardi almost 5 years ago
- Status changed from Needs Feedback to New
- Assignee deleted (
Kurt Kunig)
Updated by Riccardo De Contardi almost 5 years ago
I did the following
- TYPO3 plain installation 9.5.13
- Added a "text and image" content element to a page
- Added an image (600x600px) - set imagewidth=300; image_zoom=1
- Installed extension EXT:ns_all_lightbox - plain configuration, just enabled it with lightbox
Results¶
- on frontend the image is clickable and no exception is thrown :/
P.S. PHP version: 7.2.7
Updated by Kurt Kunig almost 5 years ago
- I created a gridelement with a DatabaseQueryProcessor as "gridelementContent" and a template called "accordion" e.g.
- The template called a partial "PartAccordionElements"
- This Partials includes a <f:for each="{gridelementContent}" as="child" iteration="i">-loop for all gridelement-children
- In this for-loop a partial calla a partial="Media/PartGallery" (if images are included in the text&media gridelement-children)
- In the partial PartGallery I called directly the partial="Media/Type/Image" with this arguments="{file: img, dimensions: {width: data.imagewidth, height: data.imageheight}, data: data, settings: settings}" />
- and in that partial="Media/Type/Image" the error appears only when the zoom-parameter is set:
<ce:link.clickEnlarge image="{file}" configuration="{settings.media.popup}">
<f:render partial="Media/Rendering/Image" arguments="{file: file, dimensions: dimensions, settings: settings}" />
</ce:link.clickEnlarge>
I think that it has nothing to do with "double" or "integer" for width and height.
Updated by Kurt Kunig almost 5 years ago
- Subject changed from gallery dimension-data-types for width and height are different to the data.imagewidth and data.imageheight elements => fatal-error!? to <ce:link.clickEnlarge in the Partial /media/types/image.html => fatal-error when called with argument "dimensions: {width: data.imagewidth, height: data.imageheight}"!?
So the headline of my post is not correct and I should modify the headline.
Updated by Riccardo De Contardi almost 5 years ago
@Kurt Kunig
Thank you for your reply;
Is it then a core issue or it happens only with gridelements? Can you reproduce it using just TYPO3?
If not, I would close it and ask you to open a similar ticket on https://gitlab.com/coderscare/gridelements - You can also ask on Slack https://typo3.slack.com/messages/gridelements
Updated by Kurt Kunig almost 5 years ago
Yes, it happens only with gridelements!
So you can close it here for TYPO3 Core. I published it in gitlab.com.
Thank's for all.