koha.git
16 months agoBug 32612: (QA follow-up) Update package files
Kyle Hall [Thu, 2 Feb 2023 11:53:53 +0000 (06:53 -0500)]
Bug 32612: (QA follow-up) Update package files

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cb1da500ec1d409c836b66e0a0a1836c2d56b1fe)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit a538cfea5b8614a58c58e0dd219a4001a400e24d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32612: (QA follow-up) Remove superfluous line
Kyle Hall [Wed, 1 Feb 2023 17:37:44 +0000 (12:37 -0500)]
Bug 32612: (QA follow-up) Remove superfluous line

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 09e0f8e30db2b99556d32cbf0276fbe4e117ebab)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 9b25eb0ed31320f0f03875442cadb43a703e2b77)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32612: Add worker-error to log4perl conf
Nick Clemens [Wed, 11 Jan 2023 18:46:11 +0000 (18:46 +0000)]
Bug 32612: Add worker-error to log4perl conf

To test:
1 - Apply patch
2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below:
log4perl.logger.worker = WARN, WORKER
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen
log4perl.appender.WORKER.stderr=1
log4perl.appender.WORKER.mode=append
log4perl.appender.WORKER.layout=PatternLayout
log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n
log4perl.appender.WORKER.utf8=1
3 - Restart all
4 - Edit misc/background_jobs_worker.pl
-        my $job = Koha::BackgroundJobs->find($args->{job_id});
+        my $job;# = Koha::BackgroundJobs->find($args->{job_id});
5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log
6 - Force enqueue a job (that won't be found because of #4
  perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});'
7 - Note error in log like:
  [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3b1f2c57eaed978845eef3824c7311da06099bc5)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 872d03963e09633c50dabf3ac3be92bdb9cab391)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32741: Fix {biblios|authorities}/bib1.att duplicate codes
Tomas Cohen Arazi [Fri, 27 Jan 2023 19:32:16 +0000 (16:32 -0300)]
Bug 32741: Fix {biblios|authorities}/bib1.att duplicate codes

This patch fixes a duplicate attribute code for Author-in-order in the
biblios definition.
The picked code matches what was already in ccl.properties.

Also Chronological-term for authorities gets fixed.

To test:
1. Apply the regression tests
2. Run:
  k$ prove xt/verify_bib1.att.t
=> FAIL: Some failiures
3. Apply this patch
4. Repeat 1
=> SUCCESS: Tests now 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: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4999a289563281c2b6956edb94fc6e1b20ad54e)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit c59571cbf0ff3aa0aee4234c1672d8089d9045ed)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32741: Regression tests
Tomas Cohen Arazi [Fri, 27 Jan 2023 18:59:52 +0000 (15:59 -0300)]
Bug 32741: Regression 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>
(cherry picked from commit 74513307292745add212d39d5564309188159dea)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit a37207a192cefeaeddf591fc76728c962f461e55)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32409: Fix cashup searching with non latin-1 chars
Tomas Cohen Arazi [Tue, 6 Dec 2022 14:02:20 +0000 (11:02 -0300)]
Bug 32409: Fix cashup searching with non latin-1 chars

This patch fixes a problem with the way queries are passed to the API so
cashups are searchable with non-laint1 chars.

To test:
1. Have two superlibrarian users, one with non-latin1 chars on the name
   (e.g. خمسة)
2. Setup a debit type that can be sold.
3. Use the POS module to have some activity, using both your regular
   user and the other one.
4. Go to the register you used, and choose 'Transaction history'
5. Perform a couple cashups with each user ('Record cashup').
6. Look at the 'Cashup history' table
=> SUCCESS: You see cashups for both users
7. Use the 'Search' filter with latin chars
=> SUCCESS: Your user with only latin1 chars is displayed on the table
8. Repeat, using some non-latin1 char found on the other user
=> FAIL: Table is not refreshed or filtered!
9. Apply this patch
10. Reload the page
11. Repeat 8
=> SUCCESS: Filtering works now!
12. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
(cherry picked from commit 96cba5503c896b01bb4eb7eab326d2fa8c4b96dc)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 270170cd0e37ed016bec0ba845ce887f1b2414d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
16 months agoBug 32406: Switch acq datatable from headers to query param
David Cook [Mon, 5 Dec 2022 22:50:23 +0000 (22:50 +0000)]
Bug 32406: Switch acq datatable from headers to query param

This patch changes the pending orders datatable from using the
x-koha-query header to the "q" query parameter, so that it is
able to support UTF-8 encoded scripts rather than just Latin-1
scripts.

Test plan:

1. Apply patch
2. Go to
http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=29
3. Change title from "Gairm" to "五" (alternatively use "cœur" or Arabic title)
4. Create a basket containing multiple records including bib 29 五
5. Close the basket
6. Receive shipment
7. You should be on a page like the following:
http://localhost:8081/cgi-bin/koha/acqui/parcel.pl?invoiceid=3
8. In the search box, type in 五
9. Note that you see a "Processing..." box and then the
results are filtered to just show the order for 五

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
tcohen amend: removed the line instead as we are probably phasing out
that DT configuration option anyway.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9248a0ef1f49677d52fb47aa5556215793bf218c)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit b40ebaae3cc7ec8e6de6259f6b275ade8a6f0891)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32377: Set param skiptotals on call of GetBudgetHierarchy in acqui/histsearch.pl
Emmi Takkinen [Wed, 30 Nov 2022 10:33:19 +0000 (12:33 +0200)]
Bug 32377: Set param skiptotals on call of GetBudgetHierarchy in acqui/histsearch.pl

Calling GetBudgetHierarchy from acqui/histsearch.pl
is slow if param skiptotals is not used.

To test:
1. Open browsers Console -> Network (F12).
2. Navigate to Order search page and perform search.
=> Take a note how long it takes to load the Search results page.
3. Apply this patch.
4. Repeat step 2.
=> Page should now load faster.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0f5daaa553bc63bd2c08212ee8db3d56c52781e9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 6b5cf15102235daa38a1f5a70e6ee7bea306abe5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32688: Convert recalls awaiting pickup tabs to Bootstrap
Owen Leonard [Fri, 20 Jan 2023 11:56:55 +0000 (11:56 +0000)]
Bug 32688: Convert recalls awaiting pickup tabs to Bootstrap

This patch updates the recalls awaiting pickup template
(recalls_waiting.tt) to replace a set of jQueryUI tabs. They are
converted to Bootstrap in order to complete Bug 29226.

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

- Go to Circulation -> Recalls awaiting pickup.
- You should see two tabs, "Recalls waiting" and "Recalls waiting over X
  days."
- The tabs should look correct and work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4877666fb5fed6fcab03063603a4d00cdbb7d1e0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 8d8f40ddddc8e2d899c557e35ffd6df338446b76)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 26628: Fix access to clubs when user only has clubs permission
Katrin Fischer [Thu, 26 Jan 2023 21:46:51 +0000 (21:46 +0000)]
Bug 26628: Fix access to clubs when user only has clubs permission

If a user only has the clubs and no permission from the tools section,
they can't access the patron clubs page by navigation. This patch
extends the permission checks for tools to include the clubs, that
live on the tools page, but have a top level permission.

To test:
- create a patron with only the catalogue and clubs permissions
- log in to the staff client as that patron
- navigate to a patron record, confirm you can see the Clubs tab in the patron account, can add patrons to and remove patrons from clubs
- confirm you don't have a link to the Tools module either on the Koha homepage or in the More menu
- enter the clubs URL manually (/cgi-bin/koha/clubs/clubs.pl), confirm you are allowed to open the page
- Apply patch
- The only changes should be:
  - You can now see the Tools entry in the More navigation menu
  - You can now see the Tools module link on the start page
  - Both take you to the tools page, only visible tools is 'Patron clubs'

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 50927bb9b530f7a9c092dfe99bd2dddc69202432)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit ecdd1d2b420f646279c69f61be30e46a33e8739e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 19188: Use the Price template plugin with_symbol => 1
Jonathan Druart [Thu, 1 Feb 2018 17:32:54 +0000 (14:32 -0300)]
Bug 19188: Use the Price template plugin with_symbol => 1

