ckeditor: Undefined message when uploading file
I upgraded to 4.3.0 and the file upload is now not working. When I select an image and then click “Send to Server”, I get an “undefined” message. There is no other error messages in the console or on the server.

When debugging on the server, I notice that the attributes of the asset model are blank when it is saved, and it fails validation.
10: def respond_with_asset(asset)
11: asset_response = Ckeditor::AssetResponse.new(asset, request)
12:
=> 13: if asset.save
14: render asset_response.success(config.relative_url_root)
15: else
16: render asset_response.errors
17: end
(byebug) asset
#<Ckeditor::Picture id: nil, attachable_id: nil, attachable_type: nil, asset_type: "image", description: nil, sort_by: "", visible: false, data_file_name: nil, data_content_type: nil, data_file_size: nil, deleted_at: nil, created_at: nil, updated_at: nil, row_order: nil, data_fingerprint: nil>
(byebug)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 17
- Comments: 32 (4 by maintainers)
Commits related to this issue
- Fixed imageupload I love this guy -> https://github.com/galetahub/ckeditor/issues/829#issuecomment-528857685 — committed to Malaber/condolence_book by Malaber 5 years ago
- Fixed imageupload I love this guy -> https://github.com/galetahub/ckeditor/issues/829#issuecomment-528857685 — committed to Malaber/condolence_book by Malaber 5 years ago
If you’re using ‘ckeditor’ 4.3 gem with 4.11 JS lib, then you should use
config.filebrowserUploadMethod = 'form';if you had query params appended with an older version.CKEditor 4.9 introduced “xhr” uploads and made it default. https://github.com/galetahub/ckeditor/blob/74c188c5bb7197c67197272f55951ca1c0864cda/vendor/assets/javascripts/ckeditor/CHANGES.md#ckeditor-49 ckeditor/ckeditor-dev#1365 ckeditor/ckeditor-dev@4e0866c
stalebot is a virus
I encounter the same problem after upgrading my Ckeditor from 4.1.6 to 4.3.0.
And I solved the problem from my end without adding this line:
config.filebrowserUploadMethod = 'form';I just change this line from my OLD custom ckeditor/config: From:
config.filebrowserImageUploadUrl = "/ckeditor/pictures?";To:
config.filebrowserImageUploadUrl = "/ckeditor/pictures?command=QuickUpload&type=Images";I found a solution and it worked for me: https://stackoverflow.com/questions/54272909/ckeditor-upload-image-error-undefined-index-ckeditorfuncnum
SOLVED
In my case , i was reinstalling image magic.
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev libmagic-devsudo apt-get install imagemagickEverythins is OK right now, hope this help.
@Tectract, see previous comment https://github.com/galetahub/ckeditor/issues/829#issuecomment-495159213 that references my merged PR https://github.com/galetahub/ckeditor/commit/ee605605bbd35b1f331a68e60435b6479d7dbac4.
You can upgrade to gem version
4.3.0and update yourconfig.jswith that line to have Image Uploads work.This https://github.com/galetahub/ckeditor/pull/847/commits/ee605605bbd35b1f331a68e60435b6479d7dbac4 solved for me.
Using ckeditor 4.3.0. For those who did not want to upgrade to latest version (or were unable to), just apply that change on your own app/asssets/javascripts/ckeditor/config.js
Our QA team has tested the new config setting in config.js and confirms that Image Uploading works as in version 4.2.4. I’ll submit a PR to update the default config script.
Tested this and there does seem to be an issue with the ‘Send it to the Server’ button. However you can still upload images by clicking on ‘Browse Server’ within the image info tab.
Until this is fixed I’d recommend hiding the Upload tab. To do this add the following to your
config.jsCheck here for more info on how to customise the editors