t3x-rte_ckeditor_image icon indicating copy to clipboard operation
t3x-rte_ckeditor_image copied to clipboard

Images are not processed and unwanted attributes

Open timofo opened this issue 1 year ago • 6 comments

Bug description The images are not reduced in size and the 300px standard width is not entered in the popup. In the frontend it is written in the source code:

<img class="" src="/fileadmin/user_upload/image.jpg" data-htmlarea-file-uid="2" data-htmlarea-file-table="sys_file" width="1920" height="3400" title="" alt="" data-title-override="true" data-alt-override="true" style="">

When I resize the image in the RTE, the new width and height values are entered correctly in the img tag, but the image is not resized and remains unchanged.

I insertet the static template at first before fluid_styled_content.

Steps to reproduce To reproduce the problem: Insert an image in RTE and look at the frontend ouput.

Expected behavior The image is resized and all the attributes should disappear.

Environment

  • TYPO3 version: 12.4.17
  • PHP version: 8.2
  • Extension version: 12.0.2

Documentation Have you checked the readme/documentation?

  • [x] Yes, but I couldn't find anything helpful

timofo avatar Jul 17 '24 14:07 timofo

It seems that the TypoScript is not included. But i can't find my issue. The ImageRenderingController is never called.

timofo avatar Jul 17 '24 15:07 timofo

Ok. I got it working.

I had to change in setup.typoscript

