Bug #96554
openImageManipulation eval required does not work
0%
Description
The ImageManipulationElement can have eval with required set to enforce a selected aspect ratio.
This does not work anymore (or rather has never worked in any LTS version), probably due to further refactorings in v8 to enable multiple cropping variants.
Updated by Nikita Hovratov almost 3 years ago
- Related to Story #75880: Add art direction capabilities to BE added
Updated by Nikita Hovratov almost 3 years ago
- Related to Bug #77813: TCA type ImageManipulation can't be set required added
Updated by Marcin Sągol about 1 year ago
I was working on this issue trying to make the validation work but a bit different that it is handled at them moment.
We can set through TCA filed of type imageManipulation as required and it is handled now but for this type of filed won’t work. TYPO3 validator basically checks the value of some input to verify if it set and if not, marks it as required. The problem here is that for imageManipulation we will pretty much always have some default value set for such visible input. The second case would be the crop variants. If we have more than one crop variant configured, for example for mobile or desktop, if the field is set as required does it mean that for each variant we should have some crop set?
I decided to try the following approach:
check if imageManipulation field is required
if there is only one crop variant, this variant should be set
if there are more than one variant, check newly introduced required option for each variant and validate only those varaints that are marked as required
So in this approach we will have 2 levels of setting required option for imageManipulation field and its crop variants.
I am at the moment working on it but it is not as easy as it seems :)