Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the latest Ckeditor 4.2, WYSIWYG API reports:
"The version of CKEditor could not be detected."
at '/admin/config/content/wysiwyg'
See related:
#1853550: Ckeditor 4.0 - The version of CKEditor could not be detected.
#1151804: WYSIWYG can't detect latest CKeditor (build 3.6).
Comment | File | Size | Author |
---|
Comments
Comment #1
jenlamptonpatch as recommended by #55 from the previous issue.
Comment #2
rocketeerbkw CreditAttribution: rocketeerbkw commentedAs noted in #1853550: Ckeditor 4.0 - The version of CKEditor could not be detected. this has already been fixed in 7.x-2.x-dev. If you need to patch 7.x-2.2, at least use the patch that got committed which was #136.
Comment #3
luinva CreditAttribution: luinva commentedWhere does the patch go?
Found it.
Comment #4
philipjohn CreditAttribution: philipjohn commentedI've tried #2 with both 7.x-2.2 and 7.x-2.x-dev but with no impact.
I've also had no luck with any of the patches from #1853550: Ckeditor 4.0 - The version of CKEditor could not be detected.
P.s. I'm an issues queue novice - how do I nicely link to other issues? (Thanks @rocketeerbkw)
Comment #5
rocketeerbkw CreditAttribution: rocketeerbkw commentedI tested ckeditor 4.2.1 and it works on 7.x-2.x-dev with no additional patches.
You can link to issues with just the issue number using
[#12345]
, see the fifth bullet point below the issue message.Comment #6
luinva CreditAttribution: luinva commentedSolution:
editors/ckeditor.inc
line: 81
Replace:
if (preg_match('@version:\'(?:CKEditor )?([\d\.]+)(?:.+revision:\'([\d]+))?@', $line, $version)) {
With
if (preg_match('@version:[\"|\'](?:CKEditor )?([\d\.]+)(?:.+revision:[\"|\']([\d]+))?@', $line, $version)) {
Comment #7
simon147 CreditAttribution: simon147 commentedI just updated to the latest version of wysiwyg module and run into this bug. It seems to be still active (all the duplacates seem to be closed) making me a bit confused.
Applying the above code fixes the problem, then however get the following error message "
Any idea what is wrong?
Comment #8
bagsmode CreditAttribution: bagsmode commentedI had to perform the update to the preg_match
if
statement, as well as to the return statement within:return $version[1] . '.' . (!isset($version[2]) ? '' : $version[2]);
Comment #9
CTGreybeard CreditAttribution: CTGreybeard commentedCombining the changes from posts 6 and 8 worked for me.
CKEditor version 4.3.4.40 is the one I downloaded and installed today.
Comment #10
MediaFormat CreditAttribution: MediaFormat commented+1 for #6 with CKEditor 4.4.0.98
Comment #11
jdeg CreditAttribution: jdeg commented+1 for #6 with CKEditor 4.x
Comment #12
scromie CreditAttribution: scromie commented+1 for #6 with CKEditor 4.4.1
Comment #13
smartsystems160 CreditAttribution: smartsystems160 commented+100 for #6. worked flawlessly for me with CKEditor 4.4.1.568, Wysiwyg 7.x-2.2 version
Comment #14
TwoD#6 is not enough!
Don't complain about missing buttons or ineffective settings if that's the only patch you use. Many more changes have already been made to 7.x-2.x-dev to stay compatible with all changes between CKEditor 3 and 4.
Comment #15
ThomasRedstone CreditAttribution: ThomasRedstone commentedIt's also not really a great regex, the revisions are hex, and there is also the possibility of someone wanting to use an older version, so really the correct hack is this:
But has been said, using Dev is a much better option (using a stable build is only a stable choice if you use it with the libraries it's designed to be used with).
Comment #16
wingchuihk CreditAttribution: wingchuihk commenteddownload coeditor 4.4.3 with Drupal 7.3-- after install below location and it still not detached.
=======
The version of CKEditor could not be detected.
Extract the archive and copy its contents into a new folder in the following location:
sites/all/libraries/ckeditor
So the actual library can be found at:
sites/all/libraries/ckeditor/ckeditor.js
Do NOT download the "CKEditor for Drupal" edition.
Comment #17
hamedsbt CreditAttribution: hamedsbt commentedI installed "Wysiwyg v7.x-2.2" and latest ckeditor so had same problem and my friend fixed it for me :)
1)Open "\sites\all\libraries\ckeditor\ckeditor.js" file in a text editor.
2)Add "// version:'4.4.3',revision:'4391' " in first line (without double quotations) and save it.
enjoy!
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedwow hamedsbt. thank you!
Comment #19
phpcoder2015 CreditAttribution: phpcoder2015 commented#17 worked great with CKEditor 4.4.6 ( 2014.11.25), thanks man!
Comment #20
awells CreditAttribution: awells commentedThanks to hamedsbt for #17 ... worked for me as well (changed to 4.4.7 though)
Comment #21
izmeez CreditAttribution: izmeez commentedThis is not an issue with the latest wysiwyg-7.x-2.x-dev
Comment #22
wgallop99 CreditAttribution: wgallop99 commented#6 worked for me and I am on version 7.x-2.0-beta1 of Wysiwyg and version 4.5.6.91 of Ckeditor...am I using the wrong version of wysiwyg?
Comment #23
ercder CreditAttribution: ercder commented#6 worked for me with on Drupal 7.41, CKeditor 4.5.6, and Wysiwyg 7.x-2.2
Comment #24
TwoD@wgallop99, @ercder. Do NOT use those patches, they only appear to work and you'll get confusing problems later. There's a reason why this was marked duplicate.
Comment #25
ercder CreditAttribution: ercder commentedThanks @TwoD, was in a pinch and had I spent further time on this would have read your other warnings. Thanks.
Comment #26
ambereyes CreditAttribution: ambereyes commented#17 worked for me as well with "// version:'4.5.8'
Comment #27
ray_at_boxtm CreditAttribution: ray_at_boxtm commentedfor #7 I would suggesting another fix, Because the revision of CKEditor used when the Wysiwyg release was 4.4.2 or so. it revision starts with digits such as '1567b48', but later release of CKEditor such as version 4.5.9 comes with different revision such as "b47abaf" which starts with alpha-bet. So I think a better solution would be add alphabet to the preg_match regex check such as change
if (preg_match('@version:[\"|\'](?:CKEditor )?([\d\.]+)(?:.+revision:[\"|\']([\d]+))?@', $line, $version)) {
to
if (preg_match('@version:[\"|\'](?:CKEditor )?([\d\.]+)(?:.+revision:[\"|\']([a-z\d]+))?@', $line, $version)) {
And also I assume the revision only contains lowercase and 0-9 digits.
at line 85 of
....sites/all/modules/wysiwyg/editors/ckeditor.inc
Comment #28
TwoDAs already mentioned several times both here and elsewhere, just changing the version detection string will only trick the stable version of the module into using a version of the editor it can't handle. You must expect bugs if hacking the stable version instead of using the -dev snapshot, which does handle CKEDitor 4 properly.