Mason James [Wed, 21 Sep 2022 11:38:59 +0000 (23:38 +1200)]
Bug 28493: Make koha-passwd display the username
to test...
1/ run command
$ sudo koha-passwd dev1
Password for dev1: CraZyPa$$WoRD!!
Press enter to clear the screen...
^C
2/ apply patch
3/ run command again, note 'username' section
$ sudo koha-passwd dev1
Username for dev1: koha_dev1 <<<<<<<<<<<<
Password for dev1: CraZyPa$$WoRD!!
Press enter to clear the screen...
^C
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 4ce7f8c49378c0e32212493779b07e3ab369dee7) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Kyle M Hall [Fri, 14 Jul 2023 11:36:47 +0000 (07:36 -0400)]
Bug 34279: Don't enforce overduefinescap unless it is greater than 0
When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine.
Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is.
Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes
Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1763b136d1dcd3348ee26bca8663823b5a05f07c) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Kyle M Hall [Fri, 14 Jul 2023 11:32:11 +0000 (07:32 -0400)]
Bug 34279: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8096ec9fff44a04c8ff32525499652116d1a8ad0) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 19 Jul 2023 11:41:28 +0000 (12:41 +0100)]
Bug 32271: (QA follow-up) Restore $Price filtering for valid values
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 093d1959af59423e3a9a69139a4745703b7a399a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 19 Jul 2023 11:31:14 +0000 (12:31 +0100)]
Bug 32271: (QA follow-up) Correction to 'can_be_blank' logic
The logic introducing the can_be_blank check into the monetary decimal
format check was flawed and meant we were no longer checking decimal
formatting in the majority of cases. This patch updates that so we pass
the unit tests and correctly check any value passed that's not an empty
string.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c42725bab4f7f4dc360d9b4fe0417b8b3082d879) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 19 Jul 2023 11:11:50 +0000 (12:11 +0100)]
Bug 32271: Unit test
Add a unit test for the allow blank option added to the monetary check
in CirculationRules.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41274ef7516ad09f1f9a5e6723ba7bd53379dd02) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Kyle M Hall [Fri, 14 Jul 2023 13:08:51 +0000 (09:08 -0400)]
Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit daedce4f6ea7d7ae9d4f12cd54e94b0230683a92) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Pedro Amorim [Tue, 27 Jun 2023 15:00:00 +0000 (15:00 +0000)]
Bug 34133: Set default sort on first column (ID) desc
Test plan:
Before applying patch:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by ASC (lowest ID first)
* Close incognito
Apply patch, then:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by DESC (highest ID first)
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan from Bugzilla, and added it above.
Works as advertised. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67916fc23a518bb1ddc895f6f3e0b27c434b8a92) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Aleisha Amohia [Tue, 13 Jun 2023 05:29:22 +0000 (17:29 +1200)]
Bug 33992: Only consider the date when auto-expiring problematic recalls
This patch carries this fix into the misc/cronjobs/recalls/expire_recalls.pl cronjob so that recalls are automatically expired when they have been waiting a problematic number of days, not considering hours, as expected.
To test, follow the test plan from the first patch. This will set you up with a waiting problematic recall.
Run the cronjob manually
perl misc/cronjobs/recalls/expire_recalls.pl
Refresh your 'Recalls awaiting pickup' page. Your problematic recall should be gone/expired.
Expiration dates will apply when expiring any 'unfulfilled' recall i.e. newly requested, overdue to be returned, and awaiting pickup.
Sponsored-by: Auckland University of Technology 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 0d2052088ec62654f81154be0b9916b8e8630891) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 33028: (follow-up) Lower the two digits requirement
This patch makes the code not require two decimal digits, as the main
intention here is to forbid (locale) formatted strings to reach the DB.
The number of digits we support needs to be discussed on its own bug,
and a centralized check implemented.
This patch fixes tests:
prove t/db_dependent/Circulation.t
t/db_dependent/Circulation.t .. 1/67 Exception 'Koha::Exceptions::CirculationRule::NotDecimal' thrown 'The circulation rule expected a decimal value' with name => fine, value => 0.1
t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 53/67 subtests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 45b050871e7ed882b553f211db97204f30634646) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 19 Jul 2023 10:26:59 +0000 (11:26 +0100)]
Bug 33028: (follow-up) Add POD to new Exception
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b82f1bd8075e0d14aa9d08293831af4cd8a3059a) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 19 Jul 2023 10:21:46 +0000 (11:21 +0100)]
Bug 33028: Unit tests
Add unit tests for is_monetary functionality introduced in the
CirculationRules module.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88ccaaf3acab9996070a5bcbc057bbe9dad1c771) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
While testing this bug I found Circulation.t was failing, but the
exception doesn't actually display anything useful in terms of helping
debug what's going on.
This patch makes it add the rule_name and rule_value to the message.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b7c077c9ddade728a7d84a1cf2f5b62cc4d4841) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82bdaa8fbcdf836dd2fea93850173f15f17b7de9) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 86c2d9d1e96f318615ca6c83d6bfd685723ab5c9) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Tue, 11 Jul 2023 13:23:40 +0000 (13:23 +0000)]
Bug 33028: Perltidy database update script
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0a3b98cdb1ae0938403bf919f5494e2708821c4) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Mon, 3 Jul 2023 12:45:28 +0000 (13:45 +0100)]
Bug 33028: Throw exception if not passed a decimal number
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d5b1041f43c2a6d8b82f6ee88c1ecf6aaaeb9cae) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Tue, 27 Jun 2023 15:54:02 +0000 (16:54 +0100)]
Bug 33028: (follow-up) Apply unformat_price to decimal fields
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 461c1931b9137bfcf64c5ec9a5bc3f127727ec14) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Tue, 27 Jun 2023 15:22:36 +0000 (16:22 +0100)]
Bug 33028: (follow-up) Add unformat_price js function
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 31cbd5ce946832234c8eb6b99729d781e75fd4bc) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Fri, 16 Jun 2023 17:01:52 +0000 (17:01 +0000)]
Bug 33028: (follow-up) Rewrite database update
This rewrite the database update with some things in mind:
* We now use a positive value list of allowed characters to check
This makes sure that all of those are recognized:
1,00
1.00€
abc
* Instead of dying after finding one wrong value, we loop through
all values first, building up an error string
* When we have errors... we die and print the full list of things
that need fixing.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0199f5fbbb50cbc4656cbeb73c269a7cc6718e55) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Fri, 16 Jun 2023 16:59:22 +0000 (16:59 +0000)]
Bug 33028: Add TT filters for Price and pattern checks to input fields
With this patch, all monetary values in the table will be displayed
formatted.
Also, the input will be checked against our agreed pattern to make
sure no false values can be entered.
Missing: When editing a rule, we need to unformat the value, so that
instead of the display format we have the input format available
for editing.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c2d40bb4a05687eca67a8e06befd5d43d0a4b9d) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Fri, 16 Jun 2023 16:57:51 +0000 (16:57 +0000)]
Bug 33028: Add is_monetary to recall_overdue_fine and article_request_fee
This patch marks the 2 missing monetary values for recal over due fines
and article request fees as monetary.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2634097c15d808d4e9a96e33efa9ab245bba88c) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Fri, 3 Mar 2023 11:33:46 +0000 (11:33 +0000)]
Bug 33028: (follow-up) Fix trailing 0 decimals
We want to recognise the truthyness of a number vs string so we drop
trailing decimals if they're just 0.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 598970a1223b9af043b1977965322758565f7d06) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Fri, 3 Mar 2023 11:28:20 +0000 (11:28 +0000)]
Bug 33028: (follow-up) Move monetary definition into hash
This patch moves the defintion of monetary rule type into the rule kinds
hash.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b48a948cbe7f14526e4ea8836e5175e38ab9d20) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Thibaud Guillot [Tue, 21 Feb 2023 16:05:45 +0000 (17:05 +0100)]
Bug 33028: Fix calculations around cronjob fines.pl
When currency format is set on FR commas are decimals separators
but when cron like fines.pl try to calculate fines it's fails due to
this format.
I changed this behavior by targetted 'fine' and 'overduefinescap' in
circulation_rules.rule_name to unformat them when we save them.
This also fix the display in smart_rules table (before with commas price
was not good displayed - without decimals)
Test Plan :
1) Set your currency format on 'FR' and 'fine' OR/AND 'overduefinescap'
with commas
2) Be sure to have some patron overdues
3) Run ~/misc/cronjobs/fines.pl with args to find overdues
4) See an error like 'isn't numeric in substraction[..] or gt > [...]'
5) Run updatedatabase script (it will replace commas in your rules
changed in step 1) )
6) Repeat step 3 and see that everything was going "fine" (:tada:)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f9e161b412621c048c55741bab56b92c0b01a15) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 951e67a1b3dd1f26eddeaecd2dc63991f9667927) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
David Cook [Tue, 6 Jun 2023 03:48:06 +0000 (03:48 +0000)]
Bug 33881: Clear self-check JWT during auth kick out
This patch clears the JWT cookie during auth kick out (ie
when a web user navigates from the self-check out/in to
the rest of Koha).
Test plan:
0. Apply patch and koha-plack --reload kohadev
1. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Log in as the "koha" user
3. In another tab, go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=a&weight_search=1
5. Note that you are prompted to "Log in to your account" via the normal Koha prompt
6. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
7. Note that you are prompted to "Log in to your account" within the "Self checkout system",
and note that your self-checkout session for the "koha" user has *not* persisted like
it did before the patch was applied
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa961b97b8f52d1c9920c72d9338d150deb829b) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 158edb411b32253fae4f068ce416d6ad4d1a67d3) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 30524: (QA follow-up) Unit tests for GenerateCSRF()
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60d11ae7251a227fab3977ecd61cb01d0f062f79) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Kyle M Hall [Thu, 27 Jul 2023 11:45:57 +0000 (07:45 -0400)]
Bug 30524: (QA follow-up) Only generate CSRF token if it will be used
This patch avoids generating CSRF tokens unless the csrf-token.inc file
is included in the template.
Passed token doesn't need HTML escaped. The docs for WWW::CSRF state:
The returned CSRF token is in a text-only form suitable for inserting into a HTML form without further escaping (assuming you did not send in strange things to the Time option).
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ddf1eb6cef14da365675890920ff72f010c59527) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
i.e. `">test<a ...` was successfully injected into the HTML.
I'm attaching a quick patch I've used to patch up our instance. It just indiscriminately URI-escapes all parameter keys. I didn't decode them back since as far as I understand all valid keys do not contain special characters.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e86e81a2480ec5486660bac241c694210eaefa11) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Thu, 13 Jul 2023 09:40:38 +0000 (10:40 +0100)]
Bug 22990: (follow-up) Fix suggestion.pl
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64500a92130f6e879b6a49b5ee7c9f45b7554170) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
David Cook [Wed, 11 May 2022 07:06:55 +0000 (07:06 +0000)]
Bug 22990: Fix template toolkit syntax issues in shelves_results.tt
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd69581fcf743c6720cc8b5fba687f75fc613321) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Thu, 16 Sep 2021 14:13:23 +0000 (15:13 +0100)]
Bug 22990: Fix for shelves table
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f232250e1186dd217e77db7e121a0b98a789cb) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Amit Gupta [Wed, 22 Jan 2020 16:07:22 +0000 (21:37 +0530)]
Bug 22990: Add CSRF protection to boraccount, pay and suggestion
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Test plan would have been nioe.
Tested by changing MAX_AGE with suggestions. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 833d1dc8b082cc742b88e358edef77960b5ffc2f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
David Cook [Tue, 25 Jul 2023 05:18:00 +0000 (05:18 +0000)]
Bug 34368: Add CSRF token to Content Management pages
This change adds a CSRF token to the Content Management pages
at additional-contents.pl.
Test plan:
0. Apply patch
1. koha-plack --restart kohadev
2. Try to add "News", "HTML customizations", and "Pages".
3. Try to delete these new content entries
4. Note that you were successful in your endeavours
JD amended patch: remove empty line removal (no need to create
unecessary conflicts)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e97fae72141446b0a2fb06c454c601966e5f3494) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Fri, 23 Jun 2023 10:52:28 +0000 (11:52 +0100)]
Bug 30524: Unit tests
Test plan:
Run t/Output.t
Run t/db_dependent/Auth.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2918f6ceda533719ac0da53d8245ea4826f43681) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 13 Apr 2022 12:55:04 +0000 (13:55 +0100)]
Bug 30524: Core CSRF checking code
Split out from bug 22990 as requested.
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aba9e61cfbab1e915f1be4a527b5708b9ec59c35) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Katrin Fischer [Sun, 16 Jul 2023 14:11:19 +0000 (14:11 +0000)]
Bug 34181: Fix jQuery selector to make delete checkboxes reappear
Bug 32257 changed the page structure slightly to fix a display
issue with the labels. This resulted in a broken selector in the
function for displaying the checkboxes for deleting/emptying a
certain patron field.
To test:
* Go to Tools > Batch patron modifications
* Enter some cardnumbers or borrowernumbers
* On the batch patron edit form, verify that the checkboxes
behind each input field are missing
* Apply patch
* Verify the checkboxes reappeared
* Verify that for mandatory fields the checkbox is locked
* Make some batch edits and verify the checkboxes work as
intended
Signed-off-by: Lisette Scheer <lisette.scheer@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 d81b009ab0634e1ae33a1bb5cf20cad538bb361f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Jonathan Druart [Fri, 21 Jul 2023 09:27:26 +0000 (11:27 +0200)]
Bug 34337: (bug 33581 follow-up) Sample patrons not inserted
The "select all" link for the optional sample data is not selecting
holidays and patrons.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39496af98f3d6408821636b92c5f6e3a25e5e71c) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Martin Renvoize [Wed, 19 Jul 2023 09:24:32 +0000 (10:24 +0100)]
Bug 34178: (QA follow-up) Tidy
Tidy the relevant lines to pass the new QA rules
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 30 Jun 2023 19:32:36 +0000 (19:32 +0000)]
Bug 34178: Adjust tests
We need to clear the cache when changing rules/statuses
To test:
1 - prove -v t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Nick Clemens [Fri, 30 Jun 2023 19:26:40 +0000 (19:26 +0000)]
Bug 34178: Cache ItemsAnyAvailableAndNotRestricted in memory and don't precalculate
There are several places in the code where we precalculate ItemsAnyAvailableAndNotRestricted to avoid
looping on this routine when calling IsAvailableForItemLevelRequest on a list of items form a biblio
The value of ItemsAnyAvailableAndNotRestricted is only used when there is a circulation rule for
'onshelfholds' with a value of '2' (If all unavailable)
Rather than calculate a value that may never be used, let's cache this value per request when we do
calculate it - and reuse the cached value
To test:
1 - Apply patch
2 - Set circulation rule 'On shelf holds allowed' as 'If all unavailable'
make sure the rule applies to all of the items/patrons you test with
3 - Find a record with two items that are available
4 - Try to place a hold for a patron - not allowed
5 - Check out one item to another patron
6 - Attempt hold - still not allowed
7 - Check out second item to another patron
8 - Attempt hold - allowed!
9 - Apply patch
10 - Cancel and replace hold - it is allowed!
11 - Check in one item, and cancel hold
12 - Place hold - not allowed!
13 - Check in second item
14 - Place hold - not allowed!
15 - prove -v t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
RMAINT Comment: We remove x-koha-query in the header support
inadvertantly when backporting bug 33974. As such we backport the test
fix only for bug 33971.
This patch removes handling of x-koha-query from the tests.
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass! Change from x-koha-header to q= gives same
results.
4. Sign off :-D
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0f1b048b5d1a0e575a0352b978a21297cc282ad5) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 33671: (follow-up) Disable FK check for column change
See also BZ report. As suggested by Tomas.
NOTE: The dbrev is extended too for removing records with a failing guarantor_id
foreign key (theoretically not present obviously).
Test plan:
1) cp installer/data/mysql/db_revs/220600048.pl installer/data/mysql/atomicupdate/
2) Run updatedatabase.pl
3) Remove copied file
Bonus:
Manually remove FK constraint before running updatedatabase.
Insert a record with bad guarantor_id into relationships manually.
Run the update again.
You should not see the message that the constraint is removed.
Is the bad record count reported and record removed?
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Simplified. No longer removes the FK. Just disables during ALTER. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0397251ece455801d5b3083feb84cf959cfcea83) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: tidy
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bc251cfdd1efdf6d0f7f299838ff067744ff17b) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
David Cook [Tue, 23 Aug 2022 06:27:59 +0000 (06:27 +0000)]
Bug 31339: Add staff wrapper template include for tool plugins
This change adds a template include which can be used as a
WRAPPER for tool plugins, which makes it easy to pages in tool
templates without having to copy and maintain a lot of template
boilerplate.
Test plan:
0. Apply patch and koha-plack --restart kohadev
1. Upload koha-plugin-test-wrapper
2. Enable the plugin
3. Click "Actions" and click "Run tool"
4. Note how the plugin page looks like a perfect Koha Tools page
5. Note that the plugin only contains 6 lines of template code
to achieve this effect
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bc13d57e02083a541411aa964cb244a0e75ae8d5) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Katrin Fischer [Fri, 30 Jun 2023 14:22:17 +0000 (14:22 +0000)]
Bug 29471: Add display of MARC 520 to staff interface detail page
At the moment 520 only displays in the OPAC. With this patch it
also displays in the staff interface detail page.
To test:
* Find a record with 520 or add some 520 entries to a record
Note: different ind. 1 values will result in different labels
* View the record in the staff interface and the OPAC
* Verify only the OPAC shows the 520 entries
* Apply patch
* Verify now the staff interface displays them as well
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Updated patch for displaying $u as link.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Restored signoff line from Phil. Change only for $u. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 256518bf75f4df70a62bfe401bd911473e629efd) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Owen Leonard [Tue, 27 Jun 2023 13:40:07 +0000 (13:40 +0000)]
Bug 29732: Check alert in cataloguing authorities should be a static message
This patch modifies the authority record editor so that form
validation errors are collected in a static "dialog" at the top of the
page instead of showing in a transient JavaScript alert.
The text of the message is roughly the same as it was in the alert, and
links have been added so that the user can click to jump directly to the
field referenced.
If the user scrolls down away from the static error message, a button
appears in the floating toolbar to jump back to the message.
- Go to Authorities and create a new authority record using a framework
which has multiple mandatory fields defined
(e.g. an unmodified default framework)
- Without entering anything in mandatory fields, click the "Save"
button.
- You should see a message box appear at the top of the page.
- It should list each missing mandatory subfield and tag, each with a
"Go to field" link next to it.
- Clicking the "Go to field" link should switch you to the correct tab
and scroll the mandatory field into view.
- When you have scrolled down far enough for the error messages to be
offscreen, an "Errors" button should appear in the floating toolbar.
Clicking it should scroll the box back into view.
- If you fix some but not all of the missing mandatory fields the
message should update with only the current issues.
- Confirm that the record saves when all issues are resolved.
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5d572ec461adc2693cd3aa35d5180006636416cb) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 33270: (QA follow-up) Do not change param hashref
Might just be a theoretical thing now, but safer to clone.
Test plan:
Run t/db_dependent/Koha/Biblio/Metadata.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfbe8daf2118f0ecdeea13ef866e86d2e905b686) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Resolve:
WARN tidiness
The file is less tidy than before (bad/messy lines before: 21, now: 24)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3aba2b06527a36ad4edcf1cafbf614c974a590e) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Tue, 11 Jul 2023 13:59:50 +0000 (13:59 +0000)]
Bug 33270: (follow-up) Handle records that fail attempt to ignore bad characters
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ea1a282b5e2100578354c44d273ba77ede7ae5af) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Thu, 22 Jun 2023 11:22:18 +0000 (11:22 +0000)]
Bug 33270: Attempt to recover from invalid metadata exception
This patch uses the new record_strip_nonxml routine to attempt to display
the record when it contains invalid characters
Rather than silently strippg these, we warn in the logs, then add an 'about'
container to the response. It is displayed nicely in the web view or sent as "INVALID_METADATA" in
the xml response
The 'error' codes for OAI seem to be at the request level, and the offered codes don't have a match
for a bad record. Adding the about when we can recover seems the most generous response
To test:
Test plan, assumes using KTD default data - otherwise you need to find and import a record with encoding issues:
1 - Enable OAI-PMH system preference
2 - Browse to:
http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&resumptionToken=marcxml/350////0/0/352
3 - 500 error:
Invalid data, cannot decode metadata object (biblio_metadata.id=368, biblionumber=369, format=marcxml, schema=MARC21, decoding_error=':8: parser error : PCDATA invalid Char value 31...
4 - Apply patch, restart all
5 - Reload the page
6 - It loads!
7 - Click 'Metadata' for record 369 - it succeeds!
8 - Check the logs - confirm you see a warning of the record problem
9 - Confirm 369 has an about section
10 - Check the individul 'GetRecord' response as well
http://localhost:8080/cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=oai_dc&identifier=KOHA-OAI-TEST:369
Signed-off-by: Sam Lau <samalau@gmail.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 c71468537b4fa589e91e7fd5823ddd4f54379e21) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Fri, 23 Jun 2023 13:08:31 +0000 (13:08 +0000)]
Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata
This adds a routine that can strip non xml characters form a record.
It is intended for cases where we do not wish to throw an exception,
but rather need to process a record to allow other work to continue
To test:
prove -v t/db_dependent/Koha/Biblio/Metadata.t
Signed-off-by: Sam Lau <samalau@gmail.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 4997d59c83ec1c63a3dc2c089fed79e3ad5fa764) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jan Kissig [Wed, 12 Jul 2023 08:40:32 +0000 (10:40 +0200)]
Bug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS error in selectTab( "#tab0XX_panel" );
This is because no nav tabs are build in addbiblio.tt as BIG_LOOP has a
length(size) of 1
To test:
1) go to More>Cataloging
2) click +New record
3) Click Settings> Fast add framework
4) take a look on console
5) try selecting a different framework now, will have no effect
6) apply patch and redo steps 1 to 5
7) there should be no error in console and a change in settings works a
expected
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3ff3a62048731c130e7185f7ac81e07f41f6ff9) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@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 fbc21148e73547c0e557f106c02dcedbdcc67807) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@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 8e545cff7523b1930702b9de0eaff0b246a0ef1e) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 34288: Allow access to the cataloguing module with `tools` permission
Bug 31162 moved the cataloguing tools to a new cataloguing module home
page. This prevents people without cataloguing permissions, but with
some tools permissions to access things like the labels creator tool.
I tracked all permissions on the cataloging-home.tt template, including
the Stock Rotation ones which I initially missed because I was focusing
on tools.
This patch makes the cataloging-home.pl page require either
'cataloguing' or any relevant 'tools' permission to allow access. the
page.
The staff interface main page and the top bar dropdown are updated using
the same logic to display the cataloguing module link.
For that purpose, I wrapped the permissions on a sub in `C4::Auth`.
To test:
1. Have a patron with only 'catalogue' and some of this permissions:
2. Log in
=> FAIL: No link to the cataloguing module, neither in the dropdown
3. Apply this patch
4. Repeat 2
=> SUCCESS: You have the link!
5. Play with the different combinations and notice things are sound and
correct
6. Sign off :-D
Signed-off-by: Kyle M Hall <kyle@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 0db60995a8dd093210ffa772f56b7d5bac28d197) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Katrin Fischer [Sun, 9 Jul 2023 14:08:51 +0000 (14:08 +0000)]
Bug 29762: (follow-up) Change field names from phone to primary phone
This change is made in order to make sure that the labels on the
normal patron form and the batch patron edit tool match up.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3f80a0fcf74be12bb12f249d79139df29455f4a5) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Philip Orr [Fri, 7 Jul 2023 13:21:46 +0000 (13:21 +0000)]
Bug 29762: Change field names from "Mobile" to "Other phone"
This Patch changes the field name for "Mobile" to "Other phone"
in Patron batch modification.
To test:
1. Apply the patch
2. Go to Tools -> Batch Patron Modification and add some patrons
3. Hit "continue"
4. Verify that in the list of patrons you selected, the field
"Mobile" has been replaced by the field "Other phone"
5. Verify that down below in the fields to be batch modified,
the field "Mobile" has also been replaced by the field "Other
phone"
6. Add some data into the field "Other phone" (e.g. 12345 or
some other number) and hit save
7. Confirm that the field was correctly modified and is still
named "Other phone"
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 782bb4acf96e9263fabcd6d3b3d1637f890aa9f1) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Katrin Fischer [Mon, 10 Jul 2023 21:30:41 +0000 (21:30 +0000)]
Bug 34232: (QA follow-up) Remove superfluous "Use:" from each list entry
We do have a heading "Use existing item groups" above the
entries. The added "Use:" in front of each entry is not requires and
makes entries longer and harder to scan.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c0ea36a0072f0398c896bc6f3280cf7bfea48e8) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Lucas Gass [Fri, 7 Jul 2023 19:31:15 +0000 (19:31 +0000)]
Bug 34232: Make dropdown on additem page rescept display order
To test:
1. EnableItemGroups
2. Find a record and add some new item groups with different display orders
3. Now edit an item on the record and scroll down to the dropdown underneath "+ Add to item group"
4. Notice that the values in the dropdown do not respect the display order.
5. Apply patch and restart_all
6. The display order should now be respected
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8065e3515abb79317f7c2dcddcb794529ffc9348) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Matt Blenkinsop [Tue, 23 May 2023 14:01:40 +0000 (14:01 +0000)]
Bug 33808: Add aria-labels in reports-toolbar.inc
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8fac9067b2494cca29a2b2147b78366c6a53bcf6) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Matt Blenkinsop [Tue, 23 May 2023 14:00:59 +0000 (14:00 +0000)]
Bug 33808: Add aria-labels in basket.tt
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0813a3b3dc68f8498ec83cd7df2b0ebad099378) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Matt Blenkinsop [Tue, 23 May 2023 14:00:11 +0000 (14:00 +0000)]
Bug 33808: Add aria-labels in opac-basket.tt
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa0f113f97c1b79b69fc7f3999ced00d3ac2b3c3) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Matt Blenkinsop [Tue, 23 May 2023 13:58:13 +0000 (13:58 +0000)]
Bug 33808: Add aria-labels in opac-shelves.tt
This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 429f0d6dce8e28fee5e63f06f63552775aadc543) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Michael Hafen [Wed, 5 Jul 2023 17:17:09 +0000 (11:17 -0600)]
Bug 34209: Follow up on Bug 28726 - move whole 'select all ...' header into condition
Move the whole search header div into the checkbox column condition, so
that other patron search popups don't have an empty div.
To test:
* Activate the ERM module
* Create a new agreement
* Search for a user using the pop-up search
* Verify there is an empty div showing as grey box above the table
* Go to tools > label creator > new batch
* Search for patrons
* Verify the box isn't empty and shows the select all ... options
* Apply patch
* Repeat steps, verify the empty div is gone and the options remain
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c2e5a3242529a417d75585af113f6b50e2e690f0) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Phil Ringnalda [Sat, 1 Jul 2023 15:41:15 +0000 (08:41 -0700)]
Bug 34182: Don't set biblio.serial based on biblio.seriestitle in AddBiblio
A misunderstanding of the intention of some dead code that probably wanted
to set biblio.series (which doesn't exist) left us setting biblio.serial
if biblio.seriestitle was set. The only thing series and serial have in
common is the first four letters. We shouldn't set serial on something
with a series (unless someone also sets serial on it, of course).
Test plan:
1. Administration - MARC bibliographic framework - Actions button next to
Default framework - MARC structure
2. In the Search for tag input type 942 and click search
3. Actions button next to 942 - Edit subfields
4. Tab s - check the checkbox for Editor, uncheck the checkbox for
Collapsed - Save changes
5. Cataloging - New record
6. Click in the input for 000 and hold down Tab until you get past 008
to fill in mandatory default values, then type any character in 040
subfield c
7. Tab 2 - In 245 subfield a type Series not serial
8. Tab 4 - In 490 subfield a type any character
9. Tab 9 - Set the value of subfield c to Books
10. Click save and leave the tab open to keep the biblionumber
11. Cataloging - New record - repeat step 6
12. Tab 2 - In 245 subfield a type Serial not series
13. Tab 9 - Set the value of subfield c to Books - Type 1 in subfield s
14. Click save, the biblionumber should be one higher than the first one
15. Reports - Create from SQL
16. Type something in Report name, paste in the SQL
SELECT biblio.serial, biblio.seriestitle, biblio.title FROM biblio WHERE
biblionumber IN ("","")
and put your first biblionumber in the first "", your second in the
second.
17. Save report - Run report
18. Series not serial should have a blank in the serial column and the
character you typed in the seriestitle column; Serial not series
should have a 1 in the serial column and a blank in the seriestitle
column.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 65b7c6731933f4b7d284ac07b9adab0d2ada60ca) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Wed, 5 Jul 2023 10:41:09 +0000 (12:41 +0200)]
Bug 34184: Add empty option for suggestion "document type"
Currently when editing a suggestion, the document type will preselect to the
first entry as we don't have an empty entry.
This can lead to data errors easily.
Test plan:
Create a new suggestion
=> Notice that "document type" is empty by default, pick one
Edit it again
=> Notice that the value is kept and empty can be picked, pick empty
Edit again
=> Empty is selected and saved in DB
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6485f244e085fe48b796dd64178659c2f4a5e4ba) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pedro Amorim [Fri, 14 Jul 2023 08:37:27 +0000 (08:37 +0000)]
Bug 34256: Fix regression from 34092
It appears search_fields variable got lost somewhere in my own rebases.
search_fields variable was not being considered as it should, in the function.
I think this patch fixes it.
This showed in the borrowernumer no longer being searchable:
* Use search filters in patron search
* Set 'Search field' to borrowernumber
* Search for 19 (Henry) or 41 (koha) in sample data
* No results :(
* Apply patch
* Search leads to the patron record again
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bcabb5d24712b23963c4616efae19e940cf2c544) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Matt Blenkinsop [Wed, 12 Jul 2023 13:22:54 +0000 (13:22 +0000)]
Bug 34261: Add missing argument to show_account
This patch fixes a missing $crypt in the show_account function when deleting an edifact ordering account.
Test plan:
1) In system preferences search for EDIFACT and change EDIFACT to Enable
2) Navigate to Administration > EDI accounts
3) Create a dummy account
4) Try deleting the account using the delete button in the actions column on the far right
5) An error should be thrown - "Can't call method "decrypt_hex" on an undefined value"
6) Apply patch
7) Try deleting the account again
8) This time it should work and show the confirmation dialog box
9) Sign off
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0992769f6ee935d7f12c127ab5df827768361585) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Wed, 7 Jun 2023 13:20:40 +0000 (13:20 +0000)]
Bug 33939: Preserve order budget dropdowns and default budget dropdowns seperately
The dropdowns have different hints after bug 22802. We need to preserve those when adding
or hiding inactive budgets
To test:
1 - Add some inactive budgets to Koha
2 - Use the settings and file from bug 22802 to stage a file and begin adding to basket
3 - When adding to basket test the 'Show inactive funds' on both the 'Select to import' tab and the 'Default accounting details' tab
4 - Ensure the dropdown hints/defaults don't change when hiding/showing budgets
5 - Confirm inactive budgets are correctly shown/hidden
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 80eb5ac35be44afd5547e1fa75da475d88f95612) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Owen Leonard [Fri, 7 Jul 2023 12:19:27 +0000 (12:19 +0000)]
Bug 34225: KohaTable broken on batch item deletion and modification results
This patch adds the columns_settings include file to the batch item
modification and batch item deletion templates so that the tables can be
rendered as DataTables.
To test, apply the patch and go to Cataloging -> Batch item
modification.
- Submit a batch of barcodes or item numbers for modification.
- On the next page which shows all the items you submitted, the table
should be rendered as a DataTable.
- Confirm that sorting, filtering, and export all work correctly.
- Confirm that there are not JS errors in the browser console.
- Perform the same tests on Cataloging -> Batch item deletion.
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8813c23a79cae05b8eb3a176bea5fa755bf1ee6a) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f2a47d3ce78a23aa1b6253188108ce3b0047b7) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Marcel de Rooy [Sat, 13 May 2023 12:18:02 +0000 (12:18 +0000)]
Bug 33727: Merge both Calendar tests
The old t tests become part of the first subtest.
Test plan:
Run the new t/db_dependent/Calendar.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eb6c36c4ddec644619486dea5520e89ef9af56b) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Marcel de Rooy [Sat, 13 May 2023 12:06:55 +0000 (12:06 +0000)]
Bug 33727: Groundwork for Calendar.t
Update test while removing need for Test::DBIx::Class.
Test plan:
Run t/Calendar.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e736a5d5f342325651944772b74c5ace1b8814f) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 34243: Fix copy/pasted city references in api tests
Two occurrences.
Just comments.
Test plan:
Read the patch.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 308d75d05d105a5829c98617b5229fae587c32f3) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Phil Ringnalda [Tue, 27 Jun 2023 22:34:59 +0000 (15:34 -0700)]
Bug 34097: Prevent clicking ellipsis for dateaccessioned plugin from scrolling up
Test plan:
1. Find a record with several items (in ktd "MacLaren's Gaelic
self-taught" will do nicely
2. Click the Edit button next to one of the items
3. Click the "..." to the right of "d - Date acquired" and verify that the
page doesn't scroll up to the top, and that the current date is
inserted in the field
4. Click the "..." to the right of "w - Price effective from" and verify
that the page doesn't scroll up and the current date is inserted
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3824547e5c92328ae0bf54939ec0315b1cbfd98f) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Tue, 11 Jul 2023 08:21:09 +0000 (10:21 +0200)]
Bug 33863: Update values in data that will be saved
We are not saving the values of the input but a representation of the
form, contains in $("#order_edit").data('row');
To acchieve that it's preferable to reuse _update_unitprice and call it
when #change_currency is modified.
Some code cleaning slipped into the patch, for readability purpose.
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3a7202363d0033a9c29b1143fc47c8c631f269f) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Wed, 5 Jul 2023 09:55:33 +0000 (11:55 +0200)]
Bug 33863: Reset value if checkbox is unchecked
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 768702be7af6afe8df4558c56ef3bd3d09562603) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Tue, 30 May 2023 12:37:33 +0000 (14:37 +0200)]
Bug 33863: (bug 25655 follow-up) Check "Change currency" only if checked before
We should not check "Change currency" if it has not modified in the
original order.
Test plan:
Create an order with 3+ items
Receive 1 item, don't check "change currency"
Receive an other item
=> "Change currency" is not checked
Check "Change currency", modify the currency and the price
Receive a third item
=> Change currency is checked, invoice currency and price are set
correctly to the previous values
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 140bad214c86531c57ecf1ec804697ac1be4895a) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Katrin Fischer [Mon, 10 Jul 2023 21:08:38 +0000 (21:08 +0000)]
Bug 33946: (QA follow-up) Add spans and classes for styling and translatability
Adds back the spans around No title and more spans for
'No bibliographic record' with individual classes for each
to allow for styling later.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f91cc77a68983c1c47ca785eb750dfebd3a1cdb5) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Thu, 8 Jun 2023 12:19:07 +0000 (13:19 +0100)]
Bug 33946: Resync opac/intranet includes
This patch resyncs the whitespace chomping in the opac include to match
that in the intranet include so aid in diffing between the two.
No changes should be visible in the UI but there may be cleaner markup
as a result.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 04814be829ad99bb5a5302f84419528d64548465) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 8 Jun 2023 07:48:42 +0000 (09:48 +0200)]
Bug 33946: Do not display link to non-existing bibliographic record
If you use biblio-title.inc on a biblio that does not longer exist, "No title" is shown with a link to catalogue/detail?.pl?biblionumber=
We should at least remove the link.
We could even do better and display "No bibliographic record" if the biblio does not longer exist.
Test plan:
Edit mainpage.pl, add
$template->param( your_bib => Koha::Biblios->find(42) );
Edit intranet-main.tt, add
[% INCLUDE 'biblio-title.inc' biblio=your_bib link = 1 %]
Not hit the main page and see what's hapenning.
If you have a bibliographic record with biblionumber=42, its info will
be displayed.
Remove this record and try again => it's replaced with "No bibliographic record"
without a link
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3e0abddffb8927a48dcf798f8934b5565a9b3b4) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 6 Jul 2023 12:08:26 +0000 (14:08 +0200)]
Bug 34211: Add +strings for GET /api/v1/biblios/:biblio_id/items
Allow to embed stringified version of attributes for the "Get items for
a biblio" endpoint
Test plan:
curl -u koha:koha --request GET 'http://localhost:8081/api/v1/biblios/47/items' --header "Content-Type: application/json" --header "x-koha-embed: +strings" | jq
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2d27d02a4d63b3d3a322db18db8420693e986fdd) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 6 Jul 2023 12:08:13 +0000 (14:08 +0200)]
Bug 34211: Add tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b86ad81bbf19eb5becf0652dcd23dad99cf158be) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Wed, 5 Jul 2023 13:44:50 +0000 (15:44 +0200)]
Bug 27824: Trim column headers
To support additional spaces.
Using the system for defining a column name placeholder (Bug 23390), if
there is a space inside the column name placeholder it won't work. The
SQL example in Bug 5697:
SELECT
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a
href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=',
i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">',
i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i
"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber
for batch." With that space removed it works as expected.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c73648f77e530fdd50885bd0e72343d0d4c5c4e) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Wed, 5 Jul 2023 13:44:32 +0000 (15:44 +0200)]
Bug 27824: Add a test
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a91e80af7dc76c926c246b8f6f98bf6682345dcd) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 31147: Recalls should not adjust due time for related checkouts
The current recalls behaviour adjusts the due date of the most appropriate checkout based on the 'recall due date interval' circulation rule. It also adjusts the due time, which is buggy behaviour. The due date should be adjusted based on the circulation rule, but the due time should remain the same.
To test:
1. Enable the UseRecalls system preference and configure recalls-related circulation and fines rules
2. Check out Item A to Patron A
3. Log into the database and check the due date for that checked out item, e.g.
SELECT date_due FROM issues WHERE itemnumber = XXXX;
--> It should be YYYY-MM-DD 23:59:00
4. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database
SELECT date_due FROM issues WHERE itemnumber = XXXX;
--> It should be today + the number of days in your recall due date interval circulation rule, at the exact time you placed the recall. This is buggy behaviour.
5. Apply the patch and restart services
6. Check in Item A, do NOT fulfill the recall
7. Cancel the recall
8. Check out Item A to Patron A
9. Log into the database and check the due date for that checked out item, e.g.
SELECT date_due FROM issues WHERE itemnumber = XXXX;
--> It should be YYYY-MM-DD 23:59:00
10. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database
SELECT date_due FROM issues WHERE itemnumber = XXXX;
--> It should be today + the number of days in your recall due date interval circulation rule, with time of 23:59:00.
11. Check in Item A, do NOT fulfill the recall
12. Cancel the recall
13. Check out Item A to Patron A. Specify a due date and change the due time so it isn't 23:59.
14. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database
SELECT date_due FROM issues WHERE itemnumber = XXXX;
--> It should be today + the number of days in your recall due date interval circulation rule, with time you set in Step 13.
Sponsored-by: Catalyst IT Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 780d6ecb51710bfc2b6978cbe8b8614b12c7eadf) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
David Cook [Wed, 7 Jun 2023 05:30:40 +0000 (05:30 +0000)]
Bug 33933: Only show use restriction once on OPAC detail page
This patch removes a regression from bug 32611 that caused the
use restriction text to be shown twice for "Available" items.
Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=29
2. Edit item and add "Restricted access" for "5 - Use restrictions"
3. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29
4. Note that "Status" says "Available (Restricted access)" and there is no
duplicate "Restricted access" at the top of that table cell
Signed-off-by: ebal <eric.balluto@univ-lyon2.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0df163bfcfafb3baac6d11ab1864bdbd4d0befa) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Phil Ringnalda [Tue, 20 Jun 2023 01:32:46 +0000 (18:32 -0700)]
Bug 28196: Insert searchid in URL correctly, so it doesn't follow the hash
Test plan:
1. Search the catalog in the staff client for anything which will return
at least two results
2. Click on any result to go to the bib detail page
3. Click the edit button for any item attached to the bib
4. Verify that the loaded URL contains &searchid=scs_(a number), and
that the URL ends with #edititem
5. Make any change to the item, save, verify that your change was made
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 213392fd6bc02f3551a573e3a6127f3ecbaaed31) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Lucas Gass [Fri, 7 Jul 2023 23:12:56 +0000 (23:12 +0000)]
Bug 34220: Only show biblio-view-menu.inc if their is an associated bib
To test:
- Go to Tools > Log viewer
- Uncheck All modules
- Check the 'Catalog' module
- Make sure "To screen in the browser" is the selected output
- Click Submit
After the page loads, instead of the tools side navbar appearing on the left, a 'catalog detail' type navbar (Normal, MARC, ISBD, etc.) is present with links that error out as there's no associated bibnumber.
-Apply patch
-Try again, you should not see the biblio-view-menu
-Try one more time but this time add a valid biblionumber to the Object: field. Now the biblio-view-menu should show with links to that particular bib.
Works as advertised. Signed-off-by: Alexander Blanchard <alexander.blanchard@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7118a01294c6eab2b79305d95ecf7cad64d69458) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Katrin Fischer [Sun, 9 Jul 2023 15:33:01 +0000 (15:33 +0000)]
Bug 31082: (QA follow-up) Fix translation - we are in a .tt not in a .js file
Just changing from two to one underscore.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7a0a31a79d09b985f0fd8dd4166f7ee825bc561) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>