Bugzilla – Attachment 174918 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.76 KB, created by
Marcel de Rooy
on 2024-11-22 10:20:40 UTC
(
hide
)
Description:
Bug 37393: fix "In bundle:" link not showing for items in staff interface
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-11-22 10:20:40 UTC
Size:
3.76 KB
patch
obsolete
>From 886f7a33e76b5d1cd17dd2ea8e74e3c1ec40f210 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 >Content-Type: text/plain; charset=utf-8 > >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> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 036179cfa9..6502a4f67d 100644 >--- a/api/v1/swagger/paths/biblios.yaml >+++ b/api/v1/swagger/paths/biblios.yaml >@@ -472,6 +472,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 9fa81b87f7..f6ce0667c3 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 >@@ -245,9 +245,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 %] >@@ -568,11 +566,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.5
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