Commit graph

50654 commits

Author SHA1 Message Date
2d8722c97d Bug 34893: Add checkpw change to REST API
This patch adds the checkpw return value change to the REST API
route for validating user identifiers and password.

Test plan:
0. Apply patch
1. prove t/db_dependent/api/v1/password_validation.t

Bonus points:
1. koha-plack --reload kohadev
2. Enable syspref RESTBasicAuth
3. curl -XPOST -H "Content-Type: application/json" \
-u <staff_userid>:<staff_password> \
-d '{"identifier":"<cardnumber>","password":"<password>"}' \
http://localhost:8081/api/v1/auth/password/validation
4. Validation doesn't fail. It gives you cardnumber, patron_id, userid

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
38e1c2a951 Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron
Imagine we have a set of users. Some of those users have a NULL userid. We then call AuthenticatePatron from ILS-DI for a patron with a NULL userid, but a valid cardnumber. We call checkpw, which returns the cardnumber and userid. We then call Koha::Patrons->find on the userid *which is null*, meaning the borrowernumber returned is not the correct one, but instead the earliest patron inserted into the database that has a NULL userid.

Test Plan:
1) Give three patrons a userid and a password
2) From the database cli, set all patrons's userid to null
   Run this query: update borrowers set userid = null;
3) Call AuthenticatePatron with username being the 1st patron cardnumber,
   and password being the password you set for that patron
   http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=kohacard&password=koha
4) Note you get back a borrowernumber for a different patron. Refresh the page and the number is correct.
5) Do the same with the 2nd patron. Same issue at 1st and correct number after.
6) Apply this patch
7) Restart all the things!
8) Do the same with the 3rd patron.
9) Note you get the correct borrowernumber! :D
10) prove t/Auth.t t/db_dependent/Auth_with_ldap.t t/Auth_with_shibboleth.t t/db_dependent/Auth_with_cas.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
1f50091a06 Bug 34893: Add unit tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-24 17:33:44 +00:00
Andrew Fuerste Henry
7c9a2beb9d Bug 25835: Include overdues with fines in overdues_report permission
To test:
1 - have a user with circulate_remaining_permissions but not
    overdues_report
2 - confirm user can see and run Overdues with Fines
3 - apply patch
4 - confirm user can no longer see links to Overdues with Fines or load
    the page directly by entering the url
5 - confirm a user with overdues_report or greate permission can see and
    use the tool

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 23de67a7e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9825c7ea36)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:37:52 +00:00
9051088ec0 Bug 32551: HTTP_ACCEPT_LANGUAGE legacy CGI variable not set in Mojolicious
This patch addresses the fact some of our code still relies on those CGI-era ENV variables.
In particular, C4::Laguages::getlanguage expects it to calculate the most suitable language.

As this is reported as required, I provide a fix.

I did a `git grep HTTP_` on the codebase, and the only other occurences are:

* C4::Output (HTTP_X_REQUESTED_WITH)
* C4::Context (HTTP_USER_AGENT, HTTP_X_FORWARDED_FOR)
* C4::Auth_with_shibboleth (using HTTP_ variables for matchpoints)
* Some handling on the 'Koha as a Mojo app' code
* Some .pl script not relevant to this report

I decided to limit this patch to the requested header which seems harmless. I leave the
other cases.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ qa -c 1
=> FAIL: Tests fail!
3. Apply this patch
4. Run:
  k$ qa -c 2
=> SUCCESS: Tests pass! All green!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d6e072fb5f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c1ba60ce4d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:35:50 +00:00
a9025d9d7c Bug 32551: Regression tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5292903dc1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0df6ad0aa9)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:35:50 +00:00
Kevin Carnes
f002c47366 Bug 35567: Prevent translation of Host-item in "Show analytics" link
The "Show analytics" link is built using text which can be translated.

The following languages have already translated Host-item:
fa-Arab, fi-FI, nl-NL, pt-BR, ru-RU, sv-SE

