]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 28853: Fix authority plugin when textarea in biblio record editor
Fridolin Somers [Thu, 12 Aug 2021 20:30:17 +0000 (10:30 -1000)]
Bug 28853: Fix authority plugin when textarea in biblio record editor

In biblio record editor, when subfield value contains more than 100 characters the editor uses a textarea instead of an input.
On a field using authority plugin, this breaks the JavaScript because it only searches for input tags :
In /koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt :
> this.getElementsByTagName('input')[1].value = values[i];

Test plan :
1) Prepare :
1.1) Create a new biblio record with a field using authority plugin, for example 606
1.2) Do not use authority plugin but enter in 606$x more than 100 chars
1.3) Save record
1.4) Create a new autority for 606 biblio field with $a and a $x containing more than 100 chars
2) Test 1 :
2.1) Edit again the biblio record, you see a text area for 606$x
2.2) Use authority plugin on field 606
2.3) Search and choose the new autority
2.4) Check $a,$x and $9 are well filled
3) Test 2 :
3.1) Empty field 606
3.2) Create a second $x subfield and fill it with a random value
3.3) Use authority plugin again on field 606
3.4) Search and choose the new autority
3.5) Check $a and $9 are well filled
3.6) Check first $x contains the value from autority and second $x is empty

Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29580: Fix missing end tag in circ/overdue.tt
Fridolin Somers [Sat, 27 Nov 2021 01:40:03 +0000 (15:40 -1000)]
Bug 29580: Fix missing end tag in circ/overdue.tt

In circ/overdue.tt there is a end tag </td> inside a IF condition.
I should be outside.

Test plan :
Check HTML in overdue page with and without seeing patrons infos from other
branches

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29601: Lists: Test OPACISBD before showing ISBD download
Marcel de Rooy [Tue, 30 Nov 2021 14:49:33 +0000 (14:49 +0000)]
Bug 29601: Lists: Test OPACISBD before showing ISBD download

Test plan:
Check if you see Download/ISBD for a list on OPAC.
Clear OPACISBD.
Check if the link is gone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part"
Owen Leonard [Fri, 19 Nov 2021 19:34:20 +0000 (19:34 +0000)]
Bug 29556: MARC21slim2MODS.xsl broken by duplicate template name "part"

This patch removes a redundant section from MARC21slim2MODS.xsl which
was breaking the option to use unAPI in the OPAC using MODS format.

To test, apply the patch and view a record in the OPAC using unAPI,
e.g.:

/cgi-bin/koha/unapi?id=koha:biblionumber:1&format=MODS

You should see an XML file where previously there would have been an
error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29487: Set autocomplete off for userid/password fields at login
Nick Clemens [Mon, 15 Nov 2021 18:25:20 +0000 (18:25 +0000)]
Bug 29487: Set autocomplete off for userid/password fields at login

This patch adjust:
Intranet login
Opac-main
Opac-main - 'log in to your account modal'

To test:
Login at the three places above
Confirm html shows autocomplete off on the fields
Confirm logins work

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29529: Fix \n in hint on Koha to MARC mappings
Owen Leonard [Fri, 19 Nov 2021 14:48:49 +0000 (14:48 +0000)]
Bug 29529: Fix \n in hint on Koha to MARC mappings

This patch breaks up a translatable string so that "\n" is excluded from
what is translated.

Unrelated: Capitalization is corrected on an instance of the phrase
"Koha to MARC Mappings."

To test, apply the patch and go to Administration -> Koha to MARC
mapping.

- The breadcrumb for the current page should have correct capitalization
  ("mapping" instead of "Mapping").
- Click the "Add" button for any Koha field. The dialog should display
  correctly:

  Adding a mapping for: biblio.abstract.
  Please enter field tag and subfield code, separated by a comma. (For
  control fields: add '@' as subfield code.)
  The change will be applied immediately.

Test the way the po file is updated:

 > cd misc/translator
 > perl translate update en-GB (for example)
 - Open the updated po file, en-GB-staff-prog.po
 - You should find these lines:

 SCRIPT
 koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt:86
 msgid "The change will be applied immediately."
 msgstr ""

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29494: html-template-to-template-toolkit.pl no longer required
Tomas Cohen Arazi [Tue, 16 Nov 2021 12:18:58 +0000 (09:18 -0300)]
Bug 29494: html-template-to-template-toolkit.pl no longer required

This helper script was used to transition from HTML::Template to
Template::Toolkit, which happened 11 (?) years ago.

The file is part of Koha history, but we don't need it in current
master.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29036: Compiled CSS
Kyle Hall [Fri, 3 Dec 2021 15:10:59 +0000 (10:10 -0500)]
Bug 29036: Compiled CSS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29036: (follow-up) Improve the use of variables to keep colors consistent
Owen Leonard [Fri, 24 Sep 2021 16:57:00 +0000 (16:57 +0000)]
Bug 29036: (follow-up) Improve the use of variables to keep colors consistent

This patch modifies the OPAC SCSS so that a "base theme color" variable
is defined which can be used to color button backgrounds and similar
elements. The patch also moves some other colors into variables and
removes some unused CSS.

The Koha logo which is displayed in the upper left corner of the OPAC
has been modified to use the same color.

To test, apply the patch and repeat the previous test plan.

Signed-off-by: jeremy breuillard <jeremy.breuillard@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29036: Accessibility OPAC buttons don't have sufficient contrast
Henry Bolshaw [Mon, 20 Sep 2021 21:50:28 +0000 (21:50 +0000)]
Bug 29036: Accessibility OPAC buttons don't have sufficient contrast

This patch changed the base colour of OPAC buttons to increase the
contrast ratio, improving accessibility and making the button text
easier to read.

To test:

1. Use an accessibility tool (e.g. Chrome's Lighthouse tool) to check
   the contrast ratio on the OPAC
2. Confirm that the OPAC buttons don't have sufficient colour contrast
3. Apply the patch and rebuild css:
   yarn build --view opac
4. Use the accessibility tool to confirm the button contrast ratio now
   meets minimum accessibility requirements
5. Check that the OPAC still looks ok after the changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: jeremy breuillard <jeremy.breuillard@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29488: make NumSavedReports work
Lucas Gass [Tue, 16 Nov 2021 00:17:38 +0000 (00:17 +0000)]
Bug 29488: make NumSavedReports work

1. Have a bunch of saved reports
2. Try to use the sys pref NumSavedReports to limit how many show by default
3. It doesn't work
4. Apply patch
5. Try again, now it should work

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29521: Fix style of patron clubs table when in clubs management
Owen Leonard [Thu, 18 Nov 2021 19:17:48 +0000 (19:17 +0000)]
Bug 29521: Fix style of patron clubs table when in clubs management

This patch follows up Bug 24627 to add some additional template logic to
the table of clubs so that the interface is consistent whether you're
looking at clubs during the holds process or during the clubs management
view.

The ways Bug 24627 made the clubs list more consistent with patron
search results made it LESS consistent with the Clubs management
interface.

To test, apply the patch and go to Tools -> Patron clubs.

- Scroll down to the "Clubs" table, below the "Club templates" table.
  - In the table of clubs, the club name should not be a link.
  - Hovering your mouse over the table should not highlight each row.

Confirm the previous behavior of a clubs search when placing a hold:

- Search the catalog and start the process of placing a hold on an item.
- On the "Place hold" page, click the "Clubs" tab and perform a search
  which will return multiple clubs.
- In this view, the club name should be a link. Clicking it should
  select that club for the hold.
- You should also be able to click anywhere in the row to select the
  club for the hold.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29513: (QA follow-up) Fix TT filters
Katrin Fischer [Tue, 16 Nov 2021 08:43:01 +0000 (08:43 +0000)]
Bug 29513: (QA follow-up) Fix TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29513: Convert remaining breadcrumbs div blocks into nav
Andreas Roussos [Thu, 18 Nov 2021 08:37:01 +0000 (09:37 +0100)]
Bug 29513: Convert remaining breadcrumbs div blocks into nav

As per https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27846#c0,
breadcrumbs should adhere to the WAI-ARIA Authoring Practices. Most Staff
Client template files have already been fixed, but there were a few that
were missed.

This patch fixes that.

Test plan:
1) Apply this patch.
2) Visit these pages in the Staff Client:
   Home > Acquisitions > TestVendor > Basket TestBasket (1) for TestVendor (*)
   Home > Administration > Set library checkin and transfer policy (**)
   Home > Patrons > Merge patron records (***)
   ...and confirm that the breadcrumbs display correctly.

   (*) Can be accessed by creating a test basket for a test vendor
   (**) Can be found under Administration -> Patrons and circulation
   (***) Can be found by trying to merge two Patron records

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoBug 29514: Remove extraneous HTML entity from breadcrumbs
Andreas Roussos [Thu, 18 Nov 2021 09:45:10 +0000 (10:45 +0100)]
Bug 29514: Remove extraneous HTML entity from breadcrumbs

The template file for ILL requests has a small typo in the breadcrumbs
section: there exists an extra &rsaquo; HTML entity after "Home".

This patch fixes that.

Test plan:
1) Access the ILL requests module, and notice how an extra character
   is displayed after "Home" in the breadcrumbs.
2) Apply this patch.
3) Refresh the page -- the extra character is no longer displayed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2 years agoKoha 21.11.00 is here! v21.11.00
Jonathan Druart [Thu, 25 Nov 2021 11:02:13 +0000 (12:02 +0100)]
Koha 21.11.00 is here!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years ago21.11.00 - Fix translation issues
Jonathan Druart [Fri, 26 Nov 2021 10:01:09 +0000 (11:01 +0100)]
21.11.00 - Fix translation issues

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoTranslation updates for Koha 21.11.00
Koha translators [Fri, 26 Nov 2021 07:29:39 +0000 (04:29 -0300)]
Translation updates for Koha 21.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoAdd release notes for Koha 21.11.00
Jonathan Druart [Thu, 25 Nov 2021 15:24:49 +0000 (16:24 +0100)]
Add release notes for Koha 21.11.00

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years ago21.11.00 - Update .mailmap
Jonathan Druart [Wed, 24 Nov 2021 10:13:38 +0000 (11:13 +0100)]
21.11.00 - Update .mailmap

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years ago21.11.00 - Update kohastructure.sql
Jonathan Druart [Wed, 24 Nov 2021 09:52:58 +0000 (10:52 +0100)]
21.11.00 - Update kohastructure.sql

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years ago21.11.00 - Update history.txt
Jonathan Druart [Wed, 24 Nov 2021 09:39:04 +0000 (10:39 +0100)]
21.11.00 - Update history.txt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years ago21.11.00 - Update contributors.yaml
Jonathan Druart [Wed, 24 Nov 2021 09:38:26 +0000 (10:38 +0100)]
21.11.00 - Update contributors.yaml

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28959: Fix occurrence in tools/batch_delete_records.pl
Jonathan Druart [Fri, 26 Nov 2021 11:15:17 +0000 (12:15 +0100)]
Bug 28959: Fix occurrence in tools/batch_delete_records.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: Prevent UI/Form/Builder/Item.t to fail randomly
Jonathan Druart [Thu, 25 Nov 2021 12:53:55 +0000 (13:53 +0100)]
Bug 28445: Prevent UI/Form/Builder/Item.t to fail randomly

MySQL and Perl don't order strings with _ identically which cause a
mismatch when comparing the itemtypes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28445: (follow-up) Add diag for failing test
Jonathan Druart [Thu, 25 Nov 2021 11:46:25 +0000 (12:46 +0100)]
Bug 28445: (follow-up) Add diag for failing test

Last diag was not enough (Koha_Master_D11/457)

         #   Failed test 'Item types should be sorted by description and an empty entries should be shown'
         #   at t/db_dependent/Koha/UI/Form/Builder/Item.t line 127.
         #     Structures begin differing at:
         #          $got->[11] = 'X_vvQE5'
         #     $expected->[11] = 'knHm32'
         # Itemtypes details: $VAR1 = [
         #           '',
         #           'EMVzKcGR',
         #           'x4S8_BaFCp',
         #           'Cp2BGkY',
         #           'BK',
         #           'CF',
         #           'CR',
         #           'bBvgmVAIzD',
         #           'WKyaQ_l',
         #           'Cjc0SKQz',
         #           'liic63',
         #           'X_vvQE5',
         #           'knHm32',
         #           'MP',
         #           'MX',
         #           'MU',
         #           'g_F5eNqA',
         #           'REF',
         #           'pkxaMSv',
         #           'VM'
         #         ];
         # $VAR2 = [
         #           'bBvgmVAIzD',
         #           'BK',
         #           'CF',
         #           'Cjc0SKQz',
         #           'Cp2BGkY',
         #           'CR',
         #           'EMVzKcGR',
         #           'g_F5eNqA',
         #           'knHm32',
         #           'liic63',
         #           'MP',
         #           'MU',
         #           'MX',
         #           'pkxaMSv',
         #           'REF',
         #           'VM',
         #           'WKyaQ_l',
         #           'X_vvQE5',
         #           'x4S8_BaFCp'
         #         ];
