Commit graph

49034 commits

Author SHA1 Message Date
fb196f8845
Bug 33102: Display fields from biblioitems in OPAC/staff interface cart
The OPAC/PRO cart only displays biblio fields coming from 'biblio'
table. Fields from biblioitems table aren't displayed anymore.

TO TEST:

1. Populate a cart in OPAC/staff interface and display it.
2. You can see that Year column is empty (if you don't have copyright
   field). And other fields.
3. Apply the patch.
4. You can see more fields in cart simple/detailed view.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tested by having a record with:
- biblio.copyrightdate = NULL
- biblioitems.publicationyear = 2025
Without the patch, no year is shown in the cart. With the patch, 2025 is shown.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2056b5ecec)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:34:19 +01:00
566117b2e7
Bug 33053: Handle invalid biblio_id more robustly
This patch addresses the fact the invalid FK error might differ under
some circumstances. We could try to catch the exception adding another
case, but I think this pattern is cleaner and the authors didn't provide
a fix.

We can discuss it later, as this controller class has several things to
review.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:31:52 +01:00
7324b403ba
Bug 33053: DBIC schema
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:31:47 +01:00
9210083511
Bug 33053: DBRev 22.11.05.007
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 98ed8fe352)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:29:50 +01:00
Aleisha Amohia
dba91616e3
Bug 33053: (QA follow-up) fix syntax error
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ba88442f41)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:29:14 +01:00
59734ea3b3
Bug 33053: Remove default value for tables item_groups and recalls
These default biblio_ids of 0 are harmless but incorrect. The default values should be removed.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t
3) prove t/db_dependent/Koha/Recalls.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ec66ac97f0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:29:14 +01:00
2fa45a14d5
Bug 33637: Update tab ids for batch modification form
This patch adjusts the ids in the submit function

To test:
1 - Browse to tools -> Batch patron modification
2 - Enter cardnumbers and submit
3 - No patrons
4 - Enter borrowernumbers and submit
5 - No patrons
6 - Apply patch
7 - Repeat
8 - Success, patrons are listed

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 dea17b8565)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:27:32 +01:00
c9b0106bd9
Bug 33233: Don't allow disabled attribute to remain when using browser's back button
To test:
1. Go to OPAC advanced search and do a search using only one of the inputs.
2. Once the search is complete use the browser's back button to return to the advanced search.
3. Notice the unused inputs are disabled.
4. Apply patch and try again. Now the inputs should not be disabled.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3811bb4381)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:26:54 +01:00
9809993853
Bug 33582: Use template wrapper for breadcrumbs: Tools, part 4
This patch updates several templates in the tools directory so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Notices and slips
    - New notice
    - Edit notice
    - Confirm deletion
  - Batch patron modification
  - Overdue notice/status triggers
- Cataloging ->
  - Manage staged records
    - Batch details
  - MARC modification templates
    - Edit actions for a template

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e4849e750b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:26:26 +01:00
ef3985df06
Bug 33645: Make koha-foreach return 0 if it completes successfully
This patch adds an "exit 0" to the end of koha-foreach, so that it
returns a successful exit code if it reaches the bottom of the script
without errors.

Test plan:
0) `koha-foreach echo`
1) `echo $?`
2) Note that the exit status is 1
3) Apply patch
4) `./debian/scripts/koha-foreach echo`
5) `echo $?`
6) Note that the exit status is 0

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 e8a187eb74)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:22:47 +01:00
f5967ca2de
Bug 33615: Date picker icon not visible
to test:

 - apply patch, build package

 - edit item, observe calendar icon is visible

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9ccc5ccce0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:22:29 +01:00
2538e3b685
Bug 33631: Fix misaligned labels
If you look at the results_summary on either the results
or detail pages you will notice that the label and
content are slightly misaligned.

To test:
1. On staff results, detail page, or ISBD details notice
   that slight misaligmnet between label and content.
2. Apply patch, yarn_build, clear browser cache
3. Look again, alignment should be fixed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1a86b2b1b7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:22:07 +01:00
0442b15a89
Bug 33596: Merge result page is missing page-section
This patch adds a "page-section" container around the contents of the
page seen when you complete the process of merging catalog records.

The patch also adds the "merge was successful" message into the standard
message dialog.

Perform a catalog search which will return more than one record.

- Select two records in your search results and click "Edit" -> "Merge
  records."
- Complete the process of merging your selected records.
- On the last page you should see a "merge was successful" message
  styled as the standard information box.
