]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 31138: Don't ignore DataTables errors and raise them to the end-user
Jonathan Druart [Tue, 12 Jul 2022 08:09:25 +0000 (10:09 +0200)]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user

DataTables is not raising error to the end user, it's only displaying a generic message in the console.
This leads to lot of questions on IRC or the mailing list ("the table is empty").
We can do better and display what went wrong.

We could also imagine add a link to the wiki for the more common problems (won't be implemented here however).

Test plan:
Revert "Bug 31104: Put each link on a separate header" and search for a
patron using a very long string
You should get an alert with the reponse of the server.
In my case:
"""
Something went wrong when loading the table.
414: Request-URI Too Long
"""

You can also make the REST API returns a 500 (bad specs or simply with a
die statement).

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: (QA follow-up) Move include files
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:46:30 +0000 (12:46 -0300)]
Bug 23838: (QA follow-up) Move include files

As talked with Martin, this patches were originally developed before we
added the modals/ and str/ dirs, but we need to align it with current
way of doing it. This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Add 'view' link to item detail page
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:16:32 +0000 (12:16 -0300)]
Bug 23838: Add 'view' link to item detail page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: (QA follow-up) Rename patron-renewal => checkout-renewal
Tomas Cohen Arazi [Fri, 22 Jul 2022 15:15:46 +0000 (12:15 -0300)]
Bug 23838: (QA follow-up) Rename patron-renewal => checkout-renewal

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Use $patron_to_html formater
Martin Renvoize [Fri, 22 Jul 2022 09:56:40 +0000 (10:56 +0100)]
Bug 23838: Use $patron_to_html formater

This patch updates the renewals modal to correctly format the staff
member who renewed the checkout.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: (follow-up) Add missing template filter
Owen Leonard [Tue, 26 Apr 2022 16:56:12 +0000 (16:56 +0000)]
Bug 23838: (follow-up) Add missing template filter

Quieting an issue highlighted by the QA tool.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Use $datetime formater
Martin Renvoize [Fri, 18 Mar 2022 14:53:41 +0000 (14:53 +0000)]
Bug 23838: Use $datetime formater

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 23838: Add renewals modal
Andrew Isherwood [Fri, 18 Oct 2019 07:56:21 +0000 (08:56 +0100)]
Bug 23838: Add renewals modal

This patch adds the display of the renewals modal when appropriate. A
"View" link is displayed next to renewals count where appropriate.
Clicking the link opens the modal that displays the logged renewals.

Sponsored-by: Loughborough University
Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Ben Veasey <B.T.Veasey@lboro.ac.uk>
Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I rescued this patchset by squashing previous work and updating it to
utilise the new renewals API routes introduced in bug 30275.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31128: Add effective_not_for_loan_status into items response
Martin Renvoize [Mon, 11 Jul 2022 12:07:28 +0000 (13:07 +0100)]
Bug 31128: Add effective_not_for_loan_status into items response

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31128: Unit tests
Martin Renvoize [Mon, 11 Jul 2022 12:46:05 +0000 (13:46 +0100)]
Bug 31128: Unit tests

This patch adds unit tests for the new effective_not_for_loan_status
which I add to the items api responses in this patchset.

Test plan
1) Run the unit test without applying the next commit, it should fail
2) RUn the test again after applying the next commit, it should pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31213: Auto search simple term quoted
Nick Clemens [Thu, 21 Jul 2022 18:16:22 +0000 (18:16 +0000)]
Bug 31213: Auto search simple term quoted

This patch does a second search if the first had no results and was a simple single term search

We simply quote the term, rebuild the query, and rerun the search

This targets both Zebra and ES, but is more relevant for ES

To test:
0 - Have Koha running using ES
1 - Add titles your system "Ivy + Bean" "The 6:20 Man"
2 - Search for these titles without quotes - NO results under ES
3 - Search with quotes - you find them
4 - Apply patch, restart all
5 - Search again without quotes
6 - Success!
7 - Confirm search still works under Zebra

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30458: Include librarian (manager_id) in accountline when using "Payout amount...
Kyle Hall [Tue, 5 Apr 2022 13:40:51 +0000 (09:40 -0400)]
Bug 30458: Include librarian (manager_id) in accountline when using "Payout amount" button

When using the "Payout amount" button, accountlines.manager_id is not
populated. This is not the case with the "Issue payout" buttons.

Test Plan:
1) Create a manual credit
2) Issue a payout using the "Payout amount" button
3) Inspect the payout accountline, note it has no manager_id
4) Apply this patch, restart all the things!
5) Repeat steps 1 and 2
6) Note the new payout accountline has a manager_id!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
JK: Fix commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30471: Correct display of default rules
Nick Clemens [Wed, 6 Apr 2022 13:49:58 +0000 (13:49 +0000)]
Bug 30471: Correct display of default rules

To test:
1 - Browse to 'Administration->Circulation and fines rules'
2 - Make sure you are editing 'Standard rules for all libraries'
3 - Set 'Lost item fee refund on return policy' to 'Refund lost item charge and charge new overdue fine'
4 - Swtich to edit rules for a specific library, click on the dropdown for 'Lost item fee refund on return policy' and note default says 'Use default (Refund lost item charge and restore overdue fine)'
5 - Switch default/all libraries rule to 'Refund lost item charge and restore overdue fine'
6 - On specific branch note the default option is now 'Use default (Refund lost item charge and charge new overdue fine)'
7 - Apply patch and repeat, note the default descriptions now display correctly

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29001: (QA follow-up) Remove code duplication
Joonas Kylmälä [Thu, 21 Jul 2022 17:57:20 +0000 (17:57 +0000)]
Bug 29001: (QA follow-up) Remove code duplication

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29001: Fix framework edition when subfields are reordered
Jonathan Druart [Tue, 19 Jul 2022 15:00:29 +0000 (17:00 +0200)]
Bug 29001: Fix framework edition when subfields are reordered

There is a flaw when subfields are ordered, the inputs are not retrieved
correctly.
We should not rely on the order but use an id instead.
Test plan:
Create, edit subfields
Modify values from the different subfields
Confirm that values are correctly saved

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31202: Don't remove optional SIP fields with a value of "0"
Kyle Hall [Wed, 20 Jul 2022 16:32:58 +0000 (12:32 -0400)]
Bug 31202: Don't remove optional SIP fields with a value of "0"

If the value of a SIP field is "0", that evaluates to false, so any calls to maybe_add with a value of "0" will not get added to the SIP response message.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.t

