While beta testing a citation parsing plugin, I discovered a corruption that stumped the Check and Repair Database… tool. It causes a freeze and, since the Cancel does not work, it becomes necessary to kill the Gramps task.
This particular corruption causes a serialization crash when the bad Citation is selected in any Citation view. So deleting via the GUI - Remove is not possible.
I tried converting the sqlite.db file to an .sql text file, deleting the affected citation/source/repository injections. But the problem was with secondary records (a corrupt Attribute) and I could not find that SQL line. So the .db rebuilt from the redacted .sql still froze the Check and Repair Database… tool.
Finally was able to recover the corrupted tree. The solution was to delete the affected Citation, Sources and Repository with careful recursive use of the Remove Unused Objects… tool. But if the Citation had been in use, that would not have worked either. The tool would not have offered a ‘referenced’ Citation as a markable Delete choice.
The same code that created a bad attribute in 5.2 worked correctly under the 6.0 version. And there are plans to make the Cancel button truly functional. More time being spent pickle-proofing the Check and Repair Database tool probably isn’t a good use of time.
But a method of deleting an object by a specific ID (without previewing the records other values) seems worthwhile.
Maybe it could just be an SQL script to run in one of the shell gramplets?