To make it displayed correctly depending on the configuration of the
currency

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit c6366c6d6869be719e48e73b40827efd574a13c6)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit ae4e269b7b12975d7e0d5504d0b2b504fa41a4ce)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 19188: Self checkout missing currency symbol
Jenny Way [Tue, 16 Jan 2018 22:05:39 +0000 (22:05 +0000)]
Bug 19188: Self checkout missing currency symbol

Test plan:
1. Under administration and system preferences, enable WebBasedSelfCheck
2. In OPAC give user fine by going to 'my account' at top right
3. Then under fines tab 'create manual invoice'
4. Make sure this amount is more than noissuescharge which can be
   changed under system preferences
5. Go to the web based self check from the OPAC URL
6. Log in as your user
7. Try to check out an item
7. Error 'Item cannot be checked out' should occur
8. With the patch, the currency symbol should show for the amount.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 5eab08cc2edd897f9afdfeb46caf5e409476946f)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 13f7ee3e938b41f66d3d057001660c347b3dc08c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32570: Display patron.state correctly
Lucas Gass [Wed, 4 Jan 2023 23:03:42 +0000 (23:03 +0000)]
Bug 32570: Display patron.state correctly

To test:
1. Have a patron with both a city and state in their Main address.
2. Do a patron search that will return that patron among others.
3. Notice the patroncity will say something like Centerville, Centerville: repeating the city but no state.
4. Apply patch
5. Try step 2 again, this time the city, state should display correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5acc976dec573ddd679219a0e920871a10622ac3)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 74957821f951ec15b67e4707d562261724145805)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32644: Terminology: staff/intranet and biblio in plugins-home page
Caroline Cyr La Rose [Mon, 16 Jan 2023 20:06:19 +0000 (15:06 -0500)]
Bug 32644: Terminology: staff/intranet and biblio in plugins-home page

This patch replaces some incorrect terminology in the plugins-home page.
The current terminology is available at https://wiki.koha-community.org/wiki/Terminology

To test:
0. Make sure you have no enhanced content plugins installed
1. Apply patch
2. Go to Administration > Manage plugins
3. Click 'View plugins by class'
   --> Notice that one of the options is 'View bibliographic record enhancement
   plugins for the staff interface'
4. Make sure this phrase is gramatically correct, makes sense and has no
   typos
5. Click on that option
   --> Notice that the message says 'No plugins that can enhance the bibliographic
   records in the staff interface are installed'
6. Make sure this phrase is gramatically correct, makes sense and has no
   typos

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0fe829e5b2a67a8af2b026af02dcb23ec55af195)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 807b3f669544fc380e8f4e4c868146a133c9d156)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoUpdate debian/control file: 22.05.09 on deb9 (cb5f3095)
Mason James [Fri, 27 Jan 2023 02:14:31 +0000 (15:14 +1300)]
Update debian/control file: 22.05.09 on deb9 (cb5f3095)

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoUpdate debian/changelog file: 22.05.09
Mason James [Fri, 27 Jan 2023 02:14:33 +0000 (15:14 +1300)]
Update debian/changelog file: 22.05.09

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoRevert "Bug 29021: RenewAccruingItemWhenPaid renewals are not seen"
Lucas Gass [Thu, 2 Feb 2023 16:54:29 +0000 (16:54 +0000)]
Revert "Bug 29021: RenewAccruingItemWhenPaid renewals are not seen"

This reverts commit 055270f9f930403c38ec8a2d3450f854ae3d9b5a.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoRevert "Bug 29021: (QA follow-up) Fix for new parameter, add unit test"
Lucas Gass [Thu, 2 Feb 2023 16:54:12 +0000 (16:54 +0000)]
Revert "Bug 29021: (QA follow-up) Fix for new parameter, add unit test"

This reverts commit 26cc76369ef5a14a5bfaf4ffabeb72f036f8e0a0.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoRevert "Bug 29021: (QA follow-up) Remove useless warnings"
Lucas Gass [Thu, 2 Feb 2023 16:53:58 +0000 (16:53 +0000)]
Revert "Bug 29021: (QA follow-up) Remove useless warnings"

This reverts commit fa82da9b574707382c3187487785c7b42b45f515.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32694: (QA follow-up) Fix missing TT filters
Katrin Fischer [Fri, 27 Jan 2023 13:17:42 +0000 (13:17 +0000)]
Bug 32694: (QA follow-up) Fix missing TT filters

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b2c1c0efe12856b99a2ab76bc84468f409235cf8)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 851739b52ab41490dea36eea24f6730f296a342e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32694: Fix value of 'Keep current' option in receiving
Nick Clemens [Fri, 20 Jan 2023 20:18:27 +0000 (20:18 +0000)]
Bug 32694: Fix value of 'Keep current' option in receiving

This patch restores missing template toolkit markers around the variable

To test:
1 - Order an item in a basket
2 - Close the basket
3 - Attempt to receive the item, leaving budget as 'Keep current'
4 - 500 Error:
C4::Acquisition::ModReceiveOrder(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (koha_cclsny.aqorders, CONSTRAINT aqorders_budget_id_fk FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE CASCADE ON UPDATE CASCADE) at /usr/share/koha/intranet/cgi-bin/acqui/finishreceive.pl line 120
5 - Apply patch
6 - Receive order successfully!

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>
(cherry picked from commit 9531a82e97661ce7013a8e9a64b8d5c4d2fa3635)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 6f0bbc2afc4a592dc3d1cefb73b24a6cac4ea8ae)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29021: (QA follow-up) Remove useless warnings
Tomas Cohen Arazi [Mon, 30 Jan 2023 15:01:41 +0000 (12:01 -0300)]
Bug 29021: (QA follow-up) Remove useless warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bcaf68b51fe73dfe0b38896c0f241725edbcb01b)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 6a4f0e3c591b43bc9e2ed5b12cf620413913ec9f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29021: (QA follow-up) Fix for new parameter, add unit test
Kyle Hall [Fri, 27 Jan 2023 16:58:45 +0000 (11:58 -0500)]
Bug 29021: (QA follow-up) Fix for new parameter, add unit test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d1bd38d85319ee4240df24c1e000e2b6362ad924)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit bce3f40d5944cc57e12c112ff0e58ea379d690ba)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 29021: RenewAccruingItemWhenPaid renewals are not seen
Martin Renvoize [Wed, 11 May 2022 14:47:58 +0000 (15:47 +0100)]
Bug 29021: RenewAccruingItemWhenPaid renewals are not seen

This patch updates the call to AddRewewal from Koha::Accounts to makr
the renewal as unseen.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5b87d7a473328cfcf772b7faa31871be068d2a05)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 2c9ad0a59bfbcc41a1d5bd7b473e0bb6cc375008)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 18247: Remove SQL queries from branch_transfer_limit.pl
Alex Buckley [Mon, 8 Aug 2022 23:59:20 +0000 (23:59 +0000)]
Bug 18247: Remove SQL queries from branch_transfer_limit.pl

1. Visit Administration > Patrons and circulation > Limit transfer limits

2. Observe collection codes are displayed as tabs on the Limit transfer
limits page when the BranchTransferLimitsType syspref = 'Collection
code'

3. Switch the BranchTransferLimitsType syspref = 'item type'. Refresh
the Limit transfer limits page and observe the tabs have changed to item
type codes

4. Apply patchset and restart services