To test:
 1. Install one of the affected languages:
    koha-translate --install sv-SE --dev kohadev
 2. Modify and save the following system preferences:
    language: enable the language
    OPACLanguages: enable the language
    opaclanguagesdisplay: Allow
    EasyAnalyticalRecords: Show
 3. View a record with holdings and copy the barcode of one the items
 4. Select the Edit dropdown menu above the record details and click
    "Link to host record"
 5. Paste the barcode, click Select, and click OK
 6. Return to Normal view of the record and reload the page
 7. There should now be a "Show analytics" link
 8. Hover over the link and note that the link contains "Host-item"
 9. Switch to one of the affected languages and note that "Host-item" is
    translated
10. View the record in the OPAC and confirm that the link is also translated
11. Apply the patch
12. Update the affected language:
    koha-translate --update sv-SE --dev kohadev
13. Restart Koha (restart_all)
14. Notice that the links are no longer translated
15. Sign off

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f2c17e71d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3ce12b7dca)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 22:33:05 +00:00
Katrin Fischer
a4042a3c8c Bug 35713: Remove outdated debian/docs/LEEME.Debian file
This removes the LEEME.Debian README file from the docs
directory. We don't even have an English README here as
we usually refer to the wiki for installation instructions.
It makes sense to remove it from the codebase.

To test:
* Verify that the file is removed
* Verify that all references to the file have been removed as well
  Example: git grep LEEME

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a18e4d0e62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a3606493ad)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 20:59:50 +00:00
34cefad0ae Bug 35598: Fix selenium/authentication_2fa.t random failure
Jenkins is failing with
koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
koha_1       | 	(eval 582):1 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 584):2 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 556):17 in Selenium::Remote::Driver::_execute_command
koha_1       | 	/usr/share/perl5/Selenium/Remote/WebElement.pm:125 in Selenium::Remote::WebElement::_execute_command
koha_1       | 	t/db_dependent/selenium/authentication_2fa.t:276 in Selenium::Remote::WebElement::send_keys
koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in main::__ANON__
koha_1       | 	/usr/share/perl/5.32/Test/Builder.pm:334 in (eval)
koha_1       | 	/usr/share/perl/5.32/Test/More.pm:809 in Test::Builder::subtest
koha_1       | 	t/db_dependent/selenium/authentication_2fa.t:294 in Test::More::subtest
koha_1       |
selenium_1   | 1702911648831	Marionette	INFO	Stopped listening on port 41385
selenium_1   | JavaScript error: resource:///modules/Interactions.jsm, line 230: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
selenium_1   | 15:00:49.452 INFO [ActiveSessions$1.onStop] - Removing session c3461b22-7a80-4b56-b177-653a53cc2651 (org.openqa.selenium.firefox.GeckoDriverService)
koha_1       |     # Looks like you planned 7 tests but ran 3.
koha_1       |
koha_1       | #   Failed test 'Enforce 2FA setup on first login'
koha_1       | #   at t/db_dependent/selenium/authentication_2fa.t line 294.
koha_1       | Error while executing command: element not interactable: Element <input id="pin_code" name="pin_code" type="text"> is not reachable by keyboard at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.

The error is: "Element <input id="pin_code" name="pin_code" type="text"> is not reachable by keyboard"

A guess is that the input is either 1. outside of the viewport, or 2. not
displayed yet.

1. We are hidding #registration-form then show it when we retrieved the
   info (after POST /api/v1/auth/two-factor/registration)
