]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 26195: Add a way to specify authorised values should be expanded [OAI]
Tomas Cohen Arazi [Thu, 13 Aug 2020 17:50:16 +0000 (14:50 -0300)]
Bug 26195: Add a way to specify authorised values should be expanded [OAI]

This patch introduces a new configuration entry for OAI so the resulting
records include authorised value descriptions instead of codes.

This is off by default.

To test:
1. Create a yaml file with the extended OAI configuration
2. Visit http://kohadev.myDNSname.org:8080/cgi-bin/koha/oai.pl
3. Browse some records
=> SUCCESS: The fields tied to AV show codes.
4. Update your configuration with 'expanded_avs: 1' for one  of the
   defined format like in:

  ---
  format:
    marc21:
      metadataPrefix: marc21
      metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
      schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
      include_items: 0
    marcxml:
      metadataPrefix: marcxml
      metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
      schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
      include_items: 1
      expanded_avs: 1
5. restart_all
6. Repead 3
=> SUCCESS: AV descriptions are returned!
7. Sign off :-D

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28774: DBRev 21.05.03.001
Kyle M Hall [Fri, 3 Sep 2021 15:13:21 +0000 (11:13 -0400)]
Bug 28774: DBRev 21.05.03.001

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28774: Don't store blank values for rental discount
Nick Clemens [Wed, 28 Jul 2021 12:23:50 +0000 (12:23 +0000)]
Bug 28774: Don't store blank values for rental discount

This patch adds 'can_be_blank => 0' for the rentaldiscount rule to prevent
storing blank values in the database

Additionally, if there is no charge we do not need to check for a discount
and can simply return

To test:
1 - Set rental discount to "" to a rule in circulation rules
2 - Checkout an item that will follow this rule
3 - Check the intranet log:
    [WARN] Argument "" isn't numeric in subtraction (-) at /kohadevbox/koha/C4/Circulation.pm line 3385.
4 - Apply patch and restart all
5 - Update database
6 - Set the rule to "" again
7 - Check the DB, no rule is stored
    SELECT * FROM circulation_rules WHERE rule_name = 'rentaldiscount';
8 - Checkout the item again
9 - No warns in log

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28885: Skip invalid biblios for OpacBrowseResults
Kyle M Hall [Thu, 19 Aug 2021 14:49:34 +0000 (10:49 -0400)]
Bug 28885: Skip invalid biblios for OpacBrowseResults

If a record is deleted from Koha, but is for some reason not deleted from the search indexes, OpacBrowseResults can cause an ISE if the deleted record is in the search results for any given item. OpacBrowseResults loops through the search results, and checks if there is a biblionumber, but does *not* check to see if a result was pulled from the database for that biblionumber. It simply assumes the result must exist.

We should be checking to ensure the biblionumber was valid before operating on the biblio object.

Test Plan:
1) Use zebra for searching
2) Disable koha-indexer
3) Enable OpacBrowseResults
4) Perform a search
5) Delete an item in the search results
6) View on of the remaining items in the search results
7) Note the error
8) Apply this patch
9) Restart plack
10) Reload the page
11) The error should be gone!

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28744: Better handling of undefined to_api_mapping
Tomas Cohen Arazi [Fri, 23 Jul 2021 03:39:16 +0000 (00:39 -0300)]
Bug 28744: Better handling of undefined to_api_mapping

We always had some mapping because of the DB vs. API object definition discrepancies. But bug 25260 revamps the reserves table, and it is a perfect match. It highlights this edge case: if no mapping defined, then and undef from_api_mapping is generated (as opposed to an empty hashref) and this leads to errors in the query translation from the API.

This patch makes a small change so this method always returns an empty
hashref.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> FAIL: Test fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: remove uneeded commented lines

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28744: Regression tests
Tomas Cohen Arazi [Fri, 23 Jul 2021 03:35:49 +0000 (00:35 -0300)]
Bug 28744: Regression tests

This patch adds tests for the following cases:
- to_api_mapping not defined
- to_api_mapping returning an empty hashref

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> FAIL: Tests fail :-(

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: remove uneeded commented lines

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28891: (bug 23916 follow up) Always use 'Checkout on' as default Checkout history...
Didier Gautheron [Mon, 23 Aug 2021 13:19:03 +0000 (15:19 +0200)]
Bug 28891: (bug 23916 follow up) Always use 'Checkout on' as default Checkout history sort column

To test:
1 - Unset RecordStaffUserOnCheckout
2 - Check out an item
3 - Display Checkout history, table is sorted by 'Checkout on' column
4 - Set RecordStaffUserOnCheckout
5 - Display Checkout history, table is sorted by 'Renewed' column
6 - Apply patch
7 - Redo 1, 3, 4 and 5, table is always sorted by 'Checkout on'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 7703: (follow-up) Treat no items like none available
Owen Leonard [Fri, 6 Aug 2021 12:54:46 +0000 (12:54 +0000)]
Bug 7703: (follow-up) Treat no items like none available

This patch modifies the holds template so that during the
multi-hold process, titles with no items attached are treated the same
way as titles with no items available (items exist but cannot be place
don hold):

 - The row showing such a record will say "No items are available to be
    placed on hold."
 - The pickup location dropdown will be hidden.

To test, follow the previous test plan and confirm that these change are
reflected. Now that the pickup location field isn't present for titles
without items you should be able to complete the holds process.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 7703: (QA follow-up)
Kyle M Hall [Fri, 6 Aug 2021 11:46:12 +0000 (11:46 +0000)]
Bug 7703: (QA follow-up)

Revised test plan from Owen:

This patch modifies the hold process so that if one of the titles in a
multi-hold process has no items the process doesn't abort completely.

To test, apply the patch and perform a search in the catalog which will
return one or more records with no items attached.

 - Check checkboxes for multiple results, some of which have items and
   at least one of which has no items.
 - Click "Place hold."
 - You should be taken to the page for placing multiple holds, with a
   heading, "Cannot place hold on some items."
 - Note: You will not be able to complete the holds process without the
   next patch.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 7703: Don't block bulk hold action on search results if some items can't be place...
Kyle M Hall [Fri, 6 Aug 2021 11:19:12 +0000 (11:19 +0000)]
Bug 7703: Don't block bulk hold action on search results if some items can't be placed on hold

If you select multiple titles on the search results page in order to
place a bulk hold and some of those titles have no items you get a
JavaScript alert warning you can some cannot be placed on hold. You are
blocked from completing the action until you deselect the invalid hold.

This is unnecessary because the bulk hold process will safely refuse to
place a hold on these titles later in the process.

This patch removes the check that prevents submitting a multi-hold if
one or more records in the multi-hold have no items.

Test plan:
1) Apply patch
2) On the staff interface, do a search
3) On the search results, select at least one record with items and one
   record with no items.
4) Click the 'Place hold' button.
5) You should be redirected to reserve/request.pl with the message
   "Cannot place hold: this record has no items attached."

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28554: Fix t/db_dependent/AuthorisedValues.t
Fridolin Somers [Wed, 4 Aug 2021 08:11:10 +0000 (22:11 -1000)]
Bug 28554: Fix t/db_dependent/AuthorisedValues.t

