Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10940

export fails with related record location-type fields when contact has no such relationships

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.1
    • Fix Version/s: 4.2.3
    • Component/s: Core CiviCRM
    • Labels:

      Description

      to reproduce:

      • search for contacts and select one that does not have an employer relationship (it applies to all rel types)
      • select export from the action dropdown
      • choose to select your fields
      • choose: employee of > phone > home > phone
      • choose: employee of > phone > home > fax
      • export

      the export errors with: DB Error: value count on row

      this is because the header row is constructed correctly, but the insertion into the temp table has less data values than columns, and thus fails.

      the issue is that if the exported contact does not have the relationship in question, the code to construct those values in the $rows array is skipped, and consequently we have too few data columns for the headers.

      the bug entered in 4.1 with this commit:
      https://fisheye2.atlassian.com/browse/CiviCRM/trunk/CRM/Export/BAO/Export.php?r2=37838&r1=37831

      which was part of this issue:
      http://issues.civicrm.org/jira/browse/CRM-9295

      by adding the condition that we have a valid relationship object, it skips records for which no such relationship exists, and breaks the export.

      i've reverted that commit and am not seeing any issues with the household merging (which was the jira issue topic). maybe Deepak can review and recall what prompted the patch.

        Attachments

          Activity

            People

            • Assignee:
              deepak Deepak Srivastava
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: