Bug #71494

Story #46140: Add configurable linkhandler for arbitrary records

image wizard in the rtehtmlarea

Added by stefan schreck about 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2015-11-12
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
hard
Is Regression:
Yes
Sprint Focus:

Description

Typo3 7.6
Can't insert Image with the Link Wizard in the RTE html Area.
Wizard pops up but the click on the image won't insert the image source.
Best


Related issues

Related to TYPO3 Core - Bug #71832: htmlArea RTE insert Picture open Link Dialog Closed 2015-11-25
Related to TYPO3 Core - Bug #71298: Fix missing/broken RTE features after Link Handler API merge Accepted 2015-11-02
Related to TYPO3 Core - Bug #73657: Image wizard in the rtehtmlarea working again, but css-classes are not taken Closed 2016-02-24
Duplicated by TYPO3 Core - Bug #71643: RTE Insert images loading wrong popup content Closed 2015-11-18
Duplicated by TYPO3 Core - Bug #72592: rtehtmlarea: Inserting images not possible Closed 2016-01-08
Duplicated by TYPO3 Core - Bug #73094: Add image in RTE htmlarea Closed 2016-02-03

Associated revisions

Revision 3163daa0 (diff)
Added by Markus Klein almost 4 years ago

[BUGFIX] RTE Image Wizard

Make inserting/editing images in RTE possible again.

Resolves: #71494
Releases: master, 7.6
Change-Id: If561562d9330c39544b7bd514a273641538d03f8
Reviewed-on: https://review.typo3.org/45697
Tested-by: Frank Naegler <>
Reviewed-by: Frank Naegler <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 815ac6c0 (diff)
Added by Markus Klein almost 4 years ago

[BUGFIX] RTE Image Wizard

Make inserting/editing images in RTE possible again.

Resolves: #71494
Releases: master, 7.6
Change-Id: If561562d9330c39544b7bd514a273641538d03f8
Reviewed-on: https://review.typo3.org/46826
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Christopher Orth about 4 years ago

Can confirm that. Link Wizard opens when you click the "Insert Image" Button and you are unable to insert an image.

#2 Updated by Kevin Ditscheid about 4 years ago

Can confirm that, too, on TYPO3 7.6.0

#3 Updated by SoftPearls GmbH about 4 years ago

Additional information out of the Apache access log after clicking on the "Insert Image" Button: The request to route=/rte/wizard/image results in a HTTP 302 code and is forwarded to route=/wizard/link/browse .

(IP and domain name have been changed in the snippet from the access log.)

xxx.xxx.xxx.xxx - - [13/Nov/2015:21:08:44 +0100] "GET /typo3/index.php?route=%2Frte%2Fwizard%2Fimage&token=03e6cc5bbc19828756f7c91fafd1ad0b6aa9d933&&RTEtsConfigParams=tt_content%3A47%3Abodytext%3A9%3Atextmedia%3A9%3A&editorNo=data_tt_content__47__bodytext_&sys_language_content=0&contentTypo3Language=default HTTP/1.0" 302 670 "http://mydomain.de/typo3/index.php?route=%2Frecord%2Fedit&token=53412d9d2c45ed3f4e0f02fb6e5f189144f84370&edit[tt_content][47,]=edit&returnUrl=%2Ftypo3%2Findex.php%3FM%3Dweb_layout%26moduleToken%3D411c791386aebb653a7709b19bfd15e503ce2250%26id%3D9%23element-tt_content-47" "Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0"
xxx.xxx.xxx.xxx - - [13/Nov/2015:21:08:44 +0100] "GET /typo3/index.php?route=%2Fwizard%2Flink%2Fbrowse&token=503e869e31a995bdee52d640ec5ce4ca2542827f&RTEtsConfigParams=tt_content%3A47%3Abodytext%3A9%3Atextmedia%3A9%3A&editorNo=data_tt_content__47__bodytext_&sys_language_content=0&contentTypo3Language=default HTTP/1.0" 200 6553 "http://mydomain.de/typo3/index.php?route=%2Frecord%2Fedit&token=53412d9d2c45ed3f4e0f02fb6e5f189144f84370&edit[tt_content][47,]=edit&returnUrl=%2Ftypo3%2Findex.php%3FM%3Dweb_layout%26moduleToken%3D411c791386aebb653a7709b19bfd15e503ce2250%26id%3D9%23element-tt_content-47" "Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0"

#4 Updated by Harald Dolderer about 4 years ago

  • Target version set to 7 LTS

it seems the ability to insert images in rte is broken.
Trying to drop an image into the rte window in TYPO3 7.6 fails and the accessability icons of new created links are also not shown. That's really a big problem because all images are deleted if you update a record.
Tested with latestest Versions Firefox and IE 11 and php 5.6