Fixes where sort on lib breaks the test.

Also removes useless params in search_by_koha_field()

Run prove t/db_dependent/AuthorisedValues.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28554: In itemsearch sort item types filter by description
Fridolin Somers [Fri, 11 Jun 2021 11:42:00 +0000 (13:42 +0200)]
Bug 28554: In itemsearch sort item types filter by description

In itemsearch form, the item types filter should be sorted by description.

Test plan :
1) Create several values and descriptions in item types
2) Go to itemsearch
3) See filter by item types sorts on description and not on value

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28554: In Koha::AuthorisedValues sort by description
Fridolin Somers [Fri, 11 Jun 2021 11:35:41 +0000 (13:35 +0200)]
Bug 28554: In Koha::AuthorisedValues sort by description

In itemsearch form, there are several filters build with authorized values.
There values should be sorted by description.

Test plan :
1) Create several values and descriptions in authorized values LOC
2) Go to itemsearch
3) See filter by location sorts on description and not on value

Seems change in search_by_marc_field can not be tested in interface

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28812: Improve robustness of selector
Jonathan Druart [Mon, 30 Aug 2021 12:43:35 +0000 (14:43 +0200)]
Bug 28812: Improve robustness of selector

Use the same fix as bug 28828.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28812: (bug 7882 follow up) Copy all subfields in plugin editor
Didier Gautheron [Thu, 26 Aug 2021 13:27:45 +0000 (15:27 +0200)]
Bug 28812: (bug 7882 follow up) Copy all subfields in plugin editor

To test:
1- Create a notice with a 700$a and 700$d
2- Click on 700 $a field Tag Editor
3- Only 700$a is copied in search windows eg /authorities/auth_finder.pl pop up
4- Apply patch
5- Redo 2
6- 700$a is copied in 'Search main heading ($a only)' and $d is copied in 'Search main heading'

Signed-off-by: George Veranis <gveranis@dataly.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 25619: Adjust POD and move date check before logging
Nick Clemens [Thu, 26 Aug 2021 19:07:53 +0000 (19:07 +0000)]
Bug 25619: Adjust POD and move date check before logging

Potentially we could have logged a change when no date was passed.

This patch moves the test before logging and updates POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 25619: Adjust POD
Jonathan Druart [Wed, 11 Aug 2021 11:17:13 +0000 (13:17 +0200)]
Bug 25619: Adjust POD

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 25619: (QA follow-up) Fix subtest description
Kyle M Hall [Thu, 22 Jul 2021 10:24:12 +0000 (06:24 -0400)]
Bug 25619: (QA follow-up) Fix subtest description

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 25619: Unit Tests
Kyle M Hall [Fri, 16 Jul 2021 18:26:37 +0000 (14:26 -0400)]
Bug 25619: Unit Tests

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 25619: Add ability to adjust expiration date for waiting holds
Kyle M Hall [Fri, 16 Jul 2021 17:50:29 +0000 (13:50 -0400)]
Bug 25619: Add ability to adjust expiration date for waiting holds

There are times when an item that is waiting for pickup needs to have the expiration date extended. This would give staff the ability to modify one by one, as needed, the reserves.expirationdate for a given item awaiting pickup.

Test Plan:
1) Place a hold, trap an item for it such that is is waiting
2) Attempt to update the expiration date
3) Note the new date is not saved
4) Apply this patch, restart all the things!
5) Attempt to update the expiration date
6) The new date should be saved!

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 26223: (QA follow-up) Fix filter order
Tomas Cohen Arazi [Thu, 26 Aug 2021 12:06:50 +0000 (09:06 -0300)]
Bug 26223: (QA follow-up) Fix filter order

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 26223: include item information in OPAC ISBD view
Andreas Roussos [Mon, 17 Aug 2020 08:57:03 +0000 (10:57 +0200)]
Bug 26223: include item information in OPAC ISBD view

The ISBD view in the OPAC interface does not display item information.

This patch fixes that.

Test plan:
0) Have a biblio with at least one item attached to it and include one
   of the following snippets in the OPACISBD system preference,
   depending on your MARC flavour:

   MARC21:
   #952|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha item type</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Materials specified (bound volume or
   other part)</th>|<tr><td>{952t} </td><td> {952c} </td><td> {952y}
   </td><td> {952p} </td><td> {952o} </td><td> {9523}</td></tr>|</table>

   UNIMARC:
   #995|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha collection</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Numbering (volume or other part)</th>|
   <tr><td>{9956} </td><td> {995e} </td><td> {995h} </td><td> {995f}
   </td><td> {995k} </td><td> {995l}</td></tr>|</table>

   Switch to the OPAC ISBD view for your biblio; notice how it does
   not display item information.
1) Apply the patch, and restart Plack/memcached if necessary.
2) Refresh the OPAC ISBD view page, this time you should see item
   information as per the OPACISBD system preference setting.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28881: (bug 23376 follow-up) Fix suggestion display on order receive page
Jonathan Druart [Thu, 19 Aug 2021 10:34:58 +0000 (12:34 +0200)]
Bug 28881: (bug 23376 follow-up) Fix suggestion display on order receive page

On bug 23376 we replaced $order, from hashref Koha::Acq::Order, but 2
occurrences have not been corrected.

It causes a bug on the order receive page when the bib is linked with a
suggestion.

Test plan:
Create an order from bib A, create a suggestion for purchase on bib A
(OPAC)
Receive the order.
Without the patch: Notice the "Suggested by: (suggestion #)"
With the patch you see the info of the suggester

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoFix release notes for 21.05.03 release v21.05.03
Kyle M Hall [Tue, 24 Aug 2021 14:55:59 +0000 (10:55 -0400)]
Fix release notes for 21.05.03 release

3 years agoUpdate release notes for 21.05.03 release
Kyle M Hall [Tue, 24 Aug 2021 13:50:18 +0000 (09:50 -0400)]
Update release notes for 21.05.03 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoIncrement version for 21.05.03 release
Kyle M Hall [Tue, 24 Aug 2021 12:15:56 +0000 (08:15 -0400)]
Increment version for 21.05.03 release

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoFix translations for Koha 21.05.03
Kyle M Hall [Tue, 24 Aug 2021 12:14:03 +0000 (08:14 -0400)]
Fix translations for Koha 21.05.03

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoTranslation updates for Koha 21.05.03
Koha translators [Tue, 24 Aug 2021 11:11:36 +0000 (08:11 -0300)]
Translation updates for Koha 21.05.03

3 years agoBug 28784: (QA follow-up) Remove num_paragraph cookie from include
Marcel de Rooy [Fri, 6 Aug 2021 08:03:27 +0000 (08:03 +0000)]
Bug 28784: (QA follow-up) Remove num_paragraph cookie from include

