Bugzilla – Attachment 127555 Details for
Bug 29321
Remove a last without loop context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29321: Remove a last without loop context
Bug-29321-Remove-a-last-without-loop-context.patch (text/plain), 1.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-11-11 20:50:53 UTC
(
hide
)
Description:
Bug 29321: Remove a last without loop context
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-11-11 20:50:53 UTC
Size:
1.31 KB
patch
obsolete
>From 57345b09799705ac848885621b0857d73ca3e472 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 5 Nov 2021 15:00:04 +0000 >Subject: [PATCH] Bug 29321: Remove a last without loop context > >This reads better when converted to regular if. >Note that last within such a block is allowed in Perl, but it feels >better to use it only in a loop context. > >Test plan: >Read the patch ;) >Bonus: Test if you enter the block by using pref OPACSuggestionMandatoryFields >when adding a suggestion from opac. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Edit: Added a space between 'if' and '(' :-D >--- > opac/opac-suggestions.pl | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 9c965041ce..7c3dae9777 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -245,8 +245,7 @@ foreach my $suggestion(@$suggestions_loop) { > my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG", "opac"); > > my @mandatoryfields; >-{ >- last unless ($op eq 'add'); >+if ( $op eq 'add' ) { > my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title'; > @mandatoryfields = sort split(/\s*\,\s*/, $fldsreq_sp); > foreach (@mandatoryfields) { >-- >2.33.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29321
:
126919
|
127396
| 127555