2. Couldn't there be a race condition?
In auth.tt
284                     success: function (data) {
292                         $("#registration-form").show();
And in the selenium test:
$s->wait_for_ajax; # There is an ajax request to populate the qr_code and the secret
Not sure this wait_for_ajax is waiting for the end of success, I don't
think so.

This patch is supposed to fix both theories.

Test plan:
0. Do not apply the patch
1. Edit auth.tt and sleep 1 second before showing the form:
290                         const sleep = ms => new Promise(r => setTimeout(r, ms));
291                         await sleep(1000);
292                         $("#registration-form").show();

You will also need to replace the following line (284):
  success: function (data) {
with
  success: async function (data) {

2. prove t/db_dependent/selenium/authentication_2fa.t
=> "is not reachable by keyboard" error!

3. Apply the patch, keep the sleep

4. prove t/db_dependent/selenium/authentication_2fa.t
=> Tests are passing

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit (tcohen): Tidied a bit to clear complaints
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3270d32191)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5aa213e210)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-19 20:53:11 +00:00
ba485664db Bug 35587: (QA follow-up): QA script tidy
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 520c84756a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 95884923f7)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:26:58 +00:00
Aleisha Amohia
390e67a748 Bug 35587: Do not trigger transfer if lost item returned and BlockReturnOfLostItems enabled
This fixes current buggy behaviour - when BlockReturnOfLostItems is enabled, no transfer should be triggered and the lost status should be retained.

To test:

1. Go to Koha Administration -> Global system preferences
2. Set the BlockReturnOfLostItems system preference to Block
3. Enable the AutomaticItemReturn system preference (this is simply to make testing a bit faster)
4. Take note of your logged in library
5. Search for an item where the home library is NOT the same as your logged in library
6. Edit this item and give it a lost status
7. Check in the item
8. Notice the item is returned and a transfer is automatically triggered
9. If you go to the item record page, the lost status has been remove

10. Apply the patch and restart services

11. Edit the item again and give it a lost status. This will also cancel the transfer
12. Check in the item
13. Confirm the transfer is NOT triggered and the lost status is retained as expected.
14. Go back to system preferences and disable the BlockReturnOfLostItems system preference (set to "Don't block")
15. Check in the item
16. Confirm the transfer is triggered and lost status is removed

17. Confirm tests pass

prove t/db_dependent/Circulation/Returns.t
prove t/db_dependent/Circulation/Branch.t

Sponsored-by: Pymble Ladies' College
Signed-off-by: Esther <esther@bywatersolutions.com>
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 930ad0178d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fc777d84a4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:26:58 +00:00
e953644aac Bug 35696: Fix regression caused by bug 33167
A case was missed when switching from item.transfer.field to just
transfer.field.

This meant that the daterequested date wasn't getting filled properly in
the UI.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1f16ac11e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a3ac46b388)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:24:50 +00:00
9d32dd34ac Bug 35629: Remove redundant code
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 9149dc4d06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8810cffc0f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:22:37 +00:00
cc78b7a2bb Bug 34900: (follow-up) Add version information to more entries
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit dbc2060822)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a2dc5d7bf1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:20:09 +00:00
David Nind
23a765b0e6 Bug 34900: (follow-up) List alphabetically and tidy ups
Listed in alphabetical order (except for Koha, which is listed
at the start).

Tidy ups and consistency changes:
- end of each entry: remove full stops
- separator between software and license: use a colon
- headings for software/library name: use sentence case
  unless a noun, abbreviation, or the actual software name
- http and https: use https where site uses it
- URLs: update where required
- license names: use consistent full names with title case

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4cb2f7f2db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3c24c5afb2)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:20:09 +00:00
deefc64297 Bug 34900: (follow-up) Correct last entry
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 99e5791994)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a670c4cd3c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:20:09 +00:00
0b37409572 Bug 34900: Simplify text of about page license information
This patch simplifies the language describing third-party libraries and
their licenses so that translation are not so complicated.

The patch also removes information about some assets which are no longer
part of Koha.

The license information now lists only the library name, version (if
possible) and license.

