Commit graph

45463 commits

Author SHA1 Message Date
f3603ab9dc Bug 29871: Remove marcflavour param in Koha::Biblio->get_marc_notes
Test plan :
Display a biblio record with some MARC notes in details page and basket,
OPAC and staff
Run prove t/db_dependent/Koha/Biblio.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b74ce12b85)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:54:27 +00:00
Florian Bontemps
df5b68916b Bug 30026: Quick fix for SmsAlert Hint
Just modifying the hint provided in patrons' messaging preferences to
allow either + or 00 for international formats.
No test plan needed.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:45:09 +00:00
Florian Bontemps
ca6c8c4dfb Bug 30026: SMSAlert regex fixed for international
When registering a phone number for SMS alerts, the number goes through
a regex filter to make sure the number is valid. One of the formats used
in Europe is 00 AAA XXXXXXXXX (A = country indicator) and it is not
supported.

This patch adjusts the regex to either accept 00 AAA XXXXXXXXX or
+AAAXXXXXXXXX in this case. (Note : +AAA and 00AAA are mutually exclusive).

To test:
1) You need to have installed a SMSAlert plugin. Make sure the
   SMSSendDriver syspref is also set up with your SMS plugin of choice.
2) Pick a patron and edit its profile.
3) In the messaging preferences fieldset, under SMS number, enter any
   number with the format 00 AAA XXXXXXXXX (ie : 00111123456789).
   Try to save the modification : you should have an error message.
4) Try instead a number with the format +AAAXXXXXXXXX (ie :
   111123456789), that one should be accepted.
5) Save your modification then check that the number has been changed.
6) Apply patch.
7) Repeat step 3 to 5.
8) Observe the error is gone.
9) Try it once more with the format +00 AAA XXXXXXXXX (+00111123456789),
   that format should not be accepted: this is intentional.
10) Sign off.

    Thanks-to: Didier Gautheron <didier.gautheron@biblibre.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>
(cherry picked from commit 3dc883a1cc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:44:46 +00:00
2fd707ef98 Bug 30713: Patron entry should limit date of birth selection to dates in the past
This patch adds to the configuration of the date of birth field in the
patron entry form so that the calendar widget prohibits the selection of
a date in the future.

To test, apply the patch and open a patron record for editing. Try to
select a birth date in the future using the calendar widget. You should
be limited to a selection of today or before.

Confirm that clicking the "Yesterday" and "Today" shortcuts in the
calendar widget works correctly.

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 4d16ca1069)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:41:18 +00:00
c520925a31 Bug 30864: Add validation to password_expiry_days
When creating a patron category or editing an existing one, there is no validation for the "Password expiration" field.

If letters or other characters are entered, there is no error message and if not a number whatever is entered is not saved.

To test:
1. Go to Administration > Patrons and circulation > Patron categories.
2. Add a new patron category (or edit an existing category).
3. For the "Password expiration" field, enter letters or characters such as L$%.
=> Note that you are prompted to "Please enter only digits"

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 79396ae625)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:35:48 +00:00
Marion Durand
3202674642 Bug 29260: 210a is reported to Autor (meeting/conference) when upgrading an authority through Z3950
When upgrading an authority with Z39.50, the field 2XX is sent into the
research grid.

The field 210a is sent into the search field "Author
(meeting/conference)". Or a collective authority is more often a
corporation than and meeting so librarian has to copy and paste this
data. (In unimarc field 210a is used both for corporation and meeting.)

This patch makes 210a field be sent into the search field "Author
(corporate)" instead of the "Author (meeting/conference)" one.

1- Find an authority with collectivity type (with a field 210a).
2- Click on "Edit" then on "Edit record"
3- Click on "Replace record via Z39.50/SRU search"
4- See that the field 210 is reported in the search grid in "Author
(meeting/conference)" field
5- Apply the patch
6- Go throug step 1 to 3 again
7- See that the field 210 is now reported in the search grid in "Author
(corporate)" field

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 7306f945ce)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:32:30 +00:00
5b6166ed35 Bug 30778: Remove ModAuthInBatch
1 - git grep ModAuthInBatch
2 - Confirm none of these occurences are calls
3 - Apply patch
4 - git grep ModAuthInBatch
5 - No occurences

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:28:15 +00:00
d9a939c220 Bug 30778: Remove ModBiblioInBatch
To test:
1 - git grep ModBiblioInBatch
2 - Confirm these occurences are not calls
3 - Apply patch
4 - git grep ModBiblioInBatch
5 - No occurences

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 46fabf9bb5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-07-12 15:27:42 +00:00
0c69a97394 Update release notes for 22.05.02 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-29 20:47:56 +00:00
6b5f9752e5 Increment version for the 22.05.02 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-29 20:29:48 +00:00
5cfbd0d600 Update release notes for 22.05.01 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-27 15:35:45 +00:00
ff757ca171 Increment version for the 22.05.01 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-27 14:50:03 +00:00
Koha translators
db2eef25ea Translation updates for Koha 22.05.01
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-27 11:40:28 -03:00
c2cc1adf59 Bug 30971: (follow-up) Fix recall.branchcode occurences
This fixes a couple cases actually.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:51:00 +00:00
ae2d58d6f5 Bug 30971: (follow-up) Fix one more occurence
To test:
1. Run:
   $ git grep 'recall.itemnumber'
=> SUCCESS: No more occurences
2. Run:
   $ git grep 'recall.biblionumber'
=> SUCCESS: No more occurences
3. Run:
   $ git grep 'recall\->biblionumber'
=> SUCCESS: No more occurences
4. Run:
   $ git grep 'recall\->itemnumber'
=> FAIL: One standing occurence
5. Apply this patch
6. Repeat 4
=> SUCCESS: No more occurences
7. 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 9991dc8811)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:48:53 +00:00
6b44a63275 Bug 30971: Recalls log viewer error
This patch addresses the itemnumber and biblionumber attributes for
recalls having been renamed.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:48:32 +00:00
6619a752d9 Bug 29325: [22.05.X] Fix commit_file.pl
This patch fixes the broken commit_file.pl script.

It doesn't deal with commiting the import from the UI.

To test:
1. Pick a file for staging:
   $ kshell
  k$ misc/stage_file.pl --file TestDataImportKoha.mrc
=> SUCCESS: All good
2. Commit!
  k$ misc/commit_file.pl --batch-number 1
=> FAIL: You see
DBIx::Class::Storage::DBI::_exec_txn_begin(): DBI Exception: DBD::mysql::db begin_work failed: Already in a transaction at /kohadevbox/koha/C4/Biblio.pm line 303
3. Apply this patch
4. Repeat 2
=> SUCCESS: Commit succeeds
5. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 29325: (QA follow-up) Remove unexisting parameters of BatchRevertRecords

There is no interval and callback as in BatchCommitRecords.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 29325: Call progress callback one last time to confirm comppletion

Previously after finishing the loop we were still in a transaction that never completed - we should report progress when done
one final time to commit the last records

To test:
1 - Stage a file with > 100 records
2 - Commit file
3 - Confirm batch is imported and no records left as staged

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 29325: Fix import from staff client

same test as before, but via the staff client

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 29325: Handle the transaction in BatchCommitRecords

Requiring the callback to commit was breaking reversion, and likely elsewhere

Let's simplify and say that the routine iteself will handle the txn and commit

TO test:
1 - Stage a file
2 - Import a file
3 - Revert a file
4 - Test staff client and command line

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 29325: (QA follow-up) Tidy up

tools/manage-marc-import.pl: sub commit_batch does no longer need $schema
tools/manage-marc-import.pl: sub revert_batch: calling BatchRevertRecords which has no interval and callback
misc/commit_file.pl: sub print_progress_and_commit does no longer commit, renamed
misc/commit_file.pl: sub print_progress does no longer have a schema parameter
misc/commit_file.pl: sub revert_batch reported deleted items as added

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:39:04 +00:00
73604cdbcc Bug 30234: Fix local cover image display for other holdings
Bug 26145 added the ability to add local cover images to items.
If SeparateHoldings is set, items from other libraries are displayed in
a separate tab, and not considered as visible. We have a JS test to
assume that images not shown are not present, this only apply for the
images for the bibliographic record, as they can come from different
sources.

Test plan:
Turn on LocalCoverImages and SeparateHoldings
Create a record with different items coming from different libraries
Attach images to items and to the biblio
Notice that with this patch you can see the images from the "Other
holdings" tab

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 54734f68f2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:22:05 +00:00
5ea5c72edb Bug 30972: Don't replace biblio's local cover images when uploading an image's image
When attaching a new cover image to an item we should not replace cover
images attached to the bibliographic record if "Replace existing covers"
is ticked.

Test plan:
Attach 1+ image to a bibliographic record
Attach 1 image to an item of this biblio
Attach another image to the item and seect "replace existing covers"
=> Without this patch the images attached to the biblio are removed
=> With this patch applied only the images attached to the image are
removed

Same if you tick the checkbox when attaching an image to the biblio

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:17:41 +00:00
eae8863fcb Bug 30883: Authorities merge is limited to 100 biblio with Elasticsearch
In C4::AuthoritiesMarc::merge, we search all biblio records using an authority with Koha::Authorities->linked_biblionumbers().
This method uses simple_search_compat() with no results limit, even saying in comment :
44d6528b56/Koha/Authorities.pm (L80)

With Zebra searchengin it is correct.

But not with Elasticsearch, there is an hardcoded limit at 100 in case no limit is given :
44d6528b56/Koha/SearchEngine/Elasticsearch/Search.pm (L346)

This means authorities links are wrong after a merge or an edit in case the authority is used in more than 100 biblio records.

:(

I propose to fix by using by default the real server max given by Koha::SearchEngine::Elasticsearch::Search::max_result_window().
This will allow a huge limit nearly impossible to reach.
See Bug 30882 to how increase this limit.

Test plan :
1) Use Elasticsearch search engine
2) Use an authority id=111 linked to 200 biblio records
3) Perform a search 'an:111', you get 200 results
4) Create a new authority id=222 linked to 2 biblio records
5) Perform a search 'an:222', you get 2 results
6) Perform a merge of the two authorties, keeping id=222
7) Perform a search 'an:111'
   without patch you get 100 results
   with patch you get no results
8) Perform a search 'an:222'
   without patch you get 102 results
   with patch you get 202 results

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 48d4b016ab)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 16:03:54 +00:00
7192efd271 Bug 30899: [22.05.x] Follow-up for dbrev 211200041 from bug 30449
Replace DROP CONSTRAINT by DROP FOREIGN KEY in old dbrev, and
submit a new dbrev to fix cases where dbrev went wrong.

Test plan:

NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1.

[1] run updatedatabase; check show create table
[2] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table
[3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table
2022-06-24 15:59:43 +00:00
90bbdfdd4f Bug 30907: Fix incorrect uses of Koha::Recall->item_level_recall
This attribute name was changed to *item_level* but this two remaining
places kept calling it with the old name.

To test, verify things don't explode when looking at checkouts with
recalls and also in the log viewer.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 15:55:36 +00:00
Petro Vashchuk
348fe09847 Bug 30960: Fix JS error message when no pick-up location is selected when placing a hold
It's possible to place item-level hold without selecting a pick-up
location, which causes problems: if the item is then returned,
Koha tells about a hold, but gives error 500.
At patron's hold tab you see the number of holds, but cannot see the
actual holds there. However, if you go to the title in question,
then modify the hold so that it has a pick-up location,
then the hold will work normally again.

This patch fixes already existing but not working JS error message and
ensures that hold cannot be made while pickup location is undefined.

To reproduce:
1. Go to admin page, to the libraries configurations, and disable
pickup location for one of them.
2. Pick any biblio that has items that have that same library as a
default pickup location.
3. When placing the item-level hold, notice that the pickup location
dropdown box is empty by default. Keep it empty, place the hold.
4. Go to the patron's page of the patron who you placed that hold for,
check that it doesn't show the new hold.
5. Apply patch.
6. Repeat steps 2 and 3, it shouldn't let you make the item-level hold
until you select a specific pickup location.

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 505b62b4d2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 15:51:57 +00:00
a2d22ee029 Bug 31005: Don't inlcude attributes only required for other categories
To test:
 1 - Create a new patron attribute - check boxes to make it mandatory and visible etc.
 2 - Limit it to 'Patron' or other category
 3 - Edit a patron not in that category
 4 - Attempt to save
 5 - 500 Error
 6 - Missing mandatory extended attribute (type=MAND)
 7 - Apply patch
 8 - Attempt aedit again
 9 - It succeeds!
10 - Edit a patron in the category with MAND required
11 - on the edit page, right click teh attribute - click 'delete node'
12 - Submit the form
13 - 500 error, but this time that's good, the attribute check works

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 09:46:24 -06:00
2dbf1bf80f Bug 31005: Unit test
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 39c3943076)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 09:46:05 -06:00
5c600f65e8 Bug 30912: Fix db rev 21.12.00.016
This is a mix of Nick's patch and Jonathan's comment on it. I tested it
with KTD using MySQL 8 and it works correctly.

To test:
1. Launch KTD with bells and whistles:
   $ docker compose -f docker-compose.yml \
                    -f docker-compose.mysql8.0.yml \
                    up -d
2. Inside of it, do:
   $ koha-mysql kohadev
   > update systempreferences set value="21.1200015" where variable="version";
   > \q
   $ restart_all
   $ updatedatabase
=> SUCCESS: All good :-D
3. Run:
   $ koha-mysql kohadev
   > update systempreferences set value="21.1200015" where variable="version";
   > ALTER TABLE user_permissions DROP PRIMARY KEY;
   > \q
   $ updatedatabase
=> FAIL: You get:
Upgrade to 21.12.00.016  [12:47:09]: Bug 30060 - Update user_permissions to add primary key and remove null option from code column
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `PRIMARY`' at line 1 at /kohadevbox/koha/C4/Installer.pm line 739
4. Apply this patch
5. Run:
   $ updatedatabase
=> SUCCESS: Update goes well
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d3e6c3c709)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-24 15:37:48 +00:00
37206143b6 Bug 30733: [22.05] Simplify translatable strings
And a few minor fixes when they where causing issues for
translatability.
And rephrased a string about password reset to have it identical to
other strings with the same meaning.

Simplified via wrapping strings with <span> to split to huge
concatenated strings with a lot of %s everywhere.

== Test plan ==
This patch needs mainly proof reading. Still it's possible to do some
basic testing to demonstrate that adding a <span> in an IF doesn't
break anything.
Pick in one of the 110 modified templates a string that you know how to
display. Otherwise:
1. acquisitions => vendor => basket => add to basket =>
   search "from existing record" => add order
2. Cancel the order
3. You see without issue "Bibliographic record will not be deleted"
4. administration => Patron categories
5. Try to delete a used and unused category
6. You see as expected
   Category XXXX is in use. Deletion not possible!
   and
   Confirm deletion of category XXXX

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-17 20:20:57 +00:00
Kevin Carnes
55fc22117f Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cc40bbf195)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-17 20:17:19 +00:00
Kevin Carnes
a07e38eb1b Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch
When viewing the detail page of the first or last record of a result page,
it's not possible to browse to another page when using Elasticsearch.

To test:
1) Search for "*" in the OPAC
2) Click on the last result of the page
3) Observe that you cannot browse to the next page
4) Apply the patch
5) Search for "*" in the OPAC
6) Click on the last result of the page
7) Observe that you can browse to the next page
8) Sign off

Sponsored-by: Lund University Library

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 71f54a7571)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-17 20:16:40 +00:00
4369c228b8 Bug 30726: Fix "yesterday" when limited to past dates
Test plan:
Go to "Patrons with no checkouts" report, /cgi-bin/koha/reports/borrowers_out.pl
Select "Yesterday"
=> it automatically selects the previous day's date and populates the form field

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 637c580663)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-17 20:13:44 +00:00
ffddfb86aa Bug 30746: Fix JS error on opac-memberentry
Empty PatronSelfRegistrationBorrowerMandatoryField and PatronSelfRegistrationBorrowerUnwantedField
Go to opac-memberentry.pl
Notice the JS error
  Uncaught TypeError: j is undefined
