Cant get url image in fckeditor

poehnix - April 1, 2008 - 13:03
Project:IMCE
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

as reported also here http://drupal.org/node/238415 my imce works fine but after selecting an image on the list and clicking on Send it to FCKEditor the IMCE window closes but no string is sent to fckeditor dialog. This happens both in FF and IE6. I don't get any js error....

Anyone else noticed this?

the only "strange" setting I have is the domain not in the default position but like this

sites/domainname/modules/imce

while fckeditor is in

sites/all/modules

and I still get "connector is disabled" even if I have set the $cookiedomain variable in both settings.php ( but this shouldn't matter anyway)

any suggestion of what's going wrong?

thanks

poehnix

#1

poehnix - April 14, 2008 - 13:22

After further investigation with firebug seems that the problem lies in "appFinish" function in imce_set_app.js

the "File" object contains the url wanted (except for a slash at the beginning of the string) while the appFields object is empty so code

for (var i in appFields) {   
    doc.find('#'+ appFields[i]).val(file[i]);       
  }
  if (appFields['url']) {
    try{doc.find('#'+ appFields['url']).blur().change().focus()}catch(e){};
  }

doesn't transfer the url.

Anyone help ( or at least suggest a way to access the id=txtUrl iunput field in the parent document so I can add a code row to copy the url value?)
has anyone else noticed this issue?
thanks
poehnix

#2

poehnix - April 14, 2008 - 13:52

so to make it work with fckeditor I changed the above code in

var tmpObj=doc.find('#txtUrl')[0];
  tmpObj.value=file.url;
  tmpObjAlt=doc.find('#txtAlt')[0]; 
  win.opener.focus();
  tmpObj.focus();
  tmpObj.blur();
  tmpObjAlt.focus();

but I would like to hear a word from some people more used than me to tweak imce/jquery on how to solve this issue without hacking imce code

thanks
poehnix

#3

ufku - April 14, 2008 - 14:44

appFields is constructed by processing location.href. It should end like ...app=FCKEditor|url@txtURL|...
What is the value of location.href in the script?

#4

poehnix - April 14, 2008 - 15:35

the url isn't immediately visible (imce window doesn't have a location bar when called from fckeditor), but using Firefox 3 I found that
location.href is:

http://mysite.com/imce?app=FCKEditor|url%40txtUrl|width%40txtWidth|height%40txtHeight

the only strange stuff is the fact that @ comes encoded. Might this be the problem ( the location parsing fails?)
if so it's due to my server (php) configuration or what else?

thanks for your reply

poehnix

#5

ufku - April 14, 2008 - 19:03

That's it. @ comes encoded. I think it is about the server. My server does not encode @s.
Then, IMCE should decode the whole string.

  ...
  var data = decodeURIComponent(location.href.substr(location.href.lastIndexOf('app=')+4)).split('|');
  var appname = data.shift();
  ...

I'll commit this soon.
Thanks for debugging.

#6

poehnix - April 15, 2008 - 07:33

Thanks to you for your effort and this wonderful module.

poehnix

#7

sykic - May 17, 2008 - 11:57

I am having a similar problem to this

In the Image properties 'link tab' of Fckeditor after selecting image from IMCE nothing is returned

the correct URL is returned in the 'image info tab'

Thanks for producing this excellent module

#8

shali.nguyen - October 19, 2008 - 07:20

This is a similar issue I'm experiencing. Using IMCE's "Browse Server," after you click to "Insert Image," it works completely fine as an administrator but not as authenticated user or subadmin users (even though I've set up profiles and enabled the settings under each permission setting)....

Any thoughts?

#9

himdel - July 1, 2009 - 16:45

shali .. have you managed to make it work? I have the same problem, as admin, I can insert images via fckeditor+imce without any problems, but as auth user, the "Browse Server" button isn't there. Thanks

EDIT: fixed, you need the 'allow fckeditor file uploads' right .. which sucks .. you should be able to choose images even if you can't upload.

 
 

Drupal is a registered trademark of Dries Buytaert.