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
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

biohabit - March 10, 2007 - 19:25

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

Eaton - March 11, 2007 - 00:12
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!

#3

Anonymous - March 25, 2007 - 00:16
Status:fixed» closed

#4

misterlawrence - August 30, 2007 - 03:19
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!

#5

misterlawrence - August 30, 2007 - 03:20
Status:closed» active

Made active.

#6

ekrispin - September 3, 2007 - 21:38

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:

<?php
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.

#7

Eaton - October 9, 2007 - 05:23
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.

#8

Anonymous - October 23, 2007 - 05:31
Status:fixed» closed

#9

Petuschki - February 12, 2008 - 11:22

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

lhtown - April 22, 2008 - 01:57

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

CommanderVimes - August 13, 2008 - 12:49
Status:closed» active

I'm having the same issue.

#12

oadaeh - August 24, 2008 - 00:17
Status:active» closed

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

#13

oadaeh - August 24, 2008 - 03:07

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

 
 

Drupal is a registered trademark of Dries Buytaert.