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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Clearing Current Employer Field
Pages: [1]

Author Topic: Clearing Current Employer Field  (Read 4298 times)

farbman

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
Clearing Current Employer Field
October 28, 2008, 02:56:27 pm
If I enter a value into the Current Employer field, save it, and then later delete it the following occurs:

(1) The field itself remains empty.
(2) The summary page still shows the last non-empty value in the field.

Any suggestions?

Thanks,
Eric

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Clearing Current Employer Field
October 28, 2008, 03:14:29 pm
Can you replicate it on http://drupal.demo.civicrm.org, if you are able to replicate please file an issue in jira.

Kurund
Found this reply helpful? Support CiviCRM

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Clearing Current Employer Field
November 13, 2008, 06:56:39 am
I'm having a different problem with the Current Employer field. Here's what happens:

Individuals in the database have a Current Employer recorded and the data shows correctly in the summary profile pages.

When I open up the profile page in edit - the Current Employer field is empty. Making any changes to the record (without re-entering the Current Employer data) deletes the Current Employer from the record after saving.

The function works correctly in the sandbox - so I assume I have something causing the problem in my installation - I've tried various solutions and have run out of ideas - Looking for assistance.  Any help would be appreciated!
--
Joe

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Clearing Current Employer Field
November 13, 2008, 10:00:23 am
Since it sounds like the exact same case is working on the demo, I think you'll have to do some local debugging. Apparently the function which sets default values for the profile form in edit mode isn't retrieving that particular value for some reason.

You could start by adding a debug line to the function call and see what's returned in $defaults array - and then trace back from there. To get started add the following line in CRM/Profile/Form.php:

Code: [Select]
            CRM_Core_BAO_UFGroup::setProfileDefaults( $this->_id, $this->_fields, $defaults, true );
// add the next line ...
            CRM_Core_Error::debug($defaults); exit();

Here's what I see on my 2.1 install - having added Current Employer to the sample "Name and Address" profile:

Code: [Select]
Array
(
    [first_name] => Dave
    [last_name] => Greenberg
    [street_address-1] => 302 Main Street
    [state_province-1] => 1004
    [country-1] => 1228
    [current_employer] => CiviCRM LLC
)
Protect your investment in CiviCRM by  becoming a Member!

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Clearing Current Employer Field
November 30, 2008, 11:46:43 am
Did a bit of digging and found that the "Current Employer" / "Relationship" / "Membership" is causing a few problems for others as well:
http://forum.civicrm.org/index.php/topic,5704.0.html
http://issues.civicrm.org/jira/browse/CRM-3694

I was finally able to reproduce the problem in the sandbox...
If "Demographics" is unchecked in Global Settings >> Settings - Site Preferences >> Editing Contacts, then the "Current Employer" box in the edit view of an Individual's record is not populated, and the value will be null if the record is saved without re-entering the value. It doesn't seem that "Current Employer" should be tied to "Demographics". So, while I don't use "Demographics", I can live with the field showing up on the admin form - perhaps this can be fixed in a future release.

While running through some other scenarios, a few other potential enhancements appeared.
>>It would be nice to see "Current Employer" as one of the field choices in the "Merge Contacts" selection under "Find and Merge Duplicate Contacts"
>>It would be GREAT if Memberships were activated without having to edit/save relationships for each contact - is there a workaround or a script to resolve this issue?
--
Joe

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: Clearing Current Employer Field
November 30, 2008, 12:22:38 pm
Quote from: joemaine on November 30, 2008, 11:46:43 am
http://issues.civicrm.org/jira/browse/CRM-3694

I was finally able to reproduce the problem in the sandbox...
If "Demographics" is unchecked in Global Settings >> Settings - Site Preferences >> Editing Contacts, then the "Current Employer" box in the edit view of an Individual's record is not populated, and the value will be null if the record is saved without re-entering the value. It doesn't seem that "Current Employer" should be tied to "Demographics". So, while I don't use "Demographics", I can live with the field showing up on the admin form - perhaps this can be fixed in a future release.

thanx for reproducing, i've reopened the issue and we'll fix in a future release (2.2?)

