From 93e717ac316c3ee03769b6c557e482f04ac9945b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Dec 2023 14:54:34 +0100 Subject: [PATCH] Bug 34478: Manual fix - opac-suggestions Signed-off-by: Jonathan Druart --- .../bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 8 ++++---- opac/opac-suggestions.pl | 6 +++--- t/db_dependent/selenium/regressions.t | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index 202326779e..6da4f51b8b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -39,7 +39,7 @@ [% END %] [% IF ( suggestion ) %] -
  • Suggest for purchase
  • +
  • Suggest for purchase
  • [% END %] [% IF Koha.Preference('OpacCatalogConcerns') %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index 46bf965697..2be316bc6f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -9,7 +9,7 @@ [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% INCLUDE 'doc-head-open.inc' %] -[% IF ( op_add ) %]Enter a new purchase suggestion[% END %] +<title>[% IF ( op_add_form ) %]Enter a new purchase suggestion[% END %] [% IF ( op_else ) %]Purchase suggestions[% END %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog [% INCLUDE 'doc-head-close.inc' %] @@ -25,7 +25,7 @@ [% INCLUDE 'patron-title.inc' patron = logged_in_user %] [% END %] [% END %] - [% IF ( op_add ) %] + [% IF ( op_add_form ) %] [% WRAPPER breadcrumb_item %] Purchase suggestions [% END %] @@ -49,7 +49,7 @@
    - [% IF ( op_add ) %] + [% IF ( op_add_form ) %]

    Your purchase suggestions

    [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]

    You cannot place any more suggestions

    @@ -305,7 +305,7 @@ [% END %] - [% END # IF op_add %] + [% END # IF op_add_form %] [% IF ( op_else ) %]

    diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 04c800f883..84866326ac 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -144,7 +144,7 @@ if ( $op eq "add_validate" && not $biblionumber ) { # If we are creating the sug if ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) { push @messages, { type => 'error', code => 'biblio_exists', id => $duplicatebiblionumber, title => $duplicatetitle }; $need_confirm = 1; - $op = 'add'; + $op = 'add_form'; } } @@ -245,7 +245,7 @@ if ( $op eq "delete_confirm" ) { my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG", "opac"); my @mandatoryfields; -if ( $op eq 'add' ) { +if ( $op eq 'add_form' ) { my $fldsreq_sp = C4::Context->preference("OPACSuggestionMandatoryFields") || 'title'; @mandatoryfields = sort split(/\s*\|\s*/, $fldsreq_sp); foreach (@mandatoryfields) { @@ -268,7 +268,7 @@ if ( $op eq 'add' ) { my @unwantedfields; { - last unless ($op eq 'add'); + last unless ($op eq 'add_form'); my $fldsreq_sp = C4::Context->preference("OPACSuggestionUnwantedFields"); @unwantedfields = sort split(/\s*\|\s*/, $fldsreq_sp); foreach (@unwantedfields) { diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index 9f42cec5b4..97a3fa761b 100755 --- a/t/db_dependent/selenium/regressions.t +++ b/t/db_dependent/selenium/regressions.t @@ -354,7 +354,7 @@ subtest 'OPAC - Suggest for purchase' => sub { my $biblio = Koha::Biblios->find($biblionumber); $driver->get( $opac_base_url . "opac-detail.pl?biblionumber=$biblionumber" ); - $s->click({ href => '/opac-suggestions.pl?op=cud-add&biblionumber=' . $biblionumber }); + $s->click({ href => '/opac-suggestions.pl?op=add_form&biblionumber=' . $biblionumber }); is( $driver->find_element('//a[@id="title"]')->get_text(), $biblio->title, "Suggestion's title correctly filled in with biblio's title" ); -- 2.39.5