- lib.parseFunc_RTE {
+ lib.parseFunc {

(Is this working for you with _RTE ???)

Then the attributes are removed and the image controllers are called.

Additionally i had to take the files from the "main" branch. (working image processing)

With version 12.0.2 its not working at all. (no image processing)

timofo avatar Jul 17 '24 15:07 timofo

It now works with one exception. Still had to do this.

- lib.parseFunc_RTE {
+ lib.parseFunc {

TYPO3 12+13. I don't know why.

timofo avatar Sep 23 '25 09:09 timofo

Root Cause Analysis Complete ✅

After systematic investigation, I've identified the root cause of this issue and its relationship to several other open issues.


The Problem

The extension uses lib.parseFunc_RTE in TYPO3 v12, but:

  • TYPO3 12 does NOT provide lib.parseFunc_RTE natively
  • It requires fluid_styled_content extension to define it
  • The extension does NOT declare this dependency
  • Configuration fails silently when lib.parseFunc_RTE is undefined
  • Result: ImageRenderingController never gets called → images not processed

Your discovered workaround (lib.parseFunc) is correct ✅ - lib.parseFunc is more fundamental and available earlier in TYPO3's bootstrap.


Why TYPO3 13 Works

TYPO3 13.2+ provides lib.parseFunc_RTE directly via ext:frontend (core), so no external dependency is needed.

Reference: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.2/Important-103485-ProvideLibparseFuncViaExtfrontend.html


Related Issues (Same Root Cause)

  • #29 - "Discuss, test and document interoperability with fluid_styled_content" (OPEN since project start)
  • #293 - "TYPO3 generate wrong path to show image in frontend after upgrading from v11 to v12"
  • #304 - "Images pointing to fileadmin/processed files are broken after upgrading TYPO3 from 11.5 to 12.4" (closed as duplicate)
  • Historical: #112, #116, #117 - parseFunc vs parseFunc_RTE confusion in 2021

Quickfix for Users (Right Now)

Option A: Add fluid_styled_content

composer require typo3/cms-fluid-styled-content

Then in Template → Include Static:

  1. Include "Fluid Styled Content" FIRST
  2. THEN include "CKEditor Image Support"

Load order is critical!

Option B: Add TypoScript Override (Recommended)

Add to your site package TypoScript setup:

lib.parseFunc {
    tags.img = TEXT
    tags.img {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingController->renderImageAttributes
    }
    tags.a = TEXT
    tags.a {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageLinkRenderingController->renderImages
    }
    nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib {
        allparams.unset = 1
        data-htmlarea-file-uid.unset = 1
        data-htmlarea-file-table.unset = 1
        data-htmlarea-zoom.unset = 1
        data-htmlarea-clickenlarge.unset = 1
        data-title-override.unset = 1
        data-alt-override.unset = 1
    }
}

# If parseFunc_RTE exists, make it inherit
lib.parseFunc_RTE < lib.parseFunc
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList := addToList(img)

Option B works without adding dependencies


Permanent Fix Coming

A proper fix for the TYPO3_12 branch is being prepared that will:

  • Use dual configuration (both parseFunc and parseFunc_RTE)
  • Work with or without fluid_styled_content
  • Maintain compatibility with all v12 setups

Main branch (v13) requires no changes - it works correctly as-is.


Evidence Trail

File: Configuration/TypoScript/ImageRendering/setup.typoscript:7

lib.parseFunc_RTE {  ← Assumes this object exists!
    tags.img = TEXT
    tags.img {
        current = 1
        preUserFunc = Netresearch\RteCKEditorImage\Controller\ImageRenderingController->renderImageAttributes
    }
}

File: ext_emconf.php (TYPO3_12 branch)

'depends' => [
    'typo3'        => '12.4.0-12.4.99',
    'rte_ckeditor' => '12.4.0-12.4.99',
],
// ❌ Missing: 'fluid_styled_content'

Git History: Extension has oscillated between parseFunc and parseFunc_RTE since 2021 (commits faf7060, 42ab413), indicating this has been a long-standing confusion.


Thank you for reporting this issue and discovering the workaround - your findings were instrumental in identifying the root cause! 🙏

CybotTM avatar Oct 24 '25 22:10 CybotTM

Clarification: TYPO3 v13 Version Impact

@timofo mentioned this issue affects "TYPO3 12+13" - this requires clarification to avoid confusion.


The Version Timeline

Date Event
January 2024 TYPO3 13.0 released - lib.parseFunc_RTE NOT in core ❌
April 2024 TYPO3 13.1 released - lib.parseFunc_RTE NOT in core ❌
July 2, 2024 TYPO3 13.2 released - lib.parseFunc_RTE added to core
July 17, 2024 timofo's report - using TYPO3 12.4.17
October 2024 TYPO3 13.4 LTS released
September 2025 timofo reports still needs workaround in "TYPO3 12+13"

Affected TYPO3 Versions

Version lib.parseFunc_RTE in Core? Issue Status
TYPO3 12.x (all) ❌ NO 🔴 AFFECTED - Fix needed
TYPO3 13.0 ❌ NO 🔴 AFFECTED - Upgrade to 13.4 LTS
TYPO3 13.1 ❌ NO 🔴 AFFECTED - Upgrade to 13.4 LTS
TYPO3 13.2+ ✅ YES FIXED - Core provides lib.parseFunc_RTE
TYPO3 13.4 LTS ✅ YES FIXED - Main branch targets this

Official TYPO3 Core Change: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.2/Important-103485-ProvideLibparseFuncViaExtfrontend.html


Clarification for @timofo's v13 Report

When you reported needing the workaround in "TYPO3 12+13", you were likely using:

  • ✅ TYPO3 13.0 or 13.1 (released before the core fix)
  • ✅ These versions DID have the issue

However:

  • TYPO3 13.2+ (released July 2, 2024) has in core
  • TYPO3 13.4 LTS (current) works without workarounds
  • Our extension's main branch requires TYPO3 ^13.4

Recommendation by Version

TYPO3 12.x Users

Fix coming in PR #375 (TYPO3_12 branch)
Quickfix now: Use Option B from previous comment

TYPO3 13.0 or 13.1 Users

⚠️ Upgrade to TYPO3 13.4 LTS (EOL for 13.0/13.1 already passed)
✅ Or use the quickfix workaround

TYPO3 13.2+ Users

Should work without workarounds
If not, check that fluid_styled_content or extension TypoScript is properly loaded

TYPO3 13.4 LTS Users (Current)

No issues - main branch targets this version
✅ Extension works correctly as-is


Summary

timofo was PARTIALLY correct:

  • ✅ Issue DID affect early TYPO3 v13 releases (13.0, 13.1)
  • ❌ Issue does NOT affect TYPO3 13.2+ (fixed in core)
  • The extension's main branch targets 13.4 LTS which has the fix

The fix in PR #375 targets the TYPO3_12 branch specifically, as that's where the issue remains critical.

CybotTM avatar Oct 24 '25 22:10 CybotTM