To test, apply the patch and go to the about page in the staff
interface. Open the "Licenses" tab and check the content.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 84f18c3cc2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d8f4c60372)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:20:09 +00:00
Julian Maurice
a4edd5ca08 Bug 35070: Fix get_enabled_plugins when database is not created yet
Koha::Plugins::get_enabled_plugins is called by Koha::Plugins::call
which is called by C4::Templates->new, which is used in the web
installer when the database is not created yet

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3df1cb33c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fec97b4ae8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:16:26 +00:00
8860b00ae8 Bug 35070: (QA follow-up) Fix missing TT filter
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c3d78bc35a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d8df06a8cd)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:16:26 +00:00
Julian Maurice
28623f6aa9 Bug 35070: Add test verifying plugins cannot override core templates
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2233c230b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 829ef649c0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:16:26 +00:00
63a48597c4 Bug 35070: Tidy
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 21fd864416)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cd2e54f6e1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:16:25 +00:00
Julian Maurice
49c5392ae6 Bug 35070: Add plugin hook template_include_paths
It allows to add paths to Template::Toolkit's INCLUDE_PATH option

http://template-toolkit.org/docs/manual/Config.html#section_INCLUDE_PATH

Test plan:
1. Install the modified kitchen sink plugin:

    git clone --branch template-include-paths \
    https://github.com/jajm/dev-koha-plugin-kitchen-sink.git

2. Run misc/devel/install_plugins.pl
3. Restart memcached and koha
4. Go to Administration -> Manage Plugins
5. Run the KitchenSink plugin's tool
6. Click on "Schedule greeting"
7. Go to Administration -> Manage jobs
8. If you don't see any jobs, uncheck "Current jobs only"
9. You should see a job of type "Unknown job type
   'plugin_kitchensink_greeter". Click on the "View" button
10. Under the Report section you should see "This is the report block"
11. Under the Detailed messages section you should see "This is the
    detail block"
12. Open the browser console, you should see a message "This is the js
    block"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5047e0761c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit fe5b461cbf)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:16:25 +00:00
27464fbe39 Bug 35698: (bug 32162 follow-up) fix bug number in db rev
Should be 32162, not 31162.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit bc8a9b36ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6694512cf0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:13:08 +00:00
5df77a718d Bug 35658: Fix misaligned collectionFormat in patron_holds.yaml
This patch fixes a silly typo.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54b07ffc18)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 104c6bf1cc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:11:01 +00:00
31d73fc742 Bug 28012: (QA follow-up) Use form validation for numbering patterns
Activates standard validation and error messages. Converts from
pattern check to digits class for "display order" field.

To test:
* Compare error message when leaving required fields empty
* Compare error message when entering wrong/false data in display order

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f816027ea1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 452ab27397)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:08:53 +00:00
7af0354964 Bug 28012: (QA follow-up) Add numeric imput mode to display order field
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 49138a6df7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9be82743f1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:08:53 +00:00
Joonas Kylmälä
aa3415ff3f Bug 28012: Creating numbering pattern: mark mandatory fields required
If any of these fields were missing, notably the Numbering formula
then saving the new numbering pattern silently failed, it didn't give
any error but it didn't save any new pattern either.

Note that there is a plan to make description field optional, so even
if it currently is mandatory on the DB level we leave it optional
here (and due to people using production DB's in non-strict mode which
allows this to be optional).

To test:
  1) After applying this patch make sure all the 3 fields must be
  filled in
  /cgi-bin/koha/serials/subscription-numberpatterns.pl?op=new
  page and it cannot be saved without those.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a69b5e6ee9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 77e7e11c3a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:08:53 +00:00
Joonas Kylmälä
8a9f2a05e0 Bug 28012: Use definedness test instead of bool when checking whether to null fields
Saving a new numbering pattern didn't work without having to fill all
the fields, even those that are not mandatory.

To test:
 1) Go to /cgi-bin/koha/serials/subscription-numberpatterns.pl
    and try creating a new pattern, notice that only Name and
    Description are mandatory after applying this patch
 2) Make sure editing existing numbering patterns still works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 97aab6a98e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4a81e4c2a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:08:53 +00:00