5. Reload the Limit transfer limits page and confirm it displays
correctly with the  BranchTransferLimitsType = 'collection code' and
'item type'

6. Confirm you can successfully save transfer policies

Sponsored-by: Catalyst IT
Signed-off-by: Jacob Omara <jacob.omara@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e863f93c06e1e67ddbf0c705657ca7d024006f6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit b57ce0e15b6cae5933c3836697be9ec5a607f14d)

17 months agoBug 32416: Add a warning to the file
Nick Clemens [Wed, 7 Dec 2022 13:02:33 +0000 (13:02 +0000)]
Bug 32416: Add a warning to the file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e88f31d8a28566cef2275c3d9e62f3432b1f54f2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit ab0a00dcb90f07b6b115a76b916553eeabb9ee71)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32416: Update attribute number for arp search to 9015
Nick Clemens [Wed, 7 Dec 2022 12:56:02 +0000 (12:56 +0000)]
Bug 32416: Update attribute number for arp search to 9015

Bug 20078 updated the attribute for arp to 2014 to avoid conflict with 9013 not-on-loan-count

Bug 28830 then added Control-number-identifier as 2014, breaking arp again

This patch updates the number to 9015

To test:
1 - Apply first patch
2 - Attempt searching by arp, no results (add a unique 526$d to a record to ease searching)
3 - Apply this patch
4 - Copy bib1.att and ccl.properties to the correct locations
    cp etc/zebradb/biblios/etc/bib1.att /etc/koha/zebradb/biblios/etc/bib1.att
    cp etc/zebradb/ccl.properties /etc/koha/zebradb/ccl.properties
5 - Restart zebra
6 - Rebuild indexes
7 - Search again, success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e6efa820993c0b04fd848caf84658620b7ef337d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 54f0873019d9e0f1db9d750a19ae25e52396aeb0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32393: (QA follow-up) Add explicit undef response in two catch blocks
Marcel de Rooy [Tue, 24 Jan 2023 13:38:41 +0000 (13:38 +0000)]
Bug 32393: (QA follow-up) Add explicit undef response in two catch blocks

Do not implicitly depend on last statement returning nothing.
Make it explicit. We want $args to be null here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 08cc23626c30a61254eddd552f6b23253876d753)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 223583d3b59295259d48417fb00e9b4c4e86294d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32393: Deal with the DB fallback part
Jonathan Druart [Tue, 24 Jan 2023 08:11:25 +0000 (09:11 +0100)]
Bug 32393: Deal with the DB fallback part

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 85c330d8f2ca6246cf3619c8075907cce8387be0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 54e87225eac2c70aa6487b6f614bddc3083a774b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32393: Split into 2 try catch blocks
Jonathan Druart [Wed, 11 Jan 2023 11:36:42 +0000 (12:36 +0100)]
Bug 32393: Split into 2 try catch blocks

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8df96262c145fc0ee26c019601b6a86de9396915)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 5fc37e57062fb16bd65e682bbca853151382834b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32393: Prevent invalid job to block the job queue
Jonathan Druart [Fri, 2 Dec 2022 13:23:38 +0000 (14:23 +0100)]
Bug 32393: Prevent invalid job to block the job queue

I have faced a problem when testing an incorrect version of bug 32370.
The frame sent to the message broker was not a correct JSON encoded
string, and its decoding was obviously failing, exploding the worker
script.
Additionally, as we don't send a ack for this frame, the next pull will
result in processing the same message, and so in the same explosion.
No more messages can be processed!

This patch is logging the error and ack the message to the broker, in
order to not get stuck.

Test plan:
0. Dont' apply this patch
1. Enqueue a bad message
  a. Apply 32370
  b. Comment the following line in Koha::BackgroundJob::enqueue
    $self->set_encoded_json_field( { data => $job_args,    field => 'data' } );
  c. restart_all
  d. Use the batch item modification tool to enqueue a new job
=> Notice the error in the log
=> Note that the status of the job is "new"
=> Inspect rabbitmq queue:
% rabbitmq-plugins enable rabbitmq_management
% rabbitmqadmin get queue=koha_kohadev-long_tasks
You will notice there is a message in the "long_tasks" queue
2. Enqueue a good message
  a. Remove the change from 1.b
  b. restart_all
  c. Enqueue another job
=> Same error in the log
=> Both jobs are new
=> Inspect rabbitmq, there are 2 messages
3. Apply this patch
4. restart_all
=> Second (good) job is finished
=> rabbitmq long_tasks queue is empty

We cannot mark the first job as done, we have no idea which job it was!

QA: Note that this patch is dealing with another problem, not tested in
this test plan. If an exception is not correctly caught by the ->process
method of the job, we won't crash the worker. The job will be marked as
failed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca9a5981839a444fce109540035f26cac2780611)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32394: [22.05.x] Add tests
Jonathan Druart [Wed, 14 Dec 2022 08:01:33 +0000 (09:01 +0100)]
Bug 32394: [22.05.x] Add tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32394: [22.05.x] Restore long tasks queue
Jonathan Druart [Fri, 2 Dec 2022 13:43:27 +0000 (14:43 +0100)]
Bug 32394: [22.05.x] Restore long tasks queue

We are sending "queue" as parameter, but "job_queue" is retrieved in
Koha::BackgroundJob->enqueue...

Test plan:
Read code and confirm the above.
More fun for test plan will be found on bug 32393

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32394: [22.05.x] Regression tests
Tomas Cohen Arazi [Wed, 14 Dec 2022 17:30:18 +0000 (14:30 -0300)]
Bug 32394: [22.05.x] Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32561: Prevent worker to run with unecessary modules in memory
Jonathan Druart [Wed, 4 Jan 2023 09:08:06 +0000 (10:08 +0100)]
Bug 32561: Prevent worker to run with unecessary modules in memory

Regression of bug 28413, bug 30410 added a "use Koha::Plugins" statement at the top of Koha::BackgroundJob, and so all Koha module are loaded by the worker on startup.

See bug 28413 for more info

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a85a6bc4d4a1c15a065dc8b188d6de0c23f99271)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 16ecdc2f8edfcdc77214751caa049e46b237184c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32321: Pre-populate material type for 006 in advanced cataloging editor
Nick Clemens [Tue, 22 Nov 2022 14:05:08 +0000 (14:05 +0000)]
Bug 32321: Pre-populate material type for 006 in advanced cataloging editor

To test"
1 - Edit a record in advanced cataloging editor with field helpers enabled
2 - Choose a material type, not BKS, from dropdown
3 - Set the first position to something
4 - Save the record
5 - 006 shows 'BKS'
6 - Apply patch
7 - Reload
8 - Record should show correct value
9 - Edit 006 and confirm the first position correctly determines material type

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7818717f3c69bcaf5953d6139f6a104dfb1c4ee7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 8a28f6e2595997604e11355b49bffb5b90979113)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32692: Terminology - use staff interface for MARC framework subfield editor
David Nind [Fri, 20 Jan 2023 18:42:01 +0000 (18:42 +0000)]
Bug 32692: Terminology - use staff interface for MARC framework subfield editor

For the visibility options in the advanced constraints section of the
MARC framework subfield editor, use 'Staff interface' instead
of 'Intranet'.