Apply this patch
Go to opac-memberentry.pl
=> no JS error
Fill the pref with some values
Go to opac-memberentry.pl
=> Confirm that the fields you marked as mandatory as flagged accordinly
on the UI

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c699f05970)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-17 20:11:05 +00:00
9b2793c8c1 Bug 23659: DBRev 22.05.00.001
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-16 14:36:49 +00:00
dbd807004b Bug 23659: (follow-up) Correct syspref.sql to match atomicupdate
Missed updating this file when I added another option and renamed another

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dd9ca0c44e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-16 14:30:31 +00:00
e46d1dd92a Bug 23659: Add DefaultHoldPickupLocation system preference
On the staff side behaviour differs for default pickup location when placing a hold or
placing an overridden hold. Additionally, the behaviour has changed betwee master and stables

We should provide a consistent default, and allow the library to specify their choice

Note this only affects staff client as there is only a single dropdown on OPAC and it is not
tied to items

To test:
 1 - Apply patch
 2 - Update database
 3 - Find a record with items from various branches, and at least one with a different home/holding branch
 4 - Ensure there is an item that requires override to hold, and  AllowHoldPolicyOverride  is enabled
 4 - Attempt to place hold
 5 - Confirm all dropdowns default to logged in library
 6 - Set DefaultHoldPickupLocation to item's home branch
 7 - Refresh and confirm all dropdowns match item home library except biblio level hold - still logged in library
 8 - Set DefaultHoldPickupLocation to item's holding branch
 9 - Refresh and confirm defaults
10 - Mark one of the items holding library as 'not a pickup location' in Admin->Libraries
11 - Refresh and confirm dropdown is now empty for that item

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a25b4d78d0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-16 14:30:15 +00:00
5cf20b6ad1 Bug 30893: Fix documentation in update_patrons_category.pl
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 f279cdd30f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:26:59 +00:00
eae79e1bd3 Bug 30868: (bug 29684 follow-up) Fix borrowernumber var in template
borrower_data does not contain the borrowernumber, it is sent
separately.

Test plan:
1. Edit a patron record (for example: Henry Acevedo).
2. Note that the URL is http://127.0.0.1:8081/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=19
3. Change date of birth to yesterday.
4. Save.
5. Error message displayed above the Save and Cancel buttons:
   The following fields are wrong. Please fix them.
   - Patron's age is incorrect for their category. Ages allowed are 18-999.
6. Note that the URL is now http://127.0.0.1:8081/cgi-bin/koha/members/memberentry.pl
7. Fix date of birth (for example: change year to 2000).
8. Select Save.
=> Without this patch you get: "Patron not found. Return to search."
=> With this patch applied the patron's data is saved

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 9f1cfa0bd3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:23:17 +00:00
Slava Shishkin
6aa9f6dd50 Bug 30884: Fix jQuery selector to correctly detect active tab
To reproduce:
1. Go to /tools/modborrowers.pl and fill form Card number list with data and click Continue.
2. It should give "No patron card numbers or borrowernumbers given." warning.
3. Using the browser inspector tool see that post fields cardnumberlist or borrowernumberlist
   is sent with empty data.

Apply the patch, and then:
1. Fill form Card number or Borrowernumber list and click Continue.
2. Get the result: table with patrons for editing or warning about not found number.
3. Using the inspector tool see that request has data from the active tab in the form.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0062c67d6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:19:35 +00:00
Aleisha Amohia
8bcba5be88 Bug 30886: Show pending recall on item on OPAC
The 'completed' flag was causing the wrong status to be shown, but we
can also give a more useful message to the patron.

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.
5) Go back to the staff client and check the item in. Confirm the recall
as waiting for Patron A.
6) Go back to the OPAC record page and look at the holdings table.
Notice the status still says the item is Available.
7) Apply patch, restart services, refresh the OPAC.
8) Confirm the holdings table status now says the item has a pending
recall.

Sponsored-by: Catalyst IT

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 8f09ef75c3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:12:51 +00:00
Aleisha Amohia
38396f9dc3 Bug 30885: Display recall data correctly
This page does not pull the recall columns correctly.

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 an item-level recall on that item.
5) Go back to the staff interface and search for the item. Confirm that when you go
to the record detail page, it explodes and errors are shown.
6) Apply patch and refresh page.
7) Confirm page loads as expected.
8) Check the Status information for the item in the Holdings table.
Confirm it shows the recall information correctly.
9) Check in the item and confirm the recall as waiting for Patron A.
10) Go back to the record detail page and confirm the Status information
for the item shows as Waiting in the Holdings table.

Sponsored-by: Catalyst IT

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 3b1ee10ee5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:08:56 +00:00
c40ab314f9 Bug 30876: (follow-up) Use the $biblio object even further
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12464241eb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:04:44 +00:00
6f5d6d4f78 Bug 30876: Use Koha::Biblio
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b60d59eb89)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:04:26 +00:00
7f8e480dfa Bug 30876: Fix wrong call to ->search in list context
The code is clearly incorrect as ->search no longer returns a list when
called in list context.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8beb878e5b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 16:03:58 +00:00
3dcb7492ec Bug 30756: (follow-up) Restore MARC21 authority file
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b99458a6f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 15:59:44 +00:00
93cd916cc1 Bug 30840: Add support for barcode filters to course reserves
This bug adds support for barcode filters on the inputs in the course reserves module.

To test:
1 - Set itemBarcodeInputFilter to 'Remove spaces from'
2 - Find a barcode in your system and add spaces between each characters
    e.g. 3 9 9 9 9 0 0 0 0 0 0 8 1 8
3 - Past that barcode into the checkin box, success
4 - Browse to course reserves, ensure you have a course or create on
5 - Test adding a reserve, batch adding a reserve, and batch removing reserves
6 - The pasted barcode does not in any
7 - Apply patch and restart
8 - Pasted barcode with spaces can now successfuly be added, batch added, and batch removed from courses

Signed-off-by: Jason Robb <jrobb@sekls.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b8a18702d2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-15 15:54:56 +00:00
e79fe19e67 Bug 29961: Make horizontal scroll bar always visible on acqui/z3950_search.pl
To test:
1. In Acquisitions make a basket and add something "From an external source"
2. Search for a title and click on the 'MARC' button, make sure the MARC prview is both tall and wide.
3. You will not see the horizontal scroll bar unless you scroll all the way to the bottom of the preview.
4. Apply patch.
5. Try steps 1 & 2 again, this time you should see the horizontal scroll bar as soon as the MARC prveiw loads.

Note: I put the CSS on multiple lines for better readability

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 98c5ecd0d5)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-10 16:56:58 +00:00
7cc6606c97 Bug 30756: Rename to Koha_MetadataRecord_Authority
What we are actually testing here.

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

JD amended patch: remove Dumper

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e96ba5ac7b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-10 16:53:33 +00:00
f70b564a18 Bug 30756: Further adjustments to Koha_Authority.t
Remove use of exported_records file in favor of TestBuilder.
Remove conditional tests with SKIP block. Create reservoir record.

Test plan:
Run t/db_dependent/Koha_Authority.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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 24ff8b4a85)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-10 16:53:04 +00:00
de503196c4 Bug 30756: Ground work for improving Koha_Authority.t
Move stuff into two subtests.

Test plan:
Run t/db_dependent/Koha_Authority.t.
If you have no imported auths, you will still see skips.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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 96867a4fdc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-10 16:52:45 +00:00
3274099da4 Bug 30855: (follow-up) Rewrite tests using Basic authentication
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4ea3da6f1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-10 16:48:49 +00:00
c5be7b9f56 Bug 30855: Rename /import => /import_batches
This patch renames the route to make it consistent for future additions.

To test:
1. Run
   $ git grep 'matches/chosen'
=> FAIL: all occurences use /api/v1/import/
2. Apply this patch
3. Run:
   $ git grep 'matches/chosen'
=> SUCCESS: All occurences have '/api/v1/import_batches/'
4. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/import_record_matches.t
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 891972d0d3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-06-10 16:48:16 +00:00