We needed the translated_description. It should be the same actually,
but maybe something weird is happening.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29113: Fix random assignation
Jonathan Druart [Thu, 7 Oct 2021 08:06:15 +0000 (10:06 +0200)]
Bug 29113: Fix random assignation

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29113: Hide code for additional contents and generate it
Jonathan Druart [Mon, 4 Oct 2021 14:28:49 +0000 (16:28 +0200)]
Bug 29113: Hide code for additional contents and generate it

additional_contents.code is used to group DB rows together. Each row
represent one content in a given language, and the code is used to know
they are translation of the lang='default' one.

It's not really useful for the end user and we could hide it and
generate it.

Test plan:
Create/Edit/Delete additional contents (news and HTML customizations)
and confirm that they are correctly grouped together.
You need several languages installed to test this patch correctly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29564: Use List::MoreUtils so SIP U16/Xenial does not break
Mason James [Wed, 24 Nov 2021 01:57:51 +0000 (14:57 +1300)]
Bug 29564: Use List::MoreUtils so SIP U16/Xenial does not break

 - run prove t/00-load.t, see error
 - apply patch

    00:07:08.189 koha_1       | #   Failed test 'use C4::SIP::Sip::Configuration;'
    00:07:08.189 koha_1       | #   at t/00-load.t line 46.
    00:07:08.189 koha_1       | #     Tried to use 'C4::SIP::Sip::Configuration'.
    00:07:08.189 koha_1       | #     Error:  "uniq" is not exported by the List::Util module

 - run prove t/00-load.t, see tests pass :0)

https://bugs.koha-community.org/show_bug.cgi?id=29478

https://bugs.koha-community.org/show_bug.cgi?id=29564

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29567: (bug 28445 follow-up) Restore cataloguing plugins
Jonathan Druart [Wed, 24 Nov 2021 10:56:52 +0000 (11:56 +0100)]
Bug 29567: (bug 28445 follow-up) Restore cataloguing plugins

Broken by bug 28445.

See also the FIXME from
  commit 86156da415141e32e16f2090477be32bda241afb
  Bug 28445: Adjust code to handle regexs

The problem is that the cataloguing plugins inject JS code in the DOM BEFORE the footer
in somes page we have all the JS loaded at the end of the DOM
and so $ (jQuery) is not defined

It's working on additem as we don't have the JS in the footer, but the
batch item mod tool has it there.

Test plan:
Batch edit items and confirm that cataloguing are working correctly with
this patch applied.

Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29381: Prevent sending of automatic renewal messages on every cron run
Joonas Kylmälä [Sun, 31 Oct 2021 14:52:50 +0000 (14:52 +0000)]
Bug 29381: Prevent sending of automatic renewal messages on every cron run

Currently the auto-renewal digest messages are sent on every cron run
even if there was nothing to renew or no renewal errors.

This regression was introduced in the commit "Bug 18532: Add
individual issues to digest notice and hide auto_renewals messaging
preference when not needed".

To test:
 1) set syspref AutoRenewalNotices to be according to patron
    preferences
 2) Enable renewal digest messages on a patron's messaging preferences
 3) Checkout a book for patron, during the checkout use the Checkout
 settings menu to check the box "Automatic renewal"
 4) Run
    $ perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm --digest-per-branch
    $ perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm --digest-per-branch
 5) Notice you have now two renewal messages for the patron
 6) Apply patch
 7) repeat step 4) and notice you don't get anymore these unnecessary
    renewal messages

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29524: (bug 28935 follow-up) Restore modification of some patron's attributes
Jonathan Druart [Mon, 22 Nov 2021 13:24:40 +0000 (14:24 +0100)]
Bug 29524: (bug 28935 follow-up) Restore modification of some patron's attributes

On
  commit 5f37d8d2f496ce3c9fd6dfd5a2efa7a9fe435af3
  Bug 28935: No filtering on patron's data on member entry pages
we restricted the list of the columns from the borrowers table that can
be modified from the patron edit view.
We were too restrictive, the following 3 attributes can be edited from
this form: privacy_guarantor_fines, privacy_guarantor_checkouts,
checkprevcheckout and lang

Test plan:
Turn on the following prefs:
- AllowStaffToSetFinesVisibilityForGuarantor
- AllowStaffToSetCheckoutsVisibilityForGuarantor
- CheckPrevCheckout (set to 'unless overridden *')
- TranslateNotices
Edit a patron and see the 4 different options are now displayed.
Change their value, save, edit again
Confirm that the values have been saved

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29565: Prevent regressions.t to fail on slow boxes
Jonathan Druart [Wed, 24 Nov 2021 08:26:38 +0000 (09:26 +0100)]
Bug 29565: Prevent regressions.t to fail on slow boxes

It's failing randomly on some Jenkins' nodes

 #   Failed test 'Encoding in session variables'
 #   at t/db_dependent/selenium/regressions.t line 300.
 Can't call method "get_text" on an undefined value at t/db_dependent/selenium/regressions.t line 285.

It can be recreated locally with the following changes:
@ t/lib/Selenium.pm:50 @ sub new {
     );
     bless $self, $class;
     $self->add_error_handler;
-    $self->driver->set_implicit_wait_timeout(5000);
+    $self->driver->set_implicit_wait_timeout(1000);
     return $self;
 }

@ t/lib/Selenium.pm:50 @ sub new {
     );
     bless $self, $class;
     $self->add_error_handler;
-    $self->driver->set_implicit_wait_timeout(5000);
+    $self->driver->set_implicit_wait_timeout(1000);
     return $self;
 }

This patch suggests to simply double the timeout.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29485: (follow-up) Trying to prevent administration_tasks.t to fail randomly
Jonathan Druart [Wed, 24 Nov 2021 08:12:16 +0000 (09:12 +0100)]
Bug 29485: (follow-up) Trying to prevent administration_tasks.t to fail randomly

Recreated the problem after run #47
Error while executing command: no such element: Unable to locate element: //*[@id="userid"] at /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm line 411.

