Issue Bug Closed

#91987Cropping Wizard broken when using multiple crop variants

Philipp Wrann 08/12/20, 13:30 updated 08/13/20, 14:20

Description

When opening the cropping wizard, the loading indicator is never removed. When inspecting the console you can find a javascript error:

Uncaught SyntaxError: JSON.parse: end of data while reading object contents at line 1 column 2 of the JSON data

The relevant part of the compiled script is

n=this.trigger.attr("data-crop-variants");if(!n)throw new TypeError("ImageManipulation: No cropVariants data found for image");this.data=e.isEmptyObject(this.data)?JSON.parse(n):this.data

As you can see here:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Resources/Private/Templates/ImageManipulation/ImageManipulationElement.html#L22

the markup is generated by using double-quotes, which results in broken markup, because json also contains double-quotes.

by replacing the double quotes with single quotes this works again.

There is only one thing, that confuses me – this worked before! I just got a issue assigned (own bugtracker), that cropping does not work … and thats what i found out.

This commit introduced the issue:
https://github.com/TYPO3/TYPO3.CMS/commit/063938393d793d7e4b0261da8fe709073a815ae9

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.