Still found in opac-bottom.inc.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28784: (follow-up) Always make three search boxes
Nick Clemens [Tue, 3 Aug 2021 12:17:02 +0000 (12:17 +0000)]
Bug 28784: (follow-up) Always make three search boxes

The previous patch removed search_boxes_loop - that's okay, it was always
getting the same three values.

If we don't do something in the template though, we get no boxes

Ultimately this should be a include, and not a hardcoded loop, but keeping changes
small for backporting

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28784: Remove code related to num_paragraph cookie
Jonathan Druart [Tue, 3 Aug 2021 08:58:47 +0000 (10:58 +0200)]
Bug 28784: Remove code related to num_paragraph cookie

It could lead to server freeze if set to a big value (we are pushing
into an array and so RAM is being fulfilled, and CPU is looping).

I don't understand the point of this cookie.

        var numPar = $("#booleansearch fieldset p").size();
        if (numPar > [% search_boxes_count | html %]){
            jQuery.cookie("num_paragraph", numPar,{ path: '/'});
        }else{
            jQuery.removeCookie("num_paragraph", { path: '/'});
        }

But "#booleansearch fieldset p" does not exist, it's not 'p' but 'div'
elements.

I've removed the code related to num_paragraph and the "Return to the
last advanced search" feature still works as before.

From this comment:
    # determine what to display next to the search boxes (ie, boolean option
    # shouldn't appear on the first one, scan indexes should, adding a new
    # box should only appear on the last, etc.

The only bit that is not working as described is "adding a new box
should only appear on the last", but it has been working this way for
a long time already I think, and I don't see it as a bug.

Test plan:
Read the code, check that the above is correct.
Search for regression in this "return to last adv search" feature added
by bug 13307.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28872: DBRev 21.05.02.003
Kyle M Hall [Fri, 20 Aug 2021 18:09:13 +0000 (14:09 -0400)]
Bug 28872: DBRev 21.05.02.003

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28872: Fix QA issues on atomicupdate
Jonathan Druart [Wed, 18 Aug 2021 11:03:09 +0000 (13:03 +0200)]
Bug 28872: Fix QA issues on atomicupdate

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28872: Atomicupdate to correct existing values
Andrew Fuerste-Henry [Tue, 17 Aug 2021 23:57:54 +0000 (23:57 +0000)]
Bug 28872: Atomicupdate to correct existing values

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28872: make AcquisitionLog, NewsLog, NoticesLog use 1/0 for their values
Andrew Fuerste-Henry [Tue, 17 Aug 2021 17:29:02 +0000 (17:29 +0000)]
Bug 28872: make AcquisitionLog, NewsLog, NoticesLog use 1/0 for their values

To test:
1 - edit AcquisitionLog, NewsLog, NoticesLog to change their values
2 - in About Koha, see the errors noted above
3 - apply patch, restart services
4 - re-edit AcquisitionLog, NewsLog, NoticesLog to change their values again
5 - reload About, see errors are cleared
6 - confirm that actions are logged as expected when logs are on, not logged when logs are off

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28525: Dont let TinyMCE do code cleanup
Lucas Gass [Mon, 7 Jun 2021 22:17:46 +0000 (22:17 +0000)]
Bug 28525: Dont let TinyMCE do code cleanup

If you look at Bug 24764 and Bug 26942 we adjusted the TinyMCE for the News tool so it will not do some types of automatic code clean up.

The TinyMCE editor for system preferences which can be enabled by 'UseWYSIWYGinSystemPreferences' has the same problems.

We should make the configurations the same.

To Test:
1. Turn on 'UseWYSIWYGinSystemPreferences'
2. Go to a system preference like 'RestrictedPageContent'
3. Try entering something like '<i class="fa fa-facebook-official" aria-hidden="true">TEST</i>' in the Source Code window
4. It gets cleaned up by the editor
5. Try something like '<a href="https://www.test.com" referrerpolicy="&quot;no-referrer-when-downgrade">TEST</a>'
6. It's cleaned up by the editor.
7. Try something like '<link href="https://fonts.googleapis.com/css?family=Open+Sans” rel=“stylesheet">'
8. Cleaned up by editor.
9. Apply patch
10. Try step 3, 5, and 7 again.
11. It should not be changed by the editor

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28861: Item type column always hidden in OPAC holds history
Tomas Cohen Arazi [Fri, 13 Aug 2021 20:00:38 +0000 (17:00 -0300)]
Bug 28861: Item type column always hidden in OPAC holds history

This patch fixes the 'Requested item  type' column not showing for holds
history in OPAC.

It was due to a template variable not being set. When solved, it become
clear that an import was missing for a template plugin.

To test:
1. Enable AllowHoldItemTypeSelection
2. Add a couple item-type constrained holds
3. See them in the holds history page
=> SUCCESS: Item type column shows
4. Enable OPACHoldsHistory
5. Look for them in the OPAC
=> FAIL: The item type column doesn't show
6. Apply this patch
7. Repeat 5
=> SUCCESS: The column shows! The item type is described!
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28776: Warns from GetItemsInfo when biblio marked as serial
Nick Clemens [Wed, 28 Jul 2021 13:32:24 +0000 (13:32 +0000)]
Bug 28776: Warns from GetItemsInfo when biblio marked as serial

GetItemsInfo sorts the items using serial fields if the biblio is
defined as a serial

The fields may not be defined. We can add a fallback to blank in this case

To test:
1 - Mark a record with items as serial in the marc (942$s)
2 - At least one of the items should have no enumchron defined
3 - Load the detail page
4 - Warns in logs:
    [WARN] Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/C4/Items.pm line 811.
5 - Apply patch and restart all
6 - Reload the details page
7 - No more warns

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28873: Fix age displayed in db_dependent/Koha/Patrons.t
Fridolin Somers [Tue, 17 Aug 2021 20:19:29 +0000 (10:19 -1000)]
Bug 28873: Fix age displayed in db_dependent/Koha/Patrons.t

In test suite db_dependent/Koha/Patrons.t actually shows :

    1..10
    ok 1 - Patron with no dateofbirth is always valid for any category
    ok 2 - Today=2020-02-28, dob=2015-03-01, is 5, should be valid=0
    ok 3 - Today=2020-02-28, dob=2015-02-27, is 5, should be valid=1
    ok 4 - Today=2020-02-28, dob=2009-02-28, is 11, should be valid=0
    ok 5 - Today=2020-02-28, dob=2015-02-28, is 7, should be valid=1
    ok 6 - Today=2020-02-28, dob=2009-02-27, is 11, should be valid=0
    ok 7 - Today=2020-02-28, dob=2016-08-27, is 3, should be valid=0
    ok 8 - Today=2020-02-28, dob=2009-03-01, is 11, should be valid=1
    ok 9 - Today=2020-02-28, dob=2007-08-27, is 12, should be valid=0
    ok 10 - Today=2020-02-28, dob=2015-02-28, is 5, should be valid=1

Some ages are incorrect :

1) dob=2009-03-01, is 11
=> it is age 10
so valid=1 in category 5 to 10

