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 #1

Updated by Ralf Thietz over 4 years ago

  • PHP Version changed from 7.3 to 7.2
  • Complexity changed from hard to medium
Actions #2

Updated by Riccardo De Contardi over 4 years ago

Am I totally wrong, or there should'nt even be the possibility to add an image using the CKEditor? At least, without using EXT:rte_ckeditor_image ?

The PHP code reported here is maybe some legacy old code?

Actions #3

Updated by Benni Mack almost 4 years ago

  • Status changed from New to Closed

That is correct, we don't provide such a solution in EXT:core, and the code was actually removed in TYPO3 v10. So this needs to be handled in the respective extension.

Actions

Also available in: Atom PDF