Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.0

Bug #6605 reference to NULL element
Submitted: 2006-01-27 14:30 UTC
From: renzo dot toma at xs4all dot nl Assigned: ttsuruoka
Status: Closed Package: Services_Amazon
PHP Version: 5.0.4 OS: linux/fedoracore4
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 37 + 12 = ?

 
 [2006-01-27 14:30 UTC] renzo dot toma at xs4all dot nl
Description: ------------ PHP Notice: Undefined index: TotalResults in /usr/share/pear/Services/Amazon.php on line 796 Can easilly be fixed with an: if (isset($data['TotalResults'])) { $totalresults = $data['TotalResults']; } else { $totalresults = ''; } Did Amazon change the XML structure? Test script: --------------- #!/usr/bin/php <?php if ($argc != 2) { print "Usage: $argv[0] <asin>\n"; die; } $asin = $argv[1]; require_once 'PEAR.php'; require_once 'Services/Amazon.php'; $amazon = &new Services_Amazon('...', 'dev'); $products = $amazon->searchAsin($asin); if(!PEAR::isError($products)) { if (isset($products[0])) { $product = $products[0]; $authors = implode(', ', $product['authors']); echo "{$product['name']}, {$authors}, {$product{'asin'}}, {$product['imagesmall']}, {$product['url']}"; } } else { echo $products->message; } ?> Expected result: ---------------- No PHP notice Actual result: -------------- PHP Notice: Undefined index: TotalResults in /usr/share/pear/Services/Amazon.php on line 796

Comments

 [2006-01-27 16:53 UTC] ttsuruoka at php dot net
This bug has been fixed in CVS. Thank you for reporting!