2) dob=2015-03-01, is 5
=> it is age 4
so valid=0 in category 5 to 10

3) dob=2015-02-28, is 7
=> this date of birth is already tested
I suppose here dob is wrong, age wanted is 7 in the middle of age restrictions.
so dob=2013-02-28

This patch fixes ages.
Also adds the category code 'AGE_5_10' in messages to display age limits

Test plan :
Run prove -v t/db_dependent/Koha/Patrons.t without and with patch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28802: Fix Asset.t
Jonathan Druart [Wed, 18 Aug 2021 14:25:26 +0000 (16:25 +0200)]
Bug 28802: Fix Asset.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28802: Untranslatable strings in browser.js
Fridolin Somers [Tue, 3 Aug 2021 08:57:10 +0000 (22:57 -1000)]
Bug 28802: Untranslatable strings in browser.js

File koha-tmpl/intranet-tmpl/js/browser.js is not parsed by translation
process, which uses koha-tmpl/intranet-tmpl/prog/js/**/*.js
We must move it to prog/js.

Test plan :
1) Perform a search on staff interface
2) Click on a result
3) Check you see records browser

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28868: Add back mastheadsearch class name
Lucas Gass [Mon, 16 Aug 2021 21:23:47 +0000 (21:23 +0000)]
Bug 28868: Add back mastheadsearch class name

In masthead.inc there is a wrapper for the main search bar called #opac-main-search. Prior to Bug 20168 that warpper had a class name of 'mastheadsearch'.

Historically CSS/JS customization of the main search bar was done via the mastheadsearch class.

Test plan:
1. Inscept the element on the OPAC main page and see the element with an ID of 'opac-main-search'.
2. Apply patch
3. Inscept that same element and you should now also see a class of 'mastheadsearch'.
4. Nothing visually should be different with the patch applied.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 26852: subfield $e missing in X11 definition of MARC21 headings
Janusz Kaczmarek [Sun, 21 Dec 2014 08:31:47 +0000 (09:31 +0100)]
Bug 26852: subfield $e missing in X11 definition of MARC21 headings

This patch adds $e to 111 and 611, but removes it from 100 and 110 as it's
used for the relator term there and should not be copied. Same for 111$j.

Test plan:

1. Have a biblio record with, for example, 711 field with a $e subfield.
2. Have two auth records: one with 111 field reflecting the 711 field and second similar but without $e subfield
3. Have LinkerModule set to Default
4. Run link_bibs_to_authorities.pl
5. 711 should remain unlinked since there were two record found by the Default Linker and no one was chosen.

6. Apply the patch.
7. Run link_bibs_to_authorities.pl
8. 711 should be linked now.

Repeat testing in similar fashion for authorities:

9. 100/110 $e
10. 111 $j

NB zebra index definition is OK:
kohaidx:index_match_heading tag="111" subfields="acdefghjklnpqstvxyz" subdivisions="vxyz">
in etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml

Signed-off-by: Sara Brown <sbrown@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28834: Correct wording biblios/authorities in tools home
Fridolin Somers [Mon, 9 Aug 2021 20:07:53 +0000 (10:07 -1000)]
Bug 28834: Correct wording biblios/authorities in tools home

In tools home, we actually see 2 wordings : biblios/bibliographic authorities/authority
Looks like bibliographic is more correct.

Test plan :
1) Apply patch and look at words in tools home /cgi-bin/koha/tools/tools-home.pl

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28779: (QA follow-up) Even more specific message
Katrin Fischer [Tue, 10 Aug 2021 13:21:18 +0000 (15:21 +0200)]
Bug 28779: (QA follow-up) Even more specific message

For the detail page, the MARC view etc. we use the text:

The record you requested does not exist (488).

I think this is better than "not found", because that sounds
like it might be an issue with the search index, which we can
rule out in this case.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28779: (QA follow-up) More specific message and soem cleanup
Nick Clemens [Fri, 30 Jul 2021 14:39:39 +0000 (14:39 +0000)]
Bug 28779: (QA follow-up) More specific message and soem cleanup

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28779: Skip processing of non-existent biblios
Joonas Kylmälä [Thu, 29 Jul 2021 16:35:47 +0000 (19:35 +0300)]
Bug 28779: Skip processing of non-existent biblios

Just checking with a regex that whether an input looks like a biblionumber
is not enough, we need to also verify there is a biblio really existing
in the database and skip processing of hold request for non-existent
biblionumbers.

To test:
 1) Go to page /cgi-bin/koha/reserve/request.pl?biblionumbers=XXXXX
    where XXXXX is non-existent biblionumber, notice internal server error
 2) Apply patch
 3) Repeat step 1 and notice we cannot place a hold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28825: Can't edit local cover image for item from details page
Owen Leonard [Fri, 6 Aug 2021 16:49:50 +0000 (16:49 +0000)]
Bug 28825: Can't edit local cover image for item from details page

This patch corrects the markup for local cover images attached to items.
The correction allows correct display of an "edit" link when the user
clicks an item's cover image and views it in the lightbox-style modal.

To test, apply the patch and make sure the "LocalCoverImages" system
preference is enabled.

- View the details of a bibliographic record in the catalog which has
  items attached..
- In the table of holdings, click Edit -> Upload image.
- Upload an image for the item and return to the bibliographic detail
  page.
- Your image should now be displayed in the holdings table.
- Click the image to view it.
- In the footer of the modal there is an edit link: "Local cover image
  (edit). Before this patch the edit link would lead to a missing page.
  After applying the patch the link should take you to the "Image view"
  where you have the option of deleting the image or uploading another
  one.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27847: Compiled CSS changes
Kyle M Hall [Fri, 13 Aug 2021 11:57:25 +0000 (07:57 -0400)]
Bug 27847: Compiled CSS changes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27847: Don't obscure page when checkin modal is non-blocking
Owen Leonard [Mon, 19 Apr 2021 11:49:25 +0000 (11:49 +0000)]
Bug 27847: Don't obscure page when checkin modal is non-blocking

This patch changes the series of events striggered when a non-blocking
modal dialog is displayed during checkin. If the "TransfersBlockCirc"
preference is set to "Don't block," the user can continue to check in
even though a transfer dialog has appeared. This patch hides the modal's
"backdrop" element so that the modal doesn't look like one which blocks
further action.

There is no Bootstrap backdrop option which both hides the backdrop and
makes it non-blocking, so we have to use the default non-blocking option
and "manually" hide the backdrop.

The "show.bs.modal" event must be added in order to make the
necessary change before the modal is displayed. This prevents the
darkened backdrop from appearing and then being hidden.

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

- Set the "TransfersBlockCirc" preference to "Don't block."
- Check in an item which belongs to another library.
- A modal dialog should be displayed: "Please return this item to XXX"
- The page "behind" the modal should not be darkened, and the cursor
  focus should remain in the check-in field.
- Checking in an item which as a hold should still trigger the
  "blocking" behavior: The modal must be dismissed by clicking one of
  its buttons (not the backdrop) and the page behind the modal should be
  darkend.
