Project

General

Profile

Actions

Bug #91987

closed

Cropping Wizard broken when using multiple crop variants

Added by Philipp Wrann over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
-- undefined --
Assignee:
-
Category:
Image Cropping
Target version:
-
Start date:
2020-08-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions

Also available in: Atom PDF