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) »
  • Bug? Exporting data with custom Location Types
Pages: [1]

Author Topic: Bug? Exporting data with custom Location Types  (Read 504 times)

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Bug? Exporting data with custom Location Types
January 14, 2014, 09:05:44 am
I have confirmed this issue occurs on the demo site as well as my site.

Here's what I did:
  • created a custom location type ("NewLocation")
  • entered some address data for a number of contacts and tagged it as "NewLocation"
  • did an advanced search to find relevant contacts
  • selected the contacts and chose to Export
  • chose "Select fields to export" and designate the address fields with "NewLocation"
  • export

The result is blank on all of the fields with a custom location type. If I choose "Primary" instead of "NewLocation" the data does get exported (assuming it was marked as primary of course). So it's not a matter of not being able to access the data, just of linking correctly based on location type. If anyone can point me to the file I should poke around in I will start hunting. I'm a little lost in the weeds in the core files (I'd love to know a good gentle place to start digging deeper and becoming more familiar, but that's a separate issue) but am interested in learning more and may be able to find something on an issue like this.

EDIT: I am poking around in CRM > Export > BAO > Export.php at the moment
« Last Edit: January 14, 2014, 09:17:59 am by Laryn »
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: Bug? Exporting data with custom Location Types
January 14, 2014, 09:35:29 am
Okay, I may have found something here. When creating a custom location type there is a warning not to use spaces on the Name of the location type, but the next field down ("Display Name") also seems to dislike spaces.

On line 130 in Export.php, it seems that this uses the display name instead of the name of the location type:
Code: [Select]
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
This is my best guess anyway, as editing the custom location type and making the display name and the name identical (without spaces) seems to solve it.
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Bug? Exporting data with custom Location Types
January 14, 2014, 09:19:47 pm
I just spent a little time poking around the export code and I agree that's part of the problem, but changing that line to give names rather than labels doesn't solve it (although I think it's part of the solution).
Try asking your question on the new CiviCRM help site.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Bug? Exporting data with custom Location Types
January 14, 2014, 09:48:12 pm
Ok this doesn't feel like the right fix but it does fix it: http://issues.civicrm.org/jira/browse/CRM-14076
Try asking your question on the new CiviCRM help site.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Bug? Exporting data with custom Location Types
March 17, 2014, 03:54:19 pm
FYI I just noticed that my home phone export was empty.  I saw in the log file the following errors:
Quote
1. Notice: Undefined index: location_type in addHierarchicalElements() (line 975 of /home/xxx/public_html/drupal/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php).
2. Notice: Undefined property: CRM_Core_DAO::$Home-phone in exportComponents() (line 858 of /home/xxx/public_html/drupal/sites/all/modules/civicrm/CRM/Export/BAO/Export.php).

#1 references CRM-13011
#2 references CRM-14076 - fix label to work as the query object expects  // FIXME: We should not be using labels as keys!

Both show status fixed. 

Debugging is a bit over my head but wanted to include the feedback in case others hit this issue.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Bug? Exporting data with custom Location Types

This forum was archived on 2017-11-26.