We're updating the issue view to help you get more done. 

CSV exporter not displaying multiple entities

Description

I'm having trouble exporting multiple entities to a CSV file. I want to return all the entities related to an object, but I only want the entities with a relationship type of 'donor', 'lender', 'vendor', 'trader', or 'transfer_party'. I tried using the 'context' and 'restrictToRelationshipTypes' options, which did exclude all other relationship types. But, if there are multiple entities with the desired relationship types, I only seem to get the last entity.

I've attached the following: my export mapping, my profile for Providence, a screenshot of the object record, and a screenshot of the object-entity relationship types.

The relevant row in my mapping has the following in the Option column:
{
"context": "ca_entities",
"restrictToRelationshipTypes": ["donor", "lender", "vendor", "trader", "transfer_party"],
"delimiter": "; "
}

For example, I have an object called "Ranger lunar probe", and there are four entities related to it:
Smithsonian NASM (transfer_party)
CalPoly SLO (transfer_party)
Eric Mehiel (contact)
Robin Schroffel (contact)

I want to return the first two entities, but the CSV file only shows 'CalPoly SLO'. Strangely, when I look at the log file (see below), it seems like the exporter grabs both 'Smithsonian NASM' and 'CalPoly SLO', so I have no idea why only 'CalPoly SLO' shows up in the CSV file.

Other things I've tried:
If I only include "transfer_party" in my restriction setting, the export result is the same: only CalPoly SLO gets exported.


LOG FILE (excerpt) ----
2017-06-12 15:47:58 - INFO --> Successfully loaded exporter with code 'export_dennis_spreadsheet' for item with ID 57
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:661 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:1 value: Donations from private sources
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:662 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:2 value: Ranger
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:663 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:3 value: Ranger lunar probe
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:664 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:4 value: 2015.99.45
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:665 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:5 value: 1
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:666 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:6 value:
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:667 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:7 value:
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:668 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Initiating context switch to 'ca_entities' for mapping ID 668 and record ID 57. The processor now tries to find matching records for the switch and calls itself for each of those items.
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:668 table_num:20 record_id:9]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:8 value: Smithsonian NASM
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:668 table_num:20 record_id:42]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:8 value: CalPoly SLO
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:669 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:9 value: transfer
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:670 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:10 value: Ranger Smithsonian NASM
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:671 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:11 value:
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:672 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:12 value: 2013 October 31
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:673 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:13 value: 2014 March 8
2017-06-12 15:47:58 - INFO --> Export mapping processor called with parameters [exporter_item_id:674 table_num:57 record_id:57]
2017-06-12 15:47:58 - INFO --> Extracted data for this mapping is as follows:
2017-06-12 15:47:58 - INFO --> element:14 value: CSC -> Air and Space bldg -> 1st floor -> open storage area


END OF LOG FILE ----
This issue is based on this thread in the support forum:
http://www.collectiveaccess.org/support/forum/index.php?p=/discussion/comment/318623

Environment

Ubuntu Server 16.04 LTS
Apache 2
MySQL 14.14
PHP 7.0

Assignee

Jonathan Byerley

Reporter

Perry Roth-Johnson

Labels

Components

Affects versions

Priority

Major
Configure