Project

General

Profile

Actions

Bug #103047

open

Crop-Variants with dot in variant-name are not being saved

Added by Gabriel Kaufmann / Typoworx NewMedia 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2024-02-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
backend, crop-variant
Complexity:
Is Regression:
Sprint Focus:

Description

I've recently defined some new crop-variants for a project with custom aspect-ratios like 1:1.4 (775/545),
which looks in TCA-Code for a specific image-relation like this:

'tx_ifmainmetallce_image' => [
'config' => [
'overrideChildTca' => [
'columns' => [
'crop' => [
'config' => [
'cropVariants' => [
'default' => [
'disabled' => true,
],
'teaser-2023' => [
'title' => 'Teaser 2023',
'allowedAspectRatios' => [
'1:1' => [
'title' => '1:1 [545x545]',
'value' => 1
],
'1:1.4' => [
'title' => '1:1.4 [775x545]',
'value' => 775/545
],
],
],
],
],
]
],
],
],
],

While testing the 1:1.4 crop-variant seems to work at first glance (frontend crop-ui) works! But when saving it's lost falling back to the first one (default entry). After I changed the key from '1:1.4' to '1:1,4' it worked.

For some reason a dot in they array identifier-key seems to break the functionality. I think this either should be fixed to make it work more intuitive or if there is any good reason for the dot (".") having a special meaning, both should be documented in crop-variants documenation. I didn't notice any kind of hint on this.

Actions #1

Updated by Gabriel Kaufmann / Typoworx NewMedia 3 months ago

Sorry for the ugly code-block. Is there any reason using the "C" (Code-block) feature doesn't format spacing well or at least apply some kind of auto-formattings?

Actions #2

Updated by Lukas Maxheim 3 months ago ยท Edited

Gabriel Kaufmann / Typoworx NewMedia wrote in #note-1:

Sorry for the ugly code-block. Is there any reason using the "C" (Code-block) feature doesn't format spacing well or at least apply some kind of auto-formattings?

You can use the "Highlighted code" function in combination with the PHP option to format your snippet in this case.

Kind regards
Lukas

Actions #3

Updated by Gabriel Kaufmann / Typoworx NewMedia 3 months ago

Lukas Maxheim wrote in #note-2:

You can use the "Highlighted code" function in combination with the PHP option to format your snippet in this case.

Thanks will try to keep that in mind. Sadly I'm not able to edit my past text to fix it here.

Actions

Also available in: Atom PDF