Closed (won't fix)
Project:
BitTorrent
Version:
5.x-2.0-beta2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
30 Jan 2008 at 09:49 UTC
Updated:
8 Jul 2009 at 03:07 UTC
The torrent module unconditionally sets #attachments to true in bt_torrent_form_alter, which is called for all forms in the system. This disables uploads for all node types.
A partly tested solution: Test whether the form ID is bt_torrent_form.
function bt_torrent_form_alter($form_id, &$form) {
...
if ($form_id == 'bt_torrent_form') {
unset($form['attachments']);
}
}
I'm attaching a patch (hopefully in the correct format), but as I said it's partly tested and I don't know if this is the correct solution.
| Comment | File | Size | Author |
|---|---|---|---|
| attachment-patch-01.patch | 463 bytes | Jonas Kvarnstrom |
Comments
Comment #1
bradfordcp commentedThis will work, but it will allow a user to upload more than one torrent per node, which I am trying to avoid. I am thinking of switching to:
but this will not allow users to upload more than one torrent on any node type.
Comment #2
bradfordcp commentedI have rolled the above code in, this will allow uploads across all forms unless your first upload is a .torrent file, then it disables a second file from being added.
Comment #3
gildedgod commentedAnd that is the case when it does not work: http://drupal.org/node/317686
Because of using CCK module the first upload is not a .torrent file...
Comment #4
liquixis commented5.x version is longer not supported.