This makes it consistent with the terminology list (see
https://wiki.koha-community.org/wiki/Terminology#I).

Test plan:
1. Go to Administration > Catalog > MARC bibliographic framework.
2. Select Actions > MARC structure for any framework.
3. For any tag select Actions > Edit subfields.
4. Note that in the advanced constraints section for the visibility
   field that 'Intranet' is used as an option.
5. Apply the patch.
6. Refresh the page and note that 'Staff interface' is now used, which
   is consistent with the terminology list (see
   https://wiki.koha-community.org/wiki/Terminology#I).
7. Sign off D:

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Amaury GAU <amaury.gau@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ab48b53d96bd33a37181b13bbb517500eae61fc2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 2dbd065065feff6a3d59c84c2f1cd742f31a3da3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32573: Send ACK message to RabbitMQ before handling the job
Kyle Hall [Thu, 5 Jan 2023 16:35:42 +0000 (11:35 -0500)]
Bug 32573: Send ACK message to RabbitMQ before handling the job

Splitting off this functionality from bug 32558. This is the comment that started this discussion: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32558#c15

From the O'Reilly book Mobile and Web Messaging:

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3c5bd02e15e5f2e5c0eae3b06f26083b4856f3d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 0f7b8008f7f1158f9b5aff9fa8c5b58cff28f000)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31893: Use checkauth and do not fetch about.tt template
Nick Clemens [Fri, 13 Jan 2023 17:29:22 +0000 (17:29 +0000)]
Bug 31893: Use checkauth and do not fetch about.tt template

This patch updates four scripts to use checkauth instead of get_template_and_user

reserve/modrequest.pl
reserve/modrequest_suspendall.pl
course_reserves/mod_course.pl
members/members-update-do.pl

No behvaiour change is expected

To test:
0 - Apply patch
1 - Place some holds for a patron
2 - From patron page, confirm you can suspend all
3 - confirm you can delete marked holds
4 - Edit a course in course-reserves
5 - Make a chaneg to personal details via OPAC
6 - Confirm change can be approved on staff side

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fc650b3e871e1d558ca1ff9f0dcb2f1fa0ad5db2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit c1a5442a2286afbcd1bb6a429adab6f5a009ca07)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32221: Borrowers.password should no longer be an option
Matt Blenkinsop [Mon, 28 Nov 2022 14:35:37 +0000 (14:35 +0000)]
Bug 32221: Borrowers.password should no longer be an option

When creating a notice template the user has the option to add the borrower's
password to the template. This should be removed as the password should not be
an option to be added to a notice.

Test plan:
1) Navigate to Tools > Notices and slips
2) Either create a new notice or edit an existing notice
3) Observe that in the list of fields available to insert into the message body,
   there is the option for "borrowers.password"
4) Apply patch
5) Navigate to the same menu
6) Observe that the "borrowers.password" option is now no longer visible

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9608b16a6ba9d877dddc75beb1e1eef691f7b21a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 7a143c19ad570adf8ab6cdf6f65a5456f7357ad3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32656: Script delete_records_via_leader.pl no longer deletes items
Kyle Hall [Tue, 17 Jan 2023 17:18:00 +0000 (12:18 -0500)]
Bug 32656: Script delete_records_via_leader.pl no longer deletes items

Bug 29788 inadvertantly replaced a call to safe_delete() with safe_to_delete()
such that any time the script should delete an item it only checks to see if
the item is delectable, after which deletion of the record fails because the
items were not deleted.

Test Plan:
1) Mark a record with items to be deleted via the record leader
2) Run delete_records_via_leader.pl -i -b -v
3) Note the script says it is deleting the items but then the record
   deletion fails. Note the items remain in the items table of the
   database.
4) Apply this patch
5) Repeat step 2
6) This time the items and record should be deleted!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 790f00781ab6c98017529ebf226d52c36c36cd68)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 03a9b139587aea26a9abde4f45a7c4f99532353c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoUpdate release notes for 22.05.09 release v22.05.09
Lucas Gass [Wed, 25 Jan 2023 21:46:44 +0000 (21:46 +0000)]
Update release notes for 22.05.09 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoIncrement version for 22.05.09 release
Lucas Gass [Wed, 25 Jan 2023 21:36:13 +0000 (21:36 +0000)]
Increment version for 22.05.09 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoTranslation updates for Koha 22.05.09
Koha translators [Wed, 25 Jan 2023 20:58:40 +0000 (17:58 -0300)]
Translation updates for Koha 22.05.09

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 22042: [22.05.x] Block all return actions when BlockReturnOfWithdrawn items is...
Nick Clemens [Fri, 8 Apr 2022 18:52:09 +0000 (18:52 +0000)]
Bug 22042: [22.05.x] Block all return actions when BlockReturnOfWithdrawn items is set to block

Currently this syspref only bokcs the literal 'return' from a patron, i.e. the checkin

It still processes transfers, refunds lost items, updates NotForLoan status etc.

We should block all of these things

To test:
1 - Set BlockReturnOfWithdrawn to block
2 - Set an item as lost and withdrawn
3 - Check it in
4 - Item is found
5 - Apply patch
6 - Repeat 1-3
7 - Checkin is blocked, item still lost

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32597: Fix table display of OPAC article requests
Lucas Gass [Mon, 9 Jan 2023 18:12:33 +0000 (18:12 +0000)]
Bug 32597: Fix table display of OPAC article requests

To test:
1. Enable ArticleRequests
2. Make some requests (two or more) on the OPAC and go to the user
   summary.
3. The table rows display horizontally.
4. Apply patch
5. Try step 2 again, the table should display correctly.

Note: I made some whitespace changes to make the markup look correct.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2ad22b26af3a32bf249395831c23d1e87e5db145)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 458d91fcf207df7e6f98b65af257365d0eb5c87b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32465: Add 'queue' to koha-worker help documentation
Nick Clemens [Wed, 14 Dec 2022 15:44:28 +0000 (15:44 +0000)]
Bug 32465: Add 'queue' to koha-worker help documentation

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 486d78f544f1fe074d4f474206155c4bcb02ea2a)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 8d0443f44a1d22afb3ba5fb70a417727029a5713)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32596: Filter jobs by enqueued on, not started on
Nick Clemens [Mon, 9 Jan 2023 14:09:29 +0000 (14:09 +0000)]
Bug 32596: Filter jobs by enqueued on, not started on

To test:
1 - Do a bunch of stuff in the staff interface the will generate background jobs
2 - Wait a bit to make sure all the jobs are done
3 - Visit Admin->Jobs
4 - Note there is nothing shown
5 - uncheck 'Current jobs only' and 'Only include jobs started in the last hour'
6 - Note that nothing is shown, but header says '(filtered from X jobs)'
7 - Apply patch
8 - Reload table
9 - Confirm you can see the finished jobs now

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b1488f251eedbeafc6c7eb817984a0ce523b6ad)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit b7ecfa0138d08e19c1aaf0a807ffdd42720944f4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32491: Split patron search terms on comma
Jonathan Druart [Thu, 5 Jan 2023 08:23:45 +0000 (09:23 +0100)]
Bug 32491: Split patron search terms on comma

Previous behaviour allowed search 'surname, firstname'. We should remove
the comma from the search terms.

Test plan:
On the main patron search, search for "surname, firstname" and confirm
that with this patch applied the search returns the expected results.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3333da49675daca9fc9d2147d31a446d20ac8ef)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit dfbc6afe1b18403bf69d05cd154dec616ad96798)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32481: Limit prefetch size for background jobs worker
David Cook [Thu, 22 Dec 2022 22:17:04 +0000 (22:17 +0000)]
Bug 32481: Limit prefetch size for background jobs worker

This patch adds a prefetch size of 1 to the background jobs worker,
so that it fetches 1 message at a time. Without this change,
the RabbitMQ connection timeout when too many messages for slow tasks
are fetched at the same time.

To test:
0. Apply patch
1. Run background worker
2. Rapidly enqueue multiple jobs that in total will take longer
than 30 minutes to process

Bug 32481: Use correct prefetch syntax for RabbitMQ

According to https://www.rabbitmq.com/stomp.html the header to
use for managing the prefetch is "prefetch-count".