Julian Maurice
97939c87b7 Bug 35588: Tidy up t/db_dependent/AuthorisedValues.t
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 002e02710b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d95aa51639)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:05:02 +00:00
8c82b57649 Bug 35588: Scope authorised value desc lookup according to field/subfield
This patch ensures that the authorised value descriptions looked up
are for the correct field/subfield designated in the CSV profile.

Test plan:
0. Do not apply the patch yet!
1. Go to http://localhost:8081/cgi-bin/koha/tools/csv-profiles.pl
2. Add a CSV profile with the default values and using the following
for the "Profile MARC fields":
000|001|003|005|006|007|008|010|015|016|020|022|040|050|082|100|110|
111|130|240|243|245|246|247|250|260|300|336|337|338|440|490|500|501|
505|520|530|600|610|611|630|648|650|651|690|700|710|711|856|887|942|995

3. Create a new List
4. Add all the database's bibs to that list using SQL like the following (where the shelfnumber equals the number for your list):
insert into virtualshelfcontents (shelfnumber,biblionumber,borrowernumber) select 1,biblionumber,51 from biblio;

5. Go to that list in the staff interface
6. Download that list using your CSV profile

7. Apply the patch
8. koha-plack --reload kohadev

9. Download that list using your CSV profile
10. Note that the output is a little slower, but still quick enough.
11. Note that the output is a bit different. For records like "Gairm",
the output will end in "1" instead of "Yes". This is correct, because
this subfield isn't an authorised value!!!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f53ebe874e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6688687d93)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:05:02 +00:00
b9d05a7e3f Bug 35579: Add unit test
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ca754a2c5e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 548c9ce885)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:02:28 +00:00
1c8291f8ae Bug 35579: Cache authorised value lookup by MARC field
This patch adds a "get_descriptions_by_marc_field" method
which caches AuthorisedValue descriptions when searched by
MARC field, which is used when exporting MARC to CSV.

Test plan:
0. Do not apply the patch yet!
1. Go to http://localhost:8081/cgi-bin/koha/tools/csv-profiles.pl
2. Add a CSV profile with the default values and using the following for the "Profile MARC fields":
000|001|003|005|006|007|008|010|015|016|020|022|040|050|082|100|110|111|130|240|243|245|246|247|250|260|300|336|337|338|440|490|500|501|505|520|530|600|610|611|630|648|650|651|690|700|710|711|856|887|942|995|952|952$c
3. Create a new List
4. Add all the database's bibs to that list using SQL like the following (where the shelfnumber equals the number for your list):
insert into virtualshelfcontents (shelfnumber,biblionumber,borrowernumber) select 1,biblionumber,51 from biblio;
5. Go to that list in the staff interface
6. Download that list using your CSV profile
7. Apply the patch
8. koha-plack --reload kohadev
9. Download that list using your CSV profile
10. Note that the output is the same, but that the output completes much more quickly after applying the patch

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 78c0e8df8d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 423c240339)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 22:02:27 +00:00
Julian Maurice
f4eb54dd6b Bug 31694: Add missing TT filters
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 47ffdaf6f4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a3e35b0548)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 21:55:16 +00:00
Kevin Carnes
b2f77bd7bb Bug 31694: (follow-up) Use values for operations to avoid translation issues
To test:
    * Try adding a preset rule that has an operation with different translations
      for the column and the pull down (e.g. Outrepasser for fr-CA)
    * Without the patch it appears as Custom (e.g. Personnalisé)
    * With the patch it appears correctly (e.g. Outrepasser)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e9c7f84896)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a0db31d75f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 21:55:16 +00:00
Shi Yao Wang
4c83ac6e5c Bug 31694: (follow-up) Fix preset display issue
Preset column should now display the right preset.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 35ddacf397)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d6511233b8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 21:55:16 +00:00
Katrin Fischer
5297dfd361 Bug 31694: (follow-up) Further improve translatability
To test:
* Add rules fo different modules and with different settings
* Verify the saved module description for a saved rule matches the pull down
* Verify the saved filter matches the pull downs (especially for source and patron category)

