Project:Fast File Transfer with X-send file
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:heshan.lk
Status:closed (fixed)

Issue Summary

Thanks for the module! Here is a patch the removes the need to patch file.inc.

AttachmentSize
xsend_dont_hack_core.patch5.38 KB

Comments

#1

Status:active» needs review

#2

whoops. Sorry for the multiple posts. Anyway, what this does is create an alternative menu item. So instead of /system/files/sample.jpg, you have /xsend/sample.jpg. Then you add the following .htaccess rule to let the new path take over:
RewriteRule ^system/files/(.*) index.php?q=xsend/$1

#3

Assigned to:Anonymous» heshan.lk

Thanks for the patch I will test it and add to the module

#4

heshanmw, thanks! I also realized the rewrite rule isn't needed either; instead hook_menu_alter can change the callback for system/files.

Here's an updated patch:

AttachmentSize
xsend_dont_hack_core.patch 5.3 KB

#5

Title:avoid patching core via alternative URL and RewriteRule» avoid patching core via hook_menu_alter

#6

Status:needs review» patch (to be ported)

#7

Status:patch (to be ported)» closed (fixed)

#8

Fixed in latest version.

#9

Status:closed (fixed)» needs work

One advantage of the original patch (which, IMHO, should be included in core!) is that modules which call the file_transfer() function directly will benefit from it. The method adopted by this issue removes the patch, thereby degrading performance for code that calls the function directly.

#10

Status:needs work» closed (fixed)

I can see your point (other modules do use this function, e.g. imagecache, alfresco). Still patching core is rarely a good solution. Why not work with the module maintainers to provide integration with xsend?

Or if you like applying patches you could always patch the modules. :-)