Daniel-KM / Omeka-plugin-CsvImportPlus

This fork of the plugin for Omeka allows users to import metadata of items from a simple CSV file. Improvements are: choice of separators, import of metadata of files and collections, update of any record, import of files one by one to avoid to overload the server.
http://omeka.org/codex/Plugins/CsvImport
22 stars 17 forks source link

Import items using Manage records (import, update, remove) creates one collection per item #6

Closed anuragji closed 9 years ago

anuragji commented 9 years ago

When I use the "Manage records (import, update, remove)" to import items the import procedure creates one collection per item.

I have no default collection selected, in fact I don't have any collections at all.

When I use the "Item" setting, I unfortunately do not have access to import any of the Item Type metadata elements, that's why I use Manage records.

Daniel-KM commented 9 years ago

Hi,

Normally, no collection is created if there is no column for collection and the collection parameter is set to "no default collection" in the form.

Did you try the sample in csv_files? There are test_manage_one.csv and test_manage_two.csv. To test them, there are parameters to set in the form, as indicate in the readme.

Sincerely,

Daniel Berthereau Infodoc & Knowledge management

anuragji commented 9 years ago

Here is a sample of the CSV File I am using:

Item Type,Record Type,Dublin Core:Title,Dublin Core:Creator,Dublin Core:Date,Dublin Core:Medium,Item Type Metadata:Owner or Custodian,Dublin Core:Identifier,geolocation:latitude,geolocation:longitude,geolocation:zoom_level,geolocation:map_type,geolocation:address,Item Type Metadata:Latitude,Item Type Metadata:,Item Type Metadata:Website for Memorial,File
Physical Object,Item,General Pershing Statue,Haig Patagian,1922,Bronze Scupture,,,37.771687,-122.466017,6,Google Maps v3.x,,37.771687,-122.466017,http://www.artandarchitecture-sf.com/?s=pershing&searchsubmit=,http://digark.us/imageserver/WWI/WEB_NW/CA_San_Francisco_Pershing_Statue.jpg
Physical Object,Item,Foresters Memorial Fountain,NA,1927,White Marble and Bronze,,,37.768328,-122.458532,6,Google Maps v3.x,,37.768328,-122.458532,http://www.sanfranciscodays.com/golden-gate-east/,http://digark.us/imageserver/WWI/WEB_NW/CA_Golden_Gate_Foresters.jpg

When I use that file to import, one empty collection gets created per item.

anuragji commented 9 years ago

I initally thought that the error was happening in CSVImport/controllers/InexController.php on line 172 - 'createCollections' => $this->session->createCollections but the session var in this case is 0, so it should really not be creating the collections. It must be getting messed up somewhere further down the line.

Daniel-KM commented 9 years ago

Hi,

I try your csv sample (except typos: cf. https://github.com/Daniel-KM/CsvImport/issues/7), but no error, the process works fine, no collection is created. The field Collection is not used with the Manage format, because the collection can be a column (set an empty value in that case). Can you check with the fixed csv sample?

Sincerely,

Daniel Berthereau Infodoc & Knowledge management

anuragji commented 9 years ago

Even with the corrected CSV, it is still doing it. You can see from the screenshot, that it imports 4 items, but creates 8 records (4 collections + 4 items).

The behavior is consistent on two separate servers, one with Omeka 2.3 and one with Omeka 2.2.2. The plugin version, btw, is 2.1.1-full

csvimportscreen (https://cloud.githubusercontent.com/assets/5738275/7967398/d74d5552-09f7-11e5-9d56-22559ed021bb.png)

Daniel-KM commented 9 years ago

Hi,

Can you try the master release that I just updated (2.1.2-full)?

Sincerely,

Daniel Berthereau Infodoc & Knowledge management

anuragji commented 9 years ago

That works like a charm - so the 2.1.1. version was the culprit.

Thanks for your help. And thank you for the plugin, btw. it is such a great addition to Omeka.