Bug 28941: Deal with OPACSuggestionUnwantedFields
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 10 Sep 2021 09:33:18 +0000 (11:33 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 30 Sep 2021 07:19:00 +0000 (09:19 +0200)
Remove fields from OPACSuggestionUnwantedFields before creating the
suggestion

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: remove useless sort

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
opac/opac-suggestions.pl

index e4ed209..6f6e91b 100755 (executable)
@@ -177,6 +177,10 @@ if ( $op eq "add_confirm" ) {
         }
     }
     else {
+        for my $f ( split(/\s*\,\s*/, C4::Context->preference("OPACSuggestionUnwantedFields") ) ) {
+            delete $suggestion->{$f};
+        }
+
         my $scrubber = C4::Scrubber->new();
         foreach my $suggest ( keys %$suggestion ) {