[Koha-bugs] [Bug 17080] New: Koha::Object-> new should handle default values for NOT NULL columns
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Aug 8 15:32:43 CEST 2016
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17080
Bug ID: 17080
Summary: Koha::Object->new should handle default values for NOT
NULL columns
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: ASSIGNED
Severity: enhancement
Priority: P5 - low
Component: Architecture, internals, and plumbing
Assignee: jonathan.druart at bugs.koha-community.org
Reporter: jonathan.druart at bugs.koha-community.org
QA Contact: testopia at bugs.koha-community.org
Recently we face the same issue on different modules after we moved them to the
Koha namespace using Koha::Object of using DBIx::Class directly.
1/ Koha::Patron::Modification on bug 16960 comment 14 and 15
2/ Koha::Patron::Category from bug 17069
3/ C4::Members::AddMember (which does not use Koha::Object) on bug 16917
If a DB column is defined as NOT NULL and has a default value, the DBIx::Class
$rs->update_or_insert method won't use the default value if the column name has
been passed to the constructor.
We do that almost everywhere as we retrieve the data from the HTML forms
without checking/cleaning them.
There are several ways to fix that:
1/ Continue to fix them case by case (what we did for the recent issues)
2/ Try to fix them globally (existing ones and the next ones)
This report will propose a global solution to avoid future issues of this kind.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list