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
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
90a4c9d878
commit
0144bb310e
|
|
@ -240,8 +240,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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue