Commit graph

49599 commits

Author SHA1 Message Date
3fac0d78aa 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 31cbd5ce94)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9741e94376)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:46 +00:00
30af01938c 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 0199f5fbbb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 00fc50a1f6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:37 +00:00
1a340d0030 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 3c2d40bb4a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32bddca286)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:29 +00:00
9c801dc346 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 e2634097c1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feb6ceaa24)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:21 +00:00
27e207f9ed 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 598970a122)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8407628512)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:13 +00:00
20555d6d50 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 2b48a948cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4a8fdaee66)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:05 +00:00
Thibaud Guillot
8da895d6f9 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" (🎉)

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 1f9e161b41)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f9eba2d23)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:55:53 +00:00
b5e1b2137f Bug 33117: Make dbrev idempotent
QA didn't spot the issue, nor I. So fixing now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 951e67a1b3dd1f26eddeaecd2dc63991f9667927)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit caa46019d0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:53:02 +00:00
Katrin Fischer
3ef1d005c1 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 d81b009ab0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 625d0f812a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:39:09 +00:00
28fcea332c 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 39496af98f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f400830a56)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:37:49 +00:00
2d9ace29c7
RMAINT: Fix permission of .08 release db_rev
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-08-15 10:37:08 +01:00
6ec5374a13 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: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 15:00:29 +00:00
38725ed0af Bug 30524: (QA follow-up) Fix tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 158edb411b32253fae4f068ce416d6ad4d1a67d3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 15:00:29 +00:00
9b6869af10 Update release notes for 22.11.08 release
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:17:06 +00:00
e4ddcfa49b Increment version for 22.11.08 release
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:31 +00:00
f05903b360 Fix translations for Koha 22.11.08
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:31 +00:00
Koha translators
a7403ca882 Translation updates for Koha 22.11.08
(cherry picked from commit 1b14e70f7fb487fab02e2055f5b4f0fe860d75db)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:30 +00:00
26ab7e0b20 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>
(cherry picked from commit d4187c77eb3b39977b759af7df7641e70cd96358)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:14 +00:00
b1bd7ec29a 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>
(cherry picked from commit 73ca151686b682aaa2b950ccbc89fcec14514112)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:08 +00:00
Michał Górny
f702922acb Bug 34023: Prevent HTML injection in "back to results" link from search page
It is possible inject raw HTML into the "Back to search results" link by leading the user to a search with specially crafted URL.

For example, using the demo instance:

1. Visit https://koha.adminkuhn.ch/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1&%22%3Etest%3Ca%20foo=%22

2. Refresh the page (for some reason, "back to results" doesn't appear unless I do that at least once).

3. Click any result.

Note that the result page now contains:

  <a href="opac-search.pl?idx=&amp;q=test&amp;weight_search=1&amp;">test<a foo=%22" title="...

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>
(cherry picked from commit cbc2b0e8dafe7053785f98247df253f014cd632c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:15:00 +00:00
a579f72ec8 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>
(cherry picked from commit 6fbc51bf06ba731d35a11ad5be3cba1c154b42a4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:54 +00:00
9d7031035e 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>
(cherry picked from commit 6f820f0f6b07eff3f2c4ad8c2d3d4dd909dd47b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:42 +00:00
486a99c804 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>
(cherry picked from commit 20fa891788e002a6679651397ca0782410882bb0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:36 +00:00
Amit Gupta
416604e1e6 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>
(cherry picked from commit 0c365b52f474e0fc0dd439f11bfa0a95534db029)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:30 +00:00
27f44f461e 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>
(cherry picked from commit a759adc91730da7b57ced0f1baf59e83031197f9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:21 +00:00
0d245c936c 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>
(cherry picked from commit 9436074a26fe903134f71e66b0f9fcb7f6724438)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:14:15 +00:00
c8ce2e559b 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>
(cherry picked from commit 6d6d36f6df79d3df22ea299934073d903f86e64a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-28 11:13:55 +00:00
0b4b871f6d Bug 33167: (RMAINT fix) Revert 33167
Bug 33167 was reverted from 22.11.x but the revert does not seem to have removed all lines causing failing tests. This patch removes remaining lines and refactors the code to its pre-33167 state
2023-07-20 08:41:00 +00:00
80fe98aff7 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 0397251ece)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4cdb3a57db)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:25 +00:00
f26621c8c4 Bug 34303: Only perlcritic files from git repo
Test plan:
Run t/00-testcritic.t

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 2bc251cfdd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 835bc43d31)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:25 +00:00
f0be1b2afa 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 256518bf75)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2cb9fa1b52)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:24 +00:00
2c51799a8a 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 cfbe8daf21)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 32db2823b8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:24 +00:00
9c25541e55 Bug 33270: (QA follow-up) Tidy
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 b3aba2b065)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d11b4360a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:24 +00:00
8160a65283 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 ea1a282b5e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 247ebf90b2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:23 +00:00
a261d736d1 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 c71468537b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2e23ed06b7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:23 +00:00
b5e51d1319 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 4997d59c83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9544bd25a2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:23 +00:00
Jan Kissig
4492065f9e 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 e3ff3a6204)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 05f5c83140)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:22 +00:00
69657cae57 Bug 34288: Unit tests
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 fbc21148e7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e7c83d93cf)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:22 +00:00
dbf6a66d2e Bug 34288: (follow-up) Tidy block
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 8e545cff75)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7a77ea6985)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:22 +00:00
301f5ecf85 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:

* inventory
* items_batchdel
* items_batchmod
* items_batchmod
* label_creator
* manage_staged_marc
* marc_modification_templates
* records_batchdel
* records_batchmod
* stage_marc_import
* upload_cover_images
* stockrotation => manage_rotas

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 0db60995a8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afacad6a2d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 10:14:21 +00:00
7d1e4955fe Revert "Bug 33496: Add 'host_items' param to Koha::Biblio->items"
This reverts commit aac8c1e36e.
2023-07-19 10:52:40 +01:00
87559c60f0 Revert "Bug 33496: (follow-up) Correct param names"
This reverts commit f0e208c1e7.
2023-07-19 10:52:30 +01:00
516e389b9c Revert "Bug 33496: (QA follow-up) Update POD statement"
This reverts commit 552c25f4f9.
2023-07-19 10:52:16 +01:00
6dd447b36e Revert "Bug 33497: Use 'host_items' param to fetch all items at once"
This reverts commit dc273a8dfe.
2023-07-19 10:51:48 +01:00
8a49386234 Revert "Bug 33497: Add a filter relationship for branchtransfers"
This reverts commit f3890f6cb2.
2023-07-19 10:51:34 +01:00
545a92bd98 Revert "Bug 33497: (follow-up) Remove unecessary scalar"
This reverts commit a41761b357.
2023-07-19 10:51:21 +01:00
cff50728db Revert "Bug 33497: (follow-up) Adjust relationship name from bug 33493"
This reverts commit fa9118ed8d.
2023-07-19 10:51:10 +01:00
f8d5a40fea Revert "Bug 33497: Don't get host items if the MARC record is invalid"
This reverts commit a4896e3832.
2023-07-19 10:50:55 +01:00
c2383c03fd Bug 34029: (RMAINT fix) Update DBIC file
Commit fb202cc3ea was missed when cherry-picking and xt/author/podcorrectness.t was failing. This commit adds the updated DBIC file that fixes the test
2023-07-19 09:02:01 +00:00
fa3bd17476 Bug 34029: (QA follow-up) Fix slipped broken char
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12956d3e8a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fb202cc3ea)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-19 08:54:02 +00:00