[Bug 38617] New: Fix warning about auto increment and biblioitems
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Bug ID: 38617 Summary: Fix warning about auto increment and biblioitems Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: About Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org Bug 35033 added a check for auto increment problems related to biblioitems. The code looks like this: my $biblioitems = $dbh->selectall_arrayref( q|select bi.biblioitemnumber from biblioitems bi join deletedbiblioitems dbi on bi.biblionumber=dbi.biblionumber|, { Slice => {} } ); It compares biblioitems and deletedbiblioitems, which makes sense. But the template that displays the results look like this: [% IF ai_biblioitems %] <h4>Bibliographic records</h4> <p>The following IDs exist in both tables [% "biblio" | $HtmlTags tag="strong" %] and [% "deletedbiblioitems" | $HtmlTags tag="strong" %]:</p> <p> [% FOR b IN ai_biblioitems %] [% b.biblioitemnumber | html %] [% UNLESS loop.last %], [% END %] [% END %] </p> [% END %] The problem is this: The following IDs exist in both tables [% "biblio" | $HtmlTags tag="strong" %] and [% "deletedbiblioitems" | $HtmlTags tag="strong" %] It says "biblio and deletedbiblioitems", when it should say "biblioitems and deletedbiblioitems". -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35033 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Created attachment 175165 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175165&action=edit Bug 38617: Fix warning about auto increment and biblioitems To reproduce: - Delete a bibliographic, noting the biblionumber (let's call it X) - Run this in the database: UPDATE deletedbiblioitems SET biblionumber = X; - Go to About Koha > System information - Notice the warning compares two tables that are not equivalent: "The following IDs exist in both tables biblio and deletedbiblioitems" To test: - Apply the patch - Reload the System information - The warning should now read: "The following IDs exist in both tables biblioitems and deletedbiblioitems" -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175165|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 175949 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175949&action=edit Bug 38617: Fix warning about auto increment and biblioitems To reproduce: - Delete a bibliographic, noting the biblionumber (let's call it X) - Run this in the database: UPDATE deletedbiblioitems SET biblionumber = X; - Go to About Koha > System information - Notice the warning compares two tables that are not equivalent: "The following IDs exist in both tables biblio and deletedbiblioitems" To test: - Apply the patch - Reload the System information - The warning should now read: "The following IDs exist in both tables biblioitems and deletedbiblioitems" Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the warning release notes| |about auto increment and | |biblioitems on the About | |Koha > System information | |page. | | | |If the system | |identifies auto increment | |issues, the message is now | |"The following IDs exist in | |both tables biblioitems and | |deletedbiblioitems", | |instead of "...tables | |biblio and | |deletedbiblioitems". CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Hi Magnus. The steps to reproduce the error didn't work for me. Using KTD, I deleted the items and then record for Programming Perl (biblionumber = 262). The SQL didn't change anything for me - before the SQL command, the biblionumber was already 262. The table details before running the SQL command: select * from deletedbiblioitems; +------------------+--------------+--------+--------+----------+---------------+------+------+-----------------+---------------+------------+------------+-----------------+----------------+------------------+------------------+-----------------------+---------------------+--------+----------------+-------+--------+--------------------------+--------------+------+-----------+----------+---------+-----------+---------+----------------+-------------+ | biblioitemnumber | biblionumber | volume | number | itemtype | isbn | issn | ean | publicationyear | publishercode | volumedate | volumedesc | collectiontitle | collectionissn | collectionvolume | editionstatement | editionresponsibility | timestamp | illus | pages | notes | size | place | lccn | url | cn_source | cn_class | cn_item | cn_suffix | cn_sort | agerestriction | totalissues | +------------------+--------------+--------+--------+----------+---------------+------+------+-----------------+---------------+------------+------------+-----------------+----------------+------------------+------------------+-----------------------+---------------------+--------+----------------+-------+--------+--------------------------+--------------+------+-----------+----------+---------+-----------+---------+----------------+-------------+ | 262 | 262 | NULL | NULL | BK | 9780596004927 | NULL | NULL | NULL | O'Reilly, | NULL | NULL | NULL | NULL | NULL | 4th ed. | NULL | 2024-12-26 19:02:47 | ill. ; | xli, 1130 p. : | NULL | 24 cm. | Beijing ; | Sebastopol : | 2012392268 | NULL | ddc | NULL | NULL | NULL | | NULL | NULL | +------------------+--------------+--------+--------+----------+---------------+------+------+-----------------+---------------+------------+------------+-----------------+----------------+------------------+------------------+-----------------------+---------------------+--------+----------------+-------+--------+--------------------------+--------------+------+-----------+----------+---------+-----------+---------+----------------+-------------+ 1 row in set (0.000 sec) I could recreate the issue by using UPDATE deletedbiblioitems SET biblionumber = 100; David -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 --- Comment #4 from Magnus Enger <magnus@libriotech.no> --- Hm, the point was to get to a situation where the same id is in both biblioitems and deletedbiblioitems. So I guess it should be UPDATE deletedbiblioitems SET biblionumber = Y; where Y is the biblionumber of a record that has *not* been deleted yet. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 --- Comment #5 from David Nind <david@davidnind.com> --- Thanks Magnus! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Assignee|koha-bugs@lists.koha-commun |magnus@libriotech.no |ity.org | QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- QA by RM -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This fixes the warning |This fixes the table name release notes|about auto increment and |in the warning about auto |biblioitems on the About |increment and biblioitems |Koha > System information |on the About Koha > System |page. |information page. | | |If the system |If the |identifies auto increment |system identifies auto |issues, the message is now |increment issues, the |"The following IDs exist in |message is now "The |both tables biblioitems and |following IDs exist in both |deletedbiblioitems", |tables biblioitems and |instead of "...tables |deletedbiblioitems", |biblio and |instead of "...tables |deletedbiblioitems". |biblio and | |deletedbiblioitems". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 |25.05.00,24.11.03 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 --- Comment #8 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 24.11.x for 24.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #9 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 --- Comment #10 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38617 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org