On creation of the link that is either pasted to the editor or put into the clipboard there is no differentiation whether clean urls is activated or NOT. Hence if clean urls is off, the link does not work, as it is in the clean format.

The affected code can be found in webfm.js around line 2000.

This is my proposal to solve this. It checks the status of cleanURLs first. If its active the link is put together the way it was before. If not active, the link is made the old fashioned way with ? and such:

Webfm.generateFileHref  = function(obj) {
  var url = getBaseUrl();
  var title = '';
  var string = '';
  if(typeof obj.ftitle != "undefined" && obj.ftitle != null && obj.ftitle.length)
    title = obj.ftitle;
  else
    title = obj.element.title.substring(obj.element.title.lastIndexOf("/") + 1);
  //create the right type of link depending on the status of cleanUrl functionality
  var cleanUrl = getWebfmCleanUrl();
  if(cleanUrl) { 
      string = "<a href=\"" + url + "\/webfm_send\/" + obj.element.id.substring(3) + "\">" + title + "</a>";
  } else {
      string = "<a href=\"" + url + "\/index.php?q=webfm_send\/" + obj.element.id.substring(3) + "\">" + title + "</a>";
  }
  Webfm.copyToClipboard(string);
  return string;
}

If you have nicer solutions, let me know!

Regards,

Frank

Comments

robmilne’s picture

Status: Active » Fixed

Thanks for catching that. Fix is in DRUPAL-5 head and will be part of the next release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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