Error in asin.module on line 205
Xangis - March 10, 2007 - 06:55
| Project: | ASIN Field |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I receive the following error message when viewing an item listed using the ASIN module and amazontools 5.X-1.5 on Drupal 5.1.
warning: implode() [function.implode]: Bad arguments. in /home/freewave/public_html/worldmusicreview/modules/asin/asin.module on line 205.
The site in question is http://www.worldmusicreview.com and the error can be seen on the front page, one per item listed. I suspected that this was related to using a two-column theme, but the error happens with any theme I use. This is a recent install of Drupal and does not have any special customization.
Thank you,
Jason Champion

#1
It appears that this line is the source of the problem, or at least the error goes away if I yank this.
$output .= '
by ' . implode(', ',$product->author) . '
';
#2
This is fixed in the latest dev snapshot -- I'll wait a bit and roll a new release (1.3) if it appears to solve your problem. thanks!
#3
#4
I reopened this issue, because I have upgraded to the latest dev (5.x-1.x-dev), ran update.php and still get the following error when I try to add a CD using the ASIN CCK field:
warning: implode() [function.implode]: Bad arguments. in /home/teameigw/public_html/sites/all/modules/asin/asin.module on line 205.Please advise. Thanks!
#5
Made active.
#6
The above indeed fixed the problem only for books (i.e. $product->author is an array of the authors of the book and therefore implode is needed).
In case of Music (Audio) and DVD, the problem is different: the $product->author field is NULL, by defintion, per Amazon (instead of author, for Audio/Music there is a field named Artist and for DVD/Video, there are the fields Actor and Director - but it seems that these are not transferred by the module according to a print_r of $product.
Therefore line 205 should be modified to the following:
<?phpif (is_array($product->author))
$output .= '<p class="asin-author">by ' . implode(', ',$product->author) . '</p>';
?>
With this fix, if the author field is NULL, the author line will not be printed.
#7
Finally fixed in version 1.4. The 'real' solution -- including different fields for different media types -- will be part of the forthcoming amazon module for Drupal 6.
#8
#9
unfortunately none of the two versions fixes the above mentioned error in my installation
I ran the update.php after installing the dev-version and still get the same error
warning: implode() [function.implode]: Bad arguments. in F:\webs\drupal\htdocs\drupal57\sites\all\modules\asin\asin.module on line 206.
#10
I get the same error:
implode() [function.implode]: Bad arguments. in /home/xxxxxxx/xxxxxxxx.com/sites/all/modules/asin/asin.module on line 206.
#11
I'm having the same issue.
#12
Look in http://drupal.org/node/195255, which is probably a duplicate of this issue, but it has the fix.
#13
Use this one instead: http://drupal.org/node/182412