Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
HI,
I am trying to setup IMCE, but no luck so far. I see an error in the Javascript console of Safari 3 which says there is an undefined value error in line 7 of imce_set_tinymce.js
Does not work in Firefox either...
Not sure what to do.
Thanks,
Eric
Comment | File | Size | Author |
---|---|---|---|
#17 | imce_set_tinymce.js_.txt | 1.25 KB | abhijit-1 |
#9 | imce_v3_fix.patch | 1.74 KB | ChrisKennedy |
Comments
Comment #1
aitala CreditAttribution: aitala commentedAs an addition.. here is the JS line at the end of the page before the body end tag
Also, I am using it with tinyMCE 3.0b2 and the 5.x-1.9 Drupal module
Comment #2
flajsg CreditAttribution: flajsg commentedSame here!
I'm using IMCE module with tinyMCE (all latest versions) and can't get image browse icon in imce image browser.
The problem is in file modules/imce/imce_set_tinymce.js
...somehow tinyMCE object doesn't have configs properties:
thanks for any help,
Gregor.
Comment #3
markstos CreditAttribution: markstos commentedI also ran into this with TinyMCE 3. I tried TinyMCE 2, but it reported different errors.
Comment #4
jwurster CreditAttribution: jwurster commentedI also have the same error after installing IMCE and TinyMCE. I hope someone can find a solution.
Comment #5
aitala CreditAttribution: aitala commentedJust to let folks know, at some point I have successfully gotten IMCE and TinyMCE to work together, I just don't remember offhand which version of each I used.. Been moving to a newer server, so I have not gotten back to it.
Eric
Comment #6
jorre CreditAttribution: jorre commentedwell, same error here... still no solution for this?
it's too bad that this functionality is just plain standard in wordpress... and in drupal it's been a hell...
seems like it's the same errors I got years ago with drupal
Comment #7
aitala CreditAttribution: aitala commentedJust to let folks know, I am currently using Drupal 5.7, the FCKEditor 5.x-2.0-beta Drupal module, the IMCE 5.x-1.x-dev Drupal module, with FCKEditor Version 2.5.1 successfully.
It also worked with TinyMCE but I kinds like FCK better.
Eric
Comment #8
ChrisKennedy CreditAttribution: ChrisKennedy commentedI think this may be due to an updated version of TinyMCE (v3) - I changed it from tinyMCE.configs to tinyMCE.settings and the error goes away. I'm not sure if this is the correct solution though.
Comment #9
ChrisKennedy CreditAttribution: ChrisKennedy commentedOk here is a proper patch to get IMCE working again under TinyMCE 3.0.
Comment #10
ChrisKennedy CreditAttribution: ChrisKennedy commentedComment #11
ledelboy CreditAttribution: ledelboy commentedThe patch didn't work for me, but I found a quick solution. What I did successfully was downgrading TinyMCE from 3.0 to 2.1.3 That version was working like a charm in an identical installation (5.7), and as soon as I did the change it began working fine.
Comment #12
csc4 CreditAttribution: csc4 commentedThere seem to be two very similar patches - this one and the one at http://drupal.org/node/178855#comment-701873
They're so similar it I don't know which one is 'right' - especially as reviewers in this thread seem think this version doesn't solve the problem.
I don't know which to apply! (or even if the right answer should be a combination of the two?)
Comment #13
ChrisKennedy CreditAttribution: ChrisKennedy commentedMy version is the correct way to fix the problem, and should work - if it doesn't let me know. Make sure you do a hard refresh or clear your cache after you apply it so that your browser doesn't use the old version.
The version in the other thread is not a clean way to fix the bug and will cause issues when you either upgrade TinyMCE or disable IMCE at some point in the future.
Comment #14
wimvanloon CreditAttribution: wimvanloon commentedChange the line in the patch:
if (version >= 3) {
to:
if (parseInt(version) >= 3) {
and it should work with tinyMCE 3.0
Comment #15
chuseq CreditAttribution: chuseq commentedGot it to work with Chris' patch but with this modification:
That is without the $.each. Honestly I don't know if the $.each is necessary, but it worked, now I can see the browse button.
I have drupal-5.7 and latest tinymce and imce.
Thanks.
Comment #16
fidoboy CreditAttribution: fidoboy commentedIt doesn't work for me, i've tried Chris patch, then applied Chuseq modifications, but it doesn't show the browse button, I've also another problem, i need 'insert image' dialog more width, how can i modify it?
regards,
Comment #17
abhijit-1 CreditAttribution: abhijit-1 commentedFirst, the patch file is a diff file. It's not a file that can be dropped into a folder.
Second, the patched code has an error -
The line
if (version >= 3) {
should actually be
if (version >= "3") {
This is so that when the version is something like "3.0.1" the comparison still succeeds.
I'm copying the entire correct code below.
Go to your /module/imce directory and open the file named "imce_set_tinymce.js"
Just copy and paste the code below into that file and save it. Everything should be fine now.
// Code begins
// $Id: imce_set_tinymce.js,v 1.1.2.4 2007/05/15 14:29:56 ufku Exp $
if (Drupal.jsEnabled) {
$(window).load(imceInitiateTinyMCE);
}
function imceInitiateTinyMCE() {
if ("undefined" != typeof(window.tinyMCE)) {
var version = tinymce.majorVersion +"."+ tinymce.minorVersion;
if (version >= "3") {
$.each(tinyMCE.editors, function() {
this.settings.file_browser_callback = "imceImageBrowser";
});
}
else {
for (var i=0; i tinyMCE.configs[i]['file_browser_callback'] = "imceImageBrowser";
}
}
if (version < 2.1) {
setTimeout('for (var i in tinyMCE.instances) {var fE = tinyMCE.instances[i]["formElement"]; if (fE["tagName"]=="DIV") tinyMCE.instances[i]["formElement"] = fE.firstChild;}', 3000);
}
}
}
var imceTinyWin, imceTinyField, imceTinyType, imceTinyURL;
function imceImageBrowser(field_name, url, type, win) {
//if (type!='image') return;//work for only images
var width = 640;
var height = 480;
var imcePopup = window.open(imceBrowserURL, '', 'width='+ width +', height='+ height +', resizable=1');
imcePopup.focus();
imceTinyWin = win;
imceTinyField = win.document.forms[0].elements[field_name];
imceTinyType = type;
imceTinyURL = url;
}
// Code ends
I'm also attaching the modified file with this post which you can drop into your modules/imce folder and overwrite the one currently there
Comment #18
abhijit-1 CreditAttribution: abhijit-1 commentedFirst, the patch file is a diff file. It's not a file that can be dropped into a folder.
Second, the patched code has an error -
The line
if (version >= 3) {
should actually be
if (version >= "3") {
This is so that when the version is something like "3.0.1" the comparison still succeeds.
I'm copying the entire correct code below.
Go to your /module/imce directory and open the file named "imce_set_tinymce.js"
Just copy and paste the code below into that file and save it. Everything should be fine now.
// Code begins
// $Id: imce_set_tinymce.js,v 1.1.2.4 2007/05/15 14:29:56 ufku Exp $
if (Drupal.jsEnabled) {
$(window).load(imceInitiateTinyMCE);
}
function imceInitiateTinyMCE() {
if ("undefined" != typeof(window.tinyMCE)) {
var version = tinymce.majorVersion +"."+ tinymce.minorVersion;
if (version >= "3") {
$.each(tinyMCE.editors, function() {
this.settings.file_browser_callback = "imceImageBrowser";
});
}
else {
for (var i=0; i tinyMCE.configs[i]['file_browser_callback'] = "imceImageBrowser";
}
}
if (version < 2.1) {
setTimeout('for (var i in tinyMCE.instances) {var fE = tinyMCE.instances[i]["formElement"]; if (fE["tagName"]=="DIV") tinyMCE.instances[i]["formElement"] = fE.firstChild;}', 3000);
}
}
}
var imceTinyWin, imceTinyField, imceTinyType, imceTinyURL;
function imceImageBrowser(field_name, url, type, win) {
//if (type!='image') return;//work for only images
var width = 640;
var height = 480;
var imcePopup = window.open(imceBrowserURL, '', 'width='+ width +', height='+ height +', resizable=1');
imcePopup.focus();
imceTinyWin = win;
imceTinyField = win.document.forms[0].elements[field_name];
imceTinyType = type;
imceTinyURL = url;
}
// Code ends
Comment #19
lordlex CreditAttribution: lordlex commentedHi,
I get this error even with the code in #18...
uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://www.XXXX.com/dev/sites/all/modules/imce/imce_set_inline.js :: imceInsertAtCursor :: line 32" data: no]
The button do to apear in tinyMCE image insert dialog.
I have Drupal 5.7, tinymce-5.x-1.9 with TinyMCE 3.0.3
LATER EDIT: i get this error only when tinymce is active... when it is not active it insert the links to the images...
Comment #20
lordlex CreditAttribution: lordlex commentedAfter patch http://drupal.org/node/178855#comment-701873 i button apear but when i press it i have this on firebug and no window open:
f has no properties
[Break on this error] return f.apply(s || t, Array.prototype.slice.call(arguments, 1));
this is in file tiny_mce.js (i renamed tiny_mce_src.js to see the line - 6701)
Comment #21
patogalla CreditAttribution: patogalla commentedI have the same problem as #20, i tried changing the way the settings are set, but nothing happens, and the same error is showing up. If someone could give me a hand or orientation of what the problem could be i'd be grateful!
Thnaks a lot anyway for this thread, i found it very useful
Details of the bug:
f has no properties
[Break on this error] eval.call(w, co);
Comment #22
edg CreditAttribution: edg commentedI first installed abhijit #17 and then Chris's patch #9 but still getting the same error.
The problem I'm experiencing with TinyMCE v3 seems to be different from some of the above posters who can't see the browse button. I can browse for images, but when I click to "add" them to the text field the preview window goes blank and the image is not inserted. If I insert the img path in the dialogue box within TinyMCE itself then it automatically sets the width and height as per normal, but when I close the image dialogue box and then submit the Story, the width, height and alignment settings are lost and the page design looks bad.
I'm using 5.7 and latest version of IMCE and latest Drupal TinyMCE module (with TinyMCE v 3). It seems like more than one problem, but maybe others are experiencing similar issues?
Comment #23
ufku CreditAttribution: ufku commentedthanks for the patches. the fix is included in 5.x-1.1 version. [#239296]
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #25
mjourney2 CreditAttribution: mjourney2 commentedIt appears that the same issue exists in the 6x version. But there is no file imce_set_inline.js, unless I'm missing it somehow?
Thanks