- The "Report" section should be shown inside a "page-section" div.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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 c2991bd6b0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:21:50 +01:00
Katrin Fischer
b6a8c6ce59
Bug 33196: Generalize pseudonymization system preference description
The Pseudonymization system preference description in
the staff interface is: "Disable/Enable pseudonymization
to comply with GDPR for personal information. Patrons and
transactions will be copied to a separate table for
statistics purpose."

GDPR is a European Union (and, at time of writing, UK) law;
it makes the system preference look irrelevant for
libraries outside this area. However, this is not correct:
pseudonymization may be useful for libraries anywhere.

This generalized the system preference description and
only uses GDPR as an example instead of the only purpose.

It also updates the fields listed to more closely reflect
the labels on the patron form.

To test:
* Search for "Pseudonymization" in the systme preferences
* Verify that the description of the system preference is
  very GDPR
* Apply patch
* Verify the system preference description is improved

https://bugs.koha-community.org/show_bug.cgi?id=33196
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 54cdae7633)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:21:32 +01:00
Katrin Fischer
b9abcea244
Bug 31405: Set focus for cursor to setSpec input when adding a new OAI set
Makes sure the focus is in the first form field when adding
a new OAI set: setSpec

To test:
* Go to administration > OAI sets
* Add a new set, verify the focus is still in the search bar on top
* Apply patch
* Repeat and verify the focus is now in the first form field
* Save set
* Edit set and verify the focus is in the search field at the top

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 5a5034792c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:20:54 +01:00
5e838f4327
Bug 32990: Prevent deadlock in _update_batch_record_counts
Resolves:
C4::ImportBatch::_update_batch_record_counts(): DBI Exception: DBD::mysql::st execute failed: Deadlock found when trying to get lock; try restarting transaction at /usr/share/koha/C4/ImportBatch.pm line 392

See also bug 32558.

Test plan:
If you apply 32558 first, run multiple processes that stage a marc import.
Without this patch, you can trigger the deadlock.
With this patch, it works.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9a6d10dc31)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:20:25 +01:00
Katrin Fischer
71f20a1c35
Bug 31410: Set focus for cursor to Server name when adding a new Z39.50/SRU server
This makes sure that the focus is in the first form field when
adding a new Z39.50 or SRU server.

To test:
* Administration > Z39.50/SRU servers
* Add a new server for each
* Verify the focus is not in the form
* Apply patch
* Verify the focus is now in the first form field
* Edit an existing server
* Verify the focus is not in the form

Not having the focus when editing is to avoid accidental changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2504a282b5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:19:58 +01:00
3f06c75929
Bug 32931: Fix translatability issues on 'show agreement' view
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 f214582bdd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:15:32 +01:00
Katrin Fischer
bad71e8369
Bug 32931: Fix translatability issues on 'new agreement' form
This fixes the "Yes" and "No" options and "License info" placeholder.

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No
   --> At the bottom of the form "License info" with "License info"
       within the input field
5. Install (complete) language, verify those are not translated
6. Apply patch
7. Update po files
8. Verify strings exist for this file, translate if necessary
9. Re-install language
10. Verify strings are now translated

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 1278b9f4fd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 16:15:18 +01:00
1d5d0cbde7
Bug 30367: (follow-up) Same adjustment for gitlab
This adds the same update for gitlab code. I was unable to trigger the error,
however, I confirm searching for 'PayPal' returns a result after this patch
as well as before.

JD amended patch: fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88000fbccb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:58:09 +01:00
63289fb34c
Bug 30367: Skip processing if we don't get releases
Some repos don't have releases, and this seems to break things as get returns an empty
response. Calling from_json on this is the error

This simply skips the bad responses to avoid the error:

To test:
1. Have this on your koha-conf.xml file:

 <plugin_repos>
    <repo>
        <name>ByWater Solutions</name>
        <org_name>bywatersolutions</org_name>
        <service>github</service>
    </repo>
    <repo>
        <name>Theke Solutions</name>
        <org_name>thekesolutions</org_name>
        <service>gitlab</service>
    </repo>
    <repo>
        <name>PTFS Europe</name>
        <org_name>ptfs-europe</org_name>
        <service>github</service>
    </repo>
 </plugin_repos>

2. Restart all services:
   $ restart_all
3. Search for the term 'barclaycard'

The search will give an error:

malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190
4. Apply patch
5. Repeat
6. No error

Note: The barclaycard plugin won't install even though it is returned as of this note - the plugin needs an update I believe, I don't think it's a Koha issue
Signed-off-by: David Nind <david@davidnind.com>

