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) »
  • minor bug
Pages: [1]

Author Topic: minor bug  (Read 1900 times)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
minor bug
October 07, 2010, 07:14:29 am
When importing a list of organizations in 3.2 (might affect previous versions also), if there's nothing in the organization name field, it tells me

Missing required field: Email Address

instead of

Missing required field: Organization Name

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: minor bug
October 07, 2010, 07:51:11 am
When you are creating a contact in CiviCRM (which you are doing with the import) it requires emailaddress or first name and last name, household name or organization name. I suspect there is also nothing in the email address field, and shows that error first?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: minor bug
October 11, 2010, 07:05:34 am
No, I'm importing organizations, which don't need an email address (they only need an organization name). In fact, there's no email addresses for any of the records. It's really just a simple bug.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: minor bug
October 11, 2010, 07:07:49 am
Okay, did you find it in the code?
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: minor bug
October 11, 2010, 07:20:13 am
Okay, fair enough:

in CRM/Import/Parser/Contact.php, about line 316ish:


Code: [Select]
     case 'Organization' :
            if ( $this->_organizationNameIndex < 0 ) {
                $errorRequired = true;
                $errorMessage  = ts('Missing required fields:') . ' ' . ts('Organization Name');
            } else {
                $errorRequired = ! CRM_Utils_Array::value($this->_organizationNameIndex, $values);
            }
            break;

        }

        $statusFieldName = $this->_statusFieldName;

        if ( $this->_emailIndex >= 0 ) {
            /* If we don't have the required fields, bail */
            if ($this->_contactType == 'Individual' &&! $this->_updateWithId ) {
                if ($errorRequired && ! CRM_Utils_Array::value($this->_emailIndex, $values)) {
                    if ( $errorMessage ) {
                        $errorMessage .= ' ' . ts('OR') . ' ' . ts('Email Address');
                    } else {
                        $errorMessage = ts('Missing required field:') . ' ' . ts('Email Address');
                    }

So that second last line is filling in the incorrect error message because it didn't get set earlier. I don't understand various if/else in the 'Organization' case, but that's where it should  be set.
« Last Edit: October 11, 2010, 07:22:06 am by adixon »

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: minor bug
October 11, 2010, 07:29:34 am
Do you want me to create an issue for it or are you happy doing that yourself?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: minor bug
October 12, 2010, 12:03:08 pm
Done: http://issues.civicrm.org/jira/browse/CRM-6940

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: minor bug
October 12, 2010, 12:04:40 pm
You're a star, thanks!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: minor bug
October 12, 2010, 12:09:44 pm
No, no, thank you.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: minor bug
October 14, 2010, 12:24:53 am
Hello,

here is the patch : https://fisheye2.atlassian.com/changelog/CiviCRM?cs=30168

if patch looks critical to integrate, go ahead and replace entire switch case code from : http://svn.civicrm.org/civicrm/trunk/CRM/Import/Parser/Contact.php

We have tweak the code for all three contact types ( Organization, Household as well as Individual )

let us know if it works for your installation.

Thanks,
Kiran
You Are Designed To Choose... Defined By Choice.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • minor bug

This forum was archived on 2017-11-26.