Bug #6047

CSV import - publication status value not imported

Added by Tim Hutchinson over 8 years ago. Updated over 7 years ago.

Status:VerifiedStart date:11/30/2013
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

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

Description

As Dan mentioned in #6035, in both 1.3.1 and 2.x, if publicationStatus is populated in the CSV file, an error is returned like:
Publication status: 'Published' is invalid. Using default.

The same error is returned if "Published" is changed to "published". (Similarly for draft/Draft)

The issue boils down to the case of the publication status, in particular around line 453 of lib/task/import/csvImportTask.class.php
$pubStatusTermId = array_search(
ucwords($self->rowStatusVars['publicationStatus']),
$self->status['pubStatusTypes']
);

Changing ucwords to strtolower seems to resolve the error. So does changing "draft" to "Draft" and "published" to "Published" in term_i18n.

I didn't dig into the code for the UI import, but the same error occurs there as well as with the command line.

It turns out there is a mix of cases for publication status, depending on the language. In English, both are lowercase, which led to this error (published != Published). In fact in French and Italian, one term is lowercase and the other is uppercase. So making the database values consistent is probably the best fix.


Related issues

Related to Access to Memory (AtoM) - Bug #12440: Publication status ignored in CSV imports performed via t... Invalid 09/17/2018

History

#1 Updated by Tim Hutchinson over 8 years ago

That should say term_i18n, not taxonomy_i18n.

#2 Updated by Dan Gillean over 8 years ago

  • Description updated (diff)
  • Category set to CSV import
  • Assignee set to Jesús García Crespo
  • Target version set to Release 2.0.2

Thanks Tim. I edited the description of the issue so it reads "term_i18n" now.

#3 Updated by Dan Gillean about 8 years ago

  • Status changed from New to QA/Review

It seems that this may have gotten fixed along the way, as part of other work? Requires further testing to verify. Imports using RAD CSV template will accept both "published" and "Published" now. We should test "draft" vs "Draft" in an AtoM instance where the default pub status is set to "published", and we should verify that the behavior is the same with the ISAD CSV template.

#4 Updated by Tim Hutchinson about 8 years ago

I think this may work on fresh installs but not sites upgraded from 1.x.

On our current test site (probably about a month out of date), I still got the warnings, and there are still inconsistent cases in term_i18n.

But looking at data/fixtures/taxonomyTerms.yml, the case is correct (Draft, Published etc. all title case). On a fresh install, it's correct in the database (I didn't test an import but there's no reason it's shouldn't work). This hasn't changed since the initial commit, which is why I'm thinking something needs to be added to the upgrade task - I'm not sure how changes to fixtures would normally be handled.

#5 Updated by Dan Gillean almost 8 years ago

  • Status changed from QA/Review to Feedback
  • Target version changed from Release 2.0.2 to Release 2.1.0

Hi all,

Please see Tim's comments above - any way we can make sure this gets added to the upgrade task(s) for 2.1 release, so we don't constantly have this problem being reported by users who have a previous install?

#6 Updated by Jesús García Crespo over 7 years ago

  • Target version changed from Release 2.1.0 to Release 2.2.0

#7 Updated by Jesús García Crespo over 7 years ago

  • Target version changed from Release 2.2.0 to Release 2.1.0

#8 Updated by Jesús García Crespo over 7 years ago

  • Assignee changed from Jesús García Crespo to Mike Gale

#9 Updated by Jesús García Crespo over 7 years ago

  • Status changed from Feedback to In progress
  • Assignee changed from Mike Gale to Jesús García Crespo

Tim, check this out: https://code.google.com/p/qubit-toolkit/source/detail?r=12128&path=/trunk/data/fixtures/taxonomyTerms.yml

I'm just going to change the code so the search is case insensitive.

#10 Updated by Jesús García Crespo over 7 years ago

  • Status changed from In progress to QA/Review
  • Assignee changed from Jesús García Crespo to Dan Gillean

#11 Updated by Dan Gillean over 7 years ago

  • Status changed from QA/Review to Verified

Tested a CSV import that included:

  • draft
  • DRAFT
  • Draft
  • Published
  • published
  • PUBLISHED

...as various publicationStatus values. All imported properly, without warnings, and with the correct publication status. I'm not going to test installing a 1.x instance and upgrading it and seeing if the issue is resolved, but since the import works, and since it no longer matters how the terms are cased for the match, I think this should solve the issue.

#12 Updated by Dan Gillean over 3 years ago

  • Related to Bug #12440: Publication status ignored in CSV imports performed via the User interface; default publication status used for all descriptions added

Also available in: Atom PDF