- Test with "TransfersBlockCirc" set to "Block." Checking in an item
  belonging to another library should trigger the "blocking" modal
  behavior.
- Test that other checkins still work correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28764: (QA follow-up) Add comment, remove two defined's
Marcel de Rooy [Mon, 9 Aug 2021 13:41:45 +0000 (13:41 +0000)]
Bug 28764: (QA follow-up) Add comment, remove two defined's

If we no longer offer the sortfield with :asc actively, we should
probably write it somewhere too.
Replaced a few defined tests by empty test. No need to split empty
string or zero etc.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28764: Alter sort dropdown to use direction parameter
Nick Clemens [Fri, 30 Jul 2021 10:54:47 +0000 (10:54 +0000)]
Bug 28764: Alter sort dropdown to use direction parameter

This code is odd -we build a select in the template, then turn it into a list of links using javascript
This patch adds a direction data element and uses it while building the links

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28764: Parse direction parameter in public list view
Nick Clemens [Tue, 27 Jul 2021 11:27:21 +0000 (11:27 +0000)]
Bug 28764: Parse direction parameter in public list view

This patch adds a check for a 'direction' paramter in list sorting.

It maintains the existing syntax for sorting 'sortfield=field:direction'
but adds support for the form used in paginations and more commonly thtoughout
Koha' sortfield=field&direction=direction'

To test:
1 - Create a public list
2 - Add enough items to generate two pages (40 worked for me)
3 - View the list and enforce sorting by date added descending:
    sortfield=dateadded:desc
4 - Note the titles shown
5 - Click to second page using the pagination bar
6 - Note the same titles are shown, in a reversed order
7 - Apply patch
8 - repeat 305
9 - Second page is sorted correctly!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28813: DBRev 21.05.02.002
Kyle M Hall [Fri, 13 Aug 2021 11:44:34 +0000 (07:44 -0400)]
Bug 28813: DBRev 21.05.02.002

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28813: Rename delivery_note to failure_code
Martin Renvoize [Thu, 5 Aug 2021 09:17:29 +0000 (10:17 +0100)]
Bug 28813: Rename delivery_note to failure_code

We now use the codes from the half implimented error_code in place of
the plain text that was being added to the delivery_note field. As part
of that we rename the field to failure_code to clarify it's intended
content.

Test plan
1/ Confirm t/db_dependent/Letters.t passes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28813: Update unit tests
Martin Renvoize [Thu, 5 Aug 2021 09:16:24 +0000 (10:16 +0100)]
Bug 28813: Update unit tests

This patch updates the unit tests to check for failure_code instead of
delivery_note and catches a missing case.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28813: DBIC Schema Update
Martin Renvoize [Thu, 5 Aug 2021 09:15:58 +0000 (10:15 +0100)]
Bug 28813: DBIC Schema Update

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28813: Update database field name
Martin Renvoize [Thu, 5 Aug 2021 09:14:49 +0000 (10:14 +0100)]
Bug 28813: Update database field name

Update the database field name from 'delivery_note' to 'failure_code' to
more accurately denote it's use.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28835: Fix ability to pass list contents to batch record modification
Fridolin Somers [Tue, 10 Aug 2021 09:14:03 +0000 (23:14 -1000)]
Bug 28835: Fix ability to pass list contents to batch record modification

Bug 12759 added the ability to pass list contents to batch record
modification/deletion tools.
Patch Bug 22417 [Restore the 'add to list' feature] removed the fetch
of lists in batch_record_modification.pl I don't understand why.
It still exists in batch_delete_records.pl.

Note that this is needed when first form is displayed.

Test plan :
1) Create a private and a public list of records
2) Open Tools > Batch record modification
3) Check you can use the lists
4) Open Tools > Batch record deletion
5) Check you can use the lists

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders
Nick Clemens [Mon, 9 Aug 2021 12:09:13 +0000 (12:09 +0000)]
Bug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders

Find closest ul for value builders.

Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript
code does not do its job anymore.
This is because a div is added and this call is now wrong:
  var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input');

Test plan 1:
1) Use a UNIMARC DB
2) Define value builder unimarc_field_4XX on 463$t
3) Create a record B1 with 200$a, 200$f
4) Create a new record B2
5) Click on value builder in 463$t
6) Search for record B1
7) Click on "Choose"
=> Without patch only 463$t is filled with a value
=> With patch 463 $t, $a, $0 and $9 are filled with a value

Test plan 2:
1) Use a MARC_21 DB
2) Define plugin marc21_linking_section.pl on 773$t
3) Make sure 773$t and other subfields are visible in intranet/editor
4) Create a new record in basic cataloging editor
5) Click on value builder in 773$t
6) Search fro a record
7) Click on "Choose"
=> Without patch fields are not fileld
=> With patch subfields are correctly filled

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28569: In opac-suggestions.pl preselect user library
Fridolin Somers [Wed, 16 Jun 2021 09:17:19 +0000 (11:17 +0200)]
Bug 28569: In opac-suggestions.pl preselect user library

In OPAC new purchase suggestion opac-suggestions.pl for library combobox :
actually first value is selected, user library should be selected.

Test plan :
1) Create a new library named 'ZZZ top'
2) Set this library on a user U1
2) Loggin at OPAC with user U1
3) Create a new suggestion
=> Check library 'ZZZ top' is preselected

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28727: (QA follow-up) Simplify permission check
Katrin Fischer [Tue, 10 Aug 2021 23:04:49 +0000 (01:04 +0200)]
Bug 28727: (QA follow-up) Simplify permission check

There was another permission check for edit_items directly below,
so instead of changing them to both be edit_items, I think we
can now remove one.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28727: Show edit item link when user has edit items permission
Andrew Fuerste-Henry [Tue, 20 Jul 2021 19:42:41 +0000 (19:42 +0000)]
Bug 28727: Show edit item link when user has edit items permission

To test:
1: log in as a user with edit_items but not edit_catalogue
2: confirm you do not get an Edit Item link on moredetail.pl
3: apply patch, restart, reload
4: confirm link now shows

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28804: (bug 25026 follow-up) Handle SQL errors in reports
Jonathan Druart [Wed, 4 Aug 2021 06:59:40 +0000 (08:59 +0200)]
Bug 28804: (bug 25026 follow-up) Handle SQL errors in reports

Since bug 25026 DBMS errors are raised, but the report module is not
dealing correctly with the errors.
If an error occurred in execute_query, next queries will fail as well,
we should skip them.

Test plan:
1. Create report from SQL queries, containing errors (invalid syntax, etc.)
'SELECT id FROM borrowers' can do it
2. Execute the query
=> Without this patch you get a 500
=> With this patch applied you see that the error raised at DBMS level
is propagated to the UI
3. Confirm that there is no regression on valid queries

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoRevert "Bug 28833: Speed up holds queue builder via parallel processing"
Kyle M Hall [Wed, 11 Aug 2021 13:21:11 +0000 (09:21 -0400)]
Revert "Bug 28833: Speed up holds queue builder via parallel processing"

