netresearch / t3x-rte_ckeditor_image

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

Images not saved in _processed_ folder for RTEs in custom content elements #180

Closed sbrandstaetter closed 6 months ago

sbrandstaetter commented 2 years ago

Working with Typo3 11LTS and newest rte_ckeditor_image version. I have an extension that provides new custom content elements with flexform and RTEs in them. For standard content elements everything works like expected (text,textpic etc). But for some reason the new code for 11LTS this new lines do not work :

rte_ckeditor_image/Classes/Database/RteImagesDbHook.php line 180-187

It seems that the path to the image is wrong for custom content elements and RTEs in a flexform. I removed the new Part so it work again as expected for all content elements: `... $imgSrc = $magicImage->getPublicUrl();

                        /*HACK SB

                        // publicUrl like 'https://www.domain.xy/typo3/image/process?token=...'?
                        // -> generate img source from storage basepath and identifier instead
                        if (strpos($imgSrc, 'process?token=') !== false) {
                        $storageBasePath = $magicImage->getStorage()->getConfiguration()['basePath'];
                        $imgUrlPre = (substr($storageBasePath, -1, 1) === '/') ? substr($storageBasePath, 0, -1) : $storageBasePath;

                        $imgSrc = '/' . $imgUrlPre . $magicImage->getIdentifier();
                        }
                        */

                        $attribArray['src'] = $imgSrc;

...`

linawolf commented 1 year ago

@sbrandstaetter does this also happen for you with DCE? I do have the error in DCE but not in manually created Content Element and not in those created with Mask. I therfore suppose this is a problem of DCE, not rte_ckeditor_image

linawolf commented 1 year ago

So changing the configuration of the RTE field in DCE to also respect the softref seems to do the trick for me:

<config>
    <type>text</type>
    <rows>5</rows>
    <cols>30</cols>
    <eval>trim,required</eval>
    <enableRichtext>1</enableRichtext>
    <richtextConfiguration>default</richtextConfiguration>
    <softref>typolink_tag,email[subst],url</softref>
</config>
Gitsko commented 6 months ago

Thank you @linawolf for your commitment, I see it the same way, with the softref in the DCE I think we can close the ticket.