With this patch I do not longer recreate the failure. It's ugly but,
well, I don't have any other solutions. It seems that the accept_alert
is taking too long and is async (??)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29478: Compiled CSS
Jonathan Druart [Mon, 22 Nov 2021 10:51:26 +0000 (11:51 +0100)]
Bug 29478: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29478: (follow-up) Today should select now for pastinclusive
Jonathan Druart [Fri, 19 Nov 2021 09:55:47 +0000 (10:55 +0100)]
Bug 29478: (follow-up) Today should select now for pastinclusive

This is getting ugly. We need to add 1 minute for the minDate or the
'Today' link may not work.

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>
2 years agoBug 29478: Today should select now for pastinclusive
Jonathan Druart [Wed, 17 Nov 2021 11:19:50 +0000 (12:19 +0100)]
Bug 29478: Today should select now for pastinclusive

If Today is clicked when we only allow dates in the past and today/now,
we should select the current date/time
We need to update the maxDate to make it up-to-date, or the maxDate may
be set to the minute before and clicking Today will blank the input.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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>
2 years agoBug 29478: (follow-up) Provide default style for shortcut buttons
Owen Leonard [Tue, 16 Nov 2021 14:17:19 +0000 (14:17 +0000)]
Bug 29478: (follow-up) Provide default style for shortcut buttons

This patch adds some CSS to _flatpickr.scss in order to give a deafult
style to the "yesterday," "today," and "tomorrow" controls added by the
shortcut plugin.

A missed translatable string is now wrapped in the __() function:
__("or").

The patch also updates the date calculation for those shortcuts to use
Flatpickr's date calculation shorthand. This isn't strictly necessary
but I think it makes the code more readable.

To test, apply the patch and build the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

In the staff client, view some pages with date-picker widgets. A
calendar widget time selection:

- Circulation -> Check out -> Checkout settings -> Select date:
  - The calendar widget should have "yesterday," "today," and "tomorrow"
    controls styled like links appearing after the time selector. The
    controls should be centered, with the "or" label on the same line.

A calendar widget without time selection:

- Tools -> Log viewer -> Display from.

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>
2 years agoBug 29478: Flatpickr - Restore 'Today' button
Jonathan Druart [Mon, 15 Nov 2021 09:59:08 +0000 (10:59 +0100)]
Bug 29478: Flatpickr - Restore 'Today' button

It's not implemented, looks like we need to use a plugin for that

https://github.com/flatpickr/flatpickr/issues/576

https://github.com/jcsmorais/shortcut-buttons-flatpickr

Test plan:
Confirm that flatpickr instances now have a yesterday, today and
tomorrow buttons.

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>
2 years agoBug 29500: Flatpickr - accept original date in the past and not others
Jonathan Druart [Wed, 17 Nov 2021 10:22:57 +0000 (11:22 +0100)]
Bug 29500: Flatpickr - accept original date in the past and not others

Bug 29241 was supposed to fix this but it didn't properly.
We are accepting other dates in the past when we should only accept the
original one (the one from the DB) AND dates in future.

Test plan:
Retry test plan for 29241 and confirm that you cannot set manually another
date in the past.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29394: Remove futuredate for renew
Jonathan Druart [Wed, 17 Nov 2021 10:30:21 +0000 (11:30 +0100)]
Bug 29394: Remove futuredate for renew

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29394: adjust request.tt
Jonathan Druart [Wed, 17 Nov 2021 08:20:59 +0000 (09:20 +0100)]
Bug 29394: adjust request.tt

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29394: (follow-up) Pass correct time format and other corrections
Owen Leonard [Tue, 16 Nov 2021 16:46:44 +0000 (16:46 +0000)]
Bug 29394: (follow-up) Pass correct time format and other corrections

This patch makes a few corrections, including adding the
correct Flatpickr date format option when the timepicker is enabled.

Besides past and future date options, I've added a "pastinclusive"
option which allows dates in the past OR today. This option was
previously applied to the checkin page.

The patch also corrects a couple of places where the wrong date field
was modified with the new data attributes.

To test, apply the patch and test the datepickers on the batch checkout
and renew pages. When you select a date and time the "TimeFormat" system
preference should be correctly applied.

The calendar widget on the checkin page should allow you to select
today's date.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29394: Remove flatpickr instantiations from most of the tt files
Jonathan Druart [Tue, 16 Nov 2021 09:54:10 +0000 (10:54 +0100)]
Bug 29394: Remove flatpickr instantiations from most of the tt files

We must reduce the instantiations as much as possible to take advantages
of the default values and specific behaviours we have defined in
calendar.inc

This patch is suggesting to have a .flatpickr class and using the data
attributes:
- flatpickr-futuredate
- flatpickr-pastdate
- flatpickr-enable-time
- flatpickr-on-close-focus

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29010: (QA follow-up) Change inputmode from numeric to decimal
Katrin Fischer [Fri, 19 Nov 2021 15:08:05 +0000 (16:08 +0100)]
Bug 29010: (QA follow-up) Change inputmode from numeric to decimal

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29010: fix pattern in search_field.weight
Thomas Klausner [Tue, 14 Sep 2021 09:13:11 +0000 (11:13 +0200)]
Bug 29010: fix pattern in search_field.weight

search_field.weight is of type NUMERIC(5,2) in the database, and values
are rendered as floats in /admin/searchengine/elasticsearch/mappings.pl

But the field validation only accepts INTs. This patch fixes the pattern
to accept NUMERIC(ish) values

- Enable Elasticsearch (but no need to actually index anyting)
- go to cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
- Enter an integer (eg "8") into any "weight" column and click save
- Koha now displays the value as NUMERIC, eg. "8.00"
- Change nothing, and click save again
- Save does not work, you get a warning by the browser that the input
  does not match the requested format (because in the html field only
  ints are allowed, but the DB stored the value as numeric and returns
  it as such)
- Workaround: Change all the values back to ints (i.e. remove ".00"),
  but this is very cumbersome if you have several weights