This reverts commit 08ad241ab510350d44673376c28d853a328a4ec5.

3 years agoBug 28833: Speed up holds queue builder via parallel processing
Kyle M Hall [Mon, 9 Aug 2021 17:46:00 +0000 (13:46 -0400)]
Bug 28833: Speed up holds queue builder via parallel processing

The holds queue builder can take a very long time to run on systems with many holds. For example, a partner with 124,784 unfilled ( not found ) holds, is taking about 64 minutes to run. If we run that same number of holds in 5 parallel chunks ( splitting the number of records as evenly as possible, but *not* taking into account the holds per bib ), it takes 21.5 minutes. If we use 10 loops, it takes less then 14 minutes.

Test Plan:
1) Generate a huge number of holds ( a few thousand at the minimum )
2) Run the holds queue builder, use the `time` utility to track how much
   time it took to run
3) Set HoldsQueueParallelLoopsCount to 10
4) Repeat step 2, note the improvement in speed
5) Experiment with other values for HoldsQueueParallelLoopsCount
6) prove t/db_dependent/HoldsQueue.t

3 years agoBug 28630: Improve date comparisons in tests
Jonathan Druart [Wed, 4 Aug 2021 09:12:41 +0000 (11:12 +0200)]
Bug 28630: Improve date comparisons in tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28630: (follow-up) Update wording of syspref
Martin Renvoize [Mon, 28 Jun 2021 13:42:13 +0000 (14:42 +0100)]
Bug 28630: (follow-up) Update wording of syspref

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28630: Add unit tests
Martin Renvoize [Fri, 25 Jun 2021 09:33:18 +0000 (10:33 +0100)]
Bug 28630: Add unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28630: Add track_login_daily to ILSDI::AuthenticatePatron
Martin Renvoize [Fri, 25 Jun 2021 08:50:50 +0000 (09:50 +0100)]
Bug 28630: Add track_login_daily to ILSDI::AuthenticatePatron

This patch adds a call to track_login_daily for the AuthenticatePatron
method in ILSDI.

Many libraries use this ILSDI endpoint for electron book borrowing and
need to maintain the lastseen based on this type of lending.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28773: (QA follow-up) Additional changes
Marcel de Rooy [Fri, 30 Jul 2021 08:51:24 +0000 (08:51 +0000)]
Bug 28773: (QA follow-up) Additional changes

The work of the first patch was not yet finished.

[1] Similar changes to template for Cataloging and Authorities
[2] Made a better distinction now between short title on button
    and long title on menu and modal
[3] The short title parameter removes need for previewed var
[4] To keep related code closer, moved the dataPreview hidden code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28773: (bug 23302 follow-up) Fix add order from z3950 search results
Jonathan Druart [Wed, 28 Jul 2021 10:04:43 +0000 (12:04 +0200)]
Bug 28773: (bug 23302 follow-up) Fix add order from z3950 search results

For translated interface.

Using 'Order' (the button text) was not a good idea as the interface can
be translated :)

Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28754: Only adjust holds on specific biblio and don't go past end of array
Nick Clemens [Fri, 23 Jul 2021 17:56:39 +0000 (17:56 +0000)]
Bug 28754: Only adjust holds on specific biblio and don't go past end of array

Our query for lowest priority holds only needs to adjust holds on the biblio we are looking at
so I add biblionumber

Additionally we can simply find the end of the array and use that rather than 99998
so I set new_rank to scalar @priority

Lastly, we don't need to fetch the lowest priority holds if we are ignoring lowest priority
so I move it into the conditional

To test:
 1 - Add holds with lowest priorty to 2 records in the catalog
 2 - Add a hold on a third record
 3 - Note errors in log like:
    [2021/07/23 17:47:17] [WARN] splice() offset past end of array at /kohadevbox/koha/C4/Reserves.pm line 1649
 4 - Apply patch and restart all the things
 5 - Add a new hold on third record - no warns
 6 - Make one of the holds on third record have lowestPriority (click rightmost arrow with line at bottom)
 7 - Note no warns
 8 - Adjust other holds on record and note no warns

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28741: (follow-up) Silence warning
Tomas Cohen Arazi [Mon, 2 Aug 2021 13:04:01 +0000 (10:04 -0300)]
Bug 28741: (follow-up) Silence warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28741: Fix use of resumption token params
Nick Clemens [Thu, 22 Jul 2021 17:56:39 +0000 (17:56 +0000)]
Bug 28741: Fix use of resumption token params

TO test:
 1 - Enable OAI-PMH server in Koha
 2 - Set OAI-PMH:MaxCount to 5
 3 - Define 6 sets in Admin->OAI sets configuration
    Can setSpec and setName to 1,2,3....
 4 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets
 5 - Click 'Show more'
 6 - Keep seeing the same 5 - note the page says 'Results fetched -4-0'
 7 - Apply patch
 8 - Restart all the things
 9 - Reload the ListSets URL above
10 - Click 'Show more'
11 - See the 6th set and note no 'Show more'
12 - Set OAI-PMH:MaxCount to 1
13 - Go to the base ListSets url again
14 - Confirm you can 'Show more' until you reach the end

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28741: Regression tests
Tomas Cohen Arazi [Fri, 30 Jul 2021 17:53:31 +0000 (14:53 -0300)]
Bug 28741: Regression tests

This patch adds regression tests for the behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28533: Fix other ocurrence
Nick Clemens [Fri, 30 Jul 2021 19:20:29 +0000 (19:20 +0000)]
Bug 28533: Fix other ocurrence

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28533: Set subfields to 'undef' if whole field request in itemcallnumebr system...
Nick Clemens [Wed, 9 Jun 2021 12:59:27 +0000 (12:59 +0000)]
Bug 28533: Set subfields to 'undef' if whole field request in itemcallnumebr system preference

This patch undefines the CNsubfields variable when the whole field is requested

Note that the substr returns '' when no characters are found, so we test if the string eq ''

Testing 'truth' doesn't work because "0" is a valid option

To test:
 1 - Edit a record, add an 082 field
     082 0 0 ‡aalpha‡bbeta‡0delta
 2 - Set itemcallnumber system preference to 082
 3 - Attempt to add/edit items
 4 - ISE
 5 - Apply patch, restart all the things
 6 - Add/edit items - no error
 7 - Confirm the itemcallnumber field is populated with "alpha beta delta"
 8 - Set itemcallnumber system preference to '0820'
 9 - Add/edit items
10 - Confirm itemcallnumber is populated with 'delta'

Signed-off-by: Salman Ali <salman.ali@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28057: (follow-up) Get the biblionumber column
Nick Clemens [Wed, 28 Jul 2021 17:37:46 +0000 (17:37 +0000)]
Bug 28057: (follow-up) Get the biblionumber column

When we fetch the biblioitems we use a select to limit the columns fetched,
we must include the biblionumber as well

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28057: Use the biblioitem's biblionumber for checking availability
Nick Clemens [Wed, 14 Apr 2021 18:19:40 +0000 (18:19 +0000)]
Bug 28057: Use the biblioitem's biblionumber for checking availability

