Closed (fixed)
Project:
Web File Manager
Version:
5.x-2.13
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2008 at 19:35 UTC
Updated:
21 May 2008 at 18:23 UTC
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
Comment #1
robmilne commentedThanks for catching that. Fix is in DRUPAL-5 head and will be part of the next release.
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.