[Bug 18361] New: Koha::Objects->find should accept composite primary keys
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Bug ID: 18361 Summary: Koha::Objects->find should accept composite primary keys Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Originates from bug 18182. Example is Koha::IssuingRule -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18182 Patch complexity|--- |Small patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 [Bug 18182] TestBuilder should be able to return Koha::Object objects -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18361 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61754 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61754&action=edit Bug 18361: Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |tomascohen@gmail.com --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- The indirect way of testing the changed find via TestBuilder works. Is it enough or should we add find tests in Koha/Objects.t? Note that I perhaps would have expected such a subtest already, but it does not exist ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #2)
The indirect way of testing the changed find via TestBuilder works. Is it enough or should we add find tests in Koha/Objects.t? Note that I perhaps would have expected such a subtest already, but it does not exist ;)
Yes we should definitely have one in Objects.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Comment on attachment 61754 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61754 Bug 18361: Koha::Objects->find should accept composite primary keys
sub find { - my ( $self, $id ) = @_; + my ( $self, @id ) = @_;
While I agree with the general idea, I'd prefer that we keep in mind that this is a passthrough to DBIC ->find method. In that sense, please look at ResultSet.pm: sub find { my $self = shift; my $attrs = (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}); IMHO we should implement exactly that, probably accept whatever is passed to K:O->find and just pass it to RS->find. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #4)
Comment on attachment 61754 [details] [review] Bug 18361: Koha::Objects->find should accept composite primary keys
sub find { - my ( $self, $id ) = @_; + my ( $self, @id ) = @_;
While I agree with the general idea, I'd prefer that we keep in mind that this is a passthrough to DBIC ->find method. In that sense, please look at ResultSet.pm:
sub find { my $self = shift; my $attrs = (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {});
IMHO we should implement exactly that, probably accept whatever is passed to K:O->find and just pass it to RS->find.
my $result = $self->_resultset()->find(@id); So we pass them to RS. What is exactly your point ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18427 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61754|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62142 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62142&action=edit Bug 18361: Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Also adjusted the POD section to show more clearly that we accept the same parameters as DBIx ResultSet does. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62143 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62143&action=edit Bug 18361: Additional tests for Koha::Objects->find Adding a subtest find in t/db_dependent/Koha/Objects.t. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Tomas: I adjusted the POD to make your concerns more visible, and renamed the @id array to a more generic name @pars, since it indeed may contain an attrs hash. Additionally, I added a find subtest in Objects.t that contains a few tests where an attr hash is passed along to find. Signoff time :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #3)
(In reply to Marcel de Rooy from comment #2)
The indirect way of testing the changed find via TestBuilder works. Is it enough or should we add find tests in Koha/Objects.t? Note that I perhaps would have expected such a subtest already, but it does not exist ;)
Yes we should definitely have one in Objects.t
Done -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62142|0 |1 is obsolete| | --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62395&action=edit Bug 18361: Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Also adjusted the POD section to show more clearly that we accept the same parameters as DBIx ResultSet does. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18361 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62143|0 |1 is obsolete| | --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62396&action=edit Bug 18361: Additional tests for Koha::Objects->find Adding a subtest find in t/db_dependent/Koha/Objects.t. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18361 Tomás Cohen Arazi <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=18361 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 62397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62397&action=edit Bug 18361: (QA followup) Add tests for the no params case This patch adds a test for the trivial case in which no param is passed and the ->find method returns undef. For completeness purposes. 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=18361 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #12)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Thx -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Bug 18361 depends on bug 18182, which changed state. Bug 18182 Summary: TestBuilder should be able to return Koha::Object objects https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62395|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62909 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62909&action=edit Bug 18361: Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Also adjusted the POD section to show more clearly that we accept the same parameters as DBIx ResultSet does. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62396|0 |1 is obsolete| | --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62910 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62910&action=edit Bug 18361: Additional tests for Koha::Objects->find Adding a subtest find in t/db_dependent/Koha/Objects.t. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #62397|0 |1 is obsolete| | --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 62911 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62911&action=edit Bug 18361: (QA followup) Add tests for the no params case This patch adds a test for the trivial case in which no param is passed and the ->find method returns undef. For completeness purposes. 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=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Jonathan: Please try again. I actually did not change anything. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- ping Jonathan -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Attachment #62909|0 |1 is obsolete| | Attachment #62910|0 |1 is obsolete| | Attachment #62911|0 |1 is obsolete| | Attachment #64339|0 |1 is obsolete| | Attachment #64340|0 |1 is obsolete| | Attachment #64341|0 |1 is obsolete| | --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64339&action=edit Bug 18361: Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Also adjusted the POD section to show more clearly that we accept the same parameters as DBIx ResultSet does. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64340&action=edit Bug 18361: Additional tests for Koha::Objects->find Adding a subtest find in t/db_dependent/Koha/Objects.t. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64341&action=edit Bug 18361: (QA followup) Add tests for the no params case This patch adds a test for the trivial case in which no param is passed and the ->find method returns undef. For completeness purposes. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64347&action=edit Bug 18361: Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Also adjusted the POD section to show more clearly that we accept the same parameters as DBIx ResultSet does. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64348&action=edit Bug 18361: Additional tests for Koha::Objects->find Adding a subtest find in t/db_dependent/Koha/Objects.t. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #24 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64349&action=edit Bug 18361: (QA followup) Add tests for the no params case This patch adds a test for the trivial case in which no param is passed and the ->find method returns undef. For completeness purposes. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18539 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Patches rebased on top of bug 18539 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18539 [Bug 18539] Forbid Koha::Objects->find calls in list context -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I get warnings from tests: t/db_dependent/Letters.t ..................................... 3/82 DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint(): NULL/undef values supplied for requested unique constraint 'primary' (NULL values in column(s): 'id'). This is almost certainly not what you wanted, though you can set DBIC_NULLABLE_KEY_NOWARN to disable this warning. at /home/vagrant/kohaclone/Koha/Objects.pm line 91 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #27 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #26)
I get warnings from tests:
t/db_dependent/Letters.t ..................................... 3/82 DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint(): NULL/undef values supplied for requested unique constraint 'primary' (NULL values in column(s): 'id'). This is almost certainly not what you wanted, though you can set DBIC_NULLABLE_KEY_NOWARN to disable this warning. at /home/vagrant/kohaclone/Koha/Objects.pm line 91
Good catch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 64372 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64372&action=edit Bug 18361: [QA Follow-up] Resolve warning on undef values supplied The following warning was raised in Letters.t: DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint(): NULL/undef values supplied for requested unique constraint 'primary' (NULL values in column(s): 'id'). This is almost certainly not what you wanted, though you can set DBIC_NULLABLE_KEY_NOWARN to disable this warning. This warning is triggered by this line in C4/Letters.pm: Koha::SMS::Providers->find( $member->{'sms_provider_id'} ); As you already guessed, the sms_provider_id returns undef. Resolved in sub find by testing if there are parameters and if so, they should not be all undefined. (In most cases there will be only one parameter; but this report is about composite keys.) Added a trivial test case in Objects.t too. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/Letters.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #29 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Bug 18361 depends on bug 18539, which changed state. Bug 18539 Summary: Forbid Koha::Objects->find calls in list context https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18539 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #30 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Enhancement not pushed to 17.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18951 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18951 [Bug 18951] Some t/Biblio tests are database dependent -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #31 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- I finally to push to 17.05.x in order to follow master using this change. Will be in 17.05.03. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #32 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Conflicts with 16.11.x. If you want this to be included, please rebase on 16.11.x. Thx! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #33 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 66006 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66006&action=edit Bug 18361: [SQUASHED FOR 16.11] Koha::Objects->find should accept composite primary keys Changes the $id parameter to an array. (IssuingRule has three keys.) The build_object method in TestBuilder.pm has been adjusted to pass multiple primary key values to find. Also adjusted the POD section to show more clearly that we accept the same parameters as DBIx ResultSet does. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/TestBuilder.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Bug 18361: Additional tests for Koha::Objects->find Adding a subtest find in t/db_dependent/Koha/Objects.t. Test plan: Run t/db_dependent/Koha/Objects.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Bug 18361: (QA followup) Add tests for the no params case This patch adds a test for the trivial case in which no param is passed and the ->find method returns undef. For completeness purposes. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Bug 18361: [QA Follow-up] Resolve warning on undef values supplied The following warning was raised in Letters.t: DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint(): NULL/undef values supplied for requested unique constraint 'primary' (NULL values in column(s): 'id'). This is almost certainly not what you wanted, though you can set DBIC_NULLABLE_KEY_NOWARN to disable this warning. This warning is triggered by this line in C4/Letters.pm: Koha::SMS::Providers->find( $member->{'sms_provider_id'} ); As you already guessed, the sms_provider_id returns undef. Resolved in sub find by testing if there are parameters and if so, they should not be all undefined. (In most cases there will be only one parameter; but this report is about composite keys.) Added a trivial test case in Objects.t too. Test plan: Run t/db_dependent/Koha/Object.t Run t/db_dependent/Koha/Objects.t Run t/db_dependent/Letters.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #34 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #32)
Conflicts with 16.11.x. If you want this to be included, please rebase on 16.11.x. Thx!
That you should do it.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18361 --- Comment #35 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thx Marcel - patches apply now and tests pass. This patch has been pushed to 16.11.x and will be in 16.11.11. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org