[Bug 20176] New: Set biblio.datecreated to NOW if not defined
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Bug ID: 20176 Summary: Set biblio.datecreated to NOW if not defined Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Test Suite Assignee: jonathan.druart@bugs.koha-community.org Reporter: julian.maurice@biblibre.com QA Contact: julian.maurice@biblibre.com Blocks: 17258 This bug is a continuation of bug 20144 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17258 [Bug 17258] [OMNIBUS] MySQL 5.7 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 71466 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71466&action=edit Bug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined Fix at constructor level, this issue appears in lot of places. Fix for: Field 'datecreated' doesn't have a default value Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Julian Maurice <julian.maurice@biblibre.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=20176 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- There are other places where the default values are enforced in 'store' subroutine (Koha::Patron::Category for example). Why does this patch enforce a default value in 'new' subroutine ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Julian Maurice from comment #2)
There are other places where the default values are enforced in 'store' subroutine (Koha::Patron::Category for example). Why does this patch enforce a default value in 'new' subroutine ?
There is no default value defined at DB level (and cannot) so ->new will explode: DBIx::Class::Storage::DBI::_dbh_execute(): Field 'datecreated' doesn't have a default value at /home/vagrant/kohaclone/Koha/Object.pm line 124 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- /home/vagrant/kohaclone/Koha/Object.pm line 124 is in "store" subroutine, so it is "store" that explodes, not "new", which is why I ask: why not override "store" to set default values (like it is done in others "Koha::Object"s) ? $ perl -MKoha::Biblio -E 'Koha::Biblio->new' # No errors $ perl -MKoha::Biblio -E 'Koha::Biblio->new->store' DBD::mysql::st execute failed: Field 'datecreated' doesn't have a default value [for Statement "INSERT INTO `biblio` () VALUES ()"] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. DBIx::Class::Storage::DBI::_dbh_execute(): Field 'datecreated' doesn't have a default value at /home/koha/koha/Koha/Object.pm line 124 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71466|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 71778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71778&action=edit Bug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined Fix at ->store level, this issue appears in lot of places. Fix for: Field 'datecreated' doesn't have a default value -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Yes sorry Julian, I have just re-read the commit I wrote locally yesterday to test and it did not make any senses. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71778|0 |1 is obsolete| | --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 71814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71814&action=edit Bug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined Fix at ->store level, this issue appears in lot of places. Fix for: Field 'datecreated' doesn't have a default value Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Julian Maurice <julian.maurice@biblibre.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=20176 Nick Clemens <nick@bywatersolutions.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=20176 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71814|0 |1 is obsolete| | --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 71818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71818&action=edit Bug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined Fix at ->store level, this issue appears in lot of places. Fix for: Field 'datecreated' doesn't have a default value Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20176 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org