The loop here gets items from the record, plus analytic items. Because of this
we need to check more than 1 record - we decide to do this via biblioitems.

We need to preserve that, but when checking ItemsAnyAvailableAndNotRestricted we
cannot assume that the biblionumber and biblioitemnumber are the same (they should be
but this may not be the best of all possible worlds)

I simply switch the call here

To test:
1 - Apply patch
2 - Test placing holds on single bibs and multiple bibs
3 - Confirm it works as expected

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28704: Library MARCOrgCode field needs maxlength attribute
Owen Leonard [Tue, 13 Jul 2021 10:54:59 +0000 (10:54 +0000)]
Bug 28704: Library MARCOrgCode field needs maxlength attribute

This patch adds a maxlength attribute to the "MARC organization code"
field in the form for adding and editing libraries. The maxlength, 16,
matches the limit of the table column.

To reproduce the problem, go to Administration -> Libraries.
 - Add or edit a library
 - Fill the "MARC organization code" field with a string longer than 16
   characters, e.g. Decriminalization
 - When you save the record you will see an error.

Apply the patch and add or edit a library.
 - Confirm that you cannot enter more than 16 characters in the "MARC
   organization code" field.

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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28728: Link to holds page from holds raio
Andrew Fuerste-Henry [Wed, 21 Jul 2021 12:37:21 +0000 (12:37 +0000)]
Bug 28728: Link to holds page from holds raio

To test:
1 - Find a bib with 1 item, place 3 bib-level holds on it (just to make
    sure there's at least one title on your holds ratio page)
2 - Go to the holds ratio page in circulation
3 - mouse over the Holds Ratio column, see that the number there is a
    link to http://[your koha]/cgi-bin/koha/circ/reserveratios.pl#, the
    page you're already on
4 - apply patch, restart_all, reload page
5 - link now goes to the holds page for that title

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28733: Correct position of desks link in admin menu
Owen Leonard [Thu, 22 Jul 2021 18:35:13 +0000 (18:35 +0000)]
Bug 28733: Correct position of desks link in admin menu

This patch moves the "Desks" link from the "Basic parameters" section to
the "Patrons and circulation" section, matching the category of the link
on the Administration home page.

To test, apply the patch and go to an administration page which includes
the left-hand navigation sidebar, e.g. Administration -> Libraries.

In the sidebar, the "Desks" link should be in the "Patrons and
circulation" section, under "Item circulation alterts," matching its
position on the Administration home page.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 28733: (follow-up) Add manage_libraries permission check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28689: Extra %s in alert message when saving an items
Owen Leonard [Thu, 15 Jul 2021 13:00:14 +0000 (13:00 +0000)]
Bug 28689: Extra %s in alert message when saving an items

This patch removes an unnecessary %s in the text built to show when
there are errors in the cataloging add item form.

To reproduce, open the add item form in cataloging and click "Add item"
without filling in all mandatory fields. You should see an alert message
that contains, "- %s 1 mandatory fields empty (highlighted)"

To test, apply the patch and return to the add item form. Now when you
save an incomplete form the message should omit the %s:

- 1 mandatory fields empty (highlighted)

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

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>
3 years agoBug 28567: DBRev 21.06.00.011
Jonathan Druart [Fri, 30 Jul 2021 14:07:09 +0000 (14:07 +0000)]
Bug 28567: DBRev 21.06.00.011

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28567: Fix 0 vs "" vs undef on the admin library form
Jonathan Druart [Fri, 25 Jun 2021 10:44:19 +0000 (12:44 +0200)]
Bug 28567: Fix 0 vs "" vs undef on the admin library form

There are two things here:
* Branches.pickup_location has a default = 1 in DB, we should not set to undef if 0
or it will be set to 1 when stored.
* The other fields are all text (varchar, mediumtext or longtext) and
can be NULL. They are correct set to NULL when a new library is created
but set to an empty string when the library is modified. That's not
consistent

Test plan:
0. Don't apply the patch
1. Create a new library, set pickup location to "No"
2. Save
=> Pickup location is set to YES
=> In DB notice that the different values you didn't fill in are set to
NULL
3. Edit the library
4. Save
=> In DB notice that the different values you didn't fill in are now set
to an empty string
5. Apply the patch, restart_all
6. Run the updatedatabase script
=> In DB all the empty string values are set to NULL
7. Repeat 1 to 4 and confirm that everything is now working as expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28509: Prevent Koha/Acquisition/Orders.t to fail randomly
Jonathan Druart [Mon, 19 Jul 2021 12:35:11 +0000 (14:35 +0200)]
Bug 28509: Prevent Koha/Acquisition/Orders.t to fail randomly

The random errors were:
03:25:39 koha_1       |     #     Structures begin differing at:
03:25:39 koha_1       |     #          $got->[0] = '10'
03:25:39 koha_1       |     #     $expected->[0] = '9'

and

16:36:15 koha_1       |     #     Structures begin differing at:
16:36:15 koha_1       |     #          $got->[0] = '100'
16:36:15 koha_1       |     #     $expected->[0] = '99'

You see it coming?

We sorted the ordernumbers alphabetically.

Test plan:
0. Don't apply this patch
1. % git checkout v21.05.01 # The error is not appearing in master right now
2. Add 2 warn statements before the 'The 2 orders are returned' tests to
display $order_1->ordernumber and $order_2->ordernumber
3. MariaDB CLI > ALTER TABLE aqorders AUTO_INCREMENT=3;
4. prove t/db_dependent/Koha/Acquisition/Orders.t
=> Fail with
    #     Structures begin differing at:
    #          $got->[0] = '10'
    #     $expected->[0] = '9'
5. Apply this patch, repeat 3. and 4.
=> The test passes now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28749: Restore the database name to Koha dumps
Jason Boyer [Wed, 28 Jul 2021 14:01:25 +0000 (14:01 +0000)]
Bug 28749: Restore the database name to Koha dumps

The line to use the --databases flag with mysqldump by default was accidentally
removed from koha-dump when the --schema-only option was added. This makes all
backups act as if koha-dump is called with the --without-db-name flag, causing
koha-restore to fail to restore the database because it's neither CREATEd or USEd.

This patch restores that line

To test:
1 - sudo debian/scripts/koha-dump kohadev
2 - zcat /var/spool/koha/kohadev/kohadev-2021-07-28.sql.gz | grep DATABASE
3 - Notice no output
4 - Apply patch
5 - sudo debian/scripts/koha-dump kohadev
6 - zcat /var/spool/koha/kohadev/kohadev-2021-07-28.sql.gz | grep DATABASE
7 - You get the line:
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ `koha_kohadev` /*!40100 DEFAULT CHARACTER SET latin1 */;

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28632: Prevent api/v1/patrons.t to fail on dates comparison
Jonathan Druart [Wed, 28 Jul 2021 10:24:14 +0000 (12:24 +0200)]
Bug 28632: Prevent api/v1/patrons.t to fail on dates comparison

 #   Failed test 'Returned patron from update matches expected'
 #   at t/db_dependent/api/v1/patrons.t line 537.
 #     Structures begin differing at:
 #          $got->{updated_on} = '2021-07-27T13:33:53+00:00'
 #     $expected->{updated_on} = '2021-07-27T13:33:52+00:00'
 # Looks like you failed 1 test of 42.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28469: Move "Skip to main content" to top of OPAC page
David Cook [Thu, 27 May 2021 03:34:30 +0000 (03:34 +0000)]
Bug 28469: Move "Skip to main content" to top of OPAC page

This patch moves the "Skip to main content" button out of the nav
element and to the top of the <body> element, so that it's the first
(potentially) viewable element on the page.

This means you can inject content above the navbar, which has
a relative position, and it won't disrupt the display of the
"Skip to main content" button.

To test:
1) Apply patch
2) Same test plan as Bug 22807:
Go to any page in the OPAC and hit the tab key. The "Skip to main
content" link should appear. Tabbing away from it should cause the link
to hide. Hitting the ENTER key when the link is highlighted should cause
the page to scroll to the main content.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28662: Compiled CSS
Kyle M Hall [Fri, 30 Jul 2021 14:57:47 +0000 (10:57 -0400)]
Bug 28662: Compiled CSS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28620: Replace remaining occurrence in test
Jonathan Druart [Mon, 26 Jul 2021 09:19:17 +0000 (11:19 +0200)]
Bug 28620: Replace remaining occurrence in test