Also:
* Renames 'User category' to 'Patron category'
* Remove some values from translations, that shouldn't be translated, like value attributs for options.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b1cd199aaa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4595fdf0de)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 21:55:16 +00:00
Caroline Cyr La Rose
b9402cb596 Bug 31694: MARC overlay rules presets don't change anything if presets are translated
This patch corrects option value names in MARC overlay rules to prevent
them from being translated.

To test:
1. Install a new language
1.1. In a terminal, run the following commands
gulp po:update
cd misc/translator
./translate install xx-XX
1.2. Go to Administration > Global system preferences
1.3. Search for language
1.4. In the language syspref check the box for the language you just installed
1.5. Save
2. In the staff interface in English, go to Administration > Record
overlay rules
3. In the column 'Preset' try the various options, note that the
'Added', 'Appended', 'Removed', and 'Deleted' settings change depending
on the chosen preset
4. Change the interface language
5. Redo step 3, notice that if the preset name is translated, the other
settings don't change
6. Apply patch
7. Redo step 3, the presets should now change the settings

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit c5a98fe574)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1da66ccc14)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 21:55:16 +00:00
278dcab1cf Bug 31297: DBIC 2024-01-12 20:38:37 +00:00
41c774c365 Bug 31297: DBRev 23.05.07.001 2024-01-12 20:35:34 +00:00
50c3887541 Bug 31297: Allow null value for description in subscription_numberpatterns
To test:
1 - Go to Serials
2 - Add a enw subscription
3 - Select Vendor and record, click next
4 - Select Numbring pattern: Number, or any to populate forms
4 - Click 'show advanced pattern'
5 - 'Modify pattern'
6 - Add a new name
7 - 'Save as new pattern'
8 - Nothin happens
9 - Check logs:
    C4::Serials::Numberpattern::AddSubscriptionNumberpattern(): DBI Exception: DBD::mysql::st execute failed: Field 'description' doesn't have a default value at /kohadevbox/koha/serials/create-numberpattern.pl line 58
10 - Apply patch
11 - Update database
12 - Restart all
13 - Click save again
14 - Success!

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Removed wrong 'out' from atomic update file.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f9b57c5342)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1732236027)
2024-01-12 20:33:25 +00:00
e68c682914 Bug 35489: [23.05.x] Add a hidden input for itemnumber even if item has no barcode
This page is a single form, all fields must have inputs to avoid data loss/mismatch

To test:
1 - Find a record in the catalog and add or edit items to have one item with a barcode and one without
2 - Place an item level hold on the item with no barcode
3 - Place another hold for a different patron on the item with a barcode
4 - From the holds table add an expiration date to the hold with a barcode and save
5 - Note the hold on the item with no barcode is now on the item with a barcode and the other hold is now a next available hold
6 - Delete the holds
7 - Apply patch
8 - Repeat 2-4
9 - Confirm the itemnumbers for the holds have not changed

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-12 14:42:36 +00:00
Julian Maurice
bf43544a52 Bug 35557: Remove references to unused PREF_LocalCoverImages
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f7ea515bcc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 31a356afd3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 21:08:48 +00:00
51433f2569 Bug 35557: Remove LoadResultsCovers
The JS function LoadResultsCovers is not used from the Staff interface.

It is supposed to load the local cover images in JS but actually we are embedding the thumbnail in the img tag.

Test plan:
Confirm that LoadResultsCovers was called but had no effect.
Note that the selector ^local-thumbnail only exists in shelfbrowser.inc

but results.js is only used from results.tt (not shelfbrowser.inc)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4e66aa8065)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 43fb9f9c7a)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 21:07:33 +00:00
fdf3e77e01 Bug 35547: Show public "staff only" lists in addbybiblionumber.pl
When adding an item to a list from catalogue/detail.pl, we can see the
latest 10  public lists. If all those lists are set as "staff only" for
"Allow changes to contents from" they will not show up in the
addbybiblionumber.pl popup. This is because the query in the popup does
not look for "staff only" lists while the "Add to list" button does.

