I have 2 different drupal sites, one 5.0 and one 5.1, and on both when I go to create content -> amazon node, I get the exact same error on line 195.

Fatal error: Call to a member function on a non-object in /home/celebcom/public_html/modules/amazontools/amazon.php4.inc on line 195

Comments

jt6919’s picture

I get this error on 6 different drupal 5.x installs (on different domains) now. This is really critical - I can't add any amazon nodes at all. Anyone have any info??

jt6919’s picture

still no responses and I have checked everything. does anyone have any ideas?

9802008’s picture

Hi There

I am experiencing a similar problem in 4.7.2 - except that adding a book sometimes works, and other times it gives the error message: Fatal error: Call to a member function on a non-object in /home/alternat/public_html/site/modules/amazontools/amazon.php4.inc on line 198

I have the latest version of amazontools installed: http://ftp.osuosl.org/pub/drupal/files/projects/amazontools-4.7.x-1.3.ta...

The problem appears to be with curl in function amazon_get_XML($Amazon_Params) line +- 300. This function is supposed to return XML from Amazon in the string $AmazonXML. However it is returning an empty string.

I have replaced amazon_get_XML with the following code to retrieve the xml (uses fopen instead of curl):

<?php 
 function amazon_get_XML($Amazon_Params) {
    
    $AmazonXML = '';
    $url = amazon_search_RESTURI($Amazon_Params);
    $handle = fopen("$url", "r");
    if ($handle) {
    while (!feof($handle)) {
        $buffer .= fgets($handle, 4096);
        
    }
    //echo htmlentities($buffer);
    fclose($handle);
    }else {
      echo "Could not connect to Amazon.  Please try refreshing the page by pushing F5.";
      die;
    }
    $AmazonXML = $buffer;
    return $AmazonXML;
  }
?>

It still bombs out when trying to connect to Amazon which makes me think it is a problem with the server.

jt6919’s picture

I don't know how it could be a problem with the amazon server, since when you get the error, you reload, and then you get the second error, but sometimes you get the picks from amazon with checkboxes to choose from. Then of course, when you go to choose any of them to add you get the error again.

What I really don't understand is how we haven't gotten any responses from anyone willing to help or with similar problems. Obviously people are using this every day without problems. But I have 5 different Drupal 5.x installs now and this doesn't work on of the different domains at all. I have different themes, a little bit of variation on the modules, and both Curl and Domxml are installed with php 5.2.6.

I just don't get it...I would love to get any kind of help with this.

jt6919’s picture

I'm beginning to think this module just doesn't work anymore (connecting to Amazon)....it doesn't work in any of my sites at all, different installs and drupal versions, etc.

Is anyone maintaining this module anymore? There haven't been any response from any maintainers in a very long time...any help at all would be appreciated.

thx!

csc4’s picture

Just a fellow user - haven't seen this problem so not sure if I can help - except to confirm that the module is working for me but as I'm Windows PHP5 I'm not sure that helps much.

Just a few thoughts - are all the Drupal installs on the same box? if so it would probably suggest a CURL/network problem - if on different boxes then what else is common apart from Drupal?

Have you tried connecting from the box to amazon at the time the problem happens?

wayland76’s picture

Curl removing patch: http://drupal.org/node/155378

MGParisi’s picture

Status: Active » Closed (won't fix)

No longer supports 4.X! Sorry, but I cant test this patch...