#5 Updated by stefan schreck about 4 years ago

Furthermore is it NOT possible to set a File LINK on an image which was inserted with pure html.
Saving the RTE Window will lead to loss of the link data or the filemount url will not be converted
/?file:221

Right now RTE with Images is useless.
Thx
Best
Stefan

#6 Updated by Harald Dolderer about 4 years ago

  • Assignee set to Benni Mack

seems nobody is working on this issue yet?
Stefan Schreck is right - RTE with images is absolute useless in 7.6.
This needs a quick solution. Is there anybody who can escalate this issue?
Thank you.

#7 Updated by Anatoliy Balabanov about 4 years ago

The same problem.
7.6.0
PHP 5.6
Insert image not working in RTE. "insert link" wizard opens instead "insert image".

#8 Updated by Markus Klein about 4 years ago

  • Status changed from New to Accepted
  • Assignee changed from Benni Mack to Markus Klein
  • Priority changed from Should have to Must have
  • Target version changed from 7 LTS to Candidate for patchlevel
  • Parent task set to #46140

#9 Updated by Bastian Heiser about 4 years ago

Same Problem.

#10 Updated by Markus Klein about 4 years ago

  • Target version changed from Candidate for patchlevel to 7.6.1

#11 Updated by Gernot Ploiner about 4 years ago

Can confirm that.

#12 Updated by Markus Klein almost 4 years ago

  • Target version changed from 7.6.1 to Candidate for patchlevel

#13 Updated by Markus Klein almost 4 years ago

  • Target version changed from Candidate for patchlevel to 7.6.3
  • Complexity set to hard

#14 Updated by Markus Klein almost 4 years ago

  • Status changed from Accepted to In Progress
  • Is Regression changed from No to Yes

#15 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#16 Updated by a. g. almost 4 years ago

Patch set 1 don't work.
It throw errors in typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php

#17 Updated by Markus Klein almost 4 years ago

@a.g. Read the commit message please, which clearly states: "Not ready for review yet!!!"

#18 Updated by Vasili Czelebski almost 4 years ago

@Markus Klein: Hi, when this bug will be fixed?
This is one of the main functionality of the CMS. We need the ability to insert images from RTE.

#19 Updated by Damien True almost 4 years ago

When will this bug be fixed?
RTE without ability to insert images is absolute useless.

#20 Updated by Loïc Stéphan almost 4 years ago

We have the same problem.
Do you have an idea when will this bug be fixed ?

Thanks.

#22 Updated by Markus Klein almost 4 years ago

This Issue will finally be resolved tonight.

@Michael: Nope, this is not a JS issue... this needs a full rewrite for the new API, consider the existing code as totally broken.

#23 Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#24 Updated by Matthias Eberlein almost 4 years ago

