Issue Bug Closed

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

Gabriel Kaufmann TYPOworx GmbH | NewMedia 02/05/24, 12:06 updated 07/09/24, 15:12

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.

Reviews 2