Bugzilla – Attachment 153297 Details for
Bug 33946
biblio-title.inc should not add a link if biblio does not exist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33946: Do not display link to non-existing bibliographic record
Bug-33946-Do-not-display-link-to-non-existing-bibl.patch (text/plain), 3.02 KB, created by
Katrin Fischer
on 2023-07-10 21:10:21 UTC
(
hide
)
Description:
Bug 33946: Do not display link to non-existing bibliographic record
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-10 21:10:21 UTC
Size:
3.02 KB
patch
obsolete
>From f7c2ce8162aaa340ec960536439eb6c75c988e2c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jun 2023 09:48:42 +0200 >Subject: [PATCH] Bug 33946: Do not display link to non-existing bibliographic > record > >If you use biblio-title.inc on a biblio that does not longer exist, "No title" is shown with a link to catalogue/detail?.pl?biblionumber= > >We should at least remove the link. > >We could even do better and display "No bibliographic record" if the biblio does not longer exist. > >Test plan: >Edit mainpage.pl, add >$template->param( your_bib => Koha::Biblios->find(42) ); >Edit intranet-main.tt, add >[% INCLUDE 'biblio-title.inc' biblio=your_bib link = 1 %] > >Not hit the main page and see what's hapenning. >If you have a bibliographic record with biblionumber=42, its info will >be displayed. >Remove this record and try again => it's replaced with "No bibliographic record" >without a link > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../intranet-tmpl/prog/en/includes/biblio-title.inc | 9 ++++++--- > .../opac-tmpl/bootstrap/en/includes/biblio-title.inc | 11 +++++++---- > 2 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc >index 6499e591e4..7ef94166b4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc >@@ -1,11 +1,14 @@ >+[%- IF link && ! biblio %][% link = 0 %][% END %] > [%- IF ( link ) -%] > <a href="[%- PROCESS biblio_a_href biblionumber => biblio.biblionumber -%]" class="title"> > [%- END -%] > >-[%- IF ( biblio.title ) -%] >- <span class="biblio-title">[%- biblio.title | html -%]</span> >+[%- IF !biblio -%] >+ No bibliographic record >+[%- ELSIF !biblio.title -%] >+ No title > [%- ELSE -%] >- <span>No title</span> >+ <span class="biblio-title">[% biblio.title | html %]</span> > [%- END -%] > [%- IF ( biblio.medium ) -%] > <span class="biblio-medium">[%- biblio.medium | html -%]</span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >index bc8d70e0e9..d3bbf53917 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >@@ -1,12 +1,15 @@ >+[%- IF link && ! biblio %][% link = 0 %][% END %] > [% IF ( link ) %] > <a href="[% PROCESS biblio_a_href biblionumber => biblio.biblionumber %]" class="title"> > [% END %] > >-[% IF ( biblio.title ) %] >- <span class="biblio-title">[% biblio.title | html %]</span> >-[% ELSE %] >+[%- IF !biblio -%] >+ No bibliographic record >+[%- ELSIF !biblio.title -%] > No title >-[% END %] >+[%- ELSE -%] >+ <span class="biblio-title">[% biblio.title | html %]</span> >+[%- END -%] > [% FOREACH subtitle IN biblio.subtitle.split(' \| ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] > <span class="subtitle">[% subtitle | html %]</span> > [% END %] >-- >2.30.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 33946
:
152145
|
152178
|
152179
| 153297 |
153298
|
153299