Bug #5431

CSV transformation's level of description sorting logic is broken

Added by Misty De Meo almost 9 years ago. Updated almost 9 years ago.

Status:VerifiedStart date:08/02/2013
Priority:MediumDue date:
Assignee:José Raddaoui Marín% Done:

0%

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

Description

As of the fix to #616, the levels of description are now brought in from the database instead of hardcoded in the source code. However, the levelOfDescriptionToSortOrder method is still converting all terms to lowercase when looking them up:

function levelOfDescriptionToSortorder($level)
{
  return array_search(strtolower($level), $this->levelsOfDescription);
}

Since the values pulled in from the database are capitalized, this means that they'll never be found even if they're correct in the source data.

Could either change to ucwords(), or just stop changing the string before searching.


Related issues

Related to Access to Memory (AtoM) - Feature #616: Get levels of descriptions from database Verified 11/19/2012

History

#1 Updated by José Raddaoui Marín almost 9 years ago

Hi Misty,

Thanks for noticing, it was my fault. I'll fix it on #616, as is still on QA/Review.

#2 Updated by Misty De Meo almost 9 years ago

Thanks! Though I have a commit ready to push to fix this, I can just push that if you'd rather.

Mike C suggested simply removing any changes to the strings and passing them along as-is. In that case we'll also need to update the example CSV data to reflect that lowercase values are no longer appropriate.

#3 Updated by Jesús García Crespo almost 9 years ago

Misty, just in case that you didn't notice: Radda pushed commit:afa139af038dd1c7b8e8af13c72e512fc5c4eb5a as part of #616. Maybe this issue can be closed now? Thank you.

#4 Updated by Jesús García Crespo almost 9 years ago

  • Target version set to Release 1.4.0

Please don't forget to assign a target version! :D

#5 Updated by José Raddaoui Marín almost 9 years ago

Sorry Misty, I didn't see your last update and I've made the change letting it as it was, with the levels of description stored in the array in lowercase.

If you feel it's better the other way, please change it.

Thanks ;)

#6 Updated by Jesús García Crespo almost 9 years ago

  • Status changed from New to Verified

#7 Updated by Misty De Meo almost 9 years ago

  • Status changed from Verified to QA/Review

That way should be fine, thanks Radda!

#8 Updated by Jesús García Crespo almost 9 years ago

  • Status changed from QA/Review to Verified
  • Assignee changed from Misty De Meo to José Raddaoui Marín

Also available in: Atom PDF