[Bug 7241] New: circulation action logs record biblionumber instead of item number
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Bug #: 7241 Summary: circulation action logs record biblionumber instead of item number Classification: Unclassified Change sponsored?: --- Product: Koha Version: unspecified Platform: All OS/Version: All Status: NEW Severity: minor Priority: P5 - low Component: Transaction logs AssignedTo: paul.poulain@biblibre.com ReportedBy: ago@bywatersolutions.com QAContact: ian.walls@bywatersolutions.com Issue log and and circulation logs are incorrectly recording biblionumber instead of item number, creating incorrect logs. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Albert Oller <ago@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|paul.poulain@biblibre.com |ago@bywatersolutions.com -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Sophie MEYNIEUX <sophie.meynieux@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sophie.meynieux@biblibre.co | |m --- Comment #1 from Sophie MEYNIEUX <sophie.meynieux@biblibre.com> 2011-11-18 08:39:48 UTC --- This problem was also reported by one of our client http://suivi.biblibre.com/view.php?id=8205 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #2 from Ian Walls <ian.walls@bywatersolutions.com> 2011-11-18 14:02:07 UTC --- There are two possible resolutions: either change the link-creating code to expect biblionumber instead of itemnumber, or start recording item number instead. The former is easier, but doesn't record as good of data. The latter is more thorough, but requires a database update to find an itemnumber for the recorded biblionumber... this may not be the item circulated (impossible to find out), but it's better than nothing. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> 2011-11-23 14:50:59 UTC --- *** Bug 7256 has been marked as a duplicate of this bug. *** -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adrien.saurat@biblibre.com --- Comment #4 from Adrien SAURAT <adrien.saurat@biblibre.com> 2011-12-19 13:08:29 UTC --- In fact, the correct ID is stored in the action_logs table : - when modifying a biblio, the biblionumber is stored in the "object" field; - when modifying an item, the itemnumber is stored in the "object" field. The problem is that, when the page "viewlogs" tries to display these log entries, there is no way to know if the value stored was an itemnumber or a biblionumber ! Where could we store this information ? 1) A new field ? (would be unuseful for many possible actions) 2) New values for the "action" field ? We now use ADD, MODIFY and DELETE. We could have ADD_ITEM, MODIFY_ITEM, DELETE_ITEM, ADD_BIBLIO, MODIFY_BIBLIO and DELETE_BIBLIO. 3) More info in the "info" field ? For example, when a systempreference is modified, the info field contains a string like this : "OPACUserCSS | new/path/test.css" We could then begin the info with "ITEM | " or "BIBLIO | ". -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #5 from Adrien SAURAT <adrien.saurat@biblibre.com> 2011-12-19 13:36:34 UTC --- There may be another (better?) way: Example of the "info" field content for an item: LDR 995 _f00658000058359 _qj _p25.00 _m2011-12-05 _10 _911139 _cMON _20 _k599.72 _n2012-01-04 _o0 _eDoc jeunesse _bVID Example of the "info" field content for a biblio: BEFORE=>LDR 02769cam 2200553 4500 010 _a2070534812 _bvol. 1 _bbr. _d69 F 010 _a2-07-053482-0 _bvol. 2 _bbr ... bla bla bla ... eDoc adultes _bFLA _qa _rPapiers collés _t1 995 _f08307000011057 _p10.70 _m2009-07-10 _10 _974042 _cFLA _20 _k523 DUP H1 _o0 _eDoc adultes _bFLA _qa _rPapiers collés _t1 "LDR 995" Ok, for the biblio it begins with "BEFORE=>" but I did not propose this as I'm not sure this will stay so (and maybe should the item also begins with BEFORE=> ?). But ! The item info begins with "LDR 995", and this string may be enough to be sure we have an item here. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> 2011-12-19 13:48:27 UTC --- Be careful, this will be different for MARC21 as item information is stored in 952 there. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #7 from Adrien SAURAT <adrien.saurat@biblibre.com> 2011-12-19 14:20:47 UTC --- Ok, important indeed. Can we consider that the field "info" for an item will ever begin either with "LDR 955" or with "LDR 952" ? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #8 from Adrien SAURAT <adrien.saurat@biblibre.com> 2011-12-19 14:34:33 UTC --- I mean of course "LDR 995" or "LDR 952". I don't have any Marc21 database to test the "LDR 952" output. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #9 from Adrien SAURAT <adrien.saurat@biblibre.com> 2011-12-27 09:54:06 UTC --- As seen with hdl today, it would be better to add a new field in the table. I've seen that the code sometimes searches for a value "item" in the info "field". It was maybe the case earlier, but now info contains the resulting string of a MARC RecordWe already have a field called "object" containing the code, "as_formatted" method call. Some parts of the code may be obsolete then, or need to be updated. We need indeed more information about the object but as the general info field is already used for the MARC Record "pretty string", I'll add a field called "object_info". When dealing with cataloguing, it will contain "item" or "biblio" to help displaying the correct link. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #10 from Adrien SAURAT <adrien.saurat@biblibre.com> 2012-01-06 16:20:48 UTC --- For information (as my previous message were probably confusing) : As Sophie told in Comment 1 we had a user reporting this kind of problem, but in fact it was about the CATALOGUING logs (log problem there too). I'm preparing a patch which will add a new column "objectinfo" and solve this. But I still have to cover the main topic of this BZ 7241, ISSUE and CIRCULATION logs (or is Albert working on this ? can I assign the bug to me? ) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|ago@bywatersolutions.com |adrien.saurat@biblibre.com --- Comment #11 from Adrien SAURAT <adrien.saurat@biblibre.com> 2012-01-09 10:00:56 UTC --- Created attachment 7088 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7088 proposed patch Proposed patch : For CIRCULATION: ISSUE and RETURN actions now store itemnumber instead of biblionumber. For CATALOGUING: we now know if the code stored in the object field is an item or a biblio (thanks to a new field called objectinfo). (this patch does not modify the history in DB) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7088|0 |1 is obsolete| | --- Comment #12 from Jared Camins-Esakov <jcamins@cpbibliography.com> 2012-02-07 14:01:22 UTC --- Created attachment 7471 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7471 Bug 7241: corrects log action for CIRC and CATALOGUING For CIRCULATION: ISSUE and RETURN actions now store itemnumber instead of biblionumber. For CATALOGUING: we now know if the code stored in the object field is an item or a biblio (thanks to a new field called objectinfo). Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> This patch does not change the user interface for the cataloguing log, but fixes the problem with the circ log. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |jcamins@cpbibliography.com -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #13 from Ian Walls <koha.sekjal@gmail.com> 2012-02-16 17:31:40 UTC --- Any change to the way the log information is recorded needs to work retroactively, or else the logs will be unusable before the date of the upgrade. Going from itemnumber to biblionumber is easy, since it's one-way mapping. Marking as Failed QA until the problem of fixing existing log entries is resolved. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #14 from Adrien SAURAT <adrien.saurat@biblibre.com> 2012-02-23 13:17:29 UTC --- As it is now, the biblionumber is stored instead of the itemnumber. We have to go from biblio to item, I thus can't see a way to completely correct the old logs. It seems dangerous to me to take a random itemnumber. For the "1 biblio = 1 item" cases we would be pretty accurate (when the item wasn't replaced), but when a biblio is related to several items it could be very misleading to display a randomly chosen itemnumber. Maybe we can make a script correcting the logs when only one item exists for the biblio, and replacing the log info with a message explaining what happened for the other cases. Message like "itemnumber not available : biblionumber = 323232" -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Koha Team Lyon 3 <koha@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@univ-lyon3.fr --- Comment #15 from Koha Team Lyon 3 <koha@univ-lyon3.fr> --- related to Bug 7869 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #16 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Any comments on this ? How should we try to correct the old logs ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7471|0 |1 is obsolete| | --- Comment #17 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Created attachment 9870 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9870&action=edit proposed patch #2 New patch. A simple one, easy to test and related to the original CIRCULATION problem. I'll create another Bug for the cataloguing problem. I think it would be good to apply this asap. The sooner the logs become clean, the better. Even if some archive is bad. Of course if someone has an idea to clean the history too, I'll do it, but as we're trying to find Itemnumbers when only a Biblionumber is stored, I don't know how to do that because. Two main problems for that: a/ A Biblio can often have several Items b/ Even if we correct only the Biblios having only one Item, it's not possible to know if it was the case when the circulation action was made (maybe some Items have disappeared since). So, what should we do? 1/ Simply use the patch to have good logs from now on. 2/ Add to the patch a script to correct history (how?) 3/ Still another solution : update the history by adding a message simply explaining that these logs are incorrects? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr --- Comment #18 from Frédéric Demians <frederic@tamil.fr> --- This patch must be applied. The more we wait, the more logs are populated with bad informations. Ian suggestion to take the first item is not that bad. An update warning could explain the situation. The logs would be inaccurate but usable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #19 from Owen Leonard <oleonard@myacpl.org> --- Frédéric could you vote with your signoff? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9870|0 |1 is obsolete| | --- Comment #20 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 11415 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11415&action=edit [SIGNED-OFF] Bug 7241: fix for the CIRC logs -> itemnumber stored correctly Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #21 from Owen Leonard <oleonard@myacpl.org> --- After applying the patch entries in the action_logs tables for ISSUE and RETURN show the itemnumber instead of the biblionumber. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|PATCH-Sent (DO NOT USE) |P5 - low Version|unspecified |master Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |mtj@kohaaloha.com --- Comment #22 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #20)
Created attachment 11415 [details] [SIGNED-OFF] Bug 7241: fix for the CIRC logs -> itemnumber stored correctly
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
patch looks good, passing QA mason@xen1:~/git/head$ koha-qa.pl * a82aaaf Bug 7241: fix for the CIRC logs -> itemnumber stored correctly C4/Circulation.pm - perlcritic-progressive tests... OK - perl -c syntax tests... OK - xt/tt_valid.t tests... OK - xt/author/valid-template.t tests... OK -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #23 from Owen Leonard <oleonard@myacpl.org> --- *** Bug 7869 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_8 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |ASSIGNED --- Comment #24 from Paul Poulain <paul.poulain@biblibre.com> --- 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 Thanks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #25 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Ok, I made a test with this request and it modified all the timestamps of my updated rows. That's because this field is designed to store the date of each sql update: `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, It seems to me that, for these logs, the important date is the "library action" date and not the "last SQL modification" date. --- I suggest adding also the following line before the UPDATE: ALTER TABLE action_logs CHANGE timestamp timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; The timestamp will still be automatically set when creating a row, but updating won't change the original date/time. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #11415|0 |1 is obsolete| | --- Comment #26 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Created attachment 12043 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12043&action=edit proposed patch #3 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gmcharlt@gmail.com --- Comment #27 from Galen Charlton <gmcharlt@gmail.com> --- (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. Another, farther-reaching option would be to add biblionumber and itemnumber columns to action_logs. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #28 from Chris Cormack <chris@bigballofwax.co.nz> --- (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.
Another, farther-reaching option would be to add biblionumber and itemnumber columns to action_logs.
+1 -- You are receiving this mail because: You are watching all bug changes.
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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12043|0 |1 is obsolete| | --- Comment #30 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 12434 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12434&action=edit [SIGNED-OFF] Bug 7241: circulation action logs record biblionumber instead of item number Issue log and and circulation logs are incorrectly recording biblionumber instead of item number, creating incorrect logs. This patch corrects this, and modifies the action_logs table in two ways: - the timestamp is not updated anymore with UPDATES (but still automatically filled when INSERTing) - to partially correct the broken logs, the log history is filled with the first found item for each biblio Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #31 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: logaction API is: sub logaction { my ($modulename, $actionname, $objectnumber, $infos)=@_; the checkin/checkout is registered with: logaction("CIRCULATION", "ISSUE", $borrower->{'borrowernumber'}, $biblio->{'biblionumber'}) that you change to: logaction("CIRCULATION", "ISSUE", $borrower->{'borrowernumber'}, $biblio->{'itemnumber'}) So the (previous and wrong) biblionumber and the (new and correct) itemnumber is the 4th parameter. That is $info And $info goes to (surprise ;-) ) action_logs.info field the "object" field is reserved for the borrowernumber It means that the UPDATE is wrong: UPDATE action_logs SET object=(SELECT itemnumber FROM items WHERE biblionumber= action_logs.object LIMIT 1) WHERE module='CIRCULATION' AND action in ('ISSUE','RETURN'); should be UPDATE action_logs SET info=(SELECT itemnumber FROM items WHERE biblionumber= action_logs.info LIMIT 1) WHERE module='CIRCULATION' AND action in ('ISSUE','RETURN'); I had proposed the SQL in comment 24 without testing it, just for the general idea (I should have told it !) It seems neither Adrien nor Kyle have tested too ... Please resubmit a working patch ! (once again, my SQL is untested !!!) (OTOH, +1 for the timestamp update) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12434|0 |1 is obsolete| | --- Comment #32 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Created attachment 14745 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14745&action=edit new proposed patch Corrected patch. To test : 1/ Have a window displaying the circulation logs of the day and a window ready to checkin/checkout an item. 2/ Checkin/checkout, consult the circ logs : if you click on the "item" link you won't get to the right document. 3/ Apply patch 4/ Checkin/checkout, consult the circ logs : if you click on the "item" link you will now get to the right document (only for the last operation, the log history is not corrected) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 mathieu saby <mathieu.saby@univ-rennes2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mathieu.saby@univ-rennes2.f | |r -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14745|0 |1 is obsolete| | --- Comment #33 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 14945 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14945&action=edit [SIGNED-OFF] Bug 7241: circulation action logs record biblionumber instead of item number Issue log and and circulation logs are incorrectly recording biblionumber instead of item number, creating incorrect logs. This patch corrects this, and modifies the action_logs table in two ways: - the timestamp is not updated anymore with UPDATES (but still automatically filled when INSERTing) - to partially correct the broken logs, the log history is filled with the first found item for each biblio Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|koha.sekjal@gmail.com |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #34 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: This patch deserves to be pushed soon, but I am still having doubts on the following: 1 You remove the timestamp on update. Why? If you do not want to change the timestamp when correcting the old log lines, remove the timestamp temporarily on update and put it back when you are ready. Or try adding timestamp=timestamp in your update statement (did not test that). I think we should keep the on update clause (in terms of consistency). This would mean that you leave kohastructure unmodified. 2 Many people already commented on the old log lines. You choose the first item as a workaround. (Another approach could have been: Delete information that is incorrect, or somehow route the old lines to biblio detail and the new ones to item detail, perhaps adding biblio to info field for old ones.) It is somewhat arbitrary. But could you at least add a separate print line in the updatedatabase output warning the sysadmin about this? Please send a followup and switch back to Signed off. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14945|0 |1 is obsolete| | --- Comment #35 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 16202 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16202&action=edit Bug 7241: circulation action logs record biblionumber instead of item number Issue log and and circulation logs are incorrectly recording biblionumber instead of item number, creating incorrect logs. This patch corrects this, and modifies the action_logs table in two ways: - the timestamp is not updated anymore with UPDATES (but still automatically filled when INSERTing) - to partially correct the broken logs, the log history is filled with the first found item for each biblio Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
From the librarian point of view: there's no update, they only generate log
From an admin point of view: it is seldom needed to make any update on this, but if this has to happen, when the admin changes something in a line, he loses
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #36 from Adrien SAURAT <adrien.saurat@biblibre.com> --- I planned to remove the automatic update, not because it seemed useless to me, but because I see this as a bug. lines and can view them (read only) in the tools section. the date related to the library action, which is, I think, the important information! I don't use this often and I'm not a librarian so I could be mistaken, and anyway for clarity this should maybe discussed in another bug, so I'll make a new patch restoring the former behaviour. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #37 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Created attachment 16627 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16627&action=edit Follow-up for DB changes Follow-up: 1/ Reset timestamp modification on update after patch application. 2/ Give more information about the log history fix. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #38 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA: Having a quick look now.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #16202|0 |1 is obsolete| | Attachment #16627|0 |1 is obsolete| | --- Comment #39 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 16636 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16636&action=edit Bug 7241: circulation action logs record biblionumber instead of item number Issue log and and circulation logs are incorrectly recording biblionumber instead of item number, creating incorrect logs. This patch corrects this, and modifies the action_logs table in two ways: - the timestamp is not updated anymore with UPDATES (but still automatically filled when INSERTing) - to partially correct the broken logs, the log history is filled with the first found item for each biblio Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #40 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 16637 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16637&action=edit Bug 7241: circulation action logs record biblionumber instead of item number Issue log and and circulation logs are incorrectly recording biblionumber instead of item number, creating incorrect logs. This patch corrects this, and modifies the action_logs table in two ways: - the timestamp is not updated anymore with UPDATES (but still automatically filled when INSERTing) - to partially correct the broken logs, the log history is filled with the first found item for each biblio Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #41 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 16638 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16638&action=edit Bug 7241 follow-up: DB changes Reset timestamp modification on update after patch application. Give more information about the log history fix. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #16636|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Version|3.8 |master --- Comment #42 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: Looks good to me now. Thanks for adjustments. Note that I had lots of nulls in info field now for a test database where lots of biblios and items were removed. Normally, this should be an exception. Repeated a few records for valid biblios and items. That was okay. Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #43 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Sorry, Adrien: One final request: Please make the item parameter in the url for item details itemnumber. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #44 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Just send a followup, test and sign. Set back to Passed QA. Thx. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #45 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Created attachment 16661 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16661&action=edit follow-up fixing the template Indeed, the template had not been modified yet and needed a few tweaks (itemnumber, tooltip, anchor). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #46 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #47 from Adrien SAURAT <adrien.saurat@biblibre.com> --- Could it be added to the 3.8 updates too? Several 3.8 librairies could make use of this. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #48 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to comment #47)
Could it be added to the 3.8 updates too? Several 3.8 librairies could make use of this.
Better contact Rmaint directly? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #49 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x will be in 3.10.6 Patches don't apply for 3.8.x -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 Isabela Terra <isabelaterra@cp2.g12.br> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED CC| |isabelaterra@cp2.g12.br Resolution|FIXED |--- --- Comment #50 from Isabela Terra <isabelaterra@cp2.g12.br> --- I am having the same problem in 3.18.05. How fix it? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7241 --- Comment #51 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Isabela, can you please create a new bug report with a step by step description on how to reproduce the problem? And link to this one? This has already been pushed a long time ago, so it might be a slight variation of the original problem. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org