Bugzilla – Attachment 169162 Details for
Bug 37393
Bundle items don't show their host in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37393: fix "In bundle:" link not showing for items in staff interface
Bug-37393-fix-In-bundle-link-not-showing-for-items.patch (text/plain), 3.67 KB, created by
Roman Dolny
on 2024-07-18 18:00:43 UTC
(
hide
)
Description:
Bug 37393: fix "In bundle:" link not showing for items in staff interface
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-18 18:00:43 UTC
Size:
3.67 KB
patch
obsolete
>From 20354eb5faf231d3d8798411c772c4dd04342694 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20Kula?= > <148193449+mkibp@users.noreply.github.com> >Date: Wed, 17 Jul 2024 13:05:02 +0000 >Subject: [PATCH] Bug 37393: fix "In bundle:" link not showing for items in > staff interface > >The cause was erroneous check `[% IF bundlesEnabled %]` before the parent bundle information is requested+shown. The `bundlesEnabled` variable checks if the current biblio ITSELF is of collection type, so should only be used for whether to show the button to add new items to the bundle items, NOT for querying whether current item is part of a bundle, as the items that make up the bundle aren't of collection type themselves. > >The second fixed problem was that `bundle_host` didn't contain `.biblio` subitem (which'd contain the actual host biblio title) as the JavaScript code assumed, and it wasn't possible to request it with the API either. > >Test plan: please follow the reproduction instructions from bug and ensure that the described issue is gone. > >If you run into an error 400 on the detail page, you need to refresh API definitions, in kts shell you'drun: > >redocly bundle --ext json api/v1/swagger/swagger.yaml --output api/v1/swagger/swagger_bundle.json >koha-plack --restart kohadev > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > api/v1/swagger/paths/biblios.yaml | 1 + > .../html_helpers/tables/items/catalogue_detail.inc | 12 ++++-------- > 2 files changed, 5 insertions(+), 8 deletions(-) > >diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml >index 2da90e27d6..e8b9b0e7cf 100644 >--- a/api/v1/swagger/paths/biblios.yaml >+++ b/api/v1/swagger/paths/biblios.yaml >@@ -443,6 +443,7 @@ > - item_type > - in_bundle > - bundle_host >+ - bundle_host.biblio > - bundle_items_lost+count > - bundle_items_not_lost+count > - course_item.course_reserves.course >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 18a2c36630..e570d67cac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -223,9 +223,7 @@ > [% IF Koha.Preference('UseRecalls') %] > embed.push('recall', 'recall+strings', 'recall.patron') > [% END %] >- [% IF bundlesEnabled %] >- embed.push('in_bundle', 'bundle_host', 'bundle_items_lost+count', 'bundle_items_not_lost+count'); >- [% END %] >+ embed.push('in_bundle', 'bundle_host', 'bundle_host.biblio', 'bundle_items_lost+count', 'bundle_items_not_lost+count'); > [% IF Koha.Preference('UseCourseReserves') %] > embed.push('course_item.course_reserves.course'); > [% END %] >@@ -541,11 +539,9 @@ > nodes += '<span class="restricted">(%s)</span>'.format(escape_str(av_restricted.get(row.restricted_status.toString()))); > } > >- [% IF bundlesEnabled %] >- if ( row.in_bundle ) { >- nodes += '<span class="bundled">%s</span>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true }))); >- } >- [% END %] >+ if ( row.in_bundle ) { >+ nodes += '<span class="bundled">%s</span>'.format(_("In bundle: %s").format($biblio_to_html(row.bundle_host.biblio, { link: true }))); >+ } > return nodes; > } > }, >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37393
:
169081
|
169162
|
174918