- Apply the patch
- Now try to save again (without changing eg "8.00" to "8". It works
- Add a new weight (eg "4"), save, it's turned into "4.00", but saving
  again still works

Sponsored-by: Steiermärkische Landesbibliothek
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 17600: Fix opac/unapi
Jonathan Druart [Mon, 22 Nov 2021 10:04:51 +0000 (11:04 +0100)]
Bug 17600: Fix opac/unapi

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29437: (QA follow-up) Update TODO in Breeding.t
Marcel de Rooy [Fri, 19 Nov 2021 07:54:37 +0000 (07:54 +0000)]
Bug 29437: (QA follow-up) Update TODO in Breeding.t

We now have some tests for BreedingSearch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29437: (QA follow-up) Remove Business::ISBN from addbooks
Marcel de Rooy [Fri, 19 Nov 2021 07:53:26 +0000 (07:53 +0000)]
Bug 29437: (QA follow-up) Remove Business::ISBN from addbooks

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29437: Search reservoir for term as title, author, or variations of ISBN
Nick Clemens [Mon, 8 Nov 2021 19:24:36 +0000 (19:24 +0000)]
Bug 29437: Search reservoir for term as title, author, or variations of ISBN

The code in the script and the module attempt to determine whether a term is an isbn, or not. Rather
than try to do this, we can simply search it on the three fields: isbn, title, author

Additionally, we should search as any of the ISBN variations to broaden our matches

Note: Curently only an ISBN 10 is stored in import biblios, so for an ISBN13 that doesn't convert
the value will be blank - this is another bug

To test:
1 - Perform a cataloging search for a valid ISBN 13 with no ISBN10 counterpart:
    9798200834976
2 - 500 error
3 - Apply patch
4 - Repeat, no results
5 - Import some records
6 - Search by title/author/isbn
7 - Confirm searching works as expected

WNC amended to fix spelling

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
AMENDED: Useless call of ISBNs (plural) when you only pass one parameter.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29437: Unit tests
Nick Clemens [Wed, 10 Nov 2021 13:33:41 +0000 (13:33 +0000)]
Bug 29437: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29456: Add Hold_Reminder description to patron categories overview page
Katrin Fischer [Mon, 15 Nov 2021 16:29:49 +0000 (16:29 +0000)]
Bug 29456: Add Hold_Reminder description to patron categories overview page

This was missed when initially adding the notice.

To test:
- Go to Administraiton > patron categories
- Edit a patron category and check "Hold reminder" in messaging
  preferences, save.
- Go to the overview page and verify it shows as 'Unknown'.
- Apply patch.
- Descrpition should now display.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29456: (bug 18532 follow-up) handle Auto_Renewals messages in category
Jonathan Druart [Tue, 16 Nov 2021 13:57:21 +0000 (14:57 +0100)]
Bug 29456: (bug 18532 follow-up) handle Auto_Renewals messages in category

The new message appears in the list on the edit view, but the list view
is showing "unknown"

Test plan:
Set AutoRenewalNotices to "according to patron messaging prefs"
Edit a patron category
Tick all the checkboxes
On the category list view you should see a correct display in the
"Messaging" column

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 5229: DBRev 21.06.00.049
Jonathan Druart [Fri, 19 Nov 2021 14:20:00 +0000 (15:20 +0100)]
Bug 5229: DBRev 21.06.00.049

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 5229: Remove from searching.pref
Tomas Cohen Arazi [Tue, 16 Nov 2021 12:14:57 +0000 (09:14 -0300)]
Bug 5229: Remove from searching.pref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 5229: Remove system preference 'OPACItemsResultsDisplay'
Jonathan Druart [Mon, 15 Nov 2021 11:48:28 +0000 (12:48 +0100)]
Bug 5229: Remove system preference 'OPACItemsResultsDisplay'

We dropped it on bug 12561 when removing the non-XSLT view. This feature
has never been implemented for XSLT views and the pref must then be
removed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29463: Escape utf8 characters before appending search query to url
Petro Vashchuk [Fri, 12 Nov 2021 13:14:46 +0000 (15:14 +0200)]
Bug 29463: Escape utf8 characters before appending search query to url

To test:
1) go to the main page of Koha and search in the "Check out" search window type "näyttö".
2) see that umlauts got replaced with replacement characters.
3) apply the patch.
4) repeat 1-2, ensure that umlauts displayed correctly and are not getting replaced with replacement characters.

JK: remove period from commit title
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29387: (QA follow-up) Fix modules in test
Marcel de Rooy [Fri, 19 Nov 2021 07:22:09 +0000 (07:22 +0000)]
Bug 29387: (QA follow-up) Fix modules in test

Can't locate object method "new" via package "Koha::BackgroundJob::BatchUpdateBiblio" (perhaps you forgot to load "Koha::BackgroundJob::BatchUpdateBiblio"?) at t/db_dependent/Koha/BackgroundJobs/BatchUpdateBiblio.t line 45.

How did it pass at signoff?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29387: Stringify exceptions for other background job modules
Jonathan Druart [Mon, 8 Nov 2021 09:22:09 +0000 (10:22 +0100)]
Bug 29387: Stringify exceptions for other background job modules

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29387: Stringify exception when logging error during a batch mod biblio
Jonathan Druart [Tue, 2 Nov 2021 09:43:57 +0000 (10:43 +0100)]
Bug 29387: Stringify exception when logging error during a batch mod biblio

If an exception is raised by one the methods/subroutines called when batch biblio update, the job will fail in the middle and some records won't be processed.

Test plan:
0. Don't apply the patch
In KTD you can run the a batch mod biblio on the 100 first records and
the worker will fail with
"""
countered object 'C4::Biblio::_koha_modify_biblioitem_nonmarc(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'lccn' at row 1 at /kohadevbox/koha/C4/Biblio.pm line 423
', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /kohadevbox/koha/Koha/BackgroundJob/BatchUpdateBiblio.pm line 120.
"""
The UI is not saying anything about this problem.

Generate 100 biblionumbers: perl -e 'for (1..100){print "$_\n"}'
1. Apply the patch and confirm than now you see the detail of the batch
update and that biblionumber 72 is marked as not been modified with the
correct error (raw DBI error)

JK: add executable bit to BatchUpdateBiblio.t
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29341: DBIC schema changes
Jonathan Druart [Fri, 19 Nov 2021 14:20:54 +0000 (15:20 +0100)]
Bug 29341: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29341: DBRev 21.06.00.048
Jonathan Druart [Fri, 19 Nov 2021 14:19:20 +0000 (15:19 +0100)]
Bug 29341: DBRev 21.06.00.048

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29341: Remove foreign keys on pseudonymized_transactions
Jonathan Druart [Wed, 17 Nov 2021 11:25:35 +0000 (12:25 +0100)]
Bug 29341: Remove foreign keys on pseudonymized_transactions