JD amended patch: fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b12aa543e2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:57:46 +01:00
38666a8bd7
Bug 33626: Remove invalid params
This patch reformats the params passed to scroll_helper as defined here:
https://metacpan.org/pod/Search::Elasticsearch::Client::7_0::Scroll

To test:
1 - perl misc/maintenance/compare_es_to_db.pl
2 - It dies:
[Param] ** Unknown param (scroll_in_qs) in (search) request. , called from sub Search::Elasticsearch::Client::7_0::Direct::scroll_helper at misc/maintenance/compare_es_to_db.pl line 55.
3 - Apply patch
4 - Repeat
5 - It succeeds!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit daa92a9371)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:57:04 +01:00
07d55778a6
Bug 33197: DBRev 22.11.05.006
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e38df2d6f7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:52:18 +01:00
Katrin Fischer
c2c248fc23
Bug 33197: Rename GDPR_Policy system preference
GDPR is a European Union (and, at time of writing, UK) law.
The GDPR_Policy system preference is about a patron
giving consent to their personal data being processed in
line with the library's privacy policy.

The name of the preference is vague: there could be
many policies implemented by libraries to comply with
GDPR. It also makes the preference look irrelevant for
libraries outside the areas where GDPR applies, while
it may be useful for libraries anywhere.

This renames GDPR_Policy to PrivacyPolicyConsent and
adjusts the system preference descriptions.

To test:
* Apply the patch
* Run database update
* Search for GDPR_Policy in the system preference
  - you should not find anything.
* Search for DataPrivacyConsent in the system preferences
  - you should find it and be able to activate it
* Verify the feature works as expected
  - If the preference is set to "enforced", you will be
    asked to give consent to the data privacy agreement
    in the OPAC when you log in
* Verify the page is now phrased neutrally using 'privacy policy'

Bonus: Consent date is now formatted according to DateFormat
       system preference.
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 bd75309933)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:50:56 +01:00
3da06bdd73
Bug 32412: Do not reload COCE image for biblio
We do not want to fetch again the new image for the biblio record. We
only want to fetch those for the shelf browser.

Note that the third parameter 'covernewwindow' was not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.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 13dccaaf05)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:39:19 +01:00
7b53a7fef5
Bug 32412: Empty coce container before appending image
To test:
1. Apply patch and clear browser cache
2. Turn on Coce for the OPAC.
3. OPACShelfBrowser must be on
4. Find a record that returns a cover image and open it's detail page.
5. Use the next/previous navigation links in the OPACShelfBrowser
6. Notice that no extra image is being added to the biblio-cover-slider.
7. Make sure that Coce images still load correctly in on the OPAC detail page, OPAC results page, and in the shelf browser.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.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 fec0bd18ae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:39:00 +01:00
Katrin Fischer
58607ab5c9
Bug 33551: (QA follow-up) Fix TT filters
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 74497dbb5a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:38:28 +01:00
cdd51a66ed
Bug 33551: Remove span from restriction-types.inc
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 63f2d76457)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:38:05 +01:00
Katrin Fischer
f34bc4c8d7
Bug 33419: (QA follow-up) Remove changes to basic_workflow.t
These are not needed: 942 and 200 have no subfields for
homebranch and holdingbranch.

The tests pass without these changes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 81f2ed7e39)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:37:29 +01:00
Laura Escamilla
d227910167
Bug 33419: Make home library and current library mandatory by default
Items without a home and current library can cause errors in Koha.
On the bibliographic page, items appear without the "edit" drop-down
or the selection check box. On a bulk delete page, items without
a home library create a red error that says "Cannot delete".

Making the home and current library values mandatory
helps avoid these issues.

Test plan (using koha-testing-docker (KTD)):
1. Reset KTD so that the web installer is used to setup Koha.[1]
2. Setup Koha using the web installer
   -> When setting up the default settings, don't add any of the
      optional data.
3. Once setup and logged in, check the two frameworks (default and ACQ)
    and note that $952$a and $952$b are not mandatory.
4. Apply the patch.
5. Repeat steps 1-2.
6. Once setup and logged in, check the two frameworks (default and ACQ)
   and note that $952$a and $952$b are now mandatory.

[1] How to access the web installer to setup Koha in KTD:
1. Access the database server:
   mysql -uroot -ppassword -hkoha-db-1
2. Drop the koha_kohadev database: drop database koha_kohadev;
3. Create the database: create database koha_kohadev;
4. Add privileges (for a real installation this would be limited):
   grant all on koha_kohadev.* to koha_kohadev;