You can verify the number of delivered and unacknowledged messages
on a channel on a connection by running "rabbitmqctl list_channels"
on the RabbitMQ host. This will tell you how many messages have been
delivered and are awaiting acknowledgement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cd89c383219eb9355b225b51219007a08b5e339e)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 6238ce057e2b2784d6c4a178728cb92d515ac454)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32349: Remove find-nonutf8 tests
Jonathan Druart [Wed, 4 Jan 2023 14:33:41 +0000 (15:33 +0100)]
Bug 32349: Remove find-nonutf8 tests

We don't run it and it does not seem very useful. Let's remove it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 26cce9e1c4e9c0ec6c41ffc60d89b3f75a40d227)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 299a7fdf9c871dbf47041f81548fcab95c14fb5c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32349: Remove TEST_QA
Jonathan Druart [Fri, 25 Nov 2022 08:07:34 +0000 (09:07 +0100)]
Bug 32349: Remove TEST_QA

There is an env var that we are passing from koha-testing-docker, TEST_QA.
It's used in Koha from a single test file, t/00-testcritic.t.
If not set, no test is run.

Do we really need this? libtest-perl-critic-perl is packaged and automatically installed.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0adc264edb3172f7d2dca771efbe19d15f240d8f)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit a375a94225a843fbbeef94a4caf58a1ab09e78b0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32330: DBRev 22.05.08.001
Lucas Gass [Tue, 24 Jan 2023 17:48:42 +0000 (17:48 +0000)]
Bug 32330: DBRev 22.05.08.001

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32330: Add indexes to table background_jobs
Fridolin Somers [Wed, 23 Nov 2022 06:49:02 +0000 (20:49 -1000)]
Bug 32330: Add indexes to table background_jobs

Table background_jobs should have indexes to optimize queries.

Query on borrowernumber :
mainpage.pl:    my $already_ran_jobs = Koha::BackgroundJobs->search(
mainpage.pl-        { borrowernumber => $logged_in_user->borrowernumber } )->count ? 1 : 0;

Query on status and queue :
misc/background_jobs_worker.pl:        my $jobs = Koha::BackgroundJobs->search({ status => 'new', queue => \@queues });

Test plan :
Run updatedatabase and play with background jobs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8755f775990bba513480a3b54372d76395ab2fbe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f2ec246fd6f16224a556e073e28479ca5104949e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32505: Restore patron search by formatted dob
Jonathan Druart [Mon, 2 Jan 2023 16:12:40 +0000 (17:12 +0100)]
Bug 32505: Restore patron search by formatted dob

Prior to the rewrite of the patron searches (bug 30063 and friends) it
was possible to search for a patron using their date of birth, formatted
following the dateformat syspref.

Now it only works if the date is iso formatted.

This patch is providing a fix to restore the behaviour, but does not
make it consistent. Only searching patrons by date of birth is fixed
here, when we actually want to fix the problem for the REST API DT
wrapper instead.

Test plan:
Search for patrons given their date of birth. You need to select "date
of birth" in the "Search field" dropdown, or set it in
DefaultPatronSearchFields.

Note that the column filtering is still not working, but I guess it was
the case already in older versions. Ideally we will need to have a
"datatype" attribute passed to the the 'th' and retrieved from
datatables.js to add this same trick and build the query appropriately.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit aa1f97c2ea4376f5c3232846038c224c927dddc8)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 6e7f7c926f991c641e034f19cd493830c46fd95f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31492: Set CSRF token in circulation.pl
Lucas Gass [Fri, 13 Jan 2023 19:01:55 +0000 (19:01 +0000)]
Bug 31492: Set CSRF token in circulation.pl

To test:
* Turn on patronimages system preferences
* Go to any patron account
* Hover over the 'dummy image' for the Add button
* Browse and select an image for upload
* Saving results in the following error:

The form submission failed (Wrong CSRF token). Try to come back, refresh the page, then try again.

Apply patch and try again. You shouldn't need to try twice, it should work on the first attempt now.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f0e6f25428a997076d29dd3daeb905befed254f8)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 11d88ba12ff14a41a1d998d0286b258e356dd64a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32255: Resolve "Cannot use file upload in batch record modification"
Géraud Frappier [Thu, 17 Nov 2022 21:11:11 +0000 (16:11 -0500)]
Bug 32255: Resolve "Cannot use file upload in batch record modification"

When using the batch record modification tool with a file of biblionumbers, nothing happens. When we click 'Continue' the file is somehow removed before continuing.

To test:
1. Get a file of biblionumbers (if you already have a file, proceed to step 2)
   1.1. Go to Reports
   1.2. Click on 'Create from SQL'
   1.3. Enter a report name (e.g. biblionumbers)
   1.4. Enter the following SQL query

SELECT biblionumber FROM biblio LIMIT 100

   1.5. Click 'Save report'
   1.6. Click 'Run report'
   1.7. Click 'Download' > 'Tab separated text'

2. Create a MARC modification template (if you already have a MARC modification template, proceed to step 3)
   2.1. Go to Cataloging > MARC modification template
   2.2. Click 'New template'
   2.3. Enter a template name (e.g. Add note)
   2.4. Click 'Submit'
   2.5. Click 'New action'
   2.6. Choose
        - Add new
        - Field 500 a
        - with value Note
   2.7. Click 'Add action'

3. Batch modify records
   3.1. Go to Cataloging > Batch record modification
   3.2. In the 'Upload a file tab', choose the biblionumber file
   --> Note that the name of the file appears next to the Choose button
   3.3. In 'Template', select the MARC modification template
   3.4. Click 'Continue'
   --> The name of the file disappears next to the Choose button and goes back to 'No file chosen'
   --> Message 'No records were modified

4. Apply path
   4.1. Procede step 3.
   4.2. See that we can see the list now

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bc974ef361926209b417502d86dbbacdb371f35a)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit e99f339be5a2b5a192b52a25e4240a8ea605f5d9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32456: Preserve date accessioned if a date is not explicitly passed
Nick Clemens [Tue, 13 Dec 2022 14:24:13 +0000 (14:24 +0000)]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2255d42abdb45955e82634a7b6fe1e1af0242361)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 655cd366e0fdc33512cfc546301854cc67a6a03a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32456: Unit tests
Nick Clemens [Fri, 16 Dec 2022 15:46:48 +0000 (15:46 +0000)]
Bug 32456: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ac6b7f9b5820b2515e1201568ba8648da935af06)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 811f676da0d5ddd500576ad5a5fcbca91c49c03f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32348: Add library public in columns settings
Fridolin Somers [Fri, 25 Nov 2022 07:57:40 +0000 (21:57 -1000)]
Bug 32348: Add library public in columns settings

Bug 27360 added public info on libraries table.
This should be added to columns settings.
Currently the column "STMP server" can not be managed in settings.

Test plan :
Play with columns settings of table Administration > Libraries

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 22865246926bf032cc3aa4a918a68bf467896dd7)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit a7f471c548c2218cffd9c05ccb09fe8f20ce9597)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 30694: Set decreaseloanholds undef when deleting circulation rule
Emmi Takkinen [Tue, 15 Nov 2022 07:31:13 +0000 (09:31 +0200)]
Bug 30694: Set decreaseloanholds undef when deleting circulation rule

When one tries to delete rule with field "Decreased loan period
for high holds" filled, delete fails without errors. This happens
because rule isn't set in code section handling the delete in
smart-rules.pl.

