68670[BUGFIX] Allow to disable allowed aspect ratios
Commit message
Review
-
Code review CR +2 Done
- Anja Leichsenring +2
- Oli Bartsch +1
- Richard Haeser +1
-
Verified V +2 Done
- Anja Leichsenring +2
- Oli Bartsch +1
- Richard Haeser +1
- core-ci +1 CI
Issues 1
Files 4
- typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php8+12 −0
- typo3/sysext/backend/Resources/Private/Templates/ImageManipulation/ImageManipulationElement.html+3 −1
- typo3/sysext/core/Classes/Imaging/ImageManipulation/CropVariant.php+1 −1
- typo3/sysext/core/Documentation/Changelog/master/Important-93854-AddDisabledOptionForAllowedAspectRatios.rstnew+35 −0
Review log 4154
Show 2129 earlier messages
-
Daniel Dorndorf uploaded patch set 1 04/02/21, 11:02
-
TYPO3com voted on patch set 1 V +1 04/02/21, 11:10 Completed build in 07m 26s on Fri, 2 Apr, 11:10 AM Test Summary: 33267 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10459
-
core-ci voted on patch set 1 V +1 04/02/21, 11:14 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1993
-
Oli Bartsch commented on patch set 1 CR -1 04/02/21, 19:25
Please add a Feature.rst for this patch. See https://docs.typo3.org/m/typo3/guide-contributionworkflow/master/en-us/AddingDocumentation/Index.html for more information. -
Daniel Dorndorf uploaded patch set 2 04/02/21, 20:03
-
Daniel Dorndorf commented on patch set 2 04/02/21, 20:07
Reply
Added the missing rst as requested -
TYPO3com voted on patch set 2 V +1 04/02/21, 20:11 Completed build in 08m 04s on Fri, 2 Apr, 08:11 PM Test Summary: 33267 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10472
-
core-ci voted on patch set 2 V +1 04/02/21, 20:13 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2006
-
Oliver Klee commented on patch set 2 04/02/21, 20:22
Feature-93854-AddDisabledOptionForAllowedAspectRatios.rst:21Can we please use non-inverted switches instead? (Inverted switches like "Do you want to not enabled this feature?" are really bad usability-wise.) Maybe we can list only the allowed ratios (possibly with a good default). -
Anja Leichsenring updated the commit message in patch set 3 04/06/21, 15:51
-
Anja Leichsenring commented on patch set 3 04/06/21, 15:51
Feature-93854-AddDisabledOptionForAllowedAspectRatios.rst:21Replywhile I agree that the usability of disable = true is questionable, in this case it is the way to go. First, it is in line with the already implemented disable switch for cropVariants (which is no reason to repeat the same thing again), secoond here we are in an overriding situation. So everything is already there, and one wants to switch one of the options off. This is correct then. Else, the original configuration would need to have enabled = true set for each entry, which is currently not the case. Overriding the existing option with disabled = true is the cleanest way to integrate the switch. -
Anja Leichsenring voted on patch set 3 V +1 CR +1 04/06/21, 15:52
-
TYPO3com voted on patch set 3 V +1 04/06/21, 15:59 Completed build in 07m 55s on Tue, 6 Apr, 03:59 PM Test Summary: 33267 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10499
-
core-ci voted on patch set 3 V +1 04/06/21, 16:03 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/2048
-
Daniel Dorndorf commented on patch set 3 04/06/21, 18:13
Feature-93854-AddDisabledOptionForAllowedAspectRatios.rst:21Reply UnresolvedI do also prefer the disable key due to consistency. I noticed the missing functionality while trying to intuitively use the disable key on the aspect ratios as on the crop variants. -
Oliver Klee wrote 04/07/21, 15:17
Removed reviewer Oliver Klee. -
Josef Glatz commented on patch set 3 CR -1 04/08/21, 06:36
Cool to see that there are other ways to customize cropVariants. I did it only with custom cropVariants and didn't had thought about such way to disable aspectRatios. I think we should make the documentation part more general instead of only writing of tt_content.We should be more "general" and not only write about tt_content. -
Josef Glatz commented on patch set 3 04/08/21, 06:39
Ah, and we should add the info also in the TCA-reference documentation (https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/ImageManipulation/Properties/CropVariants.html#cropvariants) > Beside that patch I want to share my cropvariantsbuilder extension which makes configuring cropVariants configurations much easier and more centralized by configuring defaults in a yaml file within your sitepackage extension: https://github.com/josefglatz/cropvariantsbuilder -
Daniel Dorndorf commented on patch set 3 04/10/21, 20:27
Reply Unresolved
I took the same example as in the documentation for the cropVariants. Maybe pm me on slack to discuss this further, for now it seems okay for me just as an example. -
Anja Leichsenring uploaded patch set 4 04/27/21, 17:41
-
Anja Leichsenring voted on patch set 4 V +1 CR +1 04/27/21, 17:41
-
core-ci voted on patch set 4 V +1 04/27/21, 17:51 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10754
-
Anja Leichsenring commented on patch set 4 04/27/21, 18:47
decided to change the type to bugfix, because this is a rather a bug than a missing functionality. Features can not be backported, but this one should go into v10, too. -
Benni Mack updated the commit message in patch set 5 04/28/21, 07:20
-
core-ci voted on patch set 5 V +1 04/28/21, 07:31 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10821
-
Benni Mack voted on patch set 5 CR +1 04/28/21, 07:46
-
Benni Mack voted on patch set 5 V +1 04/28/21, 12:28
-
Anja Leichsenring voted on patch set 5 V +2 CR +2 04/28/21, 12:35
-
Oli Bartsch commented on patch set 5 04/28/21, 12:39
ImageManipulationElement.php:288UnresolvedSorry for this late comment. I just wonder if we could just use array_filter here?
-
Oli Bartsch commented on patch set 5 V -1 04/28/21, 12:54
ImageManipulationElement.php:298Just tested this. In case all ratios are disabled, this triggers: TYPO3Fluid\Fluid\Core\ViewHelper\Exception: An argument "key" or "id" has to be provided Therefore, we need to check if $cropVariant is now an empty, before adding it to $cropVariants. -
Oli Bartsch commented on patch set 5 04/28/21, 12:56
ImageManipulationElement.php:298Reply UnresolvedSorry, we need to check `$cropVariant['allowedAspectRatios']` not `$cropVariant`. -
Anja Leichsenring commented on patch set 5 V 0 CR 0 04/28/21, 12:58
oof, good catch, never tried that. When you have time, please feel invited to push a new patchset. Else I do tonight. -
Oli Bartsch uploaded patch set 6 04/28/21, 14:31
-
core-ci voted on patch set 6 V +1 04/28/21, 14:44 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10838
-
Oli Bartsch commented on patch set 6 04/28/21, 14:44
Reply
So I changed the filtering to simply use array_filter and fixed two places which lead to errors on an empty allowedAspectRatios array. I'm however not sure if it's allowed to configure a cropVariant without allowedAspectRatios. Especially because this leads to misbehaviour in the image manipulation wizard (On every access the cropping area is reset). But as it's not stated in the docs nor in the code, I currently assume this is just a bug in the wizard. Otherwise, we should add the "not empty" check, mentioned in the other comment. Maybe someone with more insights on this topic can help here. :) -
Benni Mack wrote 04/30/21, 11:05
Removed reviewer Benni Mack. -
Anja Leichsenring uploaded patch set 7 05/04/21, 17:23
-
Anja Leichsenring commented on patch set 7 V +1 CR +1 05/04/21, 17:26
best I could do: Crop variants configuration default contains no allowed aspect ratios => I throw an exception if the config contains no valid allowedAspectRatios. After this being an ajax call, only the log entry will be written, but it is still better than any arbitrary translateVH complaining about a missing key or id. -
core-ci voted on patch set 7 V +1 05/04/21, 17:34 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11138
-
Anja Leichsenring uploaded patch set 8 05/04/21, 18:36
-
core-ci voted on patch set 8 V +1 05/04/21, 18:47 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11149
-
Anja Leichsenring uploaded patch set 9 05/04/21, 18:58
-
core-ci voted on patch set 9 V +1 05/04/21, 19:10 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11151
-
Oli Bartsch commented on patch set 9 05/11/21, 18:28
ImageManipulationElement.php:284I would actually prefer to just skip crop variants without aspect ratios instead of making the whole wizard unavailable. // Ignore crop variants without aspect ratios if ($cropVariant['allowedAspectRatios'] === []) { continue; } If this still leads to an exception in Fluid, we should try to fix it on this end. -
Anja Leichsenring commented on patch set 9 05/11/21, 18:38
ImageManipulationElement.php:284Replyshould we not inform the integrator, that they probably made a mistake? I can't think of a valid reason to have a cropVariant without any allowedAspectRatios, this will most likely be a configuration error if it occures. -
Richard Haeser commented on patch set 9 05/11/21, 19:17
ImageManipulationElement.php:284ReplyReally interesting. At least when we throw the error, the example on https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/ImageManipulation/Properties/CropVariants.html#define-a-cropping-configuration-for-a-specific-content-element won't work anymore, but in the end the example with disabled = true for the cropVariant doesn't make that much sense as it will not get any configuration if you override the cropVariants via TCA. But in the end the example did do the job (although the configuration doesn't make that much sense). So maybe we should go for a log message instead of throwing an exception? -
Oli Bartsch commented on patch set 9 05/11/21, 19:21
ImageManipulationElement.php:284ReplyEspecially because this should be backported, it seems a bit like a breaking change to throw an exception now. -
Richard Haeser uploaded patch set 10 05/11/21, 19:30
-
Richard Haeser commented on patch set 10 05/11/21, 19:31
ImageManipulationElement.php:284Reply UnresolvedBy moving the check for the disabled cropvariant the codes in the example are just working again and if there is no aspect ratio set in the configuration while the crop variant is enabled, it is ok to show an error IMHO. -
Richard Haeser voted on patch set 10 V +1 CR +1 05/11/21, 19:32
-
core-ci voted on patch set 10 V +1 05/11/21, 19:43 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11400
-
Oli Bartsch voted on patch set 10 V +1 CR +1 05/11/21, 19:55
-
Anja Leichsenring voted on patch set 10 V +2 CR +2 05/11/21, 19:56
-
Anja Leichsenring merged patch set 11 05/11/21, 19:56