Signed-off-by: Michal Urban <michalurban177@gmail.com>
JK: Adjust commit title

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25449: (QA follow-up) Fix basic_workflow.t
Martin Renvoize [Thu, 21 Jul 2022 06:47:20 +0000 (07:47 +0100)]
Bug 25449: (QA follow-up) Fix basic_workflow.t

Now that we have made item.itype a required field, we need to ensure we
set it for the corresponding selenium test.. this wasn't entirely easy
as the html select is hidden by select2. I had to find the select2 span,
trigger a click event to open it and then find and click an option.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25449: Fix basic_workflow.t
Jonathan Druart [Wed, 20 Jul 2022 15:39:22 +0000 (17:39 +0200)]
Bug 25449: Fix basic_workflow.t

We need to create an itemtype for the biblio, then the item form will
have 942$c prefilled by default

STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
        /usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
        (eval 1726):1 in Selenium::Remote::Driver::__ANON__
        (eval 1728):2 in Selenium::Remote::Driver::__ANON__
        /usr/share/perl5/Selenium/Remote/Driver.pm:953 in Selenium::Remote::Driver::_execute_command
        t/db_dependent/selenium/basic_workflow.t:224 in Selenium::Remote::Driver::get_title

Error while executing command: unexpected alert open: Dismissed user prompt dialog: Form not submitted because of the following problem(s)
------------------------------------------------------------------------------------

- 1 mandatory fields empty (highlighted) at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31201: Prevent Pseudonymization.t to fail
Jonathan Druart [Wed, 20 Jul 2022 15:44:05 +0000 (17:44 +0200)]
Bug 31201: Prevent Pseudonymization.t to fail

It's failing if selenium/patrons_search.t failed before, they are using
the same code and the selenium tests didn't clean correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31186: Fix the hidingrules test for result numbering
Marcel de Rooy [Tue, 19 Jul 2022 11:27:55 +0000 (11:27 +0000)]
Bug 31186: Fix the hidingrules test for result numbering

We should not test the $hidingrules variable but the number
of keys it contains.

Test plan:
Clear OpacHiddenItems.
Check with and without this patch search result numbering on
the OPAC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27045: (follow-up) Fix delimiter in header rows
Katrin Fischer [Sat, 16 Jul 2022 11:23:54 +0000 (11:23 +0000)]
Bug 27045: (follow-up) Fix delimiter in header rows

The header rows still showed \t because the newly defined
variable wasn't used there.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27045: Fix other exports using CSV profiles
Jonathan Druart [Fri, 20 Nov 2020 14:33:14 +0000 (15:33 +0100)]
Bug 27045: Fix other exports using CSV profiles

This patch corrects the export of the 2 other reports
using CSV profiles:

* Late issues (serials)
* Basket (acquisitions)

To test:
1) Late issues
* Update the late issues sample report to use tab as separator
* Create a subscription
* Go to serial collection and 'generate next' to get some late issues
* Go to Claims
* Export the late issues and verify format is correct
* Verify exported file has tabs

2) Basket summary
* Create an order with several order lines
* Create an SQL type CSV profile for basket export using tab as separator
  Example: aqorders.quantity|aqordres.listprice|Title=biblio.title
* Export the basket using your configured CSV profile
* Verify exported file has tabs

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27045: Fix items lost report export if delimiter is tab
Jonathan Druart [Fri, 20 Nov 2020 14:33:02 +0000 (15:33 +0100)]
Bug 27045: Fix items lost report export if delimiter is tab

When choosing tabulation as the delimiter for a CSV profile
for the lost item report, the tabs appear in the file as \t
instead of as proper tabs.

title\tauthor\tstocknumber\tcallnumber
"E Street shuffle :"\"Heylin, Clinton."\\

To test:
* Upate the existing sample lost item CSV profile to use tabs as
  separator
* Make sure you have some lost items in your database or create some
* Go to Reports > Lost items
* Run the report
* Check all or some of the checkboxes in the result list
* Export using the link on top and the CSV profile
* Verify the tabs are not exported correctly
* Apply patch
* Verify tabs now are proper tabs instead of \t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31192: Check for item before calling is_bundle
Martin Renvoize [Wed, 20 Jul 2022 08:29:39 +0000 (09:29 +0100)]
Bug 31192: Check for item before calling is_bundle

The code in here is weird.. we really aught to check for the item before
anything else and throw an error to screen if we don't find one... but
my patch takes the simple option, and the one taken elsewhere in the
script.. to just check for item being defined before calling a method
upon it.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30268: Check mandatory fields in addorderiso2709.pl
Julian Maurice [Wed, 9 Mar 2022 15:42:50 +0000 (16:42 +0100)]
Bug 30268: Check mandatory fields in addorderiso2709.pl

Test plan:
1. Make sure you have mandatory item subfields in the MARC bibliographic
   framework used in acquisitions ("ACQ" if it exists, the default framework
   otherwise).
2. Use the "Stage MARC records for import" tool to upload a file. Do not import
   the bibliographic records.
3. Create a new acquisition basket ("Create items when:" must be set to
   "placing an order") and add a new order from a staged file
4. Select the file you just uploaded
5. In the "Items information" tab, make sure at least one mandatory subfield is
   empty
6. Try to submit the form. If there are errors about other mandatory fields
   (like the fund for instance), fix those errors and resubmit. There should be
   an error message about mandatory item subfields.
7. Enter a value for the mandatory item subfields and resubmit the form. Verify
   that the order and the item have been correctly created.

Signed-off-by: Thibault Kero <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30333: Move view actions on acquisitions receipt summary page into menu
Owen Leonard [Tue, 22 Mar 2022 11:25:12 +0000 (11:25 +0000)]
Bug 30333: Move view actions on acquisitions receipt summary page into menu

This patch moves the "views" group of links (MARC, Card, and Order) into
a menu button. The patch also makes some corrections to the modal markup
and handling to fix a display error.

To test you must have a basket or baskets with multiple titles on order,
both received and pending.

- Apply the patch and go to Acquisitions -> Vendor -> Receive shipment
  -> Receive a new shipment (or open an existing invoice).
- In the list of pending orders:
  - Test the 'View' menu for multiple titles. The 'Order,' 'MARC,' and
    'Card' menu items should work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 7660: Use first available categorycode when none passed in
Nick Clemens [Mon, 18 Jul 2022 11:49:57 +0000 (11:49 +0000)]
Bug 7660: Use first available categorycode when none passed in

The code that populates the patron messaging preferences on initial form load
expects to have a category selected. Currently we only have one if one was
passed to the form. When creating an account from a parent, we don't have a
category explicitly selected - so we can just select the first of the possible
categories

