Hi,

I have tried a few times with all recently released version of this module and have followed the instructions to copy the php and bt_common.inc file to the drupal root however i can't make it work.

1. The interface is not clear on where to attach the file in the attach file field for the "torrent options" section or the attach field for the "attach file" section?
2. When creating a torrent with the beta 3 version i get the following error:

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/www/localhost/htdocs/modules/bittorrent/bt_torrent.module on line 351.

* Created new alias forums/test for node/45
* Your Torrent has been created.

the resulting file is not a valid torrent, azureus gives

'/tmp/test.torrent' could not be opened:

Error reading torrent file '/home/mrintegrity/.azureus/torrents/test.torrent - Error reading torrent: BDecoder: top level isn't a Map

The contents of the torrent file are just "0:"

I have tried this by putting the module in sites/all/modules and in modules/ and it's the same with the daily snapshot too!

Does anyone else actually have this working?

Thanks,

Alan

Comments

bradfordcp’s picture

I have adjusted the if statement to check for your given error, what is interesting is what caused the error. The torrent's info section should have been an array. Could you email me the torrent you are testing with?

Thanks,
~Chris

bradfordcp’s picture

Priority: Critical » Minor
Status: Active » Fixed
Jonas Kvarnstrom’s picture

This looks like the module weight bug which I don't believe has been fixed yet.

The module weight of the bt_torrent module in the system table has to be greater than that of the upload module. Otherwise, the uploaded file won't necessarily have been added to the files table when you reach this line:

          $torrent = db_fetch_object(db_query("SELECT f.filepath FROM {files} f WHERE nid = %d", $node->nid));

And then $torrent is empty without a warning, causing bdecode_torrent to fail to open the torrent. If I remember correctly, it simply returns nothing in this case without signaling an error, after which bad information is inserted into the bt_torrents table and the function finally fails because $torrent['info'] does not exist.

Jonas Kvarnstrom’s picture

See http://drupal.org/node/110238 for info on how to change the module weight during installation. It should be sufficient to set the module weight to 1 since it seems the only thing you depend on is the upload module, which is a core module and has a weight of 0.

For those of you having this problem, try executing the following (untested but should be OK):

UPDATE system SET weight = 1 WHERE name = 'bt_torrent';

Or the following in PHP, using (for example) the devel module's PHP execution field:

db_query("UPDATE system SET weight = 1 WHERE name = 'bt_torrent'");

bradfordcp’s picture

Priority: Minor » Critical
Status: Fixed » Active

I will adjust the module to set the correct weight in the system table. On another not the next update (hopefully tonight) will be adjusting database tables. I will try to adjust the install functions so that is will upgrade gracefully, but having never done that before I cannot promise anything.

~Chris

P.S. - The changes I made will be kept in the code as they will throw an error into the logs should a invalid torrent be uploaded.

mrintegrity’s picture

Apologies for not getting back sooner, was away. Will test with the information from Jonas (thanks) and let you know the results.

liquixis’s picture

Status: Active » Closed (won't fix)

5.x version is longer not supported.