Bug #10111

Delete corresponding keymap entries when removing Information Object records

Added by Steve Breker over 2 years ago. Updated almost 2 years ago.

Status:VerifiedStart date:07/08/2016
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

Category:Data model / ORMEstimated time:2.00 hours
Target version:Release 2.4.0
Google Code Legacy ID: Tested version:2.4
Sponsored:No Requires documentation:No

Description

When records are imported into AtoM (either XML or CSV), a value is written to the keymap table - if a user uses the --sourcename option available in the CLI task for CSV import, this value will be written; for XML imports, the filename is written.

During recent testing, it was discovered that the keymap records are currently not being deleted when a corresponding Information Object is deleted. This needs to be corrected to support new CSV/XML import matching logic, as the --update option may end up pointing to a deleted record, causing a false match.

This ticket will add code to QubitInformationObject::delete() that will clean up any existing keymap records.

History

#2 Updated by Dan Gillean over 2 years ago

  • Description updated (diff)

#3 Updated by Steve Breker over 2 years ago

  • Status changed from New to Code Review
  • Assignee changed from Steve Breker to Nick Wilkinson

Completed development and tested. Ready for code review.

#4 Updated by Nick Wilkinson over 2 years ago

  • Assignee changed from Nick Wilkinson to Mike Gale

Hi Mike, can you take a look for CR?

#5 Updated by Mike Gale over 2 years ago

  • Assignee changed from Mike Gale to Steve Breker

Looks good

#6 Updated by Steve Breker over 2 years ago

  • Status changed from Code Review to QA/Review
  • Assignee changed from Steve Breker to Dan Gillean

Merged and ready for testing.

#7 Updated by Dan Gillean over 2 years ago

  • Status changed from QA/Review to Feedback
  • Assignee changed from Dan Gillean to Steve Breker

Hi Steve, can you give me some testing instructions? Like, maybe a simple SQL query i can use to check the keymap table? Or is it easier if a developer QAs this issue?

#8 Updated by Steve Breker over 2 years ago

Hi Dan

You can check if the keymap rec is being deleted by:

1) loading an info object via csv import (only one info object need be created).
2) run the following sql query - your keymap record should be at the top (check your filename is in the source_name field and note the 'id'):

select * from keymap order by id desc;

3) delete the new info object from the WebUI.
4) run the same query again:

select * from keymap order by id desc;

5) your record noted in step (2) above should be gone.

#9 Updated by Steve Breker over 2 years ago

  • Status changed from Feedback to QA/Review
  • Assignee changed from Steve Breker to Dan Gillean

#10 Updated by Dan Gillean almost 2 years ago

  • Status changed from QA/Review to Verified

Also available in: Atom PDF