To test:
 1 - In KTD set 'Juvenile' category to have some messaging preferences
 2 - Find a patron, say Edna Acosta, and 'Add guarantee'
 3 - In new form preferences are blank, cancel
 4 - Apply patch, restart all
 5 - Go to Edna, click 'Add guarantee'
 6 - Preferences are populated!
 7 - Cancel
 8 - Go to 'Patrons' module
 9 - Click "+ New patron"
10 - Confirm messaging preferences load correctly when not adding child

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30570: Compiled CSS
Tomas Cohen Arazi [Wed, 20 Jul 2022 13:05:29 +0000 (10:05 -0300)]
Bug 30570: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30570: Replace the use of jQueryUI tabs in OPAC templates
Owen Leonard [Wed, 6 Jul 2022 11:36:11 +0000 (11:36 +0000)]
Bug 30570: Replace the use of jQueryUI tabs in OPAC templates

This patch switches to Bootstrap tabs anywhere in the OPAC where
jQueryUI tabs were used.

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).

- Test the item type/collection/shelvinglocation tabs on the advanced
  search page. Test that it works correctly with different variations of
  the OpacAdvancedSearchTypes system preference.
- Search for an authority record and view the details. The "Notes"
  tab should be styled correctly.
- Locate a bibliographic record and view the detail page. Verify
  that tabs are working, including all the options:
- Holdings
- Other holdings ( If OpacSeparateHoldings is enabled)
- Descriptions ( MARC notes )
- Subscriptions
- Serial collection (UNIMARC, untested)
- Components ( If ShowComponentRecords is enabled. Link to sample
  record:
  https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78023 )
- Comments
- Editions (OPACFRBRizeEditions)
- Html5media ( If HTML5MediaEnabled is on. Link to sample records:
  (https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10685)
- Images ( If OPACLocalCoverImages is enabled )

Bonus points for testing these tabs for which I don't have
credentials:
- Syndetics TOC
- Syndetics Excerpt
- Syndetics Reviews
- Syndetics AuthorNotes
- LibraryThing for Libraries (with LibraryThingForLibrariesTabbedView
  set to "in tabs."
- NovelistSelect

- Check tabs on these patron-related pages:
  - Checkout history
  - Search history
  - Patron summary. The following tabs are
    ✓ Checkouts
    ✓ Relatives' checkouts
    ✓ Overdues
    ✓ Fines
    ✓ Relatives' fines
    ✓ Holds
    ✓ Recalls
    ✓ Article requests
    ✓ Overdrive

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Bug 30570: (follow-up) Correct rebase errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30039: (QA follow-up) Change published on to publication date
Katrin Fischer [Mon, 18 Jul 2022 20:18:50 +0000 (20:18 +0000)]
Bug 30039: (QA follow-up) Change published on to publication date

As the issue might not have been published yet, but should have
been that seemed a better fit.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30039: Add published on column to claims.pl
Lucas Gass [Mon, 7 Feb 2022 19:02:53 +0000 (19:02 +0000)]
Bug 30039: Add published on column to claims.pl

To test:
1. Have a vendor setup
2. Go to serials and add a new serial w/ that vendor.
3. When creating a serial make this first issues sometime in the past.
4. Go to Claims, choose your vendor and load the table.
5. No published on column.
6. Apply patch
7. Try step 4 again and now you should see a published on column.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26377: Simplify JS code
Jonathan Druart [Tue, 31 May 2022 09:18:08 +0000 (11:18 +0200)]
Bug 26377: Simplify JS code

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26377: Show when loading the page if needed
Jonathan Druart [Tue, 31 May 2022 09:16:57 +0000 (11:16 +0200)]
Bug 26377: Show when loading the page if needed

Prevent a blink

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 26377: Clearly label parts of subscription-add.pl that relate to optional item...
Owen Leonard [Thu, 12 May 2022 16:25:05 +0000 (16:25 +0000)]
Bug 26377: Clearly label parts of subscription-add.pl that relate to optional item records

This patch modifies the form for adding a new subscription so that the
collection and item type fields are shown only when the subscription is
configured to create an item when receiving.

To test, apply the patch and go to Serials -> New subscription.

- When the page first loads, the "Do not create an item record when
  receiving this serial" radio button should be selected.
- Under the "Location" field there should be no item type or collection
  field.
- Select the "Create an item when receiving this serial" radio button.
- The item type and collection fields should appear.
- Test that the values are correctly saved when you add or edit a
  subscription.
- If you edit a subscription which had item type and collection defined,
  and you switch to "Do not create an item..." the record should save with
  empty values for those fields.
- Confirm that existing subscriptions open with the correct settings
  applied: Only records with "Create an item..." checked should open
  with the item type and collection fields displayed.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31020: Fix PassItemMarcToXSLT in system preferences description
Fridolin Somers [Thu, 23 Jun 2022 01:04:47 +0000 (15:04 -1000)]
Bug 31020: Fix PassItemMarcToXSLT in system preferences description

Bug 28373 added system preference PassItemMarcToXSLT is referenced is all XSLT system preferences.
But it only applies on results pages.
The only use in perl code is in C4::Search :
 > $marcrecord->delete_fields( @fields ) unless C4::Context->preference('PassItemMarcToXSLT');

I've tested by adding in all XSLT files :
  <strong>ITEMS <xsl:value-of select="count(marc:datafield[@tag=952])"/> </strong>
Number of items only appears in OPAC and staff interface results pages.

In fact only search pages get MARC record from search engine, in which items datas have been embedded for indexing.
In other pages MARC record does not embed items datas.

This patch adds "MARC21 952, UNIMARC 995" to be explicit we talk about
MARC datas not item tags build in XML recieved by XSLT.

Test plan :
1) Apply patch
2) Search for PassItemMarcToXSLT in system preferencies
3) Look at description of PassItemMarcToXSLT
4) Check PassItemMarcToXSLT only apprears in OPACXSLTResultsDisplay and XSLTResultsDisplay

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27546: (follow-up) Avoid index clash
Nick Clemens [Fri, 6 May 2022 12:40:00 +0000 (12:40 +0000)]
Bug 27546: (follow-up) Avoid index clash

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27546: (follow-up) Escape new search string
Nick Clemens [Tue, 26 Apr 2022 10:56:52 +0000 (10:56 +0000)]
Bug 27546: (follow-up) Escape new search string

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27546: Add 'Search within results' search box
Nick Clemens [Thu, 21 Jan 2021 14:23:35 +0000 (14:23 +0000)]
Bug 27546: Add 'Search within results' search box

