Bug 23523: (follow-up) Adjust tests for new expectations
[srvgit] / opac / opac-suggestions.pl
index 29de7a1..8f792cd 100755 (executable)
@@ -208,11 +208,14 @@ if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) {
     $template->param( branchcode => $branchcode );
 }
 
-my $mandatoryfields = '';
+my @mandatoryfields;
 {
     last unless ($op eq 'add');
     my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title';
-    $mandatoryfields = join(', ', (map { '"'.$_.'"'; } sort split(/\s*\,\s*/, $fldsreq_sp)));
+    @mandatoryfields = sort split(/\s*\,\s*/, $fldsreq_sp);
+    foreach (@mandatoryfields) {
+        $template->param( $_."_required" => 1);
+    }
 }
 
 $template->param(
@@ -224,7 +227,6 @@ $template->param(
     messages              => \@messages,
     suggestionsview       => 1,
     suggested_by_anyone   => $suggested_by_anyone,
-    mandatoryfields       => $mandatoryfields,
     patrons_pending_suggestions_count => $patrons_pending_suggestions_count,
 );