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) »
  • cli for bulk fixing current_employer field ?
Pages: [1]

Author Topic: cli for bulk fixing current_employer field ?  (Read 580 times)

pike67

  • I post occasionally
  • **
  • Posts: 55
  • Karma: 0
  • CMS version: drupal7
cli for bulk fixing current_employer field ?
September 24, 2012, 08:22:03 am
Hi

Due to a bug in my version, the current_employer fields do not always reflect the active 'employed by' relations. Put different, the relations are ok, but the 'current_employer' fields are not.

What would be a good way to fix that ? I was hoping for a cli script to run through all contacts and 'repair' them. Is that possible ? Any examples around ?

curious,
*-pike

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: cli for bulk fixing current_employer field ?
September 24, 2012, 09:50:39 am
What is your version and what is the bug exactly? What is that field set to? You could write a PHP script to fix this, presuming you just want to populate that field based on the relationship.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

pike67

  • I post occasionally
  • **
  • Posts: 55
  • Karma: 0
  • CMS version: drupal7
Re: cli for bulk fixing current_employer field ?
September 25, 2012, 07:27:05 am
Hi

thanks for your answer.

Quote from: Hershel on September 24, 2012, 09:50:39 am
What is your version and what is the bug exactly?

http://issues.civicrm.org/jira/browse/CRM-10805

It's fixed, but its rather hard to backport - code has changed completely over the versions.

Quote
You could write a PHP script to fix this, presuming you just want to populate that field based on the relationship.

Exactly what I was thinking. A php/cli script, preferably using the api, to fill the field based on the relation. Is there an example of such a script somewhere ?

thanks,
*-pike

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • cli for bulk fixing current_employer field ?

This forum was archived on 2017-11-26.