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 CiviMember (Moderator: Deepak Srivastava) »
  • Import Memberships
Pages: [1]

Author Topic: Import Memberships  (Read 2700 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Import Memberships
September 12, 2007, 09:55:07 am
I'm getting an error when importing individual members. Just went through the process with organizations, and it imported no problem. Here's the error:

Code: [Select]
Sorry. A non-recoverable error has occurred.

Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`nyaviati_joom1/civicrm_membership`, CONSTRAINT `FK_civicrm_membership_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`)), 1452

I'm matching records using first name and last name. It would seem that it's not finding and inserting the contact id in the bridge table.

Anyone else have this happen?
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Import Memberships
September 12, 2007, 10:00:49 am
More info --
It crashes after the first record is imported. But the first record is imported correctly. I thought it might have been a data error with the first record, but it doesn't seem to be. I removed that record from the file and it just imports the next one, then crashes.
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Import Memberships
September 12, 2007, 11:32:37 am
Brian - Assuming this is happening on 1.8, can you try and recreate on our demo server using a few "desensitized" records. If it recreates, please file an issue with the test import file and steps to recreate. Thx!

dave
Protect your investment in CiviCRM by  becoming a Member!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Import Memberships
September 12, 2007, 02:10:57 pm
Hmmm... I couldn't recreate it. Import worked on the demo. I'll take a look again at my install and see if I notice anything.
And yes, it is v1.8

On the demo, I had an issue with the membership types page. It crashes when saving a type (either new or editing a preexisting one). I have not had that problem on my personal 1.8 install.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Import Memberships
September 12, 2007, 02:18:19 pm
I think I might know what caused it -- the relationship type field.
For the data I'm importing, it's all for a single membership type. And that type is set to a relationship type of "employee of".
I noticed when I imported the first record, that it assigned the membership record to BOTH the individual, and his parent organization (remember that it imported the first record before crashing). That relationship type should really be set to None for this type of member.

Since that field is not editable in the member type form, what would be the best way to remove that setting? Where is it stored in the mysql schema?

I can't test it on the demo to see if my theory is true because I'm not able to change that field, and the member type page isn't working anyway.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Import Memberships
September 12, 2007, 02:34:45 pm
Confirmed.
I went into the table to remove the relationship settings for that membership type.
The import then worked like a charm.

My setting for that membership type was slightly illogical (I take responsibility). An "employee of" relationship would work if the membership type applied to organizations, and I wanted all employees to be considered members. But since this membership category is an individual contact category, the employee of relationship doesn't make  a lot of sense.

Still, you probably want it to provide a meaningful message rather than an error if someone like me does that.
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Import Memberships
September 12, 2007, 06:09:54 pm
Quote from: lcdweb on September 12, 2007, 02:10:57 pm
On the demo, I had an issue with the membership types page. It crashes when saving a type (either new or editing a preexisting one). I have not had that problem on my personal 1.8 install.


I tried reproducing this and could not. I edited a few existing membership types here:

http://demo.civicrm.org/drupal/civicrm/admin/member/membershipType?reset=1&action=browse

and also created a new one. Can you give us detailed steps on how to "crash" the system

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Import Memberships
September 12, 2007, 07:23:09 pm
If I do nothing more than "edit" the "General" membership category, then scroll down and save it (not actually making any changes), I get the following errors.

Code: [Select]
backTrace

/home/civicrm.org/demo/svn/stable/CRM/Core/Error.php, backtrace, 148
, handle,
/home/civicrm.org/demo/svn/stable/packages/PEAR.php, call_user_func, 901
/home/civicrm.org/demo/svn/stable/packages/HTML/QuickForm.php, PEAR_Error, 1995
/home/civicrm.org/demo/svn/stable/packages/PEAR.php, HTML_QuickForm_Error, 563
/home/civicrm.org/demo/svn/stable/packages/HTML/QuickForm.php, raiseError, 755
/home/civicrm.org/demo/svn/stable/CRM/Core/QuickForm/Action/Upload.php, getElement, 86
/home/civicrm.org/demo/svn/stable/CRM/Core/QuickForm/Action/Upload.php, upload, 140
/home/civicrm.org/demo/svn/stable/CRM/Core/QuickForm/Action/Upload.php, realPerform, 126
/home/civicrm.org/demo/svn/stable/packages/HTML/QuickForm/Controller.php, perform, 195
/home/civicrm.org/demo/svn/stable/packages/HTML/QuickForm/Page.php, handle, 95
/home/civicrm.org/demo/svn/stable/CRM/Core/Controller.php, handle, 213
/home/civicrm.org/demo/svn/stable/CRM/Core/Page/Basic.php, run, 314
/home/civicrm.org/demo/svn/stable/CRM/Member/Page/MembershipType.php, edit, 129
/home/civicrm.org/demo/svn/stable/CRM/Member/Invoke.php, run, 71
/home/civicrm.org/demo/svn/stable/CRM/Core/Component.php(183) : eval()'d code, admin, 1
/home/civicrm.org/demo/svn/stable/CRM/Core/Component.php, eval, 183
/home/civicrm.org/demo/svn/stable/CRM/Core/Invoke.php, invoke, 697
/home/civicrm.org/demo/svn/stable/CRM/Core/Invoke.php, admin, 96
/home/civicrm.org/demo/svn/stable/drupal/civicrm.module, invoke, 319
, civicrm_invoke,
/home/civicrm.org/demo/public/drupal/includes/menu.inc, call_user_func_array, 418
/home/civicrm.org/demo/public/drupal/index.php, menu_execute_active_handler, 15

Code: [Select]
Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => QuickForm Error: nonexistent html element
    [mode] => 16
    [debug_info] => Element 'uploadFile' does not exist in HTML_QuickForm::getElement()
    [type] => HTML_QuickForm_Error
    [user_info] => Element 'uploadFile' does not exist in HTML_QuickForm::getElement()
    [to_string] => [html_quickform_error: message="nonexistent html element" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="QuickForm Error: " info="Element 'uploadFile' does not exist in HTML_QuickForm::getElement()"]
)
[/code]
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Import Memberships
September 12, 2007, 08:00:44 pm

This is so wierd. I cannot reproduce the error when I do it :( ahh, i suspect some earlier operation has cached something in your session state.

I reset demo db and session. If you can reproduce this it would be awesome. Can u keep track of what you did prior to editing the page so we have a trail and can reproduce it etc

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Import Memberships
September 12, 2007, 09:09:09 pm
Well, I'm not getting an error now. Previously I had done nothing more than click to edit one of the membership types, and then click save, and received the error quoted above.

I guess there was something in the cache that was screwing things up. The demo site was getting pretty cluttered too, perhaps something else was causing it.

-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Import Memberships

This forum was archived on 2017-11-26.