Closed (fixed)
Project:
BitTorrent
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
17 Aug 2007 at 16:27 UTC
Updated:
18 Aug 2007 at 01:14 UTC
When I tried to install the new release files, it shut down my site completely giving the following error
Fatal error: Call to undefined function: bt_message() in /var/www/vhosts/mysite.co.uk/subdomains/torrent/httpdocs/bt_common.inc on line 373
I had to delete the whole bittorent module folder to get my site back up again
Comments
Comment #1
bradfordcp commentedI am verifying the issue now. Where you trying to access a specific page or are all pages unavailable?
Comment #2
bradfordcp commentedI just performed a clean drupal installation and installed the bittorrent module without any issue. Everything appears to be working normally. Could you please provide more information?
Comment #3
droople commentedin the bt_common.inc file on line 275
there is a typo of "foreach($bparsed as & $key => $value)"
should be changed to
"foreach($bparsed as $key => $value)"
Comment #4
bradfordcp commentedLine 275 in bt_common.inc should read:
"foreach($bparsed as $key => &$value) {"
That is copied directly from the CVS (it is also the same in my working copy). The '&' is in place so $value is a reference and can be changed within the foreach loop.
From the documentation at php.net:
Comment #5
bradfordcp commentedAfter doing more research I noticed announce.php calls bt_message() at line 373 as your error states. I am wondering if all of the correct files were moved into the root of the drupal installation. That is the only thing that comes to mind.
Comment #6
droople commentedonce I change it (remove the "&" sign, the error disappears and all looks well
Comment #7
bradfordcp commentedThat is because the function is no longer doing as it was intended. Could you please paste the entire function here (with the &) so that I may verify it.
Comment #8
droople commentedComment #9
bradfordcp commentedEverything looks correct except the '&' before '$value', it should read '&$value'. If this is not in place the torrent structure will not be to spec. Most notably the information hash will be off and the structure returned will not be re-encoded appropriately. Something else that comes to mind is what version of PHP are you using. The ability to reference within a foreach loop is only in PHP 5.
Comment #10
droople commentedCould this be the problem?
Sorry for all the trouble then
Comment #11
bradfordcp commentedYes, this is the problem. PHP 5 is required to use the '&' before $value in the foreach statement. I might rewrite this later, but for now it looks like PHP 5 is required for my module.