TinyMCE 3.3b1 was released today. The changest most relevant to us include the removal of the 'safari' plugin and the addition of the 'advlist' extension. (The advlist extension lets you change the list style to things like 'circle', 'square' etc. At first glance it doesn't seem to be working for unordered lists, but that's just because Garland's styles override the <ul style="...."> set by the editor using more targeted styles for each <li>.)

Wysiwyg module does not recognize the new version because the minor version string is now partially outside the 80 char wide chunk ready by the version callback. Extending it to 100 chars works fine.

I also noted problems when loading the advlist extension after turning on script aggregation (I had changed the implementation to include tiny_mce.js for testing). It boiled down to the editorBasePath setting being an array instead of the expected string, the path to all other loaded editors were then merged into a single string!
Because of that, this patch also includes a fix for the todo in wysiwyg.module about moving the global editor parameters somewhere else. I simply put them right below Drupal.settings.wysiwyg.configs.editorName and it seems to work just fine after changing the TinyMCE implementation's init() method to look for the path there (no other implementation uses those variables yet).

Aggregating tiny_mce.js from 3.3 does not throw any errors that I can see in FF, but since versions 3.2.x can't be aggregated (even with the editroBasePath fix) I put a new version key in wysiwyg_tinymce_editor() to only turn on aggregation (or rather leave it enabled) for 3.3 and above.

I could only create a patch against 6.x-2.x-dev now due to problems reaching drupal.org, had to go via a proxy...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webavant’s picture

Works fine! Nice work.

pouvoir’s picture

install sucess,but button not display.
why?(All buttons already choice)

TwoD’s picture

@pouvoir, I do not see any toolbar problems. Are you getting any JavaScript errors? Have you tried deleting the editor profile and creating a new one for TinyMCE?

landry’s picture

FileSize
4.25 KB

And here's a backported diff against wysiwyg 6.x-2.0, correctly detects tinymce here, didn't make more tests yet.

pouvoir’s picture

When the wysiwyg enabled, the problem happen:
warning: Parameter 1 to theme_wysiwyg_profile_overview() expected to be a reference, value given in D:\Program\xampp\htdocs\drupal\includes\theme.inc on line 617.

pouvoir’s picture

I tried to remove '&' in function in wysiwyg\wysiwyg.admin.inc like
function theme_wysiwyg_profile_overview(&$form) {
the problem fixed, but tinymce doesn't work.

TwoD’s picture

@pouvoir, the theme_wysiwyg_profile_overview problem is unrelated. It happens on the admin page when using PHP 5.3, using the editor should still work. It was fixed in 2.x-dev. See #613480: PHP 5.3 Support.

Was TinyMCE working before you applied the patch? Which version of Wysiwyg are you using? The patch is made for 6.x-2.x-dev, if you are using 6.x-2.0 you need the patch from landry.
Which browser are you using?
Do you see any JavaScript errors?
Have you tried with the Garland theme?

sgabe’s picture

Patch in #4 works fine for me, thanks!

pouvoir’s picture

browser: firefox3.6
theme: Garland
I don't see any Javascript errors.
when I change to 6.x-2.x-dev, it works fine. so strange!
Thanks a lot!!

Cyberwolf’s picture

Subscribing.

deggertsen’s picture

subscribe

OFF’s picture

Subscribe

Sivaji_Ganesh_Jojodae’s picture

Subscribing i have the same problem here using TinyMCE 3.2.7 instead of 3.3b.

John Carbone’s picture

Subscribing.

Aart’s picture

Subscribing.

No problems in IE8, just in Firefox (3.5.7).

TwoD’s picture

@Aart, what are the problems in Firefox?

Aart’s picture

Feeling a bit stupid: apparently all I had to do was delete the profile and create it again, like you suggested to Pouvoir. Now the toolbar is showing just fine in FF. Thanks!

sun’s picture

+++ wysiwyg.module	26 Jan 2010 02:28:08 -0000
@@ -284,12 +284,12 @@ function wysiwyg_load_editor($profile) {
       drupal_add_js(array('wysiwyg' => array(
-        'configs' => array($editor['name'] => array()),
-        // @todo Move into (global) editor settings.
+        'configs' => array($editor['name'] => array(
         // If JS compression is enabled, at least TinyMCE is unable to determine
         // its own base path and exec mode since it can't find the script name.
         'editorBasePath' => base_path() . $editor['library path'],
         'execMode' => $library,
+        )),
       )), 'setting');

I'm basically ok with this change, but

1) the indentation is wrong

2) aren't the .init/.attach methods expecting the subkeys to be configurations for formats?

+++ editors/tinymce.inc	26 Jan 2010 02:28:08 -0000
@@ -82,8 +100,8 @@ function wysiwyg_tinymce_editor() {
-  // Version is contained in the first 80 chars.
...
+  // Version is contained in the first 80 chars before 3.3, then 100 chars.

Just change the number in the comment, please.

+++ editors/tinymce.inc	26 Jan 2010 02:28:08 -0000
@@ -574,6 +592,16 @@ function wysiwyg_tinymce_plugins($editor
+  if (version_compare($editor['installed version'], '3.3', '>=')) {
+    unset($plugins['safari']);

The Safari compatibility plugin should be moved into a dedicated condition that only adds it for the actual certain version range.

+++ editors/tinymce.inc	26 Jan 2010 02:28:08 -0000
@@ -574,6 +592,16 @@ function wysiwyg_tinymce_plugins($editor
+      'extensions' => array('advlist' => t('Advanced lists')),

The title should be singular, I think.

Powered by Dreditor.

sun’s picture

Status: Needs review » Needs work
AdrianB’s picture

Subscribing

Edit:

I've noticed that on the TinyMCE download page (that Wysiwyg links to), 3.3 is the only available download.

That means users who are new to Wysiwyg may be confused right now if 3.2.x is the only working option with the recommended release of Wysiwyg.

TwoD’s picture

Status: Needs work » Needs review
FileSize
5.75 KB

(Argh! I wrote this yesterday but just noticed I never submitted it, thankfully it was cached by the browser hehe)

1) I noticed that just after uploading the file, wanted to hear your opinion on the other changes before uploading a new one just for that.

2) Yes, at least the init method for TinyMCE does. It failed silently so I didn't notice it. As a workaround I wrapped the global settings in a special 'global' format and made the TinyMCE implementations skip it. (The TinyMCE 2.x implementation is broken for other reasons as well, just keeping them somewhat synced to.)
The CKEditor implementation is the only one which also uses the init method, but it already filters out any format keys for which don't also exist in the list of Drupal plugins, so no need for changes there (other than maybe just to indicate that the new 'global' format isn't a real one.
It''s not an optimal solution, but it makes sense to find all the editor settings below configs->editorName, global and format-specific. Another solution is to do the opposite and wrap the formatN keys in a 'formats' collection. But that would require a lot more changes and make the most commonly used settings go even deeper into the hierarchy.

3) Ok.

4) I just added a "if below 3.3" check around the safari plugin as it's already with another plugin in the "if above 3.0" check, if that's ok.

5) The full name in the plugin source is in plural. Left it as is, but I wouldn't mind if it was changed before commit.