To test:
1. Create a new circulation rule and fill all fields.
2. Try to delete the rule.
=> Rule isn't deleted, all fields except "Decreased loan period
for high holds" are now empty or have value "Unlimited".
3. Modify the rule and set field "Decreased loan period for high
holds" empty.
4. Delete the rule.
=> Rule is deleted successfully.
5. Create a new rule, fill all fields expect field "Decreased loan
period for high holds".
6. Delete the rule.
=> Rule is deleted successfully.
7. Apply this patch.
8. Again create a new rule with field "Decreased loan period for high holds" filled.
9. Try to delete the rule.
=> Rule is deleted successfully.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 91fc31c32ba14817d989bcd34854ebc8e41fa936)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 63fd9be98befc0be358b0074b94253befa929f48)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 20596: (QA follow-up) perltidy
Fridolin Somers [Thu, 15 Dec 2022 06:31:53 +0000 (20:31 -1000)]
Bug 20596: (QA follow-up) perltidy

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa13c1a9d1fe44021f991fc8e78f70e80b2a56ac)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d2ac793be2cd046095213e52073dde1d9f588c60)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 20596: Add unit test for multiple values in authority search
David Cook [Wed, 14 Dec 2022 05:17:02 +0000 (05:17 +0000)]
Bug 20596: Add unit test for multiple values in authority search

This patch adds a unit test which returns 2 authority records
via an implicit OR when searching for strings from two different
authority records.

Test plan:
1. prove t/db_dependent/Search.t

Signed-off-by: Jan Kissig <jan.kissig@th-wildau.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76d676a868be048ec57c8eb178bf813a12823c6e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5921e1c523a9673b8770a9ea2ceb8ec3223ef5de)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 20596: Join authority queries together with OR
David Cook [Wed, 14 Dec 2022 04:58:41 +0000 (04:58 +0000)]
Bug 20596: Join authority queries together with OR

This patch joins authority queries together with OR like Elasticsearch.

To the best of the author's knowledge, this code only gets triggered
when using record matching rules, but there may be other situations
where it's used.

Authority search in cataloguing plugins use a different path, and
authority search in authority home doesn't allow multiple queries,
so they'll never trigger this OR joining of queries.

Test plan:
0. Apply patch and koha-plack --restart kohadev
1. Create a record matching rule with the following:
Matching rule code: NID
Description: NormdatenID
Match threshold: 100
Record type: Authority record
Search index: Any
Score: 101
Tag: 035
Subfields: a
Offset: 0
Length: 0
Normalization rule: None

Click "Remove this match check"

2. Stage gnd.xml (from BZ 20596 attachments)
- Choose "MARCXML" for "Format"
- Choose "Authority" for "Record type"
- Choose "NID" for "Record matching rule"
- Click "Stage for import"
3. Note the job gets to "100% Finished"
(Before this patch, it would say "0% Failed")

4. View the batch
5. Import the record
6. Repeat steps 2-4 and note that the record matching rule
worked

7. Go to http://localhost:8081/cgi-bin/koha/authorities/authorities-home.pl
8. Search for "e"
9. Note that the search works

10. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=
11. Click tab 6
12. Click on the tag editor next to "a Personal Name"
13. Type "e" into each box and click "Search"
14. Note that the search works

Signed-off-by: Jan Kissig <jan.kissig@th-wildau.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b2a23149bdfdd27b1ccf5ec2106e92da4dbe05a4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9a319b8169170d4ffa1cd4e3ad9b963fc3531fac)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32247: Exit holds queue builder if there are no holds on the biblio
Nick Clemens [Thu, 17 Nov 2022 13:38:58 +0000 (13:38 +0000)]
Bug 32247: Exit holds queue builder if there are no holds on the biblio

update_queue_for_biblio currently
1 - gets the holds on a bib
2 - gets the items available to fill any holds
3 - combines these to build the queue, exiting if there are no holds or items

If there are no holds at step 1, we don't need to do step 2 or 3
This patch simply deletes the queue for this biblio, then exits if there are no holds

To test:
prove -v t/db_dependent/Reserves.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Hold.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteItem.t t/db_dependent/Koha/BackgroundJobs/BatchDeleteBiblio.t t/db_dependent/HoldsQueue.t t/db_dependent/Circulation_holdsqueue.t t/db_dependent/Biblio_holdsqueue.t t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7502f520a4fbb71fc63e76307d1ad67f059dd213)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d71eceba98866a99a6860f65fcd90ae6c23207cf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32457: Fix CGI vulnerability in addorder.pl
Marcel de Rooy [Tue, 13 Dec 2022 14:31:10 +0000 (14:31 +0000)]
Bug 32457: Fix CGI vulnerability in addorder.pl

Test plan:
Go to acqui/addorder.pl.
Create two items.
Check if results still match your expectations.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b389f9a361cf16c11f3678b8e42aa6eb1e91a930)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 427d0b32e9aefa812ac97497b79cbe511fbbca05)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32115: Add ID to check-out default help message dialog to allow customization
Mona Panchaud [Sat, 5 Nov 2022 18:25:43 +0000 (19:25 +0100)]
Bug 32115: Add ID to check-out default help message dialog to allow customization

This adds a div with the id attribute selfcheckdefaulthelpmessage to
the first paragraph of the web based self check help page.

To test:
* Enable WebBasedSelfCheck
* Go to: /cgi-bin/koha/sco/sco-main.pl in the OPAC
* Log in and open help
* Verify by looking at the source code, that the first paragraph
  starting with "If this is your first time..." now has an id.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 46cad29c5a57546b594182bd2f86ad50d021b614)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c47336e24c9268b1fbea34d0e3770a07634eb6d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31166: Digest option is not selectable for phone when PhoneNotification is enabled
Kyle Hall [Fri, 15 Jul 2022 18:10:37 +0000 (14:10 -0400)]
Bug 31166: Digest option is not selectable for phone when PhoneNotification is enabled

Digests are not available via Talking Tech, but the artificial limit should not be in place for the non-TT phone notices. If only phone is selected, digest remains disabled.

Test Plan:
1) Apply this patch
2) Enable TalkingTechPhoneNotification
3) Verify behavior hasn't changed
4) Disable TalkingTechPhoneNotification, Enable PhoneNotification
5) Note disgest option is now selectable if only phone is selected

Signed-off-by: Evelyn Hartline <evelyn@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 31166: (QA follow-up) Remove debugging lines

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 31166: (QA follow-up) Implement on OPAC side

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Squashed by RM
(cherry picked from commit 0622e118dbdd1687127c0734386e07ca268fd90d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 79320274961c3f9a59eb7815eca8de66302ffef9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32302: (follow-up) Hide ISBN label when list sent from the staff interface
David Nind [Wed, 30 Nov 2022 23:48:25 +0000 (23:48 +0000)]
Bug 32302: (follow-up) Hide ISBN label when list sent from the staff interface

This makes the same change to the staff interface. Lists sent
from the staff interface hide the ISBN label in the email message
when there are no ISBNs for a record.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 69ddb83f41cfc5c9eb6b4e483bca9316bac98db8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3d2cc5f116cbc8a2a4b00e44d1c59929a39b909a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32302: Hide "ISBN" label when no ISBN data when sending list
David Cook [Wed, 30 Nov 2022 22:52:55 +0000 (09:52 +1100)]
Bug 32302: Hide "ISBN" label when no ISBN data when sending list

There is a logic mistake in the opac-sendshelf.tt template where
we test if the "ISBN" key exists in the "BIBLIO_RESULT" hash when
we should really be testing if the arrayref returned by "ISBN" is
empty or not, since that "ISBN" key always exists and contains at least
an empty arrayref.

Test plan:
1. Apply patch and restart your Koha Starman
2. Create a public list containing records with 020 MARC fields and
records without 020 MARC fields
3. View the list in the OPAC
4. Click "Send list" and email it to yourself
5. Note that only records with 020 MARC fields with show "ISBN:"
in the email output

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 44366c09858364ac56fd37b5434bc77e7e48fe94)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 45a53a3d5e12ac9fb2ce016a90cd80895763298b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32355: Add css class url to URL syspref
Didier Gautheron [Mon, 28 Nov 2022 07:29:47 +0000 (08:29 +0100)]
Bug 32355: Add css class url to URL syspref