This enhancement adds a new input above the search results allowing one to search within the results. The search
box will take a query and add it as a limit to the previous search

These patches make a slight change to the search header, passing the dropdown selection as a parameter rather thandirectly.

Searching this way is functionally equivaled to adding 'AND' with the new term to original results.

To test:
1 - Apply patch
2 - Search on staff client wiht a term that returns results
3 - Note the new 'Search within results box'
4 - Add a search term
5 - Note new results and confirm they are as expected
6 - Enable IntranetCatalogSearchPulldown and confirm the dropdown works as expected
7 - Edit your search - the reinfements appear in the limits section and can be removed

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: DBRev 22.06.00.019
Tomas Cohen Arazi [Wed, 20 Jul 2022 12:16:47 +0000 (09:16 -0300)]
Bug 30933: DBRev 22.06.00.019

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30909: Retain permanent_location if mapped
Jonathan Druart [Tue, 7 Jun 2022 09:27:04 +0000 (11:27 +0200)]
Bug 30909: Retain permanent_location if mapped

If items.permanent_location is mapped to a MARC subfields we must retain
the value, not using items.location

Test plan:
1 - Map permanent_location to a marc field
2 - Expose that field in the item editor
3 - Change the location of the item and retain the permanent location on saving
4 - note that permanent location has not changed

Test the different other situation, when adding and editing: Empty the field, change only location, change only permanent_location, etc.

Signed-off-by: andrew <andrewfh@dubcolib.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31179: (QA follow-up) Set field as hidden for tests
Nick Clemens [Tue, 19 Jul 2022 15:26:51 +0000 (15:26 +0000)]
Bug 31179: (QA follow-up) Set field as hidden for tests

We want the tests to pass in the case where field is set to visibile in Koha

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31179: (QA follow-up) POD fix
Nick Clemens [Tue, 19 Jul 2022 15:17:56 +0000 (15:17 +0000)]
Bug 31179: (QA follow-up) POD fix

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31179: Don't copy invisible subfields when duplicating items
Jonathan Druart [Tue, 19 Jul 2022 14:09:46 +0000 (16:09 +0200)]
Bug 31179: Don't copy invisible subfields when duplicating items

Duplicate item is intended to duplicate the visible cataloging fields of an item, however,
currently it is duplicating the complete internal record of the item

To recreate:
1 - find an item in Koha staff client, copy the barcode
2 - Issue this item to a patron
3 - Return to the record
4 - Edit items
5 - Click 'Actions->Duplicate' for the item in question
6 - Save the item
7 - Note in the items table above for that 'Total checkouts' 'Due date'
 etc. have not been copied to new item

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Add lists methods for disowning
Tomas Cohen Arazi [Tue, 19 Jul 2022 17:49:52 +0000 (14:49 -0300)]
Bug 30933: Add lists methods for disowning

This patch aims to tidy things a bit by doing the following changes:

* Koha::Virtualshelf gets the 'transfer_ownership' method
* Koha::Virtualshelves gets the 'disown_or_delete' method
* Koha::Patron->delete gets rewritten/simplified by using
  disown_or_delete

The idea is to capture the current behavior in more fine grained
methods. So current tests should be passing as they do now.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Patrons.t \
           t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass
2. Apply this patches
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Run:
  k$ prove t/db_dependent/Koha/Virtualshelf.t \
           t/db_dependent/Koha/Virtualshelves.t
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Unit tests
Tomas Cohen Arazi [Tue, 19 Jul 2022 17:49:24 +0000 (14:49 -0300)]
Bug 30933: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: (follow-up) Use cannot_be_transferred in shelves scripts
Marcel de Rooy [Wed, 22 Jun 2022 12:14:37 +0000 (12:14 +0000)]
Bug 30933: (follow-up) Use cannot_be_transferred in shelves scripts

Test plan:
Verify if transfer shared list on OPAC still works as expected.
Same for intranet counterpart for public lists.

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: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: (follow-up) Consolidate transfer checks
Marcel de Rooy [Tue, 21 Jun 2022 14:41:42 +0000 (14:41 +0000)]
Bug 30933: (follow-up) Consolidate transfer checks

Adding shelf->cannot_be_transferred with unit tests.

Note: This follow-up actually refers to comment42 on the
preceding report 25498.
Furthermore, we could still improve later on using error code
more effectively (adding codes). Here we concentrate on moving
the checks to module level.

Test plan:
Run t/db_dependent/Virtualshelves.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: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Adjust pref description, include ListOwnerDesignated
Marcel de Rooy [Mon, 20 Jun 2022 11:48:25 +0000 (11:48 +0000)]
Bug 30933: Adjust pref description, include ListOwnerDesignated

Test plan:
View the pref on the System preferences, Patrons tab.

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: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Change for patron->delete
Marcel de Rooy [Mon, 20 Jun 2022 10:03:59 +0000 (10:03 +0000)]
Bug 30933: Change for patron->delete

Test plan:
Run t/db_dependent/Koha/Patrons.t
Set pref ListOwnershipUponPatronDeletion to transfer.
Set pref ListOwnerDesignated to some valid borrowernumber.
Pick a user with public or shared list, delete from interface.
Pick a user with public or shared list, delete by script. (*)
Verify in both cases that new list owner is the designated one.

(*) Tip: Create another branch. Move the patron to be deleted to that
branch. And delete by script with:
    misc/cronjobs/delete_patons.pl -c -v -library YOUR_CODE

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: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30933: Database revision (new pref)
Marcel de Rooy [Tue, 21 Jun 2022 11:29:09 +0000 (11:29 +0000)]
Bug 30933: Database revision (new pref)

Adds pref ListOwnerDesignated.
Generalize description of ListOwnershipUponPatronDeletion a bit.

Test plan:
Run updatedatabase.

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: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: (follow-up) Show error message when no sharee has email
Marcel de Rooy [Wed, 20 Jul 2022 11:45:23 +0000 (11:45 +0000)]
Bug 25498: (follow-up) Show error message when no sharee has email

Test plan:
Share a list with a patron that has no email address.
Try to transfer ownership. Verify that you get the error message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: (follow-up) Change for autocomplete change of 30578
Marcel de Rooy [Tue, 19 Jul 2022 12:18:21 +0000 (12:18 +0000)]
Bug 25498: (follow-up) Change for autocomplete change of 30578

Test plan:
Check if the patron search still works on the intranet shelves form
when transferring ownership.

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: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: (QA follow-up) Rename virtualshelfshare->patron
Marcel de Rooy [Fri, 17 Jun 2022 06:58:09 +0000 (06:58 +0000)]
Bug 25498: (QA follow-up) Rename virtualshelfshare->patron