sun’s picture

+++ editors/tinymce.inc	9 Feb 2010 02:03:10 -0000
@@ -65,6 +65,24 @@ function wysiwyg_tinymce_editor() {
+      '3.3' => array(
...
+        'libraries' => array(
+          '' => array(
+            'title' => 'Minified',
+            'files' => array('tiny_mce.js'),
+          ),

Since we are close to a new stable release, I'd prefer to add a @todo to the current 3.1 definition, stating that starting from 3.3, tiny_mce.js "may" work with enabled JS aggregation. ;)

+++ editors/tinymce.inc	9 Feb 2010 02:03:10 -0000
@@ -566,10 +584,21 @@ function wysiwyg_tinymce_plugins($editor
+      'extensions' => array('advlist' => t('Advanced lists')),

Singular would make more sense, because "Advanced image" and "Advanced link" are singular, too.

+++ editors/js/tinymce-3.js	9 Feb 2010 02:03:12 -0000
@@ -17,13 +17,15 @@ Drupal.wysiwyg.editor.init.tinymce = fun
-  // @todo Move global library settings somewhere else.
...
+    if (format == 'global') {
+      continue;
+    };

For now, I'd leave this @todo intact.

For 3.x, I think we already discussed several inheritance options...

1. Global settings
2. Format/profile settings
3. Profile/field settings (we possibly want to allow multiple profiles per format at some point)

I think we can go with this patch. One of my next best ideas (for 3.x) would be, whether something like

$.extend({}, Drupal.settings.wysiwyg.global.tinymce, settings);

or similar would work - so that we'd have a single settings variable containing everything - possibly requires a bit refactoring in a couple of places.

Powered by Dreditor.

jefffffffrey91’s picture

Completely noob here. I, too, am getting the "The version of TinyMCE could not be detected." error.

How and where do I apply this patch? Thanks.

TwoD’s picture

FileSize
5.52 KB

Updated to match sun's review.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! 2 nitpicks that can hopefully be adjusted prior commit:

+++ wysiwyg.module	10 Feb 2010 16:40:10 -0000
@@ -292,12 +292,12 @@ function wysiwyg_load_editor($profile) {
+          // If JS compression is enabled, at least TinyMCE is unable to determine
+          // its own base path and exec mode since it can't find the script name.

Slightly exceeds 80 chars - we can shorten + generalize this comment now.

+++ editors/tinymce.inc	10 Feb 2010 16:40:10 -0000
@@ -45,6 +45,7 @@ function wysiwyg_tinymce_editor() {
+      // @todo Starting from 3.3, tiny_mce.js may support JS aggregation.  

Trailing white-space here.

Powered by Dreditor.

TwoD’s picture

Status: Reviewed & tested by the community » Fixed
FileSize
7.14 KB

Committed to all branches.
Thank you for reporting, testing and reviewing! Support for TinyMCE 3.3 will be in all -dev snapshots within a few hours.

Slight modifications had to be done for DRUPAL-6--3 and HEAD as the settings had been moved higher up in the settings hierarchy there.
I also synced a bit with the TinyMCE 2.x implementations on all branches since the changes in wysiwyg.module affects it as well. It's still broken for other reasons tho, just trying to not add more of them.

Attaching the HEAD patch for reference.

EDIT: I just noticed sun meant the comment in wysiwyg.module, I only changed the corresponding one in the tinymce files. *sigh* Oh well, we have other long comments in there so I suggest we do a cleanup run soon to catch them all in one go.

bron’s picture

The heck. Do I need to apply for CVS account to patch it? I no nothing about patching. I got as far as to installing svntortoise on my Win7. I have this wysiwyg issue. Help!

TwoD’s picture

@bron, no, all you need is an up to date -dev snapshot (assuming the patch still applies to that code) and a program capable of understanding patch/diff files. TortoiseSVN will do fine, see http://drupal.org/patch/apply.

However, this patch is already committed to CVS and is thus already part of the automatically generated -dev snapshots.

bron’s picture

Still, a problem there I guess. I installed the dev snapshot and I discovered that now when I input with tinyMCE I get info that I have to provide text for that field - It doesnt happen when I disable the rich text editor.

TwoD’s picture

Sounds like what you typed in the editor doesn't get transferred to the original textarea before the form is submitted. If you have an "AJAXifying" module installed, please try disabling it as there might be compatibility problems.
If the editor is detected as being installed, which seems to be the case, please open a new issue about your problem (if you can't find an existing one of course).

joachim’s picture

Please could this be released?
It's a critical bug that breaks a popular editor completely. Three weeks with this fix still unreleased is too long.

sun’s picture

Let's discuss over in #652410: Wysiwyg 2.1

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Cl1mh4224rd’s picture

@TwoD wrote:
> "However, this patch is already committed to CVS and is thus already part of the automatically generated -dev snapshots."

Is this still true? I've downloaded the development release (6.x-2.x-dev, released 2010-Sep-10), have TinyMCE 3.3.9.1, and still get "The version of TinyMCE could not be detected."

[EDIT: Actually, the issue is that that version number for TinyMCE has been pushed out further since this patch. "Searching" the first 100 characters doesn't cut it anymore, since the minor version extends out to column 113 in TinyMCE 3.3.9.1.]

Drupal 6.19
Wysiwyg 2.1
TinyMCE 3.3.9.1

mcpuddin’s picture

Status: Closed (fixed) » Needs work
FileSize
554 bytes

Cl1mh4224rd is absolutely right. I've expanded this to an arbitrary 10 characters with this new patch.

TwoD’s picture

Status: Needs work » Fixed

Thanks for the patch mcpuddin. For safety, I increased the limit to 200 characters.

Committed this to all branches!
Gave you guys and RichieB from #754712-43: Tinymce does not appear with WYSIWYG the credit for finding and fixing this.

This fix will soon be in the -dev snapshots as well.

sun’s picture

oh YAYAYAYAYAYAY! TwoD has found that commit button again! Thank you! =)

TwoD’s picture

Yeah, finally got my dev environment sorted out. Turns it out the commit button has a rapid-fire mode too. =P

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: #695918: Getting version error when trying to install TinyMCE.

rbrownell’s picture

+Subscribe

TwoD’s picture

@nfd: No need to subscribe. This issue is fixed and will most likely not get any more attention and will as such be automatically closed in two weeks - unless someone postpones that by commenting ;).
The -dev snapshots are now able to detect the latest TinyMCE version.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jfine’s picture

I really appreciate the work guys but I too just ran into "The version of TinyMCE could not be detected." only to find out it's been fixed ages ago. How is it that the last release was 2010-Mar-08? I know it's fixed in dev but most people do not run dev. Why not bump the release at least once a month for these fixes that are already in place?

joachim’s picture

Any chance of a release with this code?

The current release is effectively broken, as the UI directs you to the TinyMCE download where you find 3.3.

TwoD’s picture

Yes, we'll make a release soon. We've been busy with other things and also waiting to see what effects other changes in -dev have had.
If you can't wait for a new release, run -dev or patch manually, then please try a previous stable version of the editor. They can be downloaded from the official TinyMCE site just like the latest version.

The changes in TinyMCE have been small since version detection broke (I believe the last recognized version is 3.3.9, and it's now at 3.3.2).

joachim’s picture

Can't wait till we have git and can have hotfix branches! :)

msielski’s picture

Can compatibility with editor libraries be listed in the "Supported editors/plugins" section of the WYSIWYG module's home page?

Would save some pain and suffering, especially because the admin/settings/wysiwyg page directs users to download, in TinyMCE's case, version 3.3.2.9 and apparently without the patch in this issue nothing earlier than 3.3 will work.

Also, bump.

TwoD’s picture

The download link always points to the "main" download page for a library, which usually holds the latest version with older versions nearby. The FAQ asks users to follow a few steps when encountering the error message about being unable to detect the installed version.

I've been thinking of including a "last known compatible version"-column with the installation instructions on admin/settings/wysiwyg, but I need to discuss that more with Sun. This issue just deals with TinyMCE and to not branch it off more, we'll handle that elsewhere.

For TinyMCE, the version last known to be recognized without the patch is 3.3.9. Version 3.3.9.2 only has minor bug fixes so it's still compatible, the "area" in which Wysiwyg searches for TinyMCE's version string just needs to be increased, which was done using a patch similar to #36 (we increased the string length to 200 characters).

mrP’s picture

Version: 6.x-2.x-dev » 6.x-2.2

many thanks. works beautifully with 3.3.9.3!