[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Fridolin Somers changed: What|Removed |Added Resolution|--- |FIXED Status|Pushed to master|RESOLVED -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added See Also||https://bugs.koha-community ||.org/bugzilla3/show_bug.cgi ||?id=26904 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Blocks||25137 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25137 [Bug 25137] PatronSelfRegistrationLibraryList results in empty branch list on opac-memberentry.pl -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Joy Nelson changed: What|Removed |Added CC||j...@bywatersolutions.com --- Comment #29 from Joy Nelson --- does not apply to 19.11.x. not backporting -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #28 from Katrin Fischer --- (In reply to Jonathan Druart from comment #27) > (In reply to Katrin Fischer from comment #24) > > Could we keep them from creeping back in with a new addition to the QA test > > tools? > > I did not manage to end up with something that would not raise too many > false positives. Thx for checking Jonathan. Wonder if this is important enough for a note in the coding guidelines? Our case with a 100 libraries using $ in their barcode might be a bit specific... but I also think the new form of writing this is nicer and more readable. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #27 from Jonathan Druart --- (In reply to Katrin Fischer from comment #24) > Could we keep them from creeping back in with a new addition to the QA test > tools? I did not manage to end up with something that would not raise too many false positives. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #26 from Martin Renvoize --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Martin Renvoize changed: What|Removed |Added Version(s)||20.05.00 released in|| Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Katrin Fischer changed: What|Removed |Added Attachment #98960|0 |1 is obsolete|| --- Comment #25 from Katrin Fischer --- Created attachment 98968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98968&action=edit j# Attachment to Bug 23084 - Replace grep {^$var$} with grep {$var eq $_} Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! Signed-off-by: Bernardo Gonzalez Kriegel Looks correct, no errors. Rebased. Signed-off-by: Katrin Fischer -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Katrin Fischer changed: What|Removed |Added Patch complexity|--- |Medium patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #24 from Katrin Fischer --- Could we keep them from creeping back in with a new addition to the QA test tools? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #23 from Katrin Fischer --- (In reply to Bernardo Gonzalez Kriegel from comment #22) > (In reply to Katrin Fischer from comment #20) > > Please rebase - should be a quick one, but I messed it up :( > > Rebased! Thx Bernardo! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Bernardo Gonzalez Kriegel changed: What|Removed |Added Attachment #98926|0 |1 is obsolete|| --- Comment #21 from Bernardo Gonzalez Kriegel --- Created attachment 98960 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98960&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! Signed-off-by: Bernardo Gonzalez Kriegel Looks correct, no errors. Rebased. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Bernardo Gonzalez Kriegel changed: What|Removed |Added Status|Patch doesn't apply |Signed Off --- Comment #22 from Bernardo Gonzalez Kriegel --- (In reply to Katrin Fischer from comment #20) > Please rebase - should be a quick one, but I messed it up :( Rebased! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Katrin Fischer changed: What|Removed |Added Status|Signed Off |Patch doesn't apply --- Comment #20 from Katrin Fischer --- Please rebase - should be a quick one, but I messed it up :( -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Attachment #98707|0 |1 is obsolete|| --- Comment #19 from Jonathan Druart --- Created attachment 98926 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98926&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! Signed-off-by: Bernardo Gonzalez Kriegel Looks correct, no errors. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #18 from Bernardo Gonzalez Kriegel --- (In reply to Jonathan Druart from comment #16) > the 'x' modifier allows whitespaces, so they must be explicitly provided by > \w to be taken into account. So I think we are good here. You are right! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Bernardo Gonzalez Kriegel changed: What|Removed |Added Attachment #98701|0 |1 is obsolete|| --- Comment #17 from Bernardo Gonzalez Kriegel --- Created attachment 98707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98707&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! Signed-off-by: Bernardo Gonzalez Kriegel Looks correct, no errors. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Bernardo Gonzalez Kriegel changed: What|Removed |Added Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #16 from Jonathan Druart --- the 'x' modifier allows whitespaces, so they must be explicitly provided by \w to be taken into account. So I think we are good here. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #15 from Bernardo Gonzalez Kriegel --- It applies now, no (new) qa errors. Just a question: In C4/TAGS.pm you replace scalar grep {/^ $key $/x} @ok_fields with scalar grep { $_ eq $key } @ok_fields Is this correct? The spaces in '/^ $key $/x' are in the matching string (by way of /x), then perhaps scalar grep { $_ eq " $key " } @ok_fields is preferable. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #14 from Jonathan Druart --- Rebased. Remaining occurrences are in tests, should not be a problem. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Attachment #90823|0 |1 is obsolete|| --- Comment #13 from Jonathan Druart --- Created attachment 98701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98701&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Bernardo Gonzalez Kriegel changed: What|Removed |Added CC||bgkrie...@gmail.com Status|Needs Signoff |Failed QA --- Comment #12 from Bernardo Gonzalez Kriegel --- Sorry, does not apply, conflicts in C4/Items.pm C4/OAI/Sets.pm C4/Search.pm admin/searchengine/elasticsearch/mappings.pl also a few more cases. C4/OAI/Sets.pm:if(0 == grep /^$value$/, @subfield_values) { C4/OAI/Sets.pm:if(0 < grep /^$value$/, @subfield_values) { misc/translator/translate:if ( $cmd ne 'create' and $lang and not grep( /^$lang$/, @{ $installer->{langs} } ) ) { t/db_dependent/Acquisition.t: unless grep ( /^$field$/, @$exp_fields ); t/db_dependent/Budgets.t:my $is_in_new_budgets = grep /^$budget->{budget_id}$/, @new_budget_ids; t/db_dependent/Budgets.t:my $is_in_old_budgets = grep /^$budget->{budget_id}$/, @old_budget_ids; t/db_dependent/Serials.t:my @arrived_missing = map { my $status = $_->{status}; ( grep { /^$status$/ } qw( 2 4 41 42 43 44 5 ) ) ? $_ : () } @serials; t/db_dependent/Serials.t:my @others = map { my $status = $_->{status}; ( grep { /^$status$/ } qw( 2 4 41 42 43 44 5 ) ) ? () : $_ } @serials; t/db_dependent/Serials.t:@arrived_missing = map { my $status = $_->{status}; ( grep { /^$status$/ } qw( 2 4 41 42 43 44 5 ) ) ? $_ : () } @serials; t/db_dependent/Serials.t:@others = map { my $status = $_->{status}; ( grep { /^$status$/ } qw( 2 4 41 42 43 44 5 ) ) ? () : $_ } @serials; -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Katrin Fischer changed: What|Removed |Added CC||katrin.fisc...@bsz-bw.de Assignee|koha-b...@lists.koha-commun |jonathan.dru...@bugs.koha-c |ity.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Status|Failed QA |Needs Signoff --- Comment #11 from Jonathan Druart --- The failure is: FAIL C4/Tags.pm FAIL forbidden patterns forbidden pattern: tab char (line 195) forbidden pattern: tab char (line 236) forbidden pattern: tab char (line 305) They existed before, not blocker. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 M. Tompsett changed: What|Removed |Added Status|Needs Signoff |Failed QA --- Comment #10 from M. Tompsett --- Failing because of C4/Tags -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #9 from M. Tompsett --- Comment on attachment 90823 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90823 Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} Review of attachment 90823: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=23084&attachment=90823) - C4/Tags fails qa test tools. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #8 from M. Tompsett --- Comment on attachment 90823 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90823 Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} Review of attachment 90823: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=23084&attachment=90823) - These are the two places I will actually test, because everything else is a easy eyeball by comparison. ::: opac/opac-memberentry.pl @@ +77,4 @@ > > my @libraries = Koha::Libraries->search; > if ( my @libraries_to_display = split '\|', > C4::Context->preference('PatronSelfRegistrationLibraryList') ) { > +@libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep { > $_ eq $branchcode } @libraries_to_display ? $b : () } @libraries; Super ugly code. There won't be scoping issues the $_? ::: opac/opac-search-history.pl @@ +70,4 @@ > @searches = map { $_->{type} ne $type ? $_ : () } @searches; > } > if ( @id ) { > +@searches = map { my $search = $_; ( grep { $_ eq > $search->{id} } @id ) ? () : $_ } @searches; Super ugly code. Test for scoping issues. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #7 from M. Tompsett --- > This is the whole point of the patch. Have a look at the related bugs, and > what this patch is trying to prevent. If the variable contains a regex > character (like parenthesis in the case of bug 22941, or $ in the case of > bug 23006), then you need to surround your var with \Q\E, see man perlre). > > So the patch could have replaced > grep {/^$var$/} @array > with > grep {/^\Q$var\E$/} @array > > But I preferred the other solution, I am sure you understand why :) Yes, anything that requires an escaped solution adds a level of complexity and poor readability which makes it prone to breaking. > > Everything else is a result of me seeing tcohen wanting to improve > > readability of code. "unless grep" is better read as "if none". > > I am not tcohen :) > The patch is a bugfix (updating the status). I would like to prevent other > issues like the ones listed in see also. Replacing them with none, any or > anything else will need more grey matter to make sure the changes will not > introduce a regression. I am not against what you suggest but I think it > should be done separately. I agree with that, which is why I just wanted an explanation of the \Q \E thing. Thanks for that. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Severity|enhancement |normal --- Comment #6 from Jonathan Druart --- (In reply to M. Tompsett from comment #5) > I only thing that really stood out was the C4/Search.pm > "Why is the \Q and \E missing?"? > > Explain that, I may sign this off. This is the whole point of the patch. Have a look at the related bugs, and what this patch is trying to prevent. If the variable contains a regex character (like parenthesis in the case of bug 22941, or $ in the case of bug 23006), then you need to surround your var with \Q\E, see man perlre). So the patch could have replaced grep {/^$var$/} @array with grep {/^\Q$var\E$/} @array But I preferred the other solution, I am sure you understand why :) > Everything else is a result of me seeing tcohen wanting to improve > readability of code. "unless grep" is better read as "if none". I am not tcohen :) The patch is a bugfix (updating the status). I would like to prevent other issues like the ones listed in see also. Replacing them with none, any or anything else will need more grey matter to make sure the changes will not introduce a regression. I am not against what you suggest but I think it should be done separately. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #5 from M. Tompsett --- Comment on attachment 90823 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90823 Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} Review of attachment 90823: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=23084&attachment=90823) - I only thing that really stood out was the C4/Search.pm "Why is the \Q and \E missing?"? Explain that, I may sign this off. Everything else is a result of me seeing tcohen wanting to improve readability of code. "unless grep" is better read as "if none". ::: C4/ImportBatch.pm @@ +1114,4 @@ > my $dbh = C4::Context->dbh; > > my $order_by = $parameters->{order_by} || 'import_record_id'; > +( $order_by ) = grep( { $_ eq $order_by } qw( import_record_id title > status overlay_status ) ) ? $order_by : 'import_record_id'; Wouldn't 'any' be semantically easier to read? It also has the added benefit of removing the whole need for () around $order_by, because $order_by is a string. $order_by = any { $_ eq $order_by } qw( import_record_id title status overlay_status ) ) ? $order_by : 'import_record_id'; Actually, the whole point of the code is even clearer with 'none': $order_by = none { $_ eq $order_by } qw( import_record_id title status overlay_status ) ) ? 'import_record_id' : $order_by; ::: C4/Installer/PerlModules.pm @@ +76,4 @@ > no warnings >; # perl throws warns for invalid $VERSION numbers which some modules > use > my ( $self, $module ) = @_; > +return -1 unless grep { $_ eq $module } keys(%$PERL_DEPS); any is better, since it is boolean. ::: C4/Items.pm @@ +2101,4 @@ > push @columns, > Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns; > my @operators = qw(= != > < >= <= like); > my $field = $filter->{field}; > +if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) > eq 'marc:') ) { any is better, since it checking if the field is in the list of columns. @@ +2105,4 @@ > my $op = $filter->{operator}; > my $query = $filter->{query}; > > +if (!$op or (0 == grep { $_ eq $op } @operators)) { none would be better than a '0 ==' check. @@ +2601,5 @@ > |; > for my $condition ( @$conditions ) { > if ( > + grep { $_ eq $condition->{field} } @item_columns > + or grep { $_ eq $condition->{field} } @biblioitem_columns any's would be nicer. ::: C4/OAI/Sets.pm @@ +500,4 @@ > my $value = $mapping->{'marcvalue'}; > my @subfield_values = $record->subfield($field, $subfield); > if ($operator eq 'notequal') { > +if(0 == grep { $_ eq $value } @subfield_values) { none. @@ +505,5 @@ > last; > } > } > else { > +if(0 < grep { $_ eq $value } @subfield_values) { any. ::: C4/Overdues.pm @@ +766,4 @@ > # Put 'print' in first if exists > # It avoid to sent a print notice with an email or sms template is no > email or sms is defined > @mtts = uniq( 'print', @mtts ) > +if grep { $_ eq 'print' } @mtts; any. ::: C4/Search.pm @@ +731,4 @@ > > my $data = $field->as_string( $subfield_letters, $facet->{ > sep } ); > > +unless ( grep { $_ eq $data } @used_datas ) { Why is the \Q and \E missing? @@ +1490,4 @@ > # this happens when selecting a subject on the opac-detail page > @limits = grep {!/^$/} @limits; > my $original_q = $q; # without available part > +unless ( grep { $_ eq 'available' } @limits ) { unless is harder to read construction, if none would be clearer, I think. @@ +1494,5 @@ > $q =~ s| and \( \( allrecords,AlwaysMatches:'' not > onloan,AlwaysMatches:''\) and \(lost,st-numeric=0\) \)||; > $original_q = $q; > } > if ( @limits ) { > +if ( grep { $_ eq 'available' } @limits ) { any. ::: C4/Serials.pm @@ +1579,4 @@ > ### Would use substr and index But be careful to previous presence > of () > $recievedlist .= "; $serialseq" unless ( index( $recievedlist, > $serialseq ) > 0 ); > } > +if ( grep { $_ eq $status } (MISSING_STATUSES) ) { any. ::: C4/Stats.pm @@ +108,4 @@ > } > my @invalid_params = (); > for my $myparam (keys %$params ) { > +push @invalid_params, $myparam unless grep { $_ eq $myparam } > @allowed_keys; if none would be easier to read. ::: C4/Tags.pm @@ +192,4 @@ > carp "Empty argument key to get_tag_rows: ignoring!"; > next; > } > + unless (1 == scalar grep { $_ eq $key } @ok_fields) { if none would be easier to read. @@
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Blocks||23166 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23166 [Bug 23166] Simplify code related to orders in catalogue/*detail.pl -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Attachment #90821|0 |1 is obsolete|| --- Comment #4 from Jonathan Druart --- Created attachment 90823 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90823&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart changed: What|Removed |Added Attachment #90820|0 |1 is obsolete|| --- Comment #3 from Jonathan Druart --- Created attachment 90821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90821&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 --- Comment #2 from Jonathan Druart --- Created attachment 90820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90820&action=edit Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} We certainly faced 3 similar bugs due to this syntax: bug 23006, bug 22941 and bug 17526. To prevent other issues related to this syntax this patch suggests to replace them all in one go. Test plan: Confirm that the 2 syntaxes are similar Eyeball the patch and confirm that there is no typo! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 Jonathan Druart 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. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 23084] Replace grep {^$var$} with grep {$var eq $_}
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23084 M. Tompsett changed: What|Removed |Added CC||mtomp...@hotmail.com --- Comment #1 from M. Tompsett --- See also bug 17526 to deal with OPAC lists. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/