Update to TYPO3 Version 7.6.3 Problem still exist...:-(

#25 Updated by a. g. almost 4 years ago

It's not fixed.
Throw error "PHP Fatal error: Arrays are not allowed in class constants in typo3\sysext\rtehtmlarea\Classes\Controller\SelectImageController.php on line 37".
Declaring const as array is allowed only on PHP 5.6+ (I have environment with PHP 5.5.12)

I fixed it on my instance, but i have another error:
"Fatal error: Uncaught exception 'TYPO3\CMS\Core\Error\Exception' with message 'PHP Catchable Fatal Error: Argument 2 passed to TYPO3\CMS\Recordlist\View\FolderUtilityRenderer::uploadForm() must be of the type array, string given, called in typo3\sysext\rtehtmlarea\Classes\ImageHandler\AddImageHandler.php on line 217 and defined in typo3\sysext\recordlist\Classes\View\FolderUtilityRenderer.php line 106' in typo3\sysext\core\Classes\Error\ErrorHandler.php on line 111"

#26 Updated by Matthias Eberlein almost 4 years ago

On TYPO3 git Master 8.0-dev same. Not working....

#27 Updated by Hannes Lau almost 4 years ago

The patch set is only 3 hours old. It has not been reviewed or accepted yet, so it won't be part of any release. Feel free to review: https://review.typo3.org/45697 .

#28 Updated by Markus Klein almost 4 years ago

Guys... thanks for your efforts, but please read up our conventions: The commit message says [WIP], which says "work in progress".
As long as a patch is WIP, there is no need to review it, unless explicitly asked for.

I pushed the current state to show that there is progress. The core team decided to not wait with today's release for this very patch, but to have another release rather soonish.
I will continue with the work on this patch tonight.

As soon as I consider it ready, I'll remove the WIP and I'm happy about many reviews then, I'll ping you here.
Cheers, Markus

#29 Updated by Matthias Eberlein almost 4 years ago

Hi Markus,
thanks for this Info...
Yes, i don's saw this[WIP] sorry.
Then we waiting for next updates.
Regards
Matthias

#30 Updated by Gerrit Code Review almost 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#31 Updated by Gerrit Code Review almost 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#32 Updated by Gerrit Code Review almost 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#33 Updated by Markus Klein almost 4 years ago

Patch is open for reviews now.

Please don't forget to post your votes on gerrit. Login with your typo3.org username and use the Reply button at the top.
R+1 means "I read the code and consider it appropriate", V+1 means "I tested the code and it works as expected"

Thanks.

#34 Updated by Ricky Mathew almost 4 years ago

I put the patch. But i got the exception as following when i clicked on the image add button.

#1455499673: No image handlers are configured. Check page TSconfig RTE.default.buttons.image.options.imageHandler. (More information)

UnexpectedValueException thrown in file
/opt/lampp/htdocs/typo3_src-7.6.3/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php in line 177.

#35 Updated by Markus Klein almost 4 years ago

You have to clear the system caches!

#36 Updated by Gerrit Code Review almost 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#37 Updated by Gerrit Code Review almost 4 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#38 Updated by Ricky Mathew almost 4 years ago

I still have an error in javascript "Uncaught TypeError: Cannot read property 'style' of null" on

rtehtmlarea/Resources/Public/JavaScript/EditImage.js at line 177 , which happens on imagewizard popup, so
that i can't still add image with the wizard.

#39 Updated by Gerrit Code Review almost 4 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#40 Updated by Markus Klein almost 4 years ago

@Ricky: Did you test the latest patchset? I changed something in this regard.
Please comment on Gerrit directly about the patch and not here. Thanks.

#41 Updated by Gerrit Code Review almost 4 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45697

#42 Updated by Gerrit Code Review almost 4 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46826

#43 Updated by Markus Klein almost 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#44 Updated by Matthias Eberlein almost 4 years ago

cool, it works...:-)
Many thank's to Markus Klein
Matthias

#45 Updated by Jelle Groenendal almost 4 years ago

Ricky Mathew wrote:

I put the patch. But i got the exception as following when i clicked on the image add button.

#1455499673: No image handlers are configured. Check page TSconfig RTE.default.buttons.image.options.imageHandler. (More information)

UnexpectedValueException thrown in file
/opt/lampp/htdocs/typo3_src-7.6.3/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php in line 177.

I'm getting the same error after updating to 7.6.4.
Am i doing something wrong?

Uncaught TYPO3 Exception
#1455499673: No image handlers are configured. Check page TSconfig RTE.default.buttons.image.options.imageHandler. (More information)

UnexpectedValueException thrown in file
/var/www/site/typo3_src-7.6.4/typo3/sysext/rtehtmlarea/Classes/Controller/SelectImageController.php in line 177.

#46 Updated by Markus Klein almost 4 years ago

AS the error message already says "Check page TSconfig RTE.default.buttons.image.options.imageHandler".
What does the Info module say for RTE.default.buttons.image.options.imageHandler?
Make sure your RTE configuration does not kick RTE.default > away.

#47 Updated by Jelle Groenendal almost 4 years ago

I had to add the following to my RTE setup to make it work

RTE.default.buttons.image.options.imageHandler {
image {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\EditImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:currentImage
}
magic {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:magicImage
displayAfter = image
scanAfter = image
}
plain {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:plainImage
displayAfter = magic
scanAfter = magic
}
}

#48 Updated by Jelle Groenendal almost 4 years ago

RTE.default.buttons.image.options.imageHandler is not active in the Info module.
i dont clear the default anywhere.
That should mean the TS : /typo3_src-7.6.4/typo3/sysext/rtehtmlarea/Configuration/PageTSconfig/Image/pageTSConfig.txt
is not loading.
When i look in the code this is only loaded when basic.enableImages = 1.
This has been set within the plugin so it should be loaded.
When i remove the check nothing happens the problem still exists.

#49 Updated by Markus Klein almost 4 years ago

Then check your extensions... something must remove that ;-)

#50 Updated by Jelle Groenendal almost 4 years ago

RTE.default wasnt being cleared. RTE was being cleared. The introduction package uses an RTE setup that clears the entire RTE.

#51 Updated by Markus Klein almost 4 years ago

Oh dear... I guess it's the bootstrap_package used in there.
https://github.com/benjaminkott/bootstrap_package

Can you please file a bug report there or even provide a PR?

#52 Updated by Jelle Groenendal almost 4 years ago

Thats the one :P i filed an issue with this.
Could probably happen more often.
Thanks for the help!

#53 Updated by Peter Morgner over 3 years ago