5. Restart everything (there may be some errors listed):
   flush_memcached and then restart_all
6. Access the web installer: go to 127.0.0.1:8081
7. Use the database user name and password:
   get from /etc/koha/sites/kohadev/koha-conf.xml
   (default: koha_kohadev, password)
8. Continue through the installation process.

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 a6caabfd2b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:36:59 +01:00
158a52b16b
Bug 33329: Correctly handle UNIMARC encoding for biblios
This patch introduces the same treatment we had for bug 32336, this time
for Koha::Objects::Record::Collections.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests fail! Encoding is wrong for UNIMARC!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

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 5121f77460)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:35:38 +01:00
34e9fa6e59
Bug 33329: Regression tests
This patch introduces tests for the bug highlighted on bug 32336, but in
the context of lists of records.

To reproduce:
1. Run:
   $ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> FAIL: Test fail, encoding is bad!

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 81fc1ebe71)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:35:08 +01:00
Katrin Fischer
5c92a40cf1
Bug 32701: Fix I18N JavaScript libraries on self checkout help page
The help page was missing the fixes from bug 28488. The missing
libraries are causing a JavaScript error on the page and likely
other issues.

To test:
* Make sure WebBasedSelfCheck is activated and configured
  Note: In ktd you don't need to configure anything, it's already set up.
* In the OPAC, go to:
  /cgi-bin/koha/sco/sco-main.pl
* Click on the link to the help in the top right corner
* Verify you see the error in the console:
  jQuery.Deferred exception: __ is not defined
* Apply patch
* Restart things
* Reload the page
* Veriy the errors are gone

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 289f0e8051)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:33:08 +01:00
Magnus Enger
a36f1b70e6
Bug 33649: Fix use of cronlogaction
C4::Log::cronlogaction() takes a hashref as argument, with "info"
and possibly "action" as keys. But there are a couple of places
where it is called with just a string as argument, and that does
not work. Both places need lock_exec to fail to trigger the error.
I have seen this on a production server, but not been able to
reproduce in ktd.

To test:
- Run this on the Koha repo: grep -r "cronlogaction(" *
- Verify that fines.pl and process_message_queue.pl are the only
  scripts that call cronlogaction without a hashref as argument,
  but do it like this: cronlogaction( $message );
- Apply this patch
- Run the grep again and verify that all calls to cronlogaction
  now take a hashref as argument

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 48a2952032)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:05:10 +01:00
309e1b0cb8
Bug 33470: Don't calculate overridden hold limits
This patch can largely be checked in the code to ensure it makes sense, it
moves a conditional up one level for the two different checks that could prevent holds

To test:
1 - Attempt to place a hold via the REST API with an invalid pickup location
    Set pickup location as no in branches to make this easy
2 - Confirm you get an error
3 - Attempt again with header (bug 27760):
    x-koha-override: any
4 - Hold is placed
5 - Repeat 1-4 above but with an item that cannot be held
6 - Apply patch
7 - Repeat 1-4 above
8 - Results should be the same

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3c31212df)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:04:22 +01:00
3d75bf866b
Bug 32921: Honor SelfCheckTimeout when modal is open
To test:
1. Set the 'SelfCheckTimeout' system preference to something low for testing.
2. Make sure 'SelfCheckReceiptPrompt' is set to 'Show'.
3. Log in to SCO and press finish but leave the modal open.
4. Wait until the 'SelfCheckTimeout' time has expired, nothing happens.
5. Apply patch and try again. You should be logged out when SelfCheckTimeout expires.

Signed-off-by: Marius Mandrescu <marius.mandrescu@inLibro.com>

JD amended patch - fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e074ffa6be)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:03:22 +01:00
fa42d94221
Bug 28267: Simplify things
We don't need:
* a separate Koha::Installer module when we already have
C4::Installer
* the tests as they are actually modifying the DB structure
without rolling back
* An unecessary complicated subroutine, just make is simple

WNC amended patch: Remove change to Koha.pm

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 f394bf61cf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:02:26 +01:00
0abb866b49
Bug 28267: Add warnings for database row formats
This patch adds a warning on about.pl regarding database row formats
other than "DYNAMIC". It points to the Koha community wiki for more
information on how to resolve the problem.

This patch also stops the installer if there are any database tables
with a row format other than "DYNAMIC". It points to the Koha community
wiki for more information on how to resolve the problem.