Behave like the statistics table and don't remove the code even if the
branch or patron's category is removed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29496: (bug 27526 follow-up) Fix item form validation
Jonathan Druart [Wed, 17 Nov 2021 14:48:48 +0000 (15:48 +0100)]
Bug 29496: (bug 27526 follow-up) Fix item form validation

The validation of the forms were blocked with "X item mandatory fields
empty" when at least one dropdown list subfield was marked as mandatory.

We need to add the 'input_marceditor' class to the select (does it
actually make sense? select vs input...)

Caused by
  commit 6ed29bccef590a1bc5e4cea175b41b8024483320
  Bug 27526: Fix mandatory and important checks
Which lamentably failed as it was stating:
"Using .input_marceditor let us fix the additem.tt form and prevent to break the other ones"

Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29496: CheckMandatorySubfields don't work properly with select field in serials...
Marion Durand [Wed, 17 Nov 2021 10:02:01 +0000 (11:02 +0100)]
Bug 29496: CheckMandatorySubfields don't work properly with select field in serials-edit.tt

Since one of the patches of BZ 27526 (Bug 27526: Fix mandatory and
important checks), CheckMandatorySubfields use the class
"input_marceditor" but in file serials-edit.tt this class is not set for
all field (it is present on text input but not on select input) 5
9- Check that no error appear and that your item has been created.

In consequence if a select field is set as mandatory, it is detected as
missing even if it is filed and so you can't submit the form and receive
the new serial.

Test plan:
0- Be sure to be in a version of koha where the patch that introduces
   the bug is present (it is present in master since Jul 8 2021 (it is
   present in 21.06.00.046) and will be pushed in 21.11.00)
1- Create (or find) a subscription for a biblio record and select the
   option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a
   select input in the framework used by the biblio record. (ex: 995$b,
   995$c or 995$e in unimarc; 952$a, 952$b or 952$c in marc21)
3- From the subscription-detail page click on "Receive"
4- Change the status to "Arrived" and fill the item form that appears.
5- Click on "Save"
6- Check that an error box appear with the message " Form not submitted
   because of the following problem(s) 1 mandatory fields empty
   (highlighted)" (the number can be different according to the number of
   concerned subfields)
7- Apply the patch
8- Repeat step 3 to 5
9- Check that no error appear and that your item has been created

JD amended patch: remove comma to separate classes

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29270: start_for is actually date_to
Jonathan Druart [Wed, 17 Nov 2021 08:32:42 +0000 (09:32 +0100)]
Bug 29270: start_for is actually date_to

The attribute has been renamed in the meanwhile..

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29477: Flatpickr - default to 23:59 for the time part
Jonathan Druart [Mon, 15 Nov 2021 09:32:30 +0000 (10:32 +0100)]
Bug 29477: Flatpickr - default to 23:59 for the time part

It was defaulting to 12:00 which was an unexpected change in behaviour
caused by flatpickr switch.

Test plan:
On the circulation view, check some items out and play with the time
part and "Remember for session". The behaviour must be correct, ie. the
same as prior to flatpickr switch.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29270: Expiration date must be in future
Jonathan Druart [Wed, 17 Nov 2021 08:03:14 +0000 (09:03 +0100)]
Bug 29270: Expiration date must be in future

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29469: (bug 17600 follow-up) Fix tag approval/rejection from staff
Jonathan Druart [Tue, 16 Nov 2021 14:46:02 +0000 (15:46 +0100)]
Bug 29469: (bug 17600 follow-up) Fix tag approval/rejection from staff

Usage: POSIX::exit(status) at /kohadevbox/koha/tags/review.pl line 72.                                                                                                                                                at /usr/share/perl/5.28/Carp.pm line 289
        Carp::croak('Usage: POSIX::exit(status)') called at /usr/lib/x86_64-linux-gnu/perl/5.28/POSIX.pm line 22
        POSIX::usage('exit(status)') called at (eval 2066) line 3

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28692: (follow-up) Add tests
Marcel de Rooy [Mon, 15 Nov 2021 13:42:02 +0000 (13:42 +0000)]
Bug 28692: (follow-up) Add tests

Test plan:
Run t/db_dependent/Log.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28692: (QA follow-up) Fix test for objects
Marcel de Rooy [Fri, 12 Nov 2021 10:40:32 +0000 (10:40 +0000)]
Bug 28692: (QA follow-up) Fix test for objects

Fix the bug where object is first stringified and then tested for
being a Koha::Item.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28692: (QA follow-up) Sort hash keys of unblessed
Marcel de Rooy [Fri, 12 Nov 2021 10:29:04 +0000 (10:29 +0000)]
Bug 28692: (QA follow-up) Sort hash keys of unblessed

Trivial add. Reads much better. And might help future diffs.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28692: (QA follow-up) Add module
Marcel de Rooy [Fri, 12 Nov 2021 09:58:22 +0000 (09:58 +0000)]
Bug 28692: (QA follow-up) Add module

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28692: Get from storage before log actions
Jonathan Druart [Tue, 12 Oct 2021 09:44:12 +0000 (11:44 +0200)]
Bug 28692: Get from storage before log actions

To make sure we have logging the values from DB.
It will reduce DB action_log table size when we log the full object and
it contains DateTime object.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28816: (follow-up) Compiled CSS
Jonathan Druart [Tue, 16 Nov 2021 12:59:48 +0000 (13:59 +0100)]
Bug 28816: (follow-up) Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29485: Trying to prevent administration_tasks.t to fail randomly
Jonathan Druart [Mon, 15 Nov 2021 14:04:06 +0000 (15:04 +0100)]
Bug 29485: Trying to prevent administration_tasks.t to fail randomly

Since bug 19185, and Koha_Master running the tests after t/db_dependent/selenium/01-installation.t is ran, t/db_dependent/selenium/administration_tasks.t is failing randomly with:

12:32:59 koha_1       | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
12:32:59 koha_1       |  /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
12:32:59 koha_1       |  (eval 1710):1 in Selenium::Remote::Driver::__ANON__
12:32:59 koha_1       |  (eval 1712):2 in Selenium::Remote::Driver::__ANON__
12:32:59 koha_1       |  /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
12:32:59 koha_1       |  /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1340 in (eval)
12:32:59 koha_1       |  /kohadevbox/koha/t/lib/Selenium.pm:170 in Selenium::Remote::Driver::find_element
12:32:59 koha_1       |  t/db_dependent/selenium/administration_tasks.t:188 in t::lib::Selenium::click

