Bug #8006

AtoM sometimes creates the same terms on the fly repeatedly during import

Added by Mike Gale over 7 years ago. Updated about 7 years ago.

Status:VerifiedStart date:02/17/2015
Priority:HighDue date:
Assignee:Dan Gillean% Done:

0%

Category:CSV import
Target version:Release 2.2.0
Google Code Legacy ID: Tested version:2.2
Sponsored:No Requires documentation:No

Description

To reproduce:
1. Create a test CSV with a 'descriptionStatus' column
2. Fill in a few test rows, all using a new, identical custom descriptionStatus such as "Disclosure"
3. Attempt a CLI import with csv:import

Result:
For each row in the import, it will display the same notice: "Term Disclosure not found in description status taxonomy, creating it..."
  • Every row that uses this description status creates a new, duplicate term for "Disclosure", and doesn't reuse the existing term that was previously created!

Expected result:
After the custom description status is created once, subsequent rows should attach to the existing, newly created term instead of duplicating it in a new one.

Analysis:
An example of the offending code is here: https://github.com/artefactual/atom/blob/dev/issue-5466-asa-timeouts/lib/task/import/csvImportTask.class.php#L479-L494

The issue is $self->status['descriptionStatusTypes'] is only ever loaded at the beginning of the import, so it will not include the newly created term in it for subsequent rows to look up. We'll need to re-load the terms into that variable after each time we create a new term.

Note we use similar code for a few other taxonomies too throughout the code, so we'll need to create a fix that applies to those too.

History

#1 Updated by Mike Gale over 7 years ago

  • Assignee changed from Mike Gale to José Raddaoui Marín

Hi Radda,

Can you please code review this fix for me? It isn't a big change, so hopefully it'll only take a minute.

https://github.com/artefactual/atom/pull/110

#2 Updated by Mike Gale over 7 years ago

  • Status changed from New to Code Review

#3 Updated by José Raddaoui Marín about 7 years ago

  • Assignee changed from José Raddaoui Marín to Mike Gale

Looks good to me.

#4 Updated by Mike Gale about 7 years ago

  • Assignee changed from Mike Gale to Dan Gillean

#5 Updated by Mike Gale about 7 years ago

  • Status changed from Code Review to QA/Review

#6 Updated by Dan Gillean about 7 years ago

  • Status changed from QA/Review to Verified
  • Target version set to Release 2.2.0
  • Requires documentation set to No
  • Tested version 2.2 added

Also available in: Atom PDF