Bug #89741
closedInsert Image in CKEditor is always set after saving to width = 300 px in workspace version - news record only
0%
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'];
}
}
}
Updated by Ralf Thietz almost 5 years ago
- PHP Version changed from 7.3 to 7.2
- Complexity changed from hard to medium
Updated by Riccardo De Contardi almost 5 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?
Updated by Benni Mack over 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.