Bug 11994: (follow-up) Make things work when LibraryName is empty

When LibraryName system preference was not set, the installation
of the plugin would fail with:

Firefox could not download the search plugin from: ...

Now if the pref is empty, the description 'Library catalog'
will be used instead.

To test:
- Empty your LibraryName pref
- Verify the search plugin can still be installed
  (see first patch for further instructions)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Katrin Fischer 2020-05-01 20:11:29 +00:00 committed by Jonathan Druart
parent f090c1d2cb
commit 1e0dd6d078

View file

@ -1,12 +1,12 @@
<?xml version='1.0' encoding='utf-8' ?>
[% USE raw %]
[% USE Koha %]
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
[%- USE raw -%]
[%- USE Koha -%]
[%- SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') -%]
[%- SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') -%]
[% IF ( opensearchdescription ) %]
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>[% LibraryNameTitle | html %]</ShortName>
<ShortName>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Library catalog[% END %]</ShortName>
<Description>Search the [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha library[% END %] catalog</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">