k-int / gokb-phase1

Original GOKb repo - Moving to https://github.com/openlibraryenvironment/gokb
http://www.gokb.org
Other
11 stars 5 forks source link

Admin option "Expunge Deleted Records" points to nonexistent function #598

Open hornmo opened 7 years ago

hornmo commented 7 years ago

The admin sidebar has one item that links to a "cleanup" function of the AdminController. Although there is a function "expungeDeletedComponents" in the CleanupService, there is no calling function in the AdminController for this. The selection of this item results in a Tomcat 404 status page.

hornmo commented 7 years ago

This is fixed in #601, but one problem that remains is the handling of HistoryEvents. When a title is deleted, the expunge function in KBComponent.groovy deletes only the participant:

ComponentHistoryEventParticipant.executeUpdate("delete from ComponentHistoryEventParticipant as c where c.participant = :component",[component:this]);

This leaves empty references in the remaining title, and if both are deleted, the historyEvent is orphaned. Therefore, the deletion of a title should probably delete the whole historyEvent. At least, historyEvents without participants should be catched by a cleanup run.