Quote from: joemaine on November 30, 2008, 11:46:43 am
While running through some other scenarios, a few other potential enhancements appeared.
>>It would be nice to see "Current Employer" as one of the field choices in the "Merge Contacts" selection under "Find and Merge Duplicate Contacts"
>>It would be GREAT if Memberships were activated without having to edit/save relationships for each contact - is there a workaround or a script to resolve this issue?

Please consider contributing code and/or hiring a developer to work on these enhancements. 2.2 is about to hit code freeze so highly unlikely that the above will be part of 2.2

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

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Clearing Current Employer Field
November 30, 2008, 12:33:32 pm
Quote
>>It would be GREAT if Memberships were activated without having to edit/save relationships for each contact - is there a workaround or a script to resolve this issue?


Please consider contributing code and/or hiring a developer to work on these enhancements. 2.2 is about to hit code freeze so highly unlikely that the above will be part of 2.2

I agree that listing "Current Member" in the "Merge Contacts" is an enhancement, sounds like an easy fix, I'll see if I can find any resources.

The other item though, having to edit/save each relationship one-by-one in order for a membership to be activated seems to be a bug - I'm not sure where to begin on that one...
--
Joe

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Clearing Current Employer Field
November 30, 2008, 03:57:12 pm
Quote from: joemaine on November 30, 2008, 12:33:32 pm
It would be GREAT if Memberships were activated without having to edit/save relationships for each contact - is there a workaround or a script to resolve this issue?
The other item though, having to edit/save each relationship one-by-one in order for a membership to be activated seems to be a bug - I'm not sure where to begin on that one...

Joe - Not sure which work flow you're referring to, but at least one related issue is in the 2.3 queue;
http://issues.civicrm.org/jira/browse/CRM-3792

If this is NOT the flow you're having a problem with - please describe the issue in more detail AND check the issue tracker to see if there's already an item to address it.
Protect your investment in CiviCRM by  becoming a Member!

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Clearing Current Employer Field
November 30, 2008, 05:32:46 pm
That would indeed be the issue.

2.3 seems so far away. Is there any thought for a workaround, a script to update the CiviCRM fields from inside the application or a database script that might have the same effect? I tried running a batch update just to see if that would have any effect - it didn't.
--
Joe

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Clearing Current Employer Field
November 30, 2008, 07:37:23 pm
I know I've dragged the topic off the original focus of the clearing of the Current Employer Field...sorry.

But I have a couple of ideas on the activation of memberships through the Current Employer field.

Doing an edit/save for each contact to secure membership status is a heavy workload, so here are a couple of temporary ways to save a few steps... They're not pretty, but knowing the workarounds in advance could save some time with data imports or offer a quick fix for individual employers.

workaround 1
>>condition that no membership(s) exists for employer(s)
>>establish relationship between individual and employer by entering data in the "current employer" field
>>create membership(s) for employer(s)
individuals are granted membership

workaround 2
>>condition that membership(s) exist for employer(s)
>>establish relationship between individual and employer by entering data in the "current employer" field
>>edit/save employer(s) active membership
individuals are granted membership

...perhaps this may offer some insight into a solution.
--
Joe

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Clearing Current Employer Field
November 30, 2008, 11:27:02 pm
Quote
I was finally able to reproduce the problem in the sandbox...
If "Demographics" is unchecked in Global Settings >> Settings - Site Preferences >> Editing Contacts, then the "Current Employer" box in the edit view of an Individual's record is not populated, and the value will be null if the record is saved without re-entering the value. It doesn't seem that "Current Employer" should be tied to "Demographics". So, while I don't use "Demographics", I can live with the field showing up on the admin form - perhaps this can be fixed in a future release.

This fix would be part of CiviCRM v2.1.3, you can also get the fix from : http://fisheye.civicrm.org/changelog/CiviCRM/?cs=18379

Kurund
Found this reply helpful? Support CiviCRM

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Clearing Current Employer Field
December 01, 2008, 08:11:57 am
Hi Kurund,

Thanks! The patch works - I appreciate the quick solution; I wish it hadn't taken so long to reproduce in the sandbox.

On another note; regarding the workarounds for relationship/membership - I'm not sure that this is the best thread to continue posting about the issue, perhaps you can move the discussion to where it belongs.

There is a 3rd workaround that seems to work the best - just run manually or set up a cron run of:  UpdateMembershipRecord.php
--
Joe

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Clearing Current Employer Field

This forum was archived on 2017-11-26.