Bug #13024

CSV import fails when importing from description view page link in sidebar context menu

Added by Dan Gillean 5 months ago. Updated 4 months ago.

Status:VerifiedStart date:05/13/2019
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

Category:CSV import
Target version:Release 2.5.1
Google Code Legacy ID: Tested version:2.5, 2.6
Sponsored:No Requires documentation:No

Description

At first glance, it appears that the issue may stem from how the task options are passed in the console - a missing space seems to cause issues.

To reproduce

  • Create a CSV of item-level descriptions using the AtoM CSV template. A version you can use is attached here, created by copying rows of the item-level children from the Irving Steinberg Photograph collection in the demo data
  • Log into AtoM
  • Find a top level description in AtoM and navigate to its view page
  • Click the "CSV" button in the Import section of the right-hand context menu
  • Add your local CSV file and start the import
  • Navigate to the jobs page for more information

Resulting error

  • File does not import
[info] [2019-05-13 13:42:05] Job 2003038 "arFileImportJob": Job started.
[info] [2019-05-13 13:42:05] Job 2003038 "arFileImportJob": Importing CSV file: example_information_objects_isad_2.3.csv.
[info] [2019-05-13 13:42:05] Job 2003038 "arFileImportJob": Indexing imported records.
[info] [2019-05-13 13:42:05] Job 2003038 "arFileImportJob": Update type: import-as-new
[info] [2019-05-13 13:42:05] Job 2003038 "arFileImportJob": php '/usr/share/nginx/atom/symfony' 'csv:import' --index     --quiet --source-name=--user-id="115215" 'example_information_objects_isad_2.3.csv' --default-parent-slug='bitter-paradise-sell-out-of-east-timor-fonds' '/usr/share/nginx/atom/uploads/tmp/TMP8183c5ed.csv';   The execution of task "csv:import" failed.;   - Too many arguments ("csv:import example_information_objects_isad_2.3.csv /usr/share/nginx/atom/uploads/tmp/TMP8183c5ed.csv" given).; symfony csv:import [--application[="..."]] [--env="..."] [--connection="..."] [--rows-until-update[="..."]] [--skip-rows[="..."]] [--error-log[="..."]] [--source-name[="..."]] [--default-parent-slug[="..."]] [--default-legacy-parent-id[="..."]] [--skip-nested-set-build] [--index] [--update="..."] [--skip-matched] [--skip-unmatched] [--skip-derivatives] [--limit="..."] [--user-id[="..."]] [--keep-digital-objects] filename
[info] [2019-05-13 13:42:05] Job 2003038 "arFileImportJob": Job finished.

Expected result

File imports successfully

Notes

The error is "too many arguments." If you look closely at the command output, notice this:

--source-name=--user-id="115215" 

By default, when no sourcename is provided (and there's no way to provide one via the user interface), AtoM should use the CSV filename as the source name. It appears that:

  • This is not being added properly
  • There is also no space between that argument and the next option, --user-id

Consequently, I think this is being understood as a single option, and is causing the task to fail.

We should make sure that the source-name is being properly added, and that there is a space before the next option is appended.

steinberg-collection-children.csv Magnifier (73.1 KB) Dan Gillean, 05/13/2019 01:57 PM


Related issues

Related to Access to Memory (AtoM) - Bug #11597: CSV import fails when importing from description view pag... Verified 09/26/2017

History

#1 Updated by Dan Gillean 5 months ago

  • Related to Bug #11597: CSV import fails when importing from description view page link in sidebar context menu added

#2 Updated by Dan Gillean 5 months ago

  • Description updated (diff)

Fix minor formatting issue in description

#3 Updated by David Juhasz 4 months ago

  • Status changed from New to Code Review
  • Target version set to Release 2.5.1
  • Tested version 2.6 added

#4 Updated by Steve Breker 4 months ago

  • Status changed from Code Review to Feedback

CR complete. Looks good!

#5 Updated by David Juhasz 4 months ago

  • Status changed from Feedback to QA/Review

Merged to qa/2.6.x and ready for testing.

#6 Updated by Dan Gillean 4 months ago

  • Status changed from QA/Review to Verified
  • Assignee set to Dan Gillean

#7 Updated by David Juhasz 4 months ago

Cherry-picked to stable/2.5.x for the 2.5.1 Release.

Also available in: Atom PDF