CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Warning : The first argument should be either string or integer on contribution.
Pages: [1]

Author Topic: Warning : The first argument should be either string or integer on contribution.  (Read 354 times)

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Warning : The first argument should be either string or integer on contribution.
March 13, 2014, 04:08:03 am
I have created the set of pricesets on contribution page. I have written the code that saves or update the drupal users account on creation of civicrm account.
When i registered myself on webform as anonymous , the drupal user is created for me. Then i went on contribution page and i selected two options for contribution and proceed with the confirm button, Then i get the transaction completed sucessfully along the ERROR:

please reply to this ques. Advance thanks to you.
« Last Edit: March 13, 2014, 04:10:13 am by dhirendra »

civicrmsav

  • I post frequently
  • ***
  • Posts: 121
  • Karma: 5
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7.x
Re: Warning : The first argument should be either string or integer on contribution.
April 21, 2014, 09:46:51 pm
I found a similar problem with my installation of 4.4.5.  On the confirmation screen for events, I was getting the same triple error message you show in your post.  Further investigation showed that something (not sure what, 'cause I couldn't get backtrace to print for some reason) is passing a 0 into the function as a double, rather than as an integer. 

I used this hack (and it is a hack) to ensure my users don't see this error message until I figure this out further.

Code: [Select]
static function value($key, $list, $default = NULL) {
  //hack to fix bug in event registration.
  if (is_double($key)) {
     $key = intval($key);
  }

   if (is_array($list)) {
      return array_key_exists($key, $list) ? $list[$key] : $default;
   }
   return $default;
}

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Warning : The first argument should be either string or integer on contribution.

This forum was archived on 2017-11-26.