I don't recreate it locally.

The screenshot of the failure shows that the screen is still on the authorised value list view.

This does not make a lot of sense, but I am failing to find a logic
here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: Fix test if sample data missing
Jonathan Druart [Mon, 15 Nov 2021 13:34:03 +0000 (14:34 +0100)]
Bug 21105: Fix test if sample data missing

    #   Failed test 'Identify - earliestDatestamp in the right format'
    #   at t/db_dependent/OAI/Server.t line 182.
    # Compared $data->{"Identify"}{"earliestDatestamp"}
    #    got : '2021-11-15T13:16:09Z'
    # expect : '2014-05-07T13:36:23Z'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29273: Fix failing tests
Jonathan Druart [Mon, 15 Nov 2021 13:15:22 +0000 (14:15 +0100)]
Bug 29273: Fix failing tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: (follow-up) Regression tests
Jonathan Druart [Mon, 15 Nov 2021 10:44:14 +0000 (11:44 +0100)]
Bug 21105: (follow-up) Regression tests

Mock KohaAdminEmailAddress in case it differs from the default value

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29408: Add JSDoc documentation for kohaTable function
Martin Renvoize [Wed, 3 Nov 2021 16:52:57 +0000 (16:52 +0000)]
Bug 29408: Add JSDoc documentation for kohaTable function

This patch adds some JSDoc formatted parameter documentation for the
kohaTable function.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29408: Update all existing uses of .api to .kohaTable
Martin Renvoize [Wed, 3 Nov 2021 16:30:50 +0000 (16:30 +0000)]
Bug 29408: Update all existing uses of .api to .kohaTable

This patch goes through the codebase and updates existing revelant calls
to .api referencing the Koha REST dataTables wrapper to use the name
name 'kohaTable'.

Test plan.
1) Ensure the tables on the following pages all continue to work as
   expected
   a) acqui/parcel
   b) admin/branches
   c) admin/cities
   d) admin/smtp_servers
   e) pos/register
   f) tools/quotes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29408: Rename Koha dataTables wrapper
Martin Renvoize [Wed, 3 Nov 2021 16:29:21 +0000 (16:29 +0000)]
Bug 29408: Rename Koha dataTables wrapper

This patch renames the Koha REST JS dataTables wrapper from the
ambigious 'api' to the clearer 'kohaTable'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29405: Fix date_renewed attribute format in patron spec
Martin Renvoize [Wed, 3 Nov 2021 13:47:35 +0000 (13:47 +0000)]
Bug 29405: Fix date_renewed attribute format in patron spec

This patch just adds the 'date' format string to ensure we are
validating the input/output of the date_renewed field correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29452: remove unnecessary warns in the logs
Christophe Croullebois [Wed, 10 Nov 2021 15:23:54 +0000 (16:23 +0100)]
Bug 29452: remove unnecessary warns in the logs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29321: Remove a last without loop context
Marcel de Rooy [Fri, 5 Nov 2021 15:00:04 +0000 (15:00 +0000)]
Bug 29321: Remove a last without loop context

This reads better when converted to regular if.
Note that last within such a block is allowed in Perl, but it feels
better to use it only in a loop context.

Test plan:
Read the patch ;)
Bonus: Test if you enter the block by using pref OPACSuggestionMandatoryFields
when adding a suggestion from opac.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: Added a space between 'if' and '(' :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27145: Wrap delete and move_to_deleted in a transaction
Kyle M Hall [Fri, 4 Dec 2020 11:55:37 +0000 (06:55 -0500)]
Bug 27145: Wrap delete and move_to_deleted in a transaction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27145: Rethrow all other exceptions
Kyle M Hall [Thu, 3 Dec 2020 14:10:30 +0000 (09:10 -0500)]
Bug 27145: Rethrow all other exceptions

Bug 14708 introduced a try catch around $patron->delete in commit:
  "Bug 14708: (QA follow-up) Use try/catch blocks when calling"

However, in the catch block it only assumes the exception was from trying to
delete anonymous patron when it can be anything else as well, the code should
be modified so that it will handle the anonymous patron case and if it is
anything else we log the other exception.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: (QA follow-up) Avoid MySQL-ism
Tomas Cohen Arazi [Fri, 12 Nov 2021 14:34:58 +0000 (11:34 -0300)]
Bug 21105: (QA follow-up) Avoid MySQL-ism

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: (QA follow-up) Silence warning because of tests setup
Tomas Cohen Arazi [Fri, 12 Nov 2021 14:15:08 +0000 (11:15 -0300)]
Bug 21105: (QA follow-up) Silence warning because of tests setup

The tests are using 'http://localhost' and the regex is setting $baseURL
to empty in this case. It works on the oai.pl front-end.

This patch changes the regex.

To test:
1. Run:
   $ kshell
  k$ t/db_dependent/OAI/Server.t
=> FAIL: Boo! Warning!
2. Apply this patch
3. Repeat 2
=> SUCCESS: Oh, cool. No warning :-D
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: Regression tests
Tomas Cohen Arazi [Fri, 12 Nov 2021 13:16:37 +0000 (10:16 -0300)]
Bug 21105: Regression tests

This patch introduces a regression test for the fixed behavior.
I also changed a oneliner regex we had for stripping query parameters
because it was causing a warning with the tests base URL
(http://localhost) because it was generating an empty baseURL.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/OAI/Server.t
=> FAIL: Tests fail, the response is incorrect!
3. Apply the bug's patch
4. Repeat 2
=> SUCCESS: Tests pass! Good response!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 21105: oai.pl returns invalid earliestDatestamp
Rudolf Byker [Thu, 15 Apr 2021 07:32:30 +0000 (09:32 +0200)]
Bug 21105: oai.pl returns invalid earliestDatestamp

For OAI-PMH, all date and time values must be in the format
"YYYY-MM-DDThh:mm:ssZ" and in UTC. Currently,
Identify.earliestDatestamp uses the SQL format "YYYY-MM-DD hh:mm:ss".
This patch fixes that.

To test:
1) Get a Koha instance with OAI-PMH enabled.
2) Visit /cgi-bin/koha/oai.pl?verb=Identify, view source for the page
   and observe that earliestDate is in the wrong format
   "YYYY-MM-DD hh:mm:ss"
