Closed PATATESUPREME closed 5 years ago
You need to set:
fos_ck_editor:
configs:
default:
filebrowserUploadMethod: form
see https://sonata-project.org/bundles/formatter/master/doc/reference/ckeditor_medias.html#configuration and #350
You are right ! Thanks a lot, I think I would not have found the answer before a while.
Hi @PATATESUPREME! i have the same issue, here i my config file, i use as mention filebrowserUploadMethod: form
but no effect. i have still the error "Réponse du serveur incorrecte."
in the console
ckeditor.js:21 [CKEDITOR] Error code: filetools-response-error.
Object
responseText: "<script>window.parent.CKEDITOR.tools.callFunction(, "/upload/media/news/0001/01/thumb_9_news_big.jpeg");</script>↵"
fos_ck_editor:
default_config: news
configs:
news:
# default toolbar plus Format button
toolbar:
- [Bold, Italic, Underline, -, Cut, Copy, Paste,
PasteText, PasteFromWord, -, Undo, Redo, -,
NumberedList, BulletedList, -, Outdent, Indent, -,
Blockquote, -, Image, Link, Unlink, Table, -, Format, Maximize, Source]
filebrowserBrowseRoute: admin_sonata_media_media_ckeditor_browser
filebrowserImageBrowseRoute: admin_sonata_media_media_ckeditor_browser
# Display images by default when clicking the image dialog browse button
filebrowserImageBrowseRouteParameters:
provider: sonata.media.provider.image
filebrowserUploadMethod: form
filebrowserUploadRoute: admin_sonata_media_media_ckeditor_upload
filebrowserUploadRouteParameters:
provider: sonata.media.provider.file
# Upload file as image when sending a file from the image dialog
filebrowserImageUploadRoute: admin_sonata_media_media_ckeditor_upload
filebrowserImageUploadRouteParameters:
provider: sonata.media.provider.image
context: news # Optional, to upload in a custom context
format: big # Optional, media format or original size returned to editor
Any ideas ?
Merci ! ;o)
Environment
Sonata packages
Symfony packages
PHP version
Subject
My configuration of the CKeditor allows to add an image to richtext fields. I'm trying to add an image in the content of a post by uploading it from my computer.
Steps to reproduce
Expected results
The image has been uploaded properly and the pop-in loads the details of the image.
Actual results
The image has been uploaded properly, when you check the media the image uploaded exists, but an alert warns us by "Incorrect server response." The response contains :
The first argument of callFunction is empty.