This patron is a 'sharee' (not the sharer).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: Transfer ownership shared list on OPAC
Marcel de Rooy [Mon, 13 Jun 2022 09:40:07 +0000 (09:40 +0000)]
Bug 25498: Transfer ownership shared list on OPAC

Test plan:
Pick or create a shared list. Login as owner.
Transfer to one of the other members.
Verify that you do no longer have Transfer, but see Remove share.
Login as the other member. Transfer it back.

Bonus: Working with two tabs, you can open the Transfer form and
in the meantime delete the list, the patron or remove the share.
Or change permissions. Submit after that and check the error message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: Show transfer button for shared lists on OPAC
Marcel de Rooy [Fri, 10 Jun 2022 09:42:41 +0000 (09:42 +0000)]
Bug 25498: Show transfer button for shared lists on OPAC

Test plan:
Pick or create a shared list.
Verify that OPAC only shows the Transfer button when you are the
owner of a shared list.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: Add a transfer form for public lists
Marcel de Rooy [Fri, 10 Jun 2022 08:26:16 +0000 (08:26 +0000)]
Bug 25498: Add a transfer form for public lists

Test plan:
[1] Valid transfer:
    Log in with staff patron C having edit_public_lists.
    Pick a public list. Choose Transfer. Select a patron.
    Submit and check if transfer was successful.
[2] Permission problem:
    Pick a staff user D. Temporary enable edit_public_lists.
    Add another private tab. Login with D.
    Pick a public list. Transfer. Choose another patron. Wait.
    Switch tab: remove added permission from D.
    Switch tab again: Submit transfer form. Error? Close tab.
[3] Bonus test - Shelf disappeared:
    Pick a public list. Transfer. Choose another patron. Wait.
    Open another tab. Delete the selected public list.
    Close tab. Submit the transfer. Not exist error?
[4] Bonus test - Patron not found:
    Pick a public list. Transfer. Choose another patron. Wait.
    Open another tab. Delete selected patron.
    Close tab. Submit transfer. Patron not found error?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 25498: Add transfer button on intranet
Marcel de Rooy [Thu, 9 Jun 2022 12:59:43 +0000 (12:59 +0000)]
Bug 25498: Add transfer button on intranet

Note: Adjusting shelves_results template too for not allowing delete
when you do not have delete_public_lists (or higher). If you are the
owner, you are allowed to edit or delete. But transfer specifically
needs edit_public_lists (or higher).

Note: Removed a few useless POD lines to make qa tools happy.

Test plan:
Check if you see the transfer button on public lists only when having
permission edit_public_lists (or higher). And never on private lists.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: DBRev 22.06.00.018
Tomas Cohen Arazi [Tue, 19 Jul 2022 14:21:00 +0000 (11:21 -0300)]
Bug 11889: DBRev 22.06.00.018

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Spelling
Martin Renvoize [Thu, 9 Jun 2022 14:39:36 +0000 (15:39 +0100)]
Bug 11889: (QA follow-up) Spelling

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) We did not need get_shared_shelves after all
Marcel de Rooy [Thu, 9 Jun 2022 09:12:18 +0000 (09:12 +0000)]
Bug 11889: (follow-up) We did not need get_shared_shelves after all

Test plan:
Run t/db_dependent/Virtualshelves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) Get rid of FIXME in Koha::Patron
Marcel de Rooy [Thu, 9 Jun 2022 07:24:31 +0000 (07:24 +0000)]
Bug 11889: (follow-up) Get rid of FIXME in Koha::Patron

Instead of get_lists, I added ->virtualshelves.

I removed the addition of the suffix to the shelf name here; if we
really want that (doubts), we should do it pref based. Removing a
staff member with public lists would result in weird names with
shelf numbers on the OPAC. (Should be very easy to restore.)

Used this opportunity to refactor the patron->delete subtest a bit:
switching to build_object, removing the 'retrieved patrons',
differentiating between staff patron and patron for sharing,
adding a few tests.

Test plan:
Enable transfer ownership. Delete a patron with lists in interface.
Check what happened.
Run t/db_dependent/Koha/Patrons.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Fix tests
Marcel de Rooy [Wed, 8 Jun 2022 14:35:31 +0000 (14:35 +0000)]
Bug 11889: (QA follow-up) Fix tests

We need some changes for 28959 changing category to public.
Added the userenv mocking.

Note: A follow-up does a bit more refactoring here. But they
should pass at least now.

Test plan:
Run t/db_dependent/Virtualshelves.t
Run t/db_dependent/Koha/Patrons.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Changes for wantarray move in ->search
Marcel de Rooy [Wed, 8 Jun 2022 14:47:05 +0000 (14:47 +0000)]
Bug 11889: (QA follow-up) Changes for wantarray move in ->search

See bug 29844.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Convert to new atomicupdate style
Marcel de Rooy [Wed, 8 Jun 2022 14:14:43 +0000 (14:14 +0000)]
Bug 11889: (QA follow-up) Convert to new atomicupdate style

The first patch contained an old .sql atomic update.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Add POD ground work
Marcel de Rooy [Wed, 8 Jun 2022 14:05:42 +0000 (14:05 +0000)]
Bug 11889: (QA follow-up) Add POD ground work

Make QA tools a fraction happier ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) Tests and new get_shared_shelves
Aleisha Amohia [Mon, 20 Feb 2017 21:51:39 +0000 (21:51 +0000)]
Bug 11889: (follow-up) Tests and new get_shared_shelves

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This is a manual reconstruction of an older patch, that git
did not want to apply anymore (sha trouble etc.)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (QA follow-up) Add entry to sysprefs.sql
Marcel de Rooy [Thu, 16 Feb 2017 09:30:35 +0000 (10:30 +0100)]
Bug 11889: (QA follow-up) Add entry to sysprefs.sql

Also changes the insert in the atomic update to an insert ignore, as
we generally do for inserting sysprefs (see updatedatabase).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: (follow-up) Remove share if you are the new owner
Marcel de Rooy [Thu, 16 Feb 2017 09:04:27 +0000 (10:04 +0100)]
Bug 11889: (follow-up) Remove share if you are the new owner

This will probably be exceptional. But if the staff member already had
a share for a private list of the patron he deletes now, he will be
the new owner and we should remove the share record.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 11889: Disown a list upon deletion of owner
Aleisha Amohia [Tue, 14 Feb 2017 22:56:31 +0000 (22:56 +0000)]
Bug 11889: Disown a list upon deletion of owner

