[Bug 30110] New: Potential bug source: plenty of "my" declarations with conditional assignments
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110 Bug ID: 30110 Summary: Potential bug source: plenty of "my" declarations with conditional assignments Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nugged@gmail.com QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart+koha@gmail.com We have a lot of these things like "my $var .= ...", what is shouldn't be (if no var before "my" so why conditional assignments?) - this looks like refactoring remnants since old times, here I found some to analyze (and fix): C4/Circulation.pm: 859: my $guarantors_non_issues_charges += $patron->relationships_debt({ include_guarantors => 1, only_this_guarantor => 0, include_this_patron => 1 }); C4/Message.pm: 165: my $format ||= sub { $_[0] || "" }; C4/Search.pm: 891: my $weighted_query .= "(rk=("; # Specifies that we're applying rank C4/Utils/DataTables/VirtualShelves.pm: 47: my $join_vs .= q| circ/circulation.pl: 477: my $guarantors_non_issues_charges += $patron->relationships_debt({ include_guarantors => 1, only_this_guarantor => 0, include_this_patron => 1 }); Koha/DateUtils.pm: 146: my $time_re .= qr| t/Labels_split_ccn.t: 41: my $split_num += scalar(@{$ccns->{$_}}); t/Labels_split_ddcn.t: 40: my $split_num += scalar(@{$ddcns->{$_}}); t/Labels_split_lccn.t: 43: my $split_num += scalar(@{$lccns->{$_}}); t/db_dependent/SIP/Message.t: 127: my $resp .= C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, $sip_item->hold_patron_name, $server ); 840: my $resp .= C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, $sip_item->hold_patron_bcode, $server ); -- 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=30110 Jonathan Druart <jonathan.druart+koha@gmail.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=30110 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 130937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130937&action=edit Bug 30110: Fix concatenation during assignements There are several occurrences of `my $var += ` or .= in the code. It should not cause problems but it's confusing. Test plan: Read the patch and confirm that the changes make sense. -- 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=30110 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com -- 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=30110 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Surely a lot of copy/paste errors. Looks good to me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130937|0 |1 is obsolete| | --- Comment #3 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 132043 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132043&action=edit Bug 30110: Fix concatenation during assignements There are several occurrences of `my $var += ` or .= in the code. It should not cause problems but it's confusing. Test plan: Read the patch and confirm that the changes make sense. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132043|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 132188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132188&action=edit Bug 30110: Fix concatenation during assignements There are several occurrences of `my $var += ` or .= in the code. It should not cause problems but it's confusing. Test plan: Read the patch and confirm that the changes make sense. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> 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=30110 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Funky.. nice bit of clean up, no regressions found. PQA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110 --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, 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=30110 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.05.00 |22.05.00,21.11.05 released in| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.11.x for 21.11.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org