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 Import (Moderator: Yashodha Chaku) »
  • Can't import contributions even though it worked fine once today!
Pages: [1] 2

Author Topic: Can't import contributions even though it worked fine once today!  (Read 4840 times)

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Can't import contributions even though it worked fine once today!
July 13, 2011, 08:52:29 pm
this is weird.  I successfully imported contributions earlier today.  One time.  But the second time, and all other times after, after the "Import Now" button, I get this:

"Fatal error: Call to undefined method CRM_Core_Error::fields() in /home/soncnv/webapps/v2/sites/all/modules/civicrm/api/v2/utils.v2.php on line 162"

How could I have imported once, and then, using the same import mapping (and even tried a new one after that to be sure), I now get THIS error?

The only thing that changed is that I added a new payment instrument.  Also, of course, the file is different....  but it passed the initial error check, and is in the exact same format as the first one!

Any ideas?  Any help appreciated.  Thanks in advance.

Civi version is actually 3.4.3 not 3.4.1- I need to update that...

PS:  I've also gotten this error sometimes today:

"warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/soncnv/webapps/v2/sites/all/modules/civicrm/CRM/Core/Error.php on line 575.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/soncnv/webapps/v2/sites/all/modules/civicrm/CRM/Core/Error.php on line 575."
« Last Edit: July 13, 2011, 08:59:19 pm by miko »

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 14, 2011, 11:41:45 am
I'm still hoping someone can help with this!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Can't import contributions even though it worked fine once today!
July 14, 2011, 12:32:52 pm
have you confirmed that no data at all was imported? I would be trying a sample file to import based on your original successful one as i would be suspecting something in the data, therefore would want to rule that out as the culprit
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 15, 2011, 06:11:54 pm
Pete- thanks- but no data imported and I created a text file with only ONE good record in it- same error.

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 15, 2011, 06:14:35 pm
Is there any way I can get the import process to ONLY use api v2?  Could this be a problem with api v2?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't import contributions even though it worked fine once today!
July 15, 2011, 06:28:31 pm
Yes, the parser should be only using v2 - the patch I attached here should cause it to use v2

http://issues.civicrm.org/jira/browse/CRM-8398
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 19, 2011, 07:53:05 am
Hi, Eileen, and others- I'm not sure how to add that patch?  I get confused when I go to that link-.  I actually DID implement the workaround at the top- copying the Contribute file to v3 api- but that doesn't even sound like the right thing to do if everything for contributions imports needs to be done in the v2 api... so then I look through that log and see you wrote "CRM-8398 - revert back to calling API v2 function directly - NB - I don't expect format_create to become part of apiv3 as an external function"- but then I don't see how to install a patch to keep everything in v2?  So first, how do I install the patch?  I'm at 3.4.4 now in my CiviCRM version.

My other concern also is that this isn't a v3-to-v2 issue completely.  My initial error occurred AFTER ONE SUCCESSFUL import:

"Fatal error: Call to undefined method CRM_Core_Error::fields() in /home/soncnv/webapps/v2/sites/all/modules/civicrm/api/v2/utils.v2.php on line 162"

** So it leaves me wondering in there's a temp file causing this?  I keep emptying the Drupal cache and templates_c directory- where is the folder where files get up.loaded?  Could THAT be the problem?  Who WROTE the "fields()" function call/method?  Someone must know who wrote that function call and that person should be able to recognize why the method might be seen as undefined?

Also, ever since upgrading to 3.4.3, and now also with 3.4.4, I KEEP getting these errors, constantly:

"warning: Invalid argument supplied for foreach() in {homedir}/sites/all/modules/civicrm/api/v3/utils.php on line 1521.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in {homedir}/sites/all/modules/civicrm/CRM/Core/Error.php on line 575."

I have no idea what they mean.  :(

I feel like jumping off a bridge because we need contributions to be imported, and it worked once, then just plain stopped.

HELP!  Please help!  Someone who knows this code, please help!  I will be your humble servant forever.  :)

Our PHP version is currently 5.2.11.

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 19, 2011, 08:17:09 am
Also, I'm afraid to apply the patch since it seems to be for CiviCRM 4?  We're Drupal 6.22 with CiviCRM 3.4.4...

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 19, 2011, 08:54:46 am
OK, so I applied that patch and it didn't help.  :(

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't import contributions even though it worked fine once today!
July 19, 2011, 01:55:25 pm
Did you replace your version of this file with this one?

http://svn.civicrm.org/civicrm/branches/v3.4/CRM/Contribute/Import/Parser/Contribution.php
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 20, 2011, 11:39:39 am
Well so I discover that part of the file had imported.  Also I learned from reading online that CiviCRM import does not like files with blank final columns and it doesn't like files saved as CSV from Excel using Windows format.  You have to save in MS-DOS CSV format if using Excel.  And you should at a final column of zeroes to your file if you otherwise end with blank final column fields.

I deleted all contributions, period, and started reimporting from scratch.  The importer started worked again, on the first file.  It was the second file where I had the problem originally, though, so I'm going to make the changes noted above- MS-DOS and zeroes, and will re-post here if the importer repeats the error that I was getting before.

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 20, 2011, 12:30:30 pm
NO LUCK!  So here I am returning to say that as soon as I got back to that file, the import dies again, with the same error as before.  So apparently there has to be something wrong with that file- but what in the world could it be?

Obviously I can't try this on the demo site without a lot of work because the contact info is sensitive enough and also, I'd have to import all the contacts...

Fatal error: Call to undefined method CRM_Core_Error::fields() in /home/soncnv/webapps/v2/sites/all/modules/civicrm/api/v2/utils.v2.php on line 162

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Can't import contributions even though it worked fine once today!
July 20, 2011, 01:17:27 pm
can you post an anonymised sample here - just the header row and a single row of data?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Can't import contributions even though it worked fine once today!
July 20, 2011, 03:28:11 pm
I think it is failing to create the contribution for some reason but the failure is not being 'captured' adequately - & so it is falling over on the bit where it creates a success message.

So, the problem is

1) something about your data is causing it not to import
2) the error handling is bung.

The best way to figure it out is like Pete says - if you can post some data that you can't import with names etc removed (preferably a single row) we should be able to find the problem.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

miko

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 2
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.77
  • PHP version: 5.2.11
Re: Can't import contributions even though it worked fine once today!
July 22, 2011, 07:56:16 pm
OK. I'll post some aononymized data in the next few days, thanks.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Can't import contributions even though it worked fine once today!

This forum was archived on 2017-11-26.