Add missing css class to URL syspref.

To Test:
1 - open admin/preferences.pl
2 - Search for URL
3 - casServerUrl, UsageStatsLibraryUrl, KohaManualBaseURL,
    PrivacyPolicyURL, LibrisURL input field size are small.
4 - Apply patch
5 - all URL fields have the same bigger size.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit af794a6cfa85d8f3160ddb4c4f626e85063a844c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5bd6dfcc59e5daaf43735f8b3f611bd18a90bd23)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 28975: (QA follow-up) Fix indentation, simplify if statement
Kyle Hall [Fri, 2 Dec 2022 14:18:08 +0000 (09:18 -0500)]
Bug 28975: (QA follow-up) Fix indentation, simplify if statement

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72c10b222743247c881b1bb07fdc18d1ae6c715a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 91830a27e2b93030865fe1edec79003274f8e6f7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32389: Fix Syndetics link on staff results page
Lucas Gass [Thu, 1 Dec 2022 17:40:30 +0000 (17:40 +0000)]
Bug 32389: Fix Syndetics link on staff results page

To test:
1. Have SyndeticsCoverImages on and Syndetics setup.
2. Do a search that will return some results with Syndetics images
3. Click on the image link and you will get a 404
4. Apply patch
5. Link works!

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>
(cherry picked from commit 2fec6d32b8de403b66b0c06b331528c6946025ed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 852b0060cc84bccd0bd0517959fba78f66040429)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 28975: Holds queue lists can show holds from all libraries even with IndependentB...
The Minh Luong [Tue, 25 Jan 2022 17:20:38 +0000 (12:20 -0500)]
Bug 28975: Holds queue lists can show holds from all libraries even with IndependentBranches

When using IndependentBranches, usually all branches are removed from the drop-down menus. But in the Holds Queue page, there is the possibility to choose "All branches". From there, you can see holds from all libraries.

To recreate :
1) Activate IndependentBranches, IndependentBranchesPatronModifications and IndependentBranchesTransfers
2) Create a staff user with limited permissions (NOT a superlibrarian), including holds permissions. Here are mine as an example
  - circulate (all)
  - catalogue
  - borrowers
    - delete_borrowers
    - edit_borrowers
  - reserveforothers (all)
  - reports (all)
3) Create (or make sure you already have) a patron in another branch (we'll call them patron X)
4) Place a hold for patron X on an available item from their own library
5) Run misc/cronjobs/holds/build_holds_queue.pl
6) Go to Circulation > Holds queue and make sure you can see the hold
7) Log in as your limited staff patron
8) Go to Circulation > Holds queue
9) In the drop-down menu, choose "All" and click Submit
-- Notice you see the hold of the patron from another branch under Patron
column: "A patron from library <library name>"
11) Apply the patch.
12) Notice that the "All" option is no longer available for the limited patron. Limited patrons can't see holds from other libraries anymore.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fe2e2f9400714341877958853e8165db517fe1fa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 6d2756b7d7f0203d9ab0a7f5900da0b19954a17b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32291: (bug 16735 follow-up) Remove ref to library category in branches.tt
Jonathan Druart [Wed, 23 Nov 2022 09:08:26 +0000 (10:08 +0100)]
Bug 32291: (bug 16735 follow-up) Remove ref to library category in branches.tt

On bug 16735 we rewrite the library groups system. Those references in
branches.tt were part of the previous code, and they can be removed.

Test plan:
Confirm the above and that those code errors are never sent to the
template.

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>
(cherry picked from commit 4f8b742cbe0c41a389290a821c0ca478bb108e26)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit e1114304618f88a40a6454be1df75bf8199141cc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31675: Remove packages from debian/control that are no longer used
Kyle M Hall [Tue, 21 Sep 2021 11:08:44 +0000 (07:08 -0400)]
Bug 31675: Remove packages from debian/control that are no longer used

As far as I can tell, we are no longer using CGI::Session::Serialize::YAML or YAML::Syck, but they are still marked dependencies for the Debian package.

Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 56ecfc55fc9850cd3bbfbae0e850f864c5a78fe3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32037: Check for existence of object before building link
Nick Clemens [Fri, 28 Oct 2022 14:43:10 +0000 (14:43 +0000)]
Bug 32037: Check for existence of object before building link

This patch adds a check on the existence of the object and passes this to the template

I also drop a level of IF by moving to ELSIF

To test:
 1 - Enable ReturnLog amd IssueLog
 2 - Checkout an item to a patron
 3 - Return it
 4 - View 'Modification log' tab of the borrwer
 5 - Note item links, test them, they work
 6 - Delete the item
 7 - Reload and try links again, they do not work
 8 - Apply patch
 9 - Reload, no more links
10 - Checkout and return another item
11 - This one has links, and they work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 03c8725b4e253faf87ca3aeda71ce8b59d4efdb0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31881: Fix search link in MARC view
Fridolin Somers [Thu, 20 Oct 2022 00:18:20 +0000 (14:18 -1000)]
Bug 31881: Fix search link in MARC view

In framework a subfield can be defined with a link (with a search field).
This create an hyperlink in MARC view.
Currently with Elasticsearch the link does not work because search query contains 'field,phr:',
which is useless since the link contains 'idx=field,phr'.
With Zebra looks like the idx param is ignored.

Test plan :
1) Use Elasticsearch search engine
2) Edit subfield 245$a in default framework
3) Enter 'title' in 'Link'
4) Save
5) Create a record with default framework with 245$a = 'The Fifth Elephant'
6) Go to MARC view
7) Click on link in 245$a
8) You find the record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 535936ea9c23ad022972150fc0f396b450d3cd2f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32016: Remove debug console.log
Thibaud Guillot [Mon, 7 Nov 2022 08:56:38 +0000 (09:56 +0100)]
Bug 32016: Remove debug console.log

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc90a41699060e56ce3ac920d02e8f5f2004ef8c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32016: Fix clear filter button behavior
Thibaud Guillot [Thu, 27 Oct 2022 12:15:19 +0000 (14:15 +0200)]
Bug 32016: Fix clear filter button behavior

For example, if you filter by global search input a datatable which saves its previous state when you want to return to this datatable, the backup is recovered in a cookie but the "clear filter" button is disabled because for it the input is empty, the verification of the recovery of the cookie not being made.

When loading I therefore added the verification of the cookie and if the search value is not empty then the button can be activated.

Test plan:

1) Be sure to have some orders and baskets which can be received
2) Go to 'cgi-bin/koha/acqui/booksellers.pl' and click on 'Receive
shipments'
3) Enter something in global search
4) Go to receive and cancel or save to be back on datatable
5) See that you cannot remove your previous input by the 'clear filter'
button
6) Apply this patch
7) Repeat steps 3) and 4)
8) See that now you can remove your search

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=31881
(cherry picked from commit a054207896610e02ab26a2c6447509d64685094a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 32622: Fix Auth.t on D10
Jonathan Druart [Fri, 13 Jan 2023 11:15:15 +0000 (12:15 +0100)]
Bug 32622: Fix Auth.t on D10

It's caused by a version mismatch of Test::MockModule with D10,
which does not have this commit: https://github.com/geofffranks/test-mockmodule/commit/fef9e742e45e2437e3449eea9970d70555d44bff

We should remove the chaining here.

Test plan:
Confirm that Auth.t still pass, and is fixed on D10

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d3b4edf009ca7a29341f2dc8a8cebfdc807bad6d)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit b36b7d57519a3d471292e47551ace1aef59d7de6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
17 months agoBug 31873: Check ->find before calling ->safe_delete
Marcel de Rooy [Wed, 19 Oct 2022 13:48:18 +0000 (13:48 +0000)]
Bug 31873: Check ->find before calling ->safe_delete

