Project

General

Profile

Actions

Bug #89741

closed

Insert Image in CKEditor is always set after saving to width = 300 px in workspace version - news record only

Added by Ralf Thietz over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2019-11-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
CKEditor Image Workspace
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Typo3 9.5.11 / Workspaces 9.5.11 / news 7.3.1

We use typo3 with the news extension. The problem occurs only in the workspace "Stage". The problem does not exist in the "live" version and with normal text elements on a page.

RTE configuration:
[Buttons]

[options]
--- [magic]
---- [maxWidth] = 1200
---- [maxHeight] = 900

Problem Description

1. Call up the news record
2. Insert picture via the CKEditor (HD resolution)
3. picture is inserted with the width 1200px
4. Save record
5. After saving, the image will again be 300 px wide (only in news "stage" version).

In the workspace, the value is not overwritten when saving and set to the value of 300PX in the code.

Extension news, field, bodytext '.

$ imageButtonConfiguration in class TYPO3 \ CMS \ Core \ Resource \ Service \ MagicImageService is an empty array with preset = 'default'

Therefore the value of the property $ magicImageMaximumWidth is alywas = 300.

Repeating the process in Live Workspace does not cause the problem.

    / *
     
Set maximum dimensions of magic images based on RTE configuration
     *
     * @param array $ rteConfiguration: RTE configuration probably coming from PageTSConfig
     * /
    public function setMagicImageMaximumDimensions (array $ rteConfiguration)
    {
        // Get maximum dimensions from the configuration of the RTE image button
        $ imageButtonConfiguration = (is_array ($ rteConfiguration ['buttons.']) && is_array ($ rteConfiguration ['buttons.'] ['image.']))? $ rteConfiguration ['buttons.'] ['image.']: [];
        if (is_array ($ imageButtonConfiguration ['options.']) && is_array ($ imageButtonConfiguration ['options.'] ['magic.']))) {
            if ((int) $ imageButtonConfiguration ['options.'] ['magic.'] ['maxWidth']> 0) {
                $ this-> magicImageMaximumWidth = (int) $ imageButtonConfiguration ['options.'] ['magic.'] ['maxWidth'];
            }
            if ((int) $ imageButtonConfiguration ['options.'] ['magic.'] ['maxHeight']> 0) {
                $ this-> magicImageMaximumHeight = (int) $ imageButtonConfiguration ['options.'] ['magic.'] ['maxHeight'];
            }
        }
    }

Actions

Also available in: Atom PDF