Test plan:
1) Create 11 "staff only" lists as staff member A
2) Log in as staff member B
3) Find a record, click the "Add to list" button, note you can see lists
   2 through 11 here
4) In the pulldown, choose the "More lists" option
5) Note those lists are not visible in the "Choose list" pulldown under
   "Select an existing list"
6) Apply this patch
7) Restart all the things!
8) Click the "More lists" option again
9) Those lists should now be in the pulldown!

Signed-off-by: sabrina <kiehl@mpis.mpg.de>
Signed-off-by: Mikko Liimatainen <mikko.liimatainen@turku.fi>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5961e5c2a3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 39b75d3da0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 21:05:54 +00:00
5efb2416c3 Bug 35619: Fix validation error alignment in change password form
Bug 31829 made a change to the change password form in the staff
interface to accommodate a gap in the CSS following the staff interface
redesign. This gap has been fixed, so we don't need a double class on
the fieldset.

With this change, the "hint" div can also be put back into place.

To test, apply the patch and locate a patron record in the staff
interface.

 - Click the "Change password" button on the patron detail page.
 - Confirm that the form layout looks correct.
 - Enter mismatched passwords in the "New password" and "Confirm new
   password" fields and click "Save"
   - The validation error message should be aligned to the right of the
     input field.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 46b0b41e09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7378b18f78)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 21:02:46 +00:00
59cdb045da Bug 35455: Remove = in ICU for indexing/searching
This change more closely aligns ICU and CHR so that ICU also
removes the = character. This fixes issues in ICU when searching
with a : which gets transformed into a =. Without this change,
the Analytics features won't work for titles with a colon in them.

Test plan:
0. Apply the patch and import bibs from Bugzilla (using Staged MARC tools)
1. cp ./etc/zebradb/etc/phrases-icu.xml /etc/koha/zebradb/etc/phrases-icu.xml
2. cp ./etc/zebradb/etc/words-icu.xml /etc/koha/zebradb/etc/words-icu.xml
3. vi /etc/koha/zebradb/etc/default.idx
Change "charmap word-phrase-utf.chr" to "icuchain words-icu.xml" for "index w"
and "icuchain phrases-icu.xml" for "index p"
4. koha-zebra --stop kohadev
5. pkill zebrasrv
6. koha-zebra --start kohadev
7. koha-rebuild-zebra -a -b -f -v kohadev

8. Search for "Awesome title" and open the detail page
9. Note that the "Analytics: Show analytics" line shows up
10. Click that link
11. Note that it opens the "Cool article" record and it displays
"In: Awesome title: awesome subtitle"
12. Click that link
13. Note that it opens the "Awesome title" record

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7375d82c40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5035e12440)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 21:00:20 +00:00
e38316dd1f Bug 35493: Do not show housebound roles as collapsible unless the housebound module is on
To test:
1. HouseboundModule - disabled
2. CollapseFieldsPatronAddForm, add 'Housebound roles'
3. Edit/create a patron.
4. Notice the useless Housebound roles link at the top of the page
5. APPLY PATCH
6. Try 1 - 3 again, this time no Housebound roles at the top ( Show collapsed fields )
7. Turn on HouseboundModule and make sure it now shows

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 49f30ad6ed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 83c18ad1c6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 20:58:39 +00:00
David Nind
af02963e9a Bug 34644: (follow-up) Additional edits to description
Linked system preference in description to cross reference, and
and removed the spaces in the bracketed text.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 5cd21f1139)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d724b82c1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 20:55:31 +00:00
0da801226b Bug 34644: replacementprice is support by MarcFieldsToOrder but is not listed
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 341b90b2ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 26fb50672f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 20:55:31 +00:00
6fb592522d Bug 34644: Improve readability of sysprefs
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 61e8073b02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b5b2d1b678)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 20:55:31 +00:00