This patch adds a syspref 'ListOwnershipUponPatronDeletion' which
decides if all the owner's lists (public and private) are deleted
when the owner is deleted, or if the ownership of their public and
shared lists are transfered to the user who deleted the owner (private
lists that are not shared are always deleted).

To test:
1) Apply patch and update database
2) Set the ListOwnershipUponPatronDeletion syspref to 'Transfer...'
3) Set up a superlibrarian user
4) Log in as this superlibrarian user and set up three lists, a public
list (maybe named 'public'), and two private lists (named 'private' and
'shared')
5) Log in as this user to the opac (if you haven't already) and share
the 'shared' list with someone
6) View the virtualshelves table in mysql to see the three lists you
just created under your new user
7) Also view the virtualshelfshares table in mysql to see the 'shared'
list
8) Log into the staff client with your regular user (a different user to
the one you just created)
9) Search for the user you just created and delete them
10) Go to your lists
11) You should see the 'shared' list under your private lists, and their
'public' list under your public lists, both with you as the owner
12) if you view both the virtualshelves table and the virtualshelfshares
table in mysql again, youll see you are now the owner and the 'private'
list will no longer exist.
13) Set the ListOwnershipUponPatronDeletion syspref back to 'Delete...'
14) Repeat steps 3 - 10 again (it may help to delete the 'shared' and
'public' lists before you re-create them)
15) You should not see any of the lists you just made under private or
public lists this time. To confirm, check the virtualshelves table in
mysql and make sure that all three lists have been deleted.

Sponsored-by: Catalyst IT
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2022-06-08 Removed old atomic update. See new follow-up.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30905: (follow-up) Get logged in branch once
Tomas Cohen Arazi [Tue, 19 Jul 2022 12:51:16 +0000 (09:51 -0300)]
Bug 30905: (follow-up) Get logged in branch once

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30905: Show waiting recalls in patron account
Aleisha Amohia [Mon, 6 Jun 2022 23:36:38 +0000 (23:36 +0000)]
Bug 30905: Show waiting recalls in patron account

This enhancement shows recalls ready for pick-up on the patron's account
so they can't be missed.

To test:
1) Enable the UseRecalls system preference and set up your
recalls-related circulation rules.
2) Check out an item to Patron B.
3) Log into the OPAC as Patron A and search for the item.
4) Place a recall on that item. Note the pickup library.
5) Go back to the staff client. At the top right of the page, confirm
your logged in library matches the recall pickup library. Set the
library to the recall pickup library if needed.
6) Check in the recalled item and confirm the recall as waiting for
Patron A.
7) Go to Patron A's account (members/moremember.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
8) Go to Patron A's checkouts (circ/circulation.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
9) Click on the menu at the top right of the page and choose 'Set
library'. Change the library to some other library.
10) Repeat steps 7 and 8, however this time the recall should show under
'Recalls waiting at other libraries'.

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30935: Holds to pull shows wrong first patron
Shi Yao Wang [Wed, 29 Jun 2022 15:13:27 +0000 (11:13 -0400)]
Bug 30935: Holds to pull shows wrong first patron

When different patrons have item level holds on the same item, Holds to
pull shows wrong first patron.

Test plan:
1) Place a record-level hold on a biblio with an available item
2) Check the Holds to pull page (circ/pendingreserves.pl)
--> The biblio should appear in the list and the patron should appear in the 'First patron' column
3) Place a second record-level hold on the same biblio
4) Go back to the Holds to pull page
--> The biblio is still there, but the patron in the 'First patron' column is the second patron
5) Place a third record-level hold on the same biblio
6) Go back to the Holds to pull page
--> The biblio is still there, but the patron in the 'First patron' column is the third patron
7) Apply the patch
8) Go back to the Holds to pull page
--> The biblio is still there and the patron in the 'First patron' column is the first patron

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27683: Impact on catalogue/detail.pl
Fridolin Somers [Thu, 11 Feb 2021 15:27:54 +0000 (16:27 +0100)]
Bug 27683: Impact on catalogue/detail.pl

Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove
test in catalogue/detail.pl.

Test plan :
1) Build an item and a linked analytical record with 773$0 and $9
2) Go to record detail page
3) Enable EasyAnalyticalRecords
4) You see analytics tab and analytical count on item
5) Disable EasyAnalyticalRecords
6) You dont see analytics tab

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref
Fridolin Somers [Thu, 11 Feb 2021 14:33:35 +0000 (15:33 +0100)]
Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref

C4::Items::GetAnalyticsCount is part of the easy analytics feature.
Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled.
Actually it may block an item deletion for wrong reason.

Test plan :
1) Dont apply patch
2) Build an item and a linked analytical record with 773$0 and $9
3) Enable EasyAnalyticalRecords
4) Try to delete the item
5) You have an alert because linked to analytics
6) Disable EasyAnalyticalRecords
7) Try to delete the item
8) You have an alert because linked to analytics
9) Apply patch
10) Try to delete the item
11) No alert, it works :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27683: Unit test for GetAnalyticsCount
Fridolin Somers [Thu, 11 Feb 2021 15:28:18 +0000 (16:28 +0100)]
Bug 27683: Unit test for GetAnalyticsCount

Run prove t/db_dependent/Items/GetAnalyticsCount.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30447: Unit tests
Michal Urban [Wed, 15 Jun 2022 08:04:37 +0000 (04:04 -0400)]
Bug 30447: Unit tests

Added tests to ensure that Koha::Holds->get_items_that_can_fill returns items with datecancelled and datearrived
Added test for correct number of items for each call of "get_items_that_fill"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30447: Check if transfers arrived or cancelled
Nick Clemens [Mon, 4 Apr 2022 12:21:43 +0000 (12:21 +0000)]
Bug 30447: Check if transfers arrived or cancelled

TO test:
 1 - Find a bib with a single item
 2 - Browse to Circulation->Transfer
 3 - Transfer the item to another branch
 4 - Check the item in at current branch and cancel the transfer on the dialog
 5 - Place a hold on the biblio for a patron at current branch
 6 - Browse to Circulation->Holds to pull
 7 - Item does not show
 8 - Apply patch, restart all
 9 - Browse to Circulation->Holds to pull
10 - Item shows

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29922: (follow-up) Remove extra sort
Shi Yao Wang [Mon, 4 Jul 2022 13:18:51 +0000 (09:18 -0400)]
Bug 29922: (follow-up) Remove extra sort

