[Bug 36687] New: itemtypes.notforloan should be tinyint and NOT NULL
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Bug ID: 36687 Summary: itemtypes.notforloan should be tinyint and NOT NULL Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org kohastructure says itemtypes.notforloan is "1 if the item is not for loan, 0 if the item is available for loan". It is also defined as smallint(6). Unlike items.notforloan it cannot be any other value than 0 or 1. I think this should be NOT NULL DEFAULT 0 and tinyint(1). -- 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=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=36687 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 165483 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165483&action=edit Bug 36687: Update itemtpes.notforloan to not allow NULL values and change to tinyint(1) -- 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=36687 --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 165484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165484&action=edit Bug 36687: Schema changes -- 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=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- 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=36687 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |tomascohen@gmail.com --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Hi, I think you need to first set any NULL values to 0 before the ALTER TABLE. I got this error when manually setting some itemtypes.notforloan values to NULL before running your DBRev. ``` ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Data truncated for column 'notforloan' at row 1 at /kohadevbox/koha/C4/Installer.pm line 741 ``` Also, I think the is_boolean flag should be added to the schema file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165483|0 |1 is obsolete| | --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 165819 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165819&action=edit Bug 36687: Update itemtypes.notforloan to not allow NULL values and change to tinyint(1) To test: 1. Have some itemtypes.notforloan values set to NULL. 2. APPLY PACTH, updatedatabase, restart_all 3. When you updatedatabase those values should be set to 0. 4. Try updating an itemtypes.notforloan value to NULL. You cannot. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165484|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 165820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165820&action=edit Bug 36687: Schema updates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> ---
Also, I think the is_boolean flag should be added to the schema file. Is it not already there?
343 '+notforloan' => { is_boolean => 1 }, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165819|0 |1 is obsolete| | --- Comment #7 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165840 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165840&action=edit Bug 36687: Update itemtypes.notforloan to not allow NULL values and change to tinyint(1) To test: 1. Have some itemtypes.notforloan values set to NULL. 2. APPLY PACTH, updatedatabase, restart_all 3. When you updatedatabase those values should be set to 0. 4. Try updating an itemtypes.notforloan value to NULL. You cannot. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165820|0 |1 is obsolete| | --- Comment #8 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 165841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165841&action=edit Bug 36687: Schema updates Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Lucas Gass from comment #0)
kohastructure says itemtypes.notforloan is "1 if the item is not for loan, 0 if the item is available for loan". It is also defined as smallint(6).
Unlike items.notforloan it cannot be any other value than 0 or 1.
I think this should be NOT NULL DEFAULT 0 and tinyint(1).
Seems wrong to me. We have several notforloan values. Not only 0 and 1. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #9)
(In reply to Lucas Gass from comment #0)
kohastructure says itemtypes.notforloan is "1 if the item is not for loan, 0 if the item is available for loan". It is also defined as smallint(6).
Unlike items.notforloan it cannot be any other value than 0 or 1.
I think this should be NOT NULL DEFAULT 0 and tinyint(1).
Seems wrong to me. We have several notforloan values. Not only 0 and 1.
This is itemtypes.notforloan. Which can only be set to 0 or 1 in the UI. See the attachment I'm uploading. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 166257 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166257&action=edit The place it can be set -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #10)
(In reply to Marcel de Rooy from comment #9)
(In reply to Lucas Gass from comment #0)
kohastructure says itemtypes.notforloan is "1 if the item is not for loan, 0 if the item is available for loan". It is also defined as smallint(6).
Unlike items.notforloan it cannot be any other value than 0 or 1.
I think this should be NOT NULL DEFAULT 0 and tinyint(1).
Seems wrong to me. We have several notforloan values. Not only 0 and 1.
This is itemtypes.notforloan. Which can only be set to 0 or 1 in the UI. See the attachment I'm uploading.
Ok Where are my glasses :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #12)
(In reply to Tomás Cohen Arazi from comment #10)
(In reply to Marcel de Rooy from comment #9)
(In reply to Lucas Gass from comment #0)
kohastructure says itemtypes.notforloan is "1 if the item is not for loan, 0 if the item is available for loan". It is also defined as smallint(6).
Unlike items.notforloan it cannot be any other value than 0 or 1.
I think this should be NOT NULL DEFAULT 0 and tinyint(1).
Seems wrong to me. We have several notforloan values. Not only 0 and 1.
This is itemtypes.notforloan. Which can only be set to 0 or 1 in the UI. See the attachment I'm uploading.
Ok Where are my glasses :)
Ah the description mentioned items.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165840|0 |1 is obsolete| | Attachment #165841|0 |1 is obsolete| | --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 166413 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166413&action=edit Bug 36687: Update itemtypes.notforloan to not allow NULL values and change to tinyint(1) To test: 1. Have some itemtypes.notforloan values set to NULL. 2. APPLY PACTH, updatedatabase, restart_all 3. When you updatedatabase those values should be set to 0. 4. Try updating an itemtypes.notforloan value to NULL. You cannot. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 166414 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166414&action=edit [DO NOT PUSH] Bug 36687: Schema updates Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- Thanks Tomas. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.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=36687 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166447 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166447&action=edit Bug 36687: (RM follow-up) Fix unit tests Set notforloan to '0' as apposed to 'undef' for tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 166448 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166448&action=edit Bug 36687: (RM follow-up) Fix more unit tests Use currency.active to test `int(1) DEFAULT NULL` now that itemtypes.notforloan is `NOT NULL DEFAULT '0'` Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Follow-ups Pushed as RM backup. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|24.05.00 |24.05.00,23.11.06 released in| | Status|Pushed to main |Pushed to stable --- Comment #21 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36687 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED --- Comment #22 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will not be backported to 23.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org