3) Apply patch
4) Visit /cgi-bin/koha/oai.pl?verb=Identify, view the source for the page
   and observe that earliestDate is now in the correct format
   "YYYY-MM-DDThh:mm:ssZ"
5) Sign off

Sponsored-by: Reformational Study Centre
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29460: Fix typo 'pendin g approval'
Marcel de Rooy [Fri, 12 Nov 2021 07:47:48 +0000 (07:47 +0000)]
Bug 29460: Fix typo 'pendin g approval'

Test plan:
Apply and git grep for it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29334: Do not apply defaultvalue to existing auth record
Marcel de Rooy [Wed, 27 Oct 2021 12:48:35 +0000 (12:48 +0000)]
Bug 29334: Do not apply defaultvalue to existing auth record

Note: The check in build_authorized_values_list with defaultvalue can be
simplified since $value may already contain the defaultvalue. It is filled
before the sub is called.
The test for inserting a blank option is generalized; and may be still
improved when using required attributes in the template? Note that we
might experience some browser issues for these placeholders.

Removed a few useless lines with respect to fields controlled
by itemtypes. The last assignment to $value was useless and
its probable intention unwanted (just use defaultvalue).

Test plan:
Put a defaultvalue in an authority framework.
Add a new authority. Check for that value.
Open existing authority. Clear field, save and reopen. Check if
field is still empty.
Bonus: test field controlled by authorised values.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 29146: Add test for editing existing item
Marcel de Rooy [Wed, 27 Oct 2021 12:30:07 +0000 (12:30 +0000)]
Bug 29146: Add test for editing existing item

Test plan:
Run t/db_dependent/Koha/UI/Form/Builder/Item.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 29146: Same for item editor
Marcel de Rooy [Wed, 27 Oct 2021 12:07:03 +0000 (12:07 +0000)]
Bug 29146: Same for item editor

Test plan:
Put some defaultvalue in an item subfield.
Test adding new item; is defaultvalue supplied already?
Test adding existing item. Clear the subfield. Save. Open again.
Is the subfield still empty now?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 29146: Apply framework defaultvalue only to new records
Marcel de Rooy [Thu, 30 Sep 2021 13:39:59 +0000 (13:39 +0000)]
Bug 29146: Apply framework defaultvalue only to new records

This applies only to the 'regular' cataloguing editor.
Another report could be opened for the advanced one,
if needed.

Test plan:
[1] Add a default value to some field X in framework Y.
[2] Open an existing biblio record in that fw. Clear field X. Save.
[3] Reopen the record. The default should not be in field X.
[4] Add a new record in that fw. You should see default value in X.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
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>
2 years agoBug 29273: Remove warnings from plugin tests
Jonathan Druart [Tue, 19 Oct 2021 13:58:25 +0000 (15:58 +0200)]
Bug 29273: Remove warnings from plugin tests

This patch is suggesting to move the broken test plugins into a separate
directory.

t/lib/plugins and t/lib/bad_plugins

Signed-off-by: David Nind <david@davidnind.com>
JK: Add executable bit to Broken.t
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28627: Calculate unitprice if not set
Nick Clemens [Fri, 12 Nov 2021 17:15:20 +0000 (17:15 +0000)]
Bug 28627: Calculate unitprice if not set

On bug 23376 the developer was too clever by half. Instead of passing
values to the template we moved to simply passing the order object.

The calculations that populated the unitprice, however, were simply dropped.

This patch restores the behaviour of setting unitprice to the estimated cost
by default. We do this conditionally in the template

To test:
 1 - Create a basket and adding items to it. Set the 'Vendor price' to
    '20', do not add an 'Actual cost'
 2 - Close the basket
 3 - Select 'Receive shipment'
 4 - Set a value for vendor invoice
 5 - Receive the order you created
 6 - Observe 'Actual cost' is = 0.00
 7 - Apply patch
 8 - Refresh the order receival page, and confirm the 'Actual cost' =
    20.00
 9 - Cancel receipt - reopen basket - edit order - add an actual cost - close
10 - Receive the order again
11 - Confirm the actual price is used
12 - Repeat this whole plan, but ensure the vendor has a different value for
     Invoice prices: Include tax

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29255: Built-in offline circulation broken with SQL error
Owen Leonard [Fri, 15 Oct 2021 18:27:16 +0000 (18:27 +0000)]
Bug 29255: Built-in offline circulation broken with SQL error

This patch makes a minor correction to one of the queries used when
synchronizing transactions in the built-in offline circulation system.
This fixes the error:

DBD::mysql::st execute failed: Column 'branchcode' in field list is
ambiguous at /kohadevbox/koha/offline_circ/download.pl line 84

To test you must be using a browser which still supports
applicationCache (Firefox before version 81, Chrome before version 94).

- Apply the patch and restart services.
- Enable the AllowOfflineCirculation system preference.
- Go to Circulation -> Built-in offline circulation interface.
- Click "Synchronize."
- Click the "Download records" button.
- After the page refreshes you should see updated dates where it lists
  "last synced" information.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29264: SIP config allows use of non-branchcode institution ids causes workers...
Kyle M Hall [Mon, 18 Oct 2021 12:28:27 +0000 (12:28 +0000)]
Bug 29264: SIP config allows use of non-branchcode institution ids causes workers to die without responding

If is entirely possible to create an SIP institution whose ID does not match a valid branchcode in Koha's SIP config. In fact, Koha's example SIP config contains an example of this ( kohalibrary / kohalibrary2 ).

If a SIP login uses an institution with an id that doesn't match a valid branchcode, everything will appear to work, but the SIP worker will die anywhere that Koha gets the branch from the userenv and assumes it is valid.

The repercussions of this are that actions such as the checkout message simply die and do not return a response message to the requestor.

At the very least, we should output a warning to the SIP log.

I think we should strongly consider disallowing institution ids in the SIP config that do not match valid branchcodes. In this scenario, attempting to start the SIP server should result in a error message with the SIP server exiting immediately.

Test Plan:
1) Apply this patch
2) Make a sip login that uses an instution whose id is *not* a valid branchcode
3) Start the SIP server
4) Check sip.log, you should see a warning similar to the following:
[2021/10/18 12:18:29] [2068079] [ERROR] ERROR: Institution kohalibrary does does not match a branchcode. This can cause unexpected behavior. C4::SIP::Sip::siplog /kohadevbox/koha/C4/SIP/Sip.pm (220)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>