Remove wrong sort in staff advanced search page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29922: Make get_search_groups return results sorted by title
Shi Yao Wang [Mon, 27 Jun 2022 15:18:05 +0000 (11:18 -0400)]
Bug 29922: Make get_search_groups return results sorted by title

get_search_groups from Koha/Library/Groups.pm returns library groups sorted by title.

Test plan:
1- Go to administration > library groups and create multiple library groups with different names (e.g. AGroup, BGroup, ÄGroup, etc.). Make sure to tick "Use for OPAC search groups" checkbox.
2- Go to advanced search in OPAC.
3- Under "Groups of librairies" , click the select button.
4- Notice that the library groups are not in alphabetical order.
5- Apply the patch.
6- Notice that the library groups are in alphabetical order.
7- Run `prove t/db_dependent/LibraryGroups.t` and all test should pass.

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@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31163: Sort cashups newest to oldest
Martin Renvoize [Fri, 15 Jul 2022 13:58:40 +0000 (14:58 +0100)]
Bug 31163: Sort cashups newest to oldest

The cashup history table was sorting from oldest to newest.. it's
perferable to show the most recent at the top by default.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29114: Trim whitespace before the barcode
Andrii Veremeienko [Fri, 29 Oct 2021 13:44:19 +0000 (16:44 +0300)]
Bug 29114: Trim whitespace before the barcode

The solution was to add regexp that trims all whitespaces.

How to test:
1. Go to the koha/virtualshelves/shelves.pl;
2. Add new list or edit existing one;
3. Start adding new items;
4. In the "Barcode" field add barcode(s) with whitespaces before them;
5. Observe that it wasn't added as the barcode isn't recognized because of whitespaces;
6. Apply the patch;
7. Repeat step 4;
8. Observe that the item was successfully added;

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27667: (QA follow-up) Fix singular index and rephrase heading
Katrin Fischer [Fri, 15 Jul 2022 13:23:18 +0000 (13:23 +0000)]
Bug 27667: (QA follow-up) Fix singular index and rephrase heading

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 27667: Display a warning for records missing in Elasticsearch
Fridolin Somers [Wed, 11 May 2022 19:38:23 +0000 (09:38 -1000)]
Bug 27667: Display a warning for records missing in Elasticsearch

On "About Koha" page are displayed the numbers of indexed biblios and authorities with ES.
It could be great if we could have comparison with the number of records in the database to display the number of missing records.
In the "System information" tab with the other "Data problems".

If Searchengine has any issue (index count will be -1), we do not
display missing records.

Test plan :
1) Use Elasticsearch searchengine
2) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
3) Go to "About Koha" page and look at System information tab
=> you see no warning
4) On a biblio record delete the MARCXML in biblio_metadata.metadata
5) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
6) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 435 in indice koha_kohadev_biblios.
7) On a authority record delete the MARCXML in auth_header.marcxml
8) Rebuild all records : koha-elasticsearch --rebuild -d kohadev
9) Go to "About Koha" page and look at System information tab
=> you see warning : 1 record(s) missing on a total of 1705 in indice koha_kohadev_authorities.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 20439: Sort SMS providers in alphabetical order by DB field
Lucas Gass [Fri, 15 Jul 2022 16:55:53 +0000 (16:55 +0000)]
Bug 20439: Sort SMS providers in alphabetical order by DB field

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.

Signed-off-by: George Williams <george@nekls.org
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31144: When modifying an order we should not load the vendor default discount
Nick Clemens [Tue, 12 Jul 2022 18:39:06 +0000 (18:39 +0000)]
Bug 31144: When modifying an order we should not load the vendor default discount

After placing an order in a basket with a discount of "0" if you attempt to modify we will load the vendor default discount, this can lead to accidentally applying a discount when modifying other order parts

To test:
0 - Have a vendor with a discount set
1 - Add an order to a basket
2 - While adding, set discount to 0
3 - Add order - prices are calculated ocrrectly
4 - Modify order
5 - Note discount is populated with vendor discount
6 - Cancel
7 - Apply patch
8 - Modify order
9 - Discount remains at 0
10 - Repeat with a vendor with no discount set
11 - Placing order not specifiying discount it remains blank
12 - Modifying order discount remains blank
13 - Modify order and set discount
14 - Confirm it is retained on modifcation

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31068: Context for translation: Print (verb) vs. Print (noun)
Caroline Cyr La Rose [Mon, 4 Jul 2022 16:10:54 +0000 (12:10 -0400)]
Bug 31068: Context for translation: Print (verb) vs. Print (noun)

This patch adds context to the term Print in the context of message transport types (as opposed to printing something/print button), for translation purposes.

To test:
0- Apply patch

Check the terms to be changed
1- Go to Tools > Notifications & slips
2- Edit a notification
** 3- In the tabs for different transport types, check the 'Print' term (letter.tt)
4- Go to Tools > Overdue notice/status triggers
** 5- In the transport types, check the 'Print' column heading (overduerules.tt)

Add a new language (fr-CA in the example, change for whatever language code you want)
6- In a terminal, run
gulp po:create --lang fr-CA
7- Then, run
gulp po:update --lang fr-CA
8- In system preferences, enable the new language in language and OpacLanguages
9- Switch the language in staff interface and OPAC

Change the translations
10- In your favourite text editor, open fr-CA-messages.po
11- Find the string msgctxt "Message transport type"
12- Enter a word in msgstr
13- Save the file
14- In a terminal, go to misc/translator
15- Run
./translate install fr-CA

Check the translations
16- Redo the steps to check the terms (steps 1-5) and make sure the terms in steps 3 and 5 are changed for the word you put in step 12.

17- Optionally, check the other pages where the term is supposed to be unchanged and make sure it is unchanged

