netresearch / t3x-rte_ckeditor_image

Image support in CKEditor for the TYPO3 ecosystem
GNU Affero General Public License v3.0
54 stars 60 forks source link

Replace deprecated Hook t3lib_parsehtml_proc.php:transformation #214

Open kevin-appelt opened 1 year ago

kevin-appelt commented 1 year ago

The hook "t3lib/class.t3lib_parsehtml_proc.php->transformation" will be removed in TYPO3 v12. https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.2/Deprecation-92992-HookT3libclasst3lib_parsehtml_procphptransformation.html

Environment

prdt3e commented 1 year ago

@sk-foresite has that in her version (for 12) via the t3lib/class.t3lib_tcemain.php solved. it will not work. I looked at the core. It should now be resolved via the entryHTMLparser_db.

RTE.default.proc.entryHTMLparser_db = 1 RTE.default.proc.entryHTMLparser_db.tags.img{ current = 1 // always = 1 preUserFunc // userFunc = Netresearch\RteCKEditorImage\Controller....... }

I think it will go in that direction.

prdt3e commented 1 year ago

@sypets #188

prdt3e commented 12 months ago

We have 2 options:

  1. as individual attributes or maybe just: data-htmlarea-file="{json}"

    RTE.default.proc.entryHTMLparser_db = 1
    RTE.default.proc.entryHTMLparser_db {
    tags {
        img.fixAttrib.src.userFunc  = Netresearch\RteCKEditorImage\Database\RteImagesDbHook->transform_rte
        img.fixAttrib.width.userFunc  = Netresearch\RteCKEditorImage\Database\RteImagesDbHook->transform_rte
        img.fixAttrib.height.userFunc  = Netresearch\RteCKEditorImage\Database\RteImagesDbHook->transform_rte
        img.fixAttrib.style.userFunc  = Netresearch\RteCKEditorImage\Database\RteImagesDbHook->transform_rte
        img.fixAttrib.data-htmlarea-file-uid.userFunc  = Netresearch\RteCKEditorImage\Database\RteImagesDbHook->transform_rte
    }
    }

    or 2: HTMLSanitizer

$GLOBALS['TYPO3_CONF_VARS']['SYS']['htmlSanitizer']['rtehtmlarea_images_db'] = \Netresearch\RteCKEditorImage\Sanitizer\RteImagesDbHook::class;

what do you mean?