Test plan:
0a. Apply the patch
0b. koha-plack --restart kohadev
1a. koha-mysql kohadev
1b. ALTER TABLE tags ROW_FORMAT=COMPACT;
2. Go to http://localhost:8081/cgi-bin/koha/about.pl
3. Note that there is a warning about database row formats
4a. koha-mysql kohadev
4b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
5. Go to http://localhost:8081/cgi-bin/koha/about.pl
6. Note that there is no warning about database row formats

7a. Manually change the version in Koha.pm to a higher version
7b. koha-plack --restart kohadev
8a. koha-mysql kohadev
8b. ALTER TABLE tags ROW_FORMAT=COMPACT;
9. Go to http://localhost:8081/
10. Log into the web installer and click through until you reach
a warning telling you that you have database row formats other
than 'DYNAMIC'
11. Note that you can't progress with the installer until
this problem is resolved
12a. koha-mysql kohadev
12b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
13. Refresh the page or redo the web installer process
14. Note that you're no longer blocked from running the installer
due to database row format
15. Undo your change to Koha.pm
16. Profit

Note: Due to bug 32665 you'll see an unrelated warning on
step 3

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

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 b76fb9cf46)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 15:02:21 +01:00
7921b0fdbc
Bug 33262: DBRev 22.11.05.005
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0587d32386)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:59:04 +01:00
8b45ddc164
Bug 33262: DBIC schema
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7a779bf9e0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:58:55 +01:00
53722e6c31
Bug 33262: Add new field to REST API route for orders
Without this patch the API driven list of pending orders
on the order receive page was broken.

With the patch, all should be well now.

prove -v t/db_dependent/api/v1/acquisitions_orders.t

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 4ab67c196d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:54:08 +01:00
f79ae8283d
Bug 33262: Unit tests
prove t/db_dependent/Biblio.t

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 177b53d794)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:54:07 +01:00
508fbb0faf
Bug 33262: Store the biblionumber of a deleted record in the order line
When a bibliographic record is deleted and linked to an order
in the acquisition module, the biblionumber in the order line is
currently deleted as well. This makes it impossible to tell what
was ordered in the first place. This is a big issue for libraries
that need to be able to track how money was spent over long periods
of time.

With this patch the biblionumber of the deleted record will be moved
to a new column deleted_biblionumber in the order line, keeping the FK
on biblionumber.

To test:
* Apply patch, run dataase update
* Create a order/basket in the acquisitions module
* Order several things, you can use existing records from the sample data
* Make sure you order one of the records at least twice
* Take a look at the aqorders table in your database, using a report:

  SELECT biblionumber, deleted_biblionumber, ordernumber from aqorders;

* From the catalog, delete the items on the records and then the records

  Note: There is a warning about attached orders warning about consequences
  for acquisitions. I have chosen to keep it at this point in time, as
  there are still visible side effects of deleting the record, like bug 10758.

* Re-run the report and compare results to the first run. deleted_biblionumber
  should now be filled with the biblionumber of the deleted record.
  biblionumber should be NULL/empty.

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 c8faeac4cd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:54:06 +01:00
16464ef656
Bug 33262: Add deleted_biblionumber column to aqorders table
This adds a new column deleted_biblionumber to the aqorders table.
This will allow us to store the biblionumber of a deleted record,
so we will still be able to tell what has been ordered once the
record is deleted.

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 0cf7687e83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:54:05 +01:00
1d5f04ec7e
Bug 22440: (follow-up) Nothing is forever
This patch picks (yet) another class for testing purposes. The class
needs to not implement to_api() and to_api_mapping().

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b22f017a16)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:38:49 +01:00
010369eac6
Bug 22440: (follow-up) Fix existing tests
As we are introducing a FK for illrequests.biblio_id, TestBuilder is
generating a linked biblio, and so tests expecting undef are failing.

This fixes it by explicitly setting biblio_id => undef on creating the
request.

The patch also cleans the area a bit, removing a redundant and fragile
test as well.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5e0c6b397d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 14:38:48 +01:00
90522198d8
Bug 22440: DBRev 22.11.05.004
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 95520f0fb5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 08:30:55 +01:00
12539a577e
Bug 22440: DBIC schema
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6a35d9fbed)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 08:30:47 +01:00
feef2edba8
Bug 22440: Move backend statuses api endpoint
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 50909d2266)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 08:16:30 +01:00
7d122a4cf0
Bug 22440: Tests
Updated API tests

Co-authored-by: Tomás 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 3cfce3b796)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-05-12 08:16:29 +01:00