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

Comments

biohabit’s picture

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) . '

';

eaton’s picture

Status: Active » Fixed

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!

Anonymous’s picture

Status: Fixed » Closed (fixed)
misterlawrence’s picture

Version: 5.x-1.2 » 5.x-1.x-dev

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!

misterlawrence’s picture

Status: Closed (fixed) » Active

Made active.

ekrispin’s picture

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:

if (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.

eaton’s picture

Status: Active » Fixed

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.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Petuschki’s picture

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.

lhtown’s picture

I get the same error:

implode() [function.implode]: Bad arguments. in /home/xxxxxxx/xxxxxxxx.com/sites/all/modules/asin/asin.module on line 206.

JaredAM’s picture

Status: Closed (fixed) » Active

I'm having the same issue.

oadaeh’s picture

Status: Active » Closed (fixed)

Look in http://drupal.org/node/195255, which is probably a duplicate of this issue, but it has the fix.

oadaeh’s picture

Use this one instead: http://drupal.org/node/182412