From 95f2b06a8dd8a2e2f9d4f05f559dd9c00cd6e9a6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 20 May 2026 16:01:35 +0100 Subject: [PATCH] Bug 42654: Restore section in OPAC course reserve detail title, breadcrumb and heading When a course reserve has a section defined, the OPAC course detail page should display it alongside the course name in the page title, breadcrumb, and main heading. A previous change inadvertently removed this, leaving only the course name in all three places. This patch restores the conditional logic so that: - If a section is set, the format "Course reserves for 'Course name' - Section" is used in the title, breadcrumb and

. - If no section is set, the existing "Course reserves for 'Course name'" format is preserved. Test plan: 1. Enable the CourseReserves system preference. 2. In the staff interface, go to Course Reserves and create (or edit) a course that has a 'Section' value filled in (e.g. "Section A"). 3. Add at least one item to that course reserve. 4. In the OPAC, browse to Course Reserves and click through to the detail page for that course. 5. Confirm that the browser tab title, the breadcrumb trail, and the page heading all show "Course reserves for '' -
". 6. Edit the course and clear the Section field. 7. Revisit the detail page and confirm that all three locations now show only "Course reserves for ''" with no trailing dash or section fragment. Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass (cherry picked from commit 29ac3a0b5ecfc4da24c3aba2f9bfd464af596abb) Signed-off-by: Baptiste Wojtkowski --- .../opac-tmpl/bootstrap/en/modules/opac-course-details.tt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt index 7d6d9c1924..7b344a7a57 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt @@ -12,7 +12,7 @@ [% INCLUDE 'doc-head-open.inc' %] [% FILTER collapse %] - [% tx("Course reserves for '{course_name}'", { course_name = course.course_name }) | html %] + [%- IF course.section -%][% tx("Course reserves for '{course_name}' - {section}", { course_name = course.course_name, section = course.section }) | html %][%- ELSE -%][% tx("Course reserves for '{course_name}'", { course_name = course.course_name }) | html %][%- END -%] › [% PROCESS 'library_name_title' %] [% END %] @@ -30,7 +30,7 @@ Course reserves [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - [% tx("Course reserves for '{course_name}'", { course_name = course.course_name }) | html %] + [%- IF course.section -%][% tx("Course reserves for '{course_name}' - {section}", { course_name = course.course_name, section = course.section }) | html %][%- ELSE -%][% tx("Course reserves for '{course_name}'", { course_name = course.course_name }) | html %][%- END -%] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -38,7 +38,9 @@
-

[% tx("Course reserves for '{course_name}'", { course_name = course.course_name }) | html %]

+

[%- IF course.section -%][% tx("Course reserves for '{course_name}' - {section}", { course_name = course.course_name, section = course.section }) | html %][%- ELSE -%][% tx("Course reserves for '{course_name}'", { course_name = course.course_name }) | html %][%- END -%]

    [% IF ( course.term ) %]
  1. [% tp('Semester', 'Term:') | html %] [% AuthorisedValues.GetByCode( 'TERM', course.term, 1 ) | html %]
  2. [% END %]