Hi
With the both 5.x.1 and 5.x.2 firebug show me same error on wysiwyg.js (ligne 78 )
Drupal.wysiwyg.instances is undefined
[Break on this error] Drupal.wysiwyg.instances[params.field] = {};
Drupal.wysiwygAttach = function(context, params) {
if (typeof Drupal.wysiwyg.editor.attach[params.editor] == 'function') {
// (Re-)initialize field instance.
Drupal.wysiwyg.instances[params.field] = {};
// Provide all input format parameters to editor instance.
jQuery.extend(Drupal.wysiwyg.instances[params.field], params);
// Provide editor callbacks for plugins, if available.
if (typeof Drupal.wysiwyg.editor.instance[params.editor] == 'object') {
jQuery.extend(Drupal.wysiwyg.instances[params.field], Drupal.wysiwyg.editor.instance[params.editor]);
}
// Store this field id, so (external) plugins can use it.
// @todo Wrong point in time. Probably can only supported by editors which
// support a onFocus() or similar event.
Drupal.wysiwyg.activeId = params.field;
// Attach or update toggle link.
Drupal.wysiwygAttachToggleLink(context, params);
// Attach editor, if enabled by default or last state was enabled.
if (params.status) {
Drupal.wysiwyg.editor.attach[params.editor](context, params, (Drupal.settings.wysiwyg.configs[params.editor] ? Drupal.wysiwyg.clone(Drupal.settings.wysiwyg.configs[params.editor][params.format]) : {}));
}
// Otherwise, attach default behaviors.
else {
Drupal.wysiwyg.editor.attach.none(context, params);
Drupal.wysiwyg.instances[params.field].editor = 'none';
}
}
};
Comments
Comment #1
sunSorry, I cannot replicate this issue.
This can only mean that wysiwyg.init.js is not loaded on the page, or, not loaded first (which might happen if you are customizing your JavaScript through other modules or directly in template.php).
Comment #2
sunSorry, without further information this issue can only be marked as won't fix. Feel free to re-open this issue if you want to provide further information.
Comment #3
jason ruyle commentedI'm getting this same problem:
Drupal 6-stable
WYSIWYG: 6.x-2.0-alpha1
IMCE Wysiwyg API bridge: 6.x-1.0
IMCE: 6.x-1.2
To re-create I have my body field set to filter input type, to I go and change it to HTML EDITOR. When I change, I get the above error in firebug.
Comment #4
jason ruyle commentedWell found issue and I'm sure someone else has posted this, but make sure you checkoff the IMCE under your Buttons/Plugins.
Comment #5
mstef commentedThis is happening without the editor even being displayed on the page. Internet Explorer throws a popup JS error on every page load. Firebug reports the same error. Just upgraded to the latest version - problem still exists. (using tinymce alone)
Comment #6
mstef commentedcache needed to be cleared after upgrading to the newest release - i believe. no problems..
Comment #7
mstef commentedWrong - both versions are throwing this error. (6.1 & 6.2)
Comment #8
sunIf Wysiwyg API does not work as expected, please
1) Remove all buttons/plugins from your Wysiwyg profile except bold+italic buttons
2) Test whether the editor appears
3) If not, temporarily disable (all) other contrib modules
4) Test again
5) If the editor appears, re-enable other contrib modules step-by-step to see who's guilty.
Comment #9
mstef commentedhas nothing to do with the editor appearing or not.
Comment #10
mstef commentedI don't know if this is related to other people getting this error but I found out what was causing mine. I was including the JS files in the Popups API. Removing it got rid of the errors. So this is fixed for me.
Comment #11
sunBetter title.
Comment #12
sun@mikestefff: Can you elaborate a bit more on your last follow-up? I don't understand what you changed to fix this issue.
Comment #13
mstef commentedWell I didn't create this issue so what I did to resolve it most likely has nothing to do with the initial post (also why changing the title might not be a good idea). I was using the popups api on every single page. One of my links included the wysiwyg js files because I was trying to load the editor inside a popup for popup node creation (ended up removing it because it wouldn't work). So because of this link, the wysiwyg files were being loaded, and I can only assume the errors were thrown because until you initialize the popup, the editor wasn't being shown.
Comment #14
sunWell, the original poster never came back to this issue.
Sorry, without further information this issue can only be marked as won't fix.
Feel free to re-open this issue if you want to provide further information. Thanks.
Comment #15
hintbw commentedI'm getting the same error with 6.0-2.x version of Wysiwyg.
I cannot get either FCKeditor or TinyMCE to load for any textarea fields. The error message is the same as the one originally reported for this issue. Here is the output from Firefox's error console (though I've tried this with multiple browsers, different themes - including Garland, and I've also tried disabling most of my modules that might be causing any javascript trouble.)
Error: Drupal.wysiwyg.editor.instance is undefined
Source File: http://www.aztea.org/sites/all/modules/wysiwyg/wysiwyg.js?P
Line: 92
Error: Drupal.wysiwyg.editor.instance is undefined
Source File: http://www.aztea.org/sites/all/modules/wysiwyg/editors/js/none.js?P
Line: 50
Error: Drupal.wysiwyg.editor.instance is undefined
Source File: http://www.aztea.org/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6....
Line: 150
Those are the three errors that appear and the error is basically the same when a TinyMCE profile is enabled for that input field.
Comment #16
sleary commentedI'm getting the exact same trio of errors as well with with 6.0-2.x. I'm also using Garland, and have tried disabling other modules. I have FCKeditor set for one input type and TinyMCE for another; I can't get either one to show up.
Comment #17
sleary commentedChanging title, because hintbw and I don't have Popups API installed but are still getting the errors. Any suggestions appreciated.
Comment #18
sunThis most probably means that wysiwyg.init.js is not loaded at all on your sites. That's basically impossible - unless a third-party module hi-jacks the JavaScripts on all pages. If you would compile a list of JavaScript-related modules you have installed on your site, we might find the one that's guilty.
Please make sure you read the FAQ for Wysiwyg module (also linked from the project page).
If Wysiwyg API does not work as expected, please test whether it works
- after clearing/flushing Drupal's cache AND your browser's cache
- by temporarily switching to Drupal core's default Garland theme.
- after removing all wysiwyg profiles, create a new one, and in that profile, remove all plugins/buttons except bold + italic.
- by using the latest development snapshot.
- after disabling (all) other contrib modules (and if it does, re-enable them step-by-step to see who's guilty).
- in a different browser.
In case none of those steps make it work, then we need much more information in this issue. The editor and editor version in question, your browser and browser version, the web server software (Apache/IIS). Hence, setting proper status.
In any case, please report back about the status of this issue. Thanks.
Comment #19
hintbw commentedHere is how I fixed the issue I had reported here. I disabled the Wysiwyg 2.0 module in the modules list. I then clicked on uninstall and checked the box to uninstall the wysiwyg module.
After uninstalling the wysiwyg module, via FTP I deleted the module completely from the server. I then downloaded the July 19th development release of Wysiwyg 2.x and uploaded that version of the module to the server and enabled the module. I then went to the Wysiwyg configuration screen and setup a basic profile for TinyMCE (including nothing more than the bold and italic modules). I then went to create content and it worked.
I subsequently went back and added additional buttons and plugins to my editor and it has continued to work. The editor continues to appear and work just fine.
NOTE: I already had the tinymce and fckeditor libraries installed at sites/all/libraries. When I uninstalled the Wysiwyg module I didn't do anything to them. The new Wysiwyg module I uploaded just picked those editor libraries up automatically since they were in the right location. (I am running TinyMCE 3.2.5)
Comment #20
sunStrange, we've seen a lot of such installation issues recently (which cannot be solved by this module). Could you add this to the FAQ, if possible?
Comment #22
Anonymous (not verified) commentedThis seems to be a Popups API issue - please replace
success: function(script) {
eval(script);
}
with
success: function(script) {
window.setTimeout(window.eval, 200, script);
}
in popups.js
Comment #23
twodPlease create a new issue about that in Popups API's issue queue (and perhaps reference this one).
This issue is a bit old and any problems here which could have been caused by Wysiwyg seem resolved.
Comment #24
scai commentedit helped for me to rename file /sites/all/modules/wysiwyg/wysiwyg.init.js to /sites/all/modules/wysiwyg/wysiwyg_init.js and change line 368 in file /sites/all/modules/wysiwyg/wysiwyg.module
to
drupal_add_js($path . '/wysiwyg_init.js', array('group' => JS_LIBRARY));
Comment #25
twod@scai. Please create a new issue if you're experiencing problems with the filename. Also make sure all caches were cleared.
The only reason I can come up with for a rename to fix things is if a broken version of wysiwyg.init.js was cached or left out of the aggregated file when JavaScript optimization/aggregation was turned on.
Comment #26
scai commentedno, JavaScript optimization/aggregation was turned off and caches were cleared few times, also I turned off and on module Wysiwyg and ran cron, but I could not solve this problem for a few days. Firebug show that Drupal.wysiwyg is undefined and file /sites/all/modules/wysiwyg/wysiwyg.init.js could not be load (404 error). I don't know why but after renaming problem dissapeared
Comment #27
Yunus260 commentedI just want to thank scai for post #24 because it helped me to remove the error message in Firebug that wysiwyg.init is not loaded or something like that.