[Bug 39835] New: Tidy is_boolean / tinyint
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Bug ID: 39835 Summary: Tidy is_boolean / tinyint Change sponsored?: --- Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@gmail.com Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org Blocks: 39324 We have a test in the QA script to catch missing "is_boolean" in the schema if the column is a tinyint(1)/boolean. We need to add it to all the attributes, so the new version of the script can know if something is missing. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39324 [Bug 39324] [OMNIBUS] All QA tests should pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 181924 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181924&action=edit Bug 39835: Modify boolean column from int(1) to tinyint(1) This is part of our guideline and we should enforce it. This patch also add "is_boolean => 0" for int(1) that are not boolean -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 181925 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181925&action=edit Bug 39835: Add is_boolean for tinyint(1) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Version|24.11 |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Tomás Cohen Arazi (tcohen) <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=39835 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #181924|0 |1 is obsolete| | --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 181926 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181926&action=edit Bug 39835: Modify boolean column from int(1) to tinyint(1) This is part of our guideline and we should enforce it. This patch also add "is_boolean => 0" for int(1) that are not boolean 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=39835 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #181925|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 181927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181927&action=edit Bug 39835: Add is_boolean for tinyint(1) 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=39835 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- I sorted the attributes alphabetically (inline) and all looks good. The dbrev works and doesn't fail if the attributes are already tinyint. QA tools happy. Waiting for a missing commit in [this branch](https://gitlab.com/joubu/qa-test-tools/-/commits/issue_93?ref_type=heads) to properly check if we would catch missing `is_boolean` entries in new submissions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.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=39835 Tomás Cohen Arazi (tcohen) <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=39835 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 181971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=181971&action=edit Bug 39835: columns_settings should be tinyint They are boolean in the schema file already -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please don't omit the success messages in your database updates... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.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=39835 --- Comment #8 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=39835 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@openfifth.c | |o.uk 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=39835 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 --- Comment #9 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 182015 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182015&action=edit Bug 39835: (follow-up) Fix API specs to check for boolean -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Sorry for not realizing this sooner, but looking at Matts patch I belive there is a mistake here that is causing a lot of tests to fail now: None of the new ones below are booleans. They are actually numbers, some can even be negative, like notforloan. They are actual tinyints that can take more than 0/1 values in Koha. damaged itemlost notforloan restricted stack withdrawn =head2 koha_objects_class diff --git a/Koha/Schema/Result/Deleteditem.pm b/Koha/Schema/Result/Deleteditem.pm index f0ffca3875e..ae17dc6d48d 100644 --- a/Koha/Schema/Result/Deleteditem.pm +++ b/Koha/Schema/Result/Deleteditem.pm @@ -536,7 +536,13 @@ __PACKAGE__->set_primary_key("itemnumber"); __PACKAGE__->add_columns( '+bookable' => { is_boolean => 1 }, + '+damaged' => { is_boolean => 1 }, '+exclude_from_local_holds_priority' => { is_boolean => 1 }, + '+itemlost' => { is_boolean => 1 }, + '+notforloan' => { is_boolean => 1 }, + '+restricted' => { is_boolean => 1 }, + '+stack' => { is_boolean => 1 }, + '+withdrawn' => { 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=39835 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 2) Item Same as last comment, but for Item. 3) Also tab here is 1-10 (the tab to display on): index 24a15f7e824..0dd90736f43 100644 --- a/Koha/Schema/Result/AuthSubfieldStructure.pm +++ b/Koha/Schema/Result/AuthSubfieldStructure.pm @@ -220,6 +220,12 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-19 06:49:06 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c6rPINoF/ZP4YzXU1VR+UQ +__PACKAGE__->add_columns( + '+isurl' => { is_boolean => 1 }, + '+linkid' => { is_boolean => 1 }, + '+tab' => { is_boolean => 1 }, +); 4) Same as before, tab AND hidden are wrong: Hidden takes numeric values. +++ b/Koha/Schema/Result/MarcSubfieldStructure.pm @@ -233,6 +233,10 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-12-10 09:06:23 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KVbDXEVf96eDkbPYpcmQVA +__PACKAGE__->add_columns( + '+hidden' => { is_boolean => 1 }, + '+isurl' => { is_boolean => 1 }, + '+tab' => { is_boolean => 1 }, +); 5) Very doubtful about rating_value: -# You can replace this text with custom content, and it will be preserved on regeneration 1; diff --git a/Koha/Schema/Result/Rating.pm b/Koha/Schema/Result/Rating.pm index a25f1eae727..78ae27d8b27 100644 --- a/Koha/Schema/Result/Rating.pm +++ b/Koha/Schema/Result/Rating.pm @@ -121,6 +121,8 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wUwI/h1WR8kVGMNCrv/tUQ +__PACKAGE__->add_columns( + '+rating_value' => { 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=39835 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #182015|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 182020 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182020&action=edit Bug 39835: (follow-up) Fix API specs to check for boolean Amended-by: Jonathan Druart Removed changes to item.yaml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 --- Comment #13 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 182021 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=182021&action=edit Bug 39835: Adjust some boolean flags -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Follow-ups pushed to main, sorry I forgot to note here! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Needs documenting --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Not needed for 24.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39835 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |david@davidnind.com Status|Needs documenting |RESOLVED --- Comment #16 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org