Author Topic: Array_Rand error  (Read 1992 times)

Anonymous

  • Guest
Array_Rand error
« on: March 02, 2009, 04:13:56 AM »
Hey, I tried to work out what was up but didn't want to mess with the php too much

I get this error

Warning: array_rand() [function.array-rand]: First argument has to be an array in /content/DesignerPlus/g/o/gothicat.co.uk/web/wordpress/wp-content/plugins/avh-amazon/2.5/avh-amazon.client.php on line 415

Been trying to look for the right line see what needed changing but not sure

website http://www.pigtailsandjoysticks.co.cc

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #1 on: March 02, 2009, 02:19:23 PM »
I just checked your site and didn't see the error message.

Do you get the message every now and then?
Peter van der Does
AVH Plugins developer

Anonymous

  • Guest
Re: Array_Rand error
« Reply #2 on: March 12, 2009, 03:31:18 PM »
Hello, I have just installed the Amazon plugin and I am getting a similar error message:

Warning: array_rand() [function.array-rand]: First argument has to be an array in /var/sites/l/littleprincesstoys.co.uk/public_html/wp-content/plugins/avh-amazon/2.5/avh-amazon.client.php on line 415

Website: http://www.littleprincesstoys.co.uk

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #3 on: March 12, 2009, 03:53:08 PM »
What's your WishList ID?
Peter van der Does
AVH Plugins developer

Anonymous

  • Guest
Re: Array_Rand error
« Reply #4 on: March 12, 2009, 06:29:32 PM »
2HCALBEMY81CT

It works fine as shortcode. Example http://www.littleprincesstoys.co.uk/about/

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #5 on: March 12, 2009, 08:21:53 PM »
Check for a typo in the wishlist ID. Either in the admin section or in the wishlist itself.
Also check if the Locale is set correctly in the widget.

If the wishlist Id is wrong it results in this error.

It's a bug in the program, it should catch that flaw and report it, thank you for reporting it.
Peter van der Does
AVH Plugins developer

Anonymous

  • Guest
Re: Array_Rand error
« Reply #6 on: March 13, 2009, 05:11:26 AM »
I worked it out. It was not picking up the default values - the one entered in Settings. I had to re-enter the wish lish and affiliate id etc once the widget had been put in place. Thanks for your responses,
Philip

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #7 on: March 13, 2009, 06:42:42 AM »
Thanks for reporting this Phillip.
It seems the bug is bigger as I expected, I'll be working on it.

Peter
Peter van der Does
AVH Plugins developer

Anonymous

  • Guest
Re: Array_Rand error
« Reply #8 on: June 28, 2009, 10:53:33 AM »
Hi

I'm on 305 and getting this same error after upgrading. Which is to say that is USED to work a treat. I'm on wordpress 2.8 (http://www.eddowding.com/blog/)

In the widget the values dont seem to be being saved, might that be part of the reason?

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #9 on: June 29, 2009, 07:31:03 AM »
Ed,

I just released v3.0.6 of the AVH Amazon plugin that should fix the problem of the Array_Rand error.
The saving of the widget options shouldn't be a problem, if it still is a problem after this update please let me know.

Thank you for reporting the bug.
Peter van der Does
AVH Plugins developer

Anonymous

  • Guest
Re: Array_Rand error
« Reply #10 on: June 30, 2009, 12:10:09 PM »
Thanks Peter!

Upgradeed, but strangely it's still happening.. any ideas? http://www.eddowding.com/blog, 2nd column, for an example.

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #11 on: June 30, 2009, 06:47:53 PM »
What is your wishlist ID you want to display?
Peter van der Does
AVH Plugins developer

Anonymous

  • Guest
Re: Array_Rand error
« Reply #12 on: September 24, 2009, 04:03:46 PM »
Same error here. Registry I want to display: 2T253UNIC2OLK

(Warning): [Thu Sep 24 16:01:40 2009] [error] [client -] PHP Warning:  array_rand() [<a href='function.array-rand'>function.array-rand</a>]: First argument has to be an array in /public_html/wp-content/plugins/avh-amazon/2.8/avh-amazon.client.php on line 428, referer: /wp-content/plugins/avh-amazon/2.8/inc/avh-amazon.admin.css?ver=3.1.2

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Array_Rand error
« Reply #13 on: September 25, 2009, 10:45:07 AM »
Did you have Items in your wishlist at the time you got this error?
Is this error still existing?
Peter van der Does
AVH Plugins developer