Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.

If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping

Answers may be delayed for posts that do not include sufficient information.

query about "ca_storage_locations"

edited October 2015 in Troubleshooting

I'm importing storage locations. My mapping works fine but for some of the entries, it creates duplicate identifiers for the same name. For example, if you look at the green marked data in the attached excel sheet, you'll see "DRAW OUT SHELF 1" could be a common entry for different shelves in different rooms. As the hierarchy for two "DRAW OUT SHELF 1" are different, it's creating duplicate identifiers (i.e. duplicate_identifier.JPG). 

Is it because of my "existingRecordPolicy" in the setting - I tried with different ones with no luck though. Could you please suggest if there's any way to avoid this?

Thanks in advance for your time.

n.b. I'm using "useParentAsSubject" option due to "variable amount of levels" in data.


  • Your mapping is written so that the storage location name is used for the idno, so if the location name is the same in two places it will create duplicate id numbers in various places in the hierarchy.  You used the setting "merge_on_idno" but the import recognizes that locations that have different hierarchical parent paths should not be merged.  If you do want them to be merged then the parent data needs to match.
  • Hi Julia,

    Thanks for your reply and sorry to chase you again, but I'm still confused with different settings. I have locations like below & I don't want them to be merged:

    Campus A  > Building B > Dept C > Level 2 > Room 3 > Shelf 4
    Campus A > Building B > Dept C > Level 3 > Room 4 > Shelf 4

    I tried with different "existingRecordPolicy" settings (i.e. none/skip_on_idno_and_preferred_labels etc), but it's still creating duplicate identifiers. 

    I understand the issue, but I have thousands of locations which is easy to put the same name as their identifier too. What do you suggest to avoid the duplicate identifiers?

  • I suggest auto-generating serialized numeric id numbers.  To apply these ids through the import you'll first need to set up the serialization in app/conf/multipart_id_numbering.conf, and then set the idnos in the mapping to "%".  The import will recognize the % as a desire to apply serial configuration to the newly-created records.
  • edited October 2015
    Hi Julia, 

    Thanks for your help, storage locations import worked fine.

    Could you please do me another favor on the attached "ca_places" mapping,  it's very similar to the above mapping. I've started pulling my hair as I'm not sure why it's not working. The id's are now auto-generated as you suggested & the relationship "created" exists under "object<=>places". 

    It's throwing the following error while importing (providence#1.5) :

    (2015-10-23 16:43:03) [Error] Could not insert new record for place: Cannot add or update a child row: a foreign key constraint fails (`ca`.`ca_places`, CONSTRAINT `fk_ca_places_hierarchy_id` FOREIGN KEY (`hierarchy_id`) REFERENCES `ca_list_items` (`item_id`)) [250]

  • Make sure there are one or more list items included in the list "place_hierarchies"
  • edited October 2015
    Hi Julia, 

    thanks for your reply. There is one list item inside "place_hierarchies" (i.e. SPECTRUM Place Authority (i1) ).

    I'm still not sure why my mapping is not working. I tried with  "placeSplitter" too instead of placeHierarchyBuilder, couldn't build the Hierarchy with variable amount of levels (if the lower-most column is missing i.e. suburb, it maps the first column as as a round-robin fashion).

    Could you please help me to sort the above mapping? This is one of my last few import & really important for the project.

  • This may be an issue on our side.  Can you create a JIRA summing up this exchange and including your data and mapping?

  • edited October 2015
    Thanks Julia, I lodged it here:

    Could you please change the project type to "Prov" in Jira? Due some strange issue in Jira, some redundant issues are created. Could you please delete those too? Screenshot attached. Sorry for the inconvenience. 
  • Our second Woonsocket ticket. Exciting!
  • edited October 2015
    sorry for that Stefan...didn't notice the project type. :(

    Regarding the issue, I can see the query from BaseModel.php doesn't return the root ID here in the code. I put a temp hack to override the root value so I can continue data importing. Not sure if it's an issue with my mapping or the code itself though. But my mapping works fine now with the hack.

Sign In or Register to comment.