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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Current Employer?
Pages: [1]

Author Topic: Current Employer?  (Read 1431 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Current Employer?
October 29, 2009, 04:56:40 am
In 3.0, when I fill in the current employer box for an individual, shouldn't it automatically create the employer/employee relationship? I am not seeing this behavior and am scratching my head on why. Am I missing a new setting?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Current Employer?
October 29, 2009, 06:16:52 am
It should. Same issue on the demo website ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Current Employer?
October 29, 2009, 06:28:30 am
It's working as it should on the demo site. What am I doing wrong on my site? Is there some setting? I have latest 3.0 stable version.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Current Employer?
October 29, 2009, 06:30:49 am
Whoa, something is extremely buggy on my site!

I just tried to do this again. I filled in my current employer box with an existing organization, submitted the form. I then got a fatal error of the following:

backTrace

/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 256
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Utils/Type.php, fatal, 171
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Relationship.php, escape, 521
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact/Utils.php, checkDuplicateRelationship, 370
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact/Utils.php, clearCurrentEmployer, 262
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, createCurrentEmployerRelationship, 194
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, add, 253
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php, create, 665
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 248
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php, mainProcess, 152
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php, realPerform, 129
/home/stoneran/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/home/stoneran/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 249
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, run, 114
/home/stoneran/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 181
/home/stoneran/public_html/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 333
, civicrm_invoke,
/home/stoneran/public_html/includes/menu.inc, call_user_func_array, 348
/home/stoneran/public_html/index.php, menu_execute_active_handler, 18

Sorry. A non-recoverable error has occurred.

is not of the type Integer

Ideas???

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Current Employer?
October 29, 2009, 09:30:46 am
Emily - quick scan of backtrace looks like the problem might be in your Relationship Types configuration. You should have a relationship type where the "name_a_b" value is "Employee of". You might need to check via phpMyAdmin - since only the label_a_b values are displayed in the UI.
Protect your investment in CiviCRM by  becoming a Member!

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: Current Employer?
October 29, 2009, 10:12:09 am

i've modified the code for 3.0.3 to do a fatal abort with a nice message in such situations. Not great, but at least users/admin wont be wondering what happened

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

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Current Employer?
October 29, 2009, 11:01:20 am
here's what's in my relationship_type table as the first entry:
id = 4     
name_a_b = Employee of (Organization)     
label_a_b = Employee of (Organization)     
name_b_a = Employer of     
label_b_a = Employer of     
description: Employment relationship.     
contact_type_a = Individual     
contact_type_b = Organization     
is_reserved = 1     
is_active  = 1

is that all looking good or is there a change? should name_a_b be reduced to just be 'Employee of' instead of with org in parentheses?

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: Current Employer?
October 29, 2009, 11:10:19 am

yes, rename name_a_b to

Employee of

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

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Current Employer?
October 29, 2009, 11:15:06 am
Yes! Something nice and simple to fix it. Relationship is now getting created.

Question: is that why I was getting the 'not of type integer' error? What's the deal with that?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Current Employer?
October 29, 2009, 01:58:26 pm
Yes - that was the problem. The code was trying to find that relationship type using the expected 'name' value - and that fetch returned null - so when the next step tried to create the relationship - the query constructing code was expecting an integer value (relationship_type.id) - but didn't get one. Lobo's fix to throw a fatal error there will at least "stop the presses" with a better error message.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Current Employer?

This forum was archived on 2017-11-26.