Hi all,

Yesterday i spent a lot of time to debug why wysiwyg can not detect the latest 4.0 CKeditor version number.

The bug is in sites/all/modules/wysiwyg/editors/ckeditor.inc
[...]
function wysiwyg_ckeditor_version($editor) {
$library = $editor['library path'] . '/ckeditor.js';
if (!file_exists($library)) {
return ;
}
$library = fopen($library, 'r');
$max_lines = 8;
while ($max_lines && $line = fgets($library, 500)) {
// version:'CKEditor 3.0 SVN',revision:'3665'
// version:'3.0 RC',revision:'3753'
// version:'3.0.1',revision:'4391'
// if (preg_match('@version:\'(?:CKEditor )?([\d\.]+)(?:.+revision:\'([\d]+))?@', $line, $version)) { <===
if (preg_match('@version:\"(?:CKEditor )?([\d\.]+)(?:.+revision:\"([\d]+))?@', $line, $version)) { <===
fclose($library);
// Version numbers need to have three parts since 3.0.1.
$version[1] = preg_replace('/^(\d+)\.(\d+)$/', '${1}.${2}.0', $version[1]);
return $version[1] . '.' . $version[2];
}
$max_lines--;
}
fclose($library);
}

In CKeditor v4.0 the version number is located between duble aphostrophes (".." ) and not between single ones as it was in previous versions. My temp solution was to modify the filtering phrase..... see above check the aphostrophes ( ' -> " ).

I have to say this is absolutly not fair from CKeditor dev team!

Comments

TwoD’s picture

Status: Active » Closed (duplicate)

Thanks for the thorough debugging, suggested fix, and for blaming CKEditor. ;)
I'm afraid I'll have to respond with closing your issue though. :(
There's already an issue with a patch and discussions over at #1853550: Ckeditor 4.0 - The version of CKEditor could not be detected..

nasinandes’s picture

Thanks!!
Its works!!

Sophabed’s picture

Works like a charm.
Thanks !!!

Lars Bo Jensen’s picture

Thanks for sharing this.

rroose’s picture

Is this going to be resolved in the module any time soon as I don't feel like hacking the module?

StormyWeather’s picture

God bless you.

THANKS!

neschi’s picture

Still works! Thanks

TwoD’s picture

Again: This was fixed long ago in [1853550] and is now in 7.x-2.x-dev and 6.x-2.x-dev and will be part of the next releases.

reptilex’s picture

Hmm ... fixed years ago ... but the stable version seems to STILL HAVE THE BUG!! There was never a new release

tvaughn78’s picture

Have the latest WYSIWYG release (7.x.2.2) and tried using with CKEditor 4.5.3 in sites/all/libraries and get the now standard error, "The version of CKEditor could not be detected.". Still seems to be an issue.