Hi,

When trying to install the latest TinyMCE version ( tinymce_3_3b1 ) I get:
The version of TinyMCE could not be detected.

The problem is that the fgets() is not reading everything it needs.
So I changed it to 100 chars at the file sites/all/modules/wysiwyg/editors/tinymce.inc
$line = fgets($script, 100);

Cheers,
Miki

CommentFileSizeAuthor
#1 fix_tinymce_version_problem.patch664 bytesmichaelbn

Comments

michaelbn’s picture

StatusFileSize
new664 bytes

Here is the diff file

hansfn’s picture

I just wanted to confirm the bug (and the fix). Thx.

twod’s picture

Status: Active » Closed (duplicate)

Please search the issue queue before reporting new issues, this is a duplicate of #695398: Support for TinyMCE 3.3.
You can follow up on the progress and help testing in that issue and the fix will most likely be released with Wysiwyg 2.1.

michaelbn’s picture

Well, I actually did search for a cure to the version erro but couldnt find it.

So, i opened this issue.
Who ever posted that issue forgot to mention the error which most people use as a search string.

burt.lo’s picture

Michael, thanks for posting this. It helped me today.

patchrobe’s picture

Thanks Miki - that worked great for me too.

mr_kazoodle’s picture

Thanks, this helped me a lot.
I manually changed that line, thinking it easier than applying the patch :p.

wkelvinf’s picture

thanks for the fix

twod’s picture

To everyone applying just the "fgets 80->100" fix:
This version of TinyMCE brought a new 'Advanced Link' plugin, and it removed the 'Safari' plugin. The patch in #695398: Support for TinyMCE 3.3 accounts for this as well as fixing a problem with the base path, so please apply that one instead.

zahor’s picture

Status: Closed (duplicate) » Patch (to be ported)

Any chance this patch can be applied to dev release so this doesn't have to be manually done every time module is downloaded?

twod’s picture

Status: Patch (to be ported) » Closed (duplicate)

This patch will not be applied anywhere. See #9 for a correct patch which compensates for changes in the editor, it will be committed when it's done and confirmed to be working.

drtrueblue’s picture

Again, thanks for the fix.

patrickfrickel’s picture

Gold absolute Gold....4am and it wasn't working....thanks a BUNCH!

Jorgen Sundberg’s picture

Thanks for that Miki, works with the patch!

drupalfantwo’s picture

Change mine to 200 instead of 100, worked fine.

rsharkey’s picture

I just wanted to confirm that I also had to change the value from "100" to "200" and the editor is now being recognized in the wsiwyg module.

I download the Version: 3.3.9.1 of TinyMCE, fyi.

function wysiwyg_tinymce_version($editor) {
  $script = $editor['library path'] . '/tiny_mce.js';
  $script = fopen($script, 'r');
  // Version is contained in the first 100 chars.
  $line = fgets($script, 200);                                         //<----------Change here!!!
  // 2.x: this.majorVersion="2";this.minorVersion="1.3"
  // 3.x: majorVersion:'3',minorVersion:'2.0.1'
  if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) {
    fclose($script);
    return $version[1] . '.' . $version[2];
  }
  fclose($script);
}
twod’s picture

This is fixed in CVS, and I think -dev snapshots were just updated too.

paskainos’s picture

Just confirming, I too received the error message: The version of TinyMCE could not be detected. Running:
Drupal 6.19
WYSIWYG 6.x-2.1
TinyMCE 3.3.9.1

[for 'semi-active' users] Installing the WYSIWYG dev version fixed it: 6.x-2.x-dev (2010-Sep-25). Noted here too: #695398: Support for TinyMCE 3.3.

AgaPe’s picture

#16 worked for me

opf1981’s picture

thanks, change to 200 worked for me at http://joomlatalk.com :)

flycatcher’s picture

#16 worked for me. I tweaked it further and found changing it to 110 works as well.

fadiwissa’s picture

TinyMCE 3.3.9.2 required that I change the value to "200"...
Thanks for the hint.

twod’s picture

Guys, like I said in #17, the fix for this has been in the -dev snapshots for a while now. No need to comment here. ;)

hansfn’s picture

Maybe make a new minor release then since this is a show-stopper bug ...

twod’s picture

Yes, we will, soon. But this is not a show stopper IMHO. Just switch to an earlier version of the editor, or the -dev version of Wysiwyg if you really need the latest version of the editor.

Or if you don't like runnin a non-stable version of Wysiwyg (though -dev is probably a lot more stable than 2.1), apply the patch manually, it's a simple change which takes minimum effort.

nachiket-1’s picture

I just wanted to confirm that I also had to change the value from "100" to "200" and the editor is now being recognized in the wsiwyg module.

It works for me... thanx for he help..

bren_c’s picture

Status: Closed (duplicate) » Active

Thanks .. changed file in sites/all/modules/wysiwyg/editors/tinymce.inc to 200 worked fine after hours of trying to follow the tinymce instructions.

sun’s picture

Status: Active » Closed (duplicate)
joshua.stout’s picture

I just had to change this from 100 to 200 also. Looks like they're moving the version information further and further down with each new release of TinyMCE. I just installed 3.3.9.2.

fyrebear’s picture

@#16, wanted to confirm setting it from 100 to 200 worked for me as well. Thanks for this fix!
$line = fgets($script, 200);

tinymce 3.3.9.2

nomis’s picture