Markus Klein wrote:

Make sure your RTE configuration does not kick RTE.default > away.

This was the only reason in my configuration (V. 7.6.5) - after uncommenting "RTE.default >" it worked again.

#54 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

#55 Updated by Tashko Valkov over 1 year ago

=====================================

Images in RTE for Typo3 ver. 7.6.26

=====================================

I had this issue but now it works in me.
This bug description helped me to solve this, especially the message #47 and #53.
Also the link https://docs.typo3.org/typo3cms/extensions/rtehtmlarea/DefaultConfigurations/Image/Index.html

-------------------------------------
Below are the steps how it was solved
-------------------------------------

1. Enable the showing images for RTE in Extension Manager (click Configure of the "rtehtmlarea" extension):
both fields "Enable images in the RTE" and "Enable additional inline elements"

2. Add in the PageTSConfig of the root page:

RTE.default {

Enable the image button
#showButtons := addToList(image)
showButtons := addToList(*)
Tags allowed outside p and div
Adding img tag to the default list
proc.allowTagsOutside := addToList(img)
Do not remove img tags
proc.entryHTMLparser_db.tags.img >

#this is for image size in BE and FE
buttons.image.options.magic.maxWidth = 800
buttons.image.options.magic.maxHeight = 800
buttons.image.options.plain.maxWidth = 800
buttons.image.options.plain.maxHeight = 800

}
#RTE.default.FE.showButtons < RTE.default.showButtons
#RTE.default.FE.proc.allowTagsOutside < RTE.default.proc.allowTagsOutside
#RTE.default.FE.proc.entryHTMLparser_db.tags.img >
------

#source: https://docs.typo3.org/typo3cms/extensions/rtehtmlarea/DefaultConfigurations/Image/Index.html

3. Now the button is shown but after click error appeared (error linked with the image handlers)
4. Add (below the above code) the following code to fix it:

This solves the issue "after click on image button error appears linked with the handlers"
RTE.default.buttons.image.options.imageHandler {
image {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\EditImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:currentImage
}
magic {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:magicImage
displayAfter = image
scanAfter = image
}
plain {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:plainImage
displayAfter = magic
scanAfter = magic
}
}

#---------
#source: https://forge.typo3.org/issues/71494 - solution #47

5. Now the image can be added but can't be save
6. Add (at the top of the all codes above) the following code to fix it:

this solves the issue "image is added but can't be saved"
RTE.default >

#---------
#source: https://forge.typo3.org/issues/71494 - solution #53

7. The whole result code from above.
(Add it in PageTSConfig of the root page):

RTE.default >

RTE.default {
showButtons := addToList(*)
proc.allowTagsOutside := addToList(img)
proc.entryHTMLparser_db.tags.img >

#this is for image size in BE and FE
buttons.image.options.magic.maxWidth = 800
buttons.image.options.magic.maxHeight = 800
buttons.image.options.plain.maxWidth = 800
buttons.image.options.plain.maxHeight = 800
}

RTE.default.buttons.image.options.imageHandler {
image {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\EditImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:currentImage
}
magic {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:magicImage
displayAfter = image
scanAfter = image
}
plain {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:plainImage
displayAfter = magic
scanAfter = magic
}
}

==============

8. In Resume: now it's working in RTE of CE Text&Media and in the "news" extension records.
Of course, I've just done this so I need to test if the RTE would work good in the next days but in all cases it seems to work now.

#56 Updated by Tashko Valkov over 1 year ago

=============================================================

This is the whole working code from the previous my message
(see it if you need detailed description)
(also enable the showing images for RTE in Extension Manager (click Configure of the "rtehtmlarea" extension):
both fields "Enable images in the RTE" and "Enable additional inline elements")

=============================================================
This solves the issue and you have images in RTE for CE Text&Media and news extension records.
Add it in PageTSConfig of the root page.
-----------------------------------------------------------------------------------------------

RTE.default >

RTE.default {
showButtons := addToList(*)
proc.allowTagsOutside := addToList(img)
proc.entryHTMLparser_db.tags.img >

#this is for image size in BE and FE
buttons.image.options.magic.maxWidth = 800
buttons.image.options.magic.maxHeight = 800
buttons.image.options.plain.maxWidth = 800
buttons.image.options.plain.maxHeight = 800
}

RTE.default.buttons.image.options.imageHandler {
image {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\EditImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:currentImage
}
magic {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:magicImage
displayAfter = image
scanAfter = image
}
plain {
handler = TYPO3\CMS\Rtehtmlarea\ImageHandler\AddImageHandler
label = LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_selectimagecontroller.xlf:plainImage
displayAfter = magic
scanAfter = magic
}
}

Also available in: Atom PDF