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
Comment #1
TwoDThanks 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..
Comment #2
nasinandes CreditAttribution: nasinandes commentedThanks!!
Its works!!
Comment #3
Sophabed CreditAttribution: Sophabed commentedWorks like a charm.
Thanks !!!
Comment #4
Lars Bo Jensen CreditAttribution: Lars Bo Jensen commentedThanks for sharing this.
Comment #5
rroose CreditAttribution: rroose commentedIs this going to be resolved in the module any time soon as I don't feel like hacking the module?
Comment #6
StormyWeather CreditAttribution: StormyWeather commentedGod bless you.
THANKS!
Comment #7
neschi CreditAttribution: neschi commentedStill works! Thanks
Comment #8
TwoDAgain: 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.
Comment #9
reptilex CreditAttribution: reptilex commentedHmm ... fixed years ago ... but the stable version seems to STILL HAVE THE BUG!! There was never a new release
Comment #10
tvaughn78 CreditAttribution: tvaughn78 commentedHave 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.