Not useful but won't hurt either.
At least all our occurrences are identical now.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28620: Remove trailing space when logging with log4perl
Marcel de Rooy [Wed, 23 Jun 2021 11:59:21 +0000 (11:59 +0000)]
Bug 28620: Remove trailing space when logging with log4perl

Trivial change.
Do sed -i -r -e'/log4perl/ s/\s%n$/%n/' on the log4perl configs.

Test plan:
Update your own config.
Trigger some logging and check that logfile.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28662: Not possible to log out of patron account in OPAC with JavaScript disabled
Owen Leonard [Tue, 6 Jul 2021 13:07:42 +0000 (13:07 +0000)]
Bug 28662: Not possible to log out of patron account in OPAC with JavaScript disabled

This patch adds a "Log out" link to the OPAC header which is hidden by
CSS when JavaScript is enabled.

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

 - Log in to the OPAC with JavaScript disabled in your browser.
 - In the header next to the logged-in user's name there should be a
   "Log out." link.
 - Confirm that it logs the user out.
 - Enable JavaScript and repeat the process to confirm that the new
   logout link doesn't appear.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28408: Add new column to the table settings config
Jonathan Druart [Mon, 26 Jul 2021 09:01:10 +0000 (11:01 +0200)]
Bug 28408: Add new column to the table settings config

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28408: Add 'Last updated' column to suggestions table
Nick Clemens [Fri, 28 May 2021 12:52:03 +0000 (12:52 +0000)]
Bug 28408: Add 'Last updated' column to suggestions table

We have specific meanings for the different dates in suggestions
Managed - means the status was changed or the suggestion edited, but doesn't change if item type updated
Modification - implies an edit of the subscript, not updated if status changed alone
Updated - this is the date field in the DB, which is actually a timestamp

The cronjob purge_suggestions.pl uses teh 'date' field

For a user, a suggestion can look old in the interface, but be considered recent by the script

To clear the confusion we should show the timestamp as well

To test:
1 - Add a suggestion
2 - In the DB, pretend you set it in the past:
    UPDATE suggestions SET manageddate='2021-01-01', suggesteddate='2021-01-01', date='2021-01-01 12:12:12';
3 - Click 'Go' In Organize by: Status
4 - Note the suggestion looks old now
5 - Check the box, and click 'Update item types with:' -> Submit
6 - Prganize by status again
7 - No change?
8 - Check the DB:
    SELECT date FROM suggestions;
9 - The field is updated
10 - Apply patch
11 - Organize by status again
12 - See the 'Last updated' ate set to today

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28336: Add missing input for item_action
Nick Clemens [Wed, 12 May 2021 17:00:57 +0000 (17:00 +0000)]
Bug 28336: Add missing input for item_action

To test:
1 - Stage a marc file of authorities
2 - Manage the staged file
3 - Attempt to change the matching rule
4 - 500 Error, in intranet-error.log:
[Wed May 12 16:53:03.046652 2021] [cgi:error] [pid 52072] [client 172.19.0.1:50580] AH01215: C4::ImportBatch::SetImportBatchItemAction(): DBI Exception: DBD::mysql::st execute failed: Column 'item_action' cannot be null [for Statement "UPDATE import_batches SET item_action = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1="1"] at /kohadevbox/koha/tools/manage-marc-import.pl line 160: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=1
5 - Apply patch
6 - Reload page and change matching rule
7 - Success!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27885: (follow-up) Use biblionumbers instead of biblionumber in form action for...
Nick Clemens [Wed, 26 May 2021 12:17:41 +0000 (12:17 +0000)]
Bug 27885: (follow-up) Use biblionumbers instead of biblionumber in form action for club search

This simply matches the code on the patrons search tab

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 27885: Populate biblionumbers parameter using biblionumbers array
Nick Clemens [Fri, 5 Mar 2021 17:32:28 +0000 (17:32 +0000)]
Bug 27885: Populate biblionumbers parameter using biblionumbers array

Currently we send $biblionumbers as the parameter, but this is just apassthrough form when a list of biblios is selected for placing a hold

If passed a single biblionumber we push it into @biblionumbers and use that for building the biblio loop

This patch uses @biblionumbers to avoid sending a blank variable in the URL

To test:
1 - On the staff client click 'place hold' for an individual record
2 - Use the form to find a patron
3 - Note the url is:
    http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumbers=
4 - Apply patch
5 - Repeat
6 - The url is now like:
    http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumbers=248
    (but with whatever biblionumber you chose)
7 - Perform a search and select multiple biblios and confirm you can place holds as before

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
JD Amended patch: Add missing space

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
3 years agoBug 28622: (bug 15758 follow-up) Remove incorrect branch selection in adv search
Jonathan Druart [Wed, 23 Jun 2021 14:19:15 +0000 (16:19 +0200)]
Bug 28622: (bug 15758 follow-up) Remove incorrect branch selection in adv search

From
  commit df97814f3034a3d5015546c4eca21f08ae951e37
  Bug 15758: Koha::Libraries - Remove GetBranches

+    selected_branchcode => ( C4::Context->IsSuperLibrarian ? C4::Context->userenv : '' ),

And

-        [% PROCESS options_for_libraries libraries => Branches.all() %]
+        [%# FIXME Should not we filter the libraries displayed? %]
+        [% PROCESS options_for_libraries libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]

The change in the pl is wrong as it should pass C4::Context->userenv->{branch},
but prior to this commit it seems that we didn't select the logged in
library anyway.

Looks like we should remove this code but preserve the current behavior and select "All libraries".

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>