Check the terms to leave unchanged (optional)
18- Enable the HoldsAutoFill and UseCashRegisters system preferences
19- Go to Administration > Cash registers and create a cash register
20- Go to a patron's account
** 21- Check the 'Print' button in the menu bar or the patron's account (members-toolbar.inc)
22- Go to the 'Accounting' tab
23- Create a manual invoice
** 24- In the 'Transactions' tab, check the 'Print' button in the fee line (boraccount.tt)
25- Pay the fee (make sure to use the cash register)
** 26- In the 'Transactions' tab, check the 'Print' button in the payment line (boraccount.tt)
27- At the top of the transactions table, click the 'Export' option
** 28- Check the 'Print' option (columns_settings.inc)
29- Go to the 'Check out' tab and check out an item
30- Go to the item's bibliographic record
** 31- Check the 'Print' button in the menu bar of the detailed record (cat-toolbar.inc)
32- Add the record to the cart and open the cart
** 33- Check the 'Print' button in the cart (basket.tt)
34- Place a hold on the item
35- In the search bar at the top, click the 'Check in' tab and check in the item
** 36- Check the 'Print' button in the 'Hold filled for' message (returns.tt)
37- Go to Tools > Cash summary for Branch
38- Click 'record cashup' and confirm
39- Click the 'Summary' link in the 'Last cashup' column
** 40- Check the 'Print' button in the cashup summary modal (cashup_summary.inc)
41- Go to Serials
42- Create a subscription (if there aren't any)
43- Receive an issue
44- From the subscription detail page, go to Create routing list
45- Add a recipient to the list
46- Save the routing list
47- Click 'Save and preview routing slip'
** 48- Check the 'Print' button in the routing list preview (routing_preview_slip.tt)

Note: I can't find where the 'Print' from tinymce_i18n.inc is displayed in the staff interface

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29105: Add effective_itemtype handling to items api
Martin Renvoize [Fri, 24 Sep 2021 11:19:12 +0000 (12:19 +0100)]
Bug 29105: Add effective_itemtype handling to items api

This patch adds effective_item_type_id to the items api.

We overload the to_api method to append the effective_item_type_id field
with that of the effective itemtype code.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29105: Unit test
Martin Renvoize [Fri, 24 Sep 2021 14:13:55 +0000 (15:13 +0100)]
Bug 29105: Unit test

This patch adds a unit test for the addition of effective_item_type_id
to the items responses.

Test plan
1) Run the unit test prior to applying the second patch and confirm it
   fails
2) Apply the second patch and confirm the unit test now passes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31071: Compiled CSS
Tomas Cohen Arazi [Mon, 18 Jul 2022 17:39:25 +0000 (14:39 -0300)]
Bug 31071: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31071: Regression: date due removed from staff search results
Owen Leonard [Tue, 12 Jul 2022 14:45:13 +0000 (14:45 +0000)]
Bug 31071: Regression: date due removed from staff search results

This patch corrects a regression caused by Bug 28321, which
inadvertently removed the date due from output of item information in
each search result.

To test, apply the patch and perform a catalog search which will return
some results which are checked out and some which aren't. Confirm that
the checked out items show the date due correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31106: Fix links generated in XSLTs
Tomas Cohen Arazi [Tue, 5 Jul 2022 00:09:05 +0000 (21:09 -0300)]
Bug 31106: Fix links generated in XSLTs

This patch addresses the case of links that are generated on the XSLT
side, those linking to and from host records using 773$t and 773$a.

To test:
1. Pick a bibliographic record (I chose 'Unconditional' from the sample
   data
2. Add " and ? to the title statement. I changed it to
   'Uncond"itional?¿'
3. Add a child record to it
4. Open the detail page for the host record
=> FAIL: It doesn't show the 'Show analytics' link
5. Repeat 4 for the same record, in the OPAC
=> FAIL: It doesn't show the 'Show analytics' link
6. Apply this patch
7. Repeat 4 and 5.
=> SUCCESS: Links are shown!
8. Follow the links
=> SUCCESS: The links take you to the right resultset!
9. Go to the child record, and notice the link back to the parent works
   :-D
10. Sign off :-D

Sponsored-by: Theke Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31106: Make clean_search_term escape double quotes
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:19:27 +0000 (15:19 -0300)]
Bug 31106: Make clean_search_term escape double quotes

We noticed that several characters will break Zebra queries. So search
terms need to be quoted for things to work. In this context, double
quotes inside search terms are problematic because double quotes are
what we use for quoting strings.

This patch makes the clean_search_term method escape double quotes.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/Koha/SearchEngine/Zebra/QueryBuilder.t
=> FAIL: It doesn't work as it should!
3. Apply this patch
4. Repeat 2
=> SUCCESS: It does the job!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31106: Unit tests
Tomas Cohen Arazi [Mon, 4 Jul 2022 18:18:44 +0000 (15:18 -0300)]
Bug 31106: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30882: (QA follow-up) Fix tests
Tomas Cohen Arazi [Mon, 18 Jul 2022 17:36:28 +0000 (14:36 -0300)]
Bug 30882: (QA follow-up) Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 31069: Remove ExplodedTerms dependency on templates
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:33:47 +0000 (12:33 -0300)]
Bug 31069: Remove ExplodedTerms dependency on templates

This patch removes the use of templates and CGI in ExplodedTerms by using the
Koha::I18N library.

The functionality on the package is too simple, and messing with the
template paths complexity on the tests was too much, given we have a
nice way to have translatable strings at the package level.

This patch does that, and cleans up the test file as well, that required
complex template and CGI mocking to run properly.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/SuggestionEngine_ExplodedTerms.t
=> FAIL: It fails in master
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Follow the original test plan
=> SUCCESS: Things work
5. Enjoy the rest of the day and forget this ever happened

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29632: DBIC update
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:11:15 +0000 (12:11 -0300)]
Bug 29632: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29632: (QA follow-up) Add ENUM value to kohastructure.sql :-D
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:09:41 +0000 (12:09 -0300)]
Bug 29632: (QA follow-up) Add ENUM value to kohastructure.sql :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28854: DBIC update
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:07:42 +0000 (12:07 -0300)]
Bug 28854: DBIC update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 29632: DBRev 22.06.00.017
Tomas Cohen Arazi [Mon, 18 Jul 2022 15:05:40 +0000 (12:05 -0300)]
Bug 29632: DBRev 22.06.00.017

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30882: Add max_result_window to index config
Fridolin Somers [Thu, 2 Jun 2022 06:24:03 +0000 (20:24 -1000)]
Bug 30882: Add max_result_window to index config

Elasticsearch number of results is by default limited by setting "index.max-result-window", default value is 10000.
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-result-window

We use this setting:
https://git.koha-community.org/Koha-community/Koha/src/commit/44d6528b566e5c16eba9b15f8aa24667293766c3/Koha/SearchEngine/Elasticsearch/Search.pm#L411

I propose we add this setting in index config.

Test plan:
1) Use Elasticsearch
2) Apply patch and flush memcached
3) Rebuild indexes: misc/search_tools/rebuild_elasticsearch.pl -v -b -d
4) Check the settings of index (when using koha-testing-docker*):
   curl 'es:9200/koha_kohadev_biblios/_settings?pretty&filter_path=**.max_result_window'
5) You should see:
   "max_result_window" : "1000000"

* You also need to add this setting to the es section in koha-testing-docker's
docker-compose.yml (after the networks configuration):
     ports:
         - "9200:9300"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>