When there is no item, you cannot safely delete it :)

Resolve this warning:
  Can't call method "safe_delete" on an undefined value at /usr/share/koha/cataloguing/additem.pl line 379
(Line numbers may vary across versions.)

Test plan:
Open item editor.
Add a new item.
Add another tab with same form. Delete new item.
Go back to former tab. Try to delete again.
You should see an alert now on top of the form.

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>
(cherry picked from commit 7d8a35585b4d2047e404fb4a1ce19596737d68ab)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoUpdate release notes for 22.05.08 release v22.05.08
Lucas Gass [Thu, 22 Dec 2022 18:17:09 +0000 (18:17 +0000)]
Update release notes for 22.05.08 release

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoIncrement version for the 22.05.08 release
Lucas Gass [Thu, 22 Dec 2022 17:18:30 +0000 (17:18 +0000)]
Increment version for the 22.05.08 release

18 months agoMerge remote-tracking branch 'translations/22.05.08-translate-20221222' into security...
Lucas Gass [Thu, 22 Dec 2022 17:15:15 +0000 (17:15 +0000)]
Merge remote-tracking branch 'translations/22.05.08-translate-20221222' into security/22.05.x-security

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoTranslation updates for Koha 22.05.08
Koha translators [Thu, 22 Dec 2022 17:11:49 +0000 (14:11 -0300)]
Translation updates for Koha 22.05.08

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 32208: Adjust Auth.pm for relogin without perms
Marcel de Rooy [Tue, 15 Nov 2022 13:55:18 +0000 (13:55 +0000)]
Bug 32208: Adjust Auth.pm for relogin without perms

If a second login on top of a current session fails on
permissions, we should not grant access without context.

Test plan:
[1] Run t/db../Auth.t, it should pass now.
[2] Test interface with/without this patch:
    Pick two users: A has perms, B has not.
    Put two staff login forms in two tabs.
    Login as A in tab1. Login as B in tab2.
    Without this patch, B gets in and crashes.
    With this patch, B does not get in ('no perms').
    Bonus: Go to opac if on same domain. You are still
    logged in as B.

NOTE: I added a FIXME here, since you could argue about filling
the session info or otoh deleting the session. We present an
authorization failure; people may not realize that they are
still logged in (see test plan - bonus).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 32208: Extend Auth.t
Marcel de Rooy [Tue, 15 Nov 2022 13:53:17 +0000 (13:53 +0000)]
Bug 32208: Extend Auth.t

Test plan:
Without follow-up patch, Auth.t should fail:
    not ok 5 - No permission response
    not ok 6 - checkauth returned failure

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 31908: Add selenium tests
Jonathan Druart [Fri, 11 Nov 2022 12:08:53 +0000 (13:08 +0100)]
Bug 31908: Add selenium tests

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 31908: Resolve second login with another userid
Marcel de Rooy [Tue, 8 Nov 2022 13:40:17 +0000 (13:40 +0000)]
Bug 31908: Resolve second login with another userid

Somewhere the line undef $userid got removed.
We need it to resolve the second login situation.

Test plan:
Login in staff with user missing privileges.
On the login form login again with another staff user.
Note that you do no longer crash.

Run t/db../Auth.t
Run t/db../Koha/Auth/TwoFactorAuth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 31908: Add a test to show issue
Marcel de Rooy [Mon, 14 Nov 2022 11:07:09 +0000 (11:07 +0000)]
Bug 31908: Add a test to show issue

Test plan:
Without next patch, run Auth.t.
Should fail now before next patch resolves problem:
    not ok 2 - Login of patron2 approved
    ok 3 - Did not return previous session ID
    not ok 4 - New session ID not empty

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 31908: Replace an exit by a safe_exit in Auth.pm L1314
Marcel de Rooy [Mon, 14 Nov 2022 11:09:43 +0000 (11:09 +0000)]
Bug 31908: Replace an exit by a safe_exit in Auth.pm L1314

No change in user experience. But since we can mock safe_exit,
we can enhance test results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 27265: (QA follow-up) Typo on L99 cron script
Marcel de Rooy [Mon, 17 Oct 2022 13:08:33 +0000 (13:08 +0000)]
Bug 27265: (QA follow-up) Typo on L99 cron script

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ae986b992dfc2299ec58f4d1c0079fbac1ec4a03)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 27265: (follow-up) Use existing parameter
Nick Clemens [Fri, 30 Sep 2022 12:32:25 +0000 (12:32 +0000)]
Bug 27265: (follow-up) Use existing parameter

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a39ecfd7f766be77d92d0054364ecda65942d2ec)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 27265: Enable message queue cron to accept multiple codes and types
Kyle M Hall [Fri, 18 Dec 2020 13:45:06 +0000 (08:45 -0500)]
Bug 27265: Enable message queue cron to accept multiple codes and types

It would be nice to be able to combine several types in a single run,
but exclude others, without having to have multiple cron lines

Test Plan:
1) Apply this patch
2) Run process_message_queue.pl with a single -c parameter
3) Note behavior is unchanged
4) Run process_message_queue.pl with multiple -c parameters
5) Note all the codes specified are processed
6) Repeat 2-5 with -t for type limits

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit da7bcc2252666e31c64d7edaecc3fc59ead79a0d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 32114: Add missing html_helpers.inc
Owen Leonard [Sat, 5 Nov 2022 16:02:55 +0000 (16:02 +0000)]
Bug 32114: Add missing html_helpers.inc

This patch makes a minor modification to the OPAC
search results RSS template so that an error isn't
triggered. The html_helpers include was missing.

To test, apply the patch and perform a catalog
search in the OPAC which will return results.

At the end of the "Your search results" heading
you should see an orange RSS icon. Clicking on it
should take you to an RSS feed instead of an
error page.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2621f28376b0c82205f3faf5e06c1f788e6c9b2a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 32242: [22.05] fix selenium tests for 22.05
Lucas Gass [Wed, 21 Dec 2022 16:41:00 +0000 (16:41 +0000)]
Bug 32242: [22.05] fix selenium tests for 22.05

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 32242: Add selenium tests
Jonathan Druart [Thu, 17 Nov 2022 13:32:49 +0000 (14:32 +0100)]
Bug 32242: Add selenium tests

This is not testing the thing at the correct level, but at least we test
the whole workflow.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a922c8cc968f41f0cbf5f577adef16312474223a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
18 months agoBug 32242: Resolve encoding issue when sending to Net::Stomp
Marcel de Rooy [Thu, 17 Nov 2022 09:29:42 +0000 (09:29 +0000)]
Bug 32242: Resolve encoding issue when sending to Net::Stomp

This is meant as a quick fix. It should be enhanced later on by
letting Net::Stomp do the UTF8 conversion.

Test plan:
Run batch mod items. Add a Unicode char in the notes.
Check if job runs and results are correct.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 022034a1c7b91adac539c7ed16fc7b48d566912e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
19 months agoBug 32012: runreport.pl should use binmode UTF-8
Fridolin Somers [Thu, 27 Oct 2022 09:15:35 +0000 (23:15 -1000)]
Bug 32012: runreport.pl should use binmode UTF-8

Like Bug 26832 added binmode UTF-8 to script misc/search_tools/export_elasticsearch_mappings.pl, this should be added to misc/cronjobs/runreport.pl.

Test plan :
1) Do not apply patch
2) Create a SQL report with :
   SELECT 'accentué',barcode FROM items limit 3
3) Note the id of this report, for example 1
4) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/without.csv
=> You see output with unknown character instead of é :
5) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: iso-8859-1
6) Apply patch
7) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/with.csv
=> You see correct output with é
8) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: utf-8

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>
(cherry picked from commit 9aa21276b21693bdc60547ec532ec0595337df08)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>