http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #29 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #27)
(In reply to comment #24)
Well, Thinking of it a little bit more, I've reverted the patch.
Having history badly broken for existing instances is really bad, because we will never be able to fix the problem properly once action_logs contains mixed informations (biblio & items)
And I've an easy proposal to fix what can be fixed: The following SQL: UPDATE action_logs SET object=(SELECT itemnumber FROM items WHERE biblionumber= action_logs.object LIMIT 1) WHERE module='CIRCULATION' AND action in ('ISSUE','RETURN');
Set the 1st item number (as we can't know which item was circulated once things have been anonymised). It's better than nothing.
I propose that you submit a new patch including an updatedatabase with this SQL
As a possible supplement, how about tagging the object column with an indication of whether it's an old-style log of a biblionumber. E.g.,
UPDATE action_logs SET object = 'biblio ' || object WHERE module = 'CIRCULATION' AND action IN ('ISSUE', 'RETURN');
Then viewlog.pl could assume that if the value is tagged with a 'biblio ' prefix that it contains an bib number; if it isn't, it contains an item number.
Doing it this way would mean that the logs are as accurate as possible. It means Adrien would have to update viewlog.pl to take care of this ? I'm not sure I'm for it. It introduce some specific code to circumvent an error in what is saved.
Another, farther-reaching option would be to add biblionumber and itemnumber columns to action_logs. mmm... the 'object' term is generic, it can also contain a borrowernumber,... Maybe that was a mistake, and it would be better to have a "biblionumber", "itemnumber", "borrowernumber",... field (one field for each needed kind of information). But that would be for another patch ;-)
-- You are receiving this mail because: You are watching all bug changes.