Commit graph

51332 commits

Author SHA1 Message Date
da2083288e
Bug 25672: (QA follow-up): tidy up code
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:44 -03:00
ea22082649
Bug 25672: Convert to restricting to listed repositories only
I think instead of a plain on/off switch we should use it in combination
with the plugin_repo's and set it to restrict to only those repos' (i.e.
disable uploads entirely if no repo's are listed, or just allow those
repo's when there are).

This patch achieves that, but only if plugins are installed via the
plugin browser method. We disable all direct upload avenues, so install
is blocked for other cases.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:43 -03:00
aa8c26ae52
Bug 25672: Prevent uninstall when plugin browser upload disabled
When plugin browser upload is disabled, also prevent plugin browser
uninstall.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:43 -03:00
678b84c740
Bug 25672: (QA follow-up) Hide install after search button
If plugin upload is disabled, but there are git repositories listed in
the config for plugin searching, then you can search for a plugin and
attempt to install it. The install leads to an error page.

This patch removes the actions column and install button should the
enable_browser_upload option be disabled

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:42 -03:00
bfd633c461
Bug 25672: Enable enable_plugin_browser_upload by default
This patch enables enable_plugin_browser_upload by default,
since the current behaviour for Koha is to enable browser upload
when enable_plugins is 1.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:41 -03:00
e2e61ec6ca
Bug 25672: Use enable_plugin_browser_upload flag to control plugin upload
This patch adds a enable_plugin_browser_upload flag to koha-conf.xml, which
controls whether or not Koha intranet users can upload Koha plugins via
their browser. Like "enable_plugins", it defaults to 0 for new installs.

This is useful when you want to provide Koha intranet users with plugins
that are pre-installed by administrators (by CLI) or restricting them
to plugins from a Github repo. See the following for more information:
Bug 23975 - Add ability to search and install plugins from GitHub
Bug 23191 - Administrators should be able to install plugins from the command line

To test:
1) Apply the full patchset
2) Confirm <enable_plugins>1</enable_plugins> is present in koha-conf.xml
3) Add <plugins_restricted>1</plugins_restricted> to koha-conf.xml
4) Ensure that the <plugin_repos> block is not commented and contains at
   least one trusted organisation in koha-conf.xml
   If needed get it from: debian/templates/koha-conf-site.xml.in
5) Run restart_all (in koha-testing-docker)
6) Go to /cgi-bin/koha/plugins/plugins-home.pl and note that you don't see
   an option to upload plugins
7) You should however see a search option and upon search you should have
   results returned from the chosen trusted organisations listed in the
   <plugin_repos> block mentioned above.
8) Clicking install on one of the results should work as expected and install
   the plugin.
9) Go directly to /cgi-bin/koha/plugins/plugins-upload.pl and note that it says
   "Plugin upload is restricted to only those plugins listed by your server
   administrator" and gives instructions on how to enable unrestricted browser
   upload.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:41 -03:00
Thibaud Guillot
24ee60cb62
Bug 29811: Add timestamp option on authority record type
According to the timestamp option for bibs record type I added the
timestamp option for authority records.
Timestamp is already present in database on field "modification_time"

Test Plan :
1 - Be sure to have authority record type for easiest test create one
2 - Execute script export_records.pl in your koha/misc directory and
choose a date (example yesterday if you just created an authority
right now).(see export_records.pl -h for help)
3 - Timestamp option has no effect on authority record type
4 - Execute script again but choose the date of tomorrow for example
5 - Same result
6 - Apply this patch
7 - Play again steps 2 and 4
8 - On step 2 you will see only your authorities created today (because
script show you authority has changes since the date you choose in
option) and for step 4 you must see an empty file.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-31 11:02:40 -03:00
af8a332b9c
Bug 34227: (follow-up) Adjust selenium tests
This patch adjusts the selenium tests to address the renamed ID for the
elements.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:39:38 -03:00
5a188651e4
Bug 33809: Centralize duplicated code
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:24 -03:00
f2538c8365
Bug 33809: (follow-up) Grammar correction
This is somewhat nitpicky but I think "Show fewer..." is more correct
than "Show less..." for strings like "Show fewer authors."

'Generally, fewer is used when the number of things is counted ("fewer
problems") whereas less is used when the number is measured ("less
trouble" or "less time").'
-- https://www.merriam-webster.com/words-at-play/fewer-vs-less

It's not a strict rule but to my ear it sounds more correct. The brief
"Show less" displayed on screen seems fine because the object feels
indeterminate: "Show less information."

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:23 -03:00
b56d54bf7e
Bug 33809: Place hold and Add to cart links need better descriptions
The place hold and add to cart buttons should identify to screen readers which title the button is linked to. This patch adds aria-labels that include the item title to make this more clear

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:23 -03:00
36c41afe9b
Bug 33809: Facet "Show more/less" links don't identify what they are showing
This patch addresses the Show more/less links in the side menu in opac-facets.inc. The links don't identify which facet they are linked to and this is confusing for screen readers.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:22 -03:00
Katrin Fischer
a65c909ebc
Bug 27943: (QA follow-up) Alternate display in result lists
The original display put the equivalent heading right after
the main heading with a = as separator. As the 7xx are repeatable
that could get croweded easily, also if the terms are longer
we might see not so nice breakage.

This puts every 7xx on its own line below the main heading
with some indentation.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:21 -03:00
Katrin Fischer
a04f9447f7
Bug 27943: (QA follow-up) Perltidy
I have some trouble to get the tidyness test on
AuthoritiesMarc.pm passing. There are several outstanding
patches touching this file, so I didn't dare to perltidy
the whole file just yet.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:21 -03:00
George Veranis
b724bb579c
Bug 27943: (follow-up) Fix unit test, and use systempreference AuthoritySeparator
Instead of hardcoding the separator we take the value from systempreference.
Also adjust the unit test to expect the "equalterm" array.
Test plan same as before.

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:20 -03:00
Katrin Fischer
956ff1ab56
Bug 27943: (QA follow-up) Add missing TT filters
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:20 -03:00
George Veranis
a8b075a4d3
Bug 27943: Add support for 7XX equal terms on authorities marc21 display
Currently when a MARC21 authority has 7XX field they do not display on
authority search result page. 7XX is equal term of 1XX based on LC rules.
Applying this patch will enable that feature, which is important for non latin
catalogues.

Test plan:
1) Add a new authority with 1XX and 7XX fields.
2) Try to search that authority and check if 7XX values are displayed
3) Apply this patch
4) Try to search that authority and you will see that 7XX values are displayed
   like "1XX = 7XX"

Sponsored-by: Keratsini-Drapetsona Municipal Library, Greece
Mentored-by: Andreas Roussos
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Works for me!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:19 -03:00
60ed1898a0
Bug 22712: Make 'Show inactive funds' button on addorderiso2907.pl work for item budgets
This requires enabling MarcItemFieldsToOrder, see bug 34645

Add an inactive Budget and some funds to your system

Import a file with multiple biblios

Confirm the button hids/displays the funds for all item orders

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:18 -03:00
f1bbdee7ac
Bug 31393: Tidy
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:18 -03:00
Julian Maurice
6973625e7a
Bug 31393: Koha::Config: handle the special case for 'content' attribute
<key content="value"></key>

was wrongly parsed as

{ key => 'value' }

whereas it should be

{ key => { content => 'value' } }

The 'content' attribute is used in shibboleth config

Test plan:
1 Run `prove t/Koha/Config.t`

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:17 -03:00
David Nind
b0a8372c2f
Bug 32312: Add missing column descriptions to the statistics table
This adds missing descriptions to the existing statistics database
columns.

It also improves some existing descriptions.

1. Go to Reports > Guided reports > Create guided report.
2. Choose 'Circulation' for the module to report on and select
   'Next'.
3. Choose 'Tabular' for the type of report and select 'Next'.
4. Scroll down to the statistics table section and note that there
   are no descriptions for:
   - statistics.other
   - statistics.location
   - statistics.ccode
   - statistics.categorycode
5. Note that:
   - the description for statistics.type is 'Type'
   - the description for statistics.itemtype is 'Item type'
6. Apply the patch.
7. Restart all the things (restart_all).
8. Reload the page.
9. Note that:
   . there are now descriptions for the columns in step 4
   . the description for statistics.type is now 'Transaction type'
     (to more clearly indicate what it contains)
   . the description for statistics.itemtype is now 'Koha item type'
     (consistent with other tables where this is used, such as items)
10. Sign off :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
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>
2023-10-30 09:02:17 -03:00
Katrin Fischer
9cea8312a5
Bug 35147: (QA follow-up) Capitalzation: Shibboleth Login
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:16 -03:00
Aleisha Amohia
184299c9c8
Bug 35147: Add classes to Shibboleth text on OPAC login page
This enhancement makes it easier for libraries to change the Shibboleth-related messages on the OPAC login page.

Libraries can employ OPACUserJS to change the text. For e.g., I can replace the message "If you do not have a Shibboleth account, but you do have a local login, then you may login below." by putting the following in OPACUserJS:

$(".shib_local_text").text("If you do not have a staff member account, but are a member of the library, then you may log in below.");

To test:

1. Go to <your-opac-url>/cgi-bin/koha/opac-user.pl , or disable the OpacPublic system preference. Ensure you are logged out of the OPAC.
2. In the staff interface, search for the OPACUserJS system preference under Koha Administration. Add the following JS and Save:

$(".shib_invalid").text("Test changing the invalid Shibboleth login message.");
$(".shib_title").text("Test changing the Shibboleth login heading.");
$(".shib_url").text("Test changing the Shibboleth account link text.");
$(".shib_local_title").text("Test changing the local login heading.");
$(".shib_local_text").text("Test changing the message that shows if you do not have a Shibboleth account.");

3. Refresh the OPAC and confirm the text changes to reflect your JS. Note: The invalid Shibboleth login will be a bit harder to test, so if you can't test, confirm the HTML in the patch looks correct.

Sponsored-by: New Zealand Council for Educational Research
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:15 -03:00
Julian Maurice
826aeaf22f
Bug 32853: Fix cataloguing/value_builder/unimarc_field_125.pl
Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:15 -03:00
Julian Maurice
4fa7d59c61
Bug 32856: Fix cataloguing/value_builder/unimarc_field_126.pl
Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:14 -03:00
2988c54971
Bug 35111: Ignore SIGPIPE in background jobs worker
This change explicitly ignores SIGPIPE signals in the background jobs
worker.

Daemons like Starman ignore SIGPIPE so it makes sense to explicitly set this.
Differences in the inner workings of MySQL vs MariaDB client libraries have yielded
different behaviours in automatic reconnections and potentially SIGPIPE handling,
so this helps to make the overall behaviour more consistent.

Test plan:
0. Apply patch and run "restart_all"
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
2. Click "Save" > "MARCXML"
3. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
4. Click "Choose file", choose the MARCXML file, click "Upload file"
5. Click "Stage for import"
6. Note the job is marked as "100% Finished"

7. In a separate window run "docker restart koha-db-1"
8. Repeat steps 3-5 for uploading file and running stage for import
9. Note that the job is marked as "100% Finished" as you'd expect

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added comment on the SIG PIPE line.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-30 09:02:14 -03:00
7c6ef360cd
Bug 10762: Fix tests continued
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-28 10:02:31 -03:00
9f98be593a
Bug 29523: Fix tests
Some tests compare things to the output of `->to_api` and are exploding
because the (now mandatory) `user` parameter is not passed in the call.

In the case of IdP.t I just got rid of the use of `to_api` as we are
just trying to acknowledge a new user has been created and the API
representation of it is irrelevant.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-28 09:47:38 -03:00
42330ef523
Bug 10762: Fix default values test
This patch adds the new default values to the data structure the result
is compared with.

It also fixes the tests count (probably an untested rebase issue)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-27 17:18:20 -03:00
43bd124f87
Bug 35173: Correctly concat error strings
This patch moves the call to $sftp->error outside of the double quote
string and into a . concat to properly expose the error message as
apposed to outputting 'Net::SFTP::Foreign=HASH(0x559c9118f0c8)->error'

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2023-10-27 16:54:30 -03:00
67f4fcc204
Bug 35003: Make cancelled hold requests filter by branch
To recreate:
1. Make sure you have the "Default waiting hold cancellation policy" set to allow via circulation rules.
2. Make several holds at different branches  holds and set them to waiting
3. Request to cancel those holds, making sure you cancel some for different branches.
4. Go to waitingreserves.tt and notice that you see all of the holds from all branches.
5. APPLY PATCH and restart services
6. Vist the waitingreserves.tt page and notice that the "Holds with cancellation requests" table can now filters by branch.
7. Use the "View all libraries" and make sure you can see all the holds with a cancellation request.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:54:06 -03:00
Katrin Fischer
e598fa8f48
Bug 34136: (QA follow-up) Perltidy
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2023-10-27 16:46:22 -03:00
Katrin Fischer
0ed87f732e
Bug 34136: (QA follow-up) Change Report to Reports as category in notices and slips
Looking at the other entries for the module in notices we most often
use the actual module name: patrons, suggestions, holds, etc.

So I updated "Report" to "Reports" to match that pattern.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2023-10-27 16:46:22 -03:00
94cee66ec7
Bug 34136: Add ability to render a report using a notice template
Sometimes it is useful to display the results of a report in a non-table format. We should be able to create notice templates to render reports.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Create a new notice template using the new "Report" option from the
   "New notice" pulldown.
4) In the "Print" area, paste the following template:

[% FOREACH b IN data %]
<div class="panel panel-default">
  <div class="panel-heading">[% b.surname %], [% b.firstname %]</div>
  <div class="panel-body">Expiration: [% b.dateexpiry %]</div>
  <div class="panel-footer">ID: [% b.borrowernumber %]</div>
</div>
[% END %]

5) Create a report with the query: SELECT * FROM borrowers
6) Once the report is saved, use the new "Run with template" option to
   select the template you just created.
7) Note that instead of the results being a paged table, you instead
   see the results rendered as cards!

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2023-10-27 16:46:22 -03:00
1d58ebfee3
Bug 35043: Do not have \n or \t appear in PO files
This is a trick, so that we won't have to deal with \t in PO files.
\n is not a problem, but it seems consistent to use the same method for
both.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:45:52 -03:00
6757cd5f86
Bug 35043: Use Locale::PO->quote
We have our own "quote_po" sub that is stating that Locale::PO::quote
is buggy because it does not deal with quoting new lines correctly.
However it seems that it is fixed now.

Ideally we could use Locale::PO::quote everywhere, but it does not
escape tab characters:
  $string =~ s/\\(?!t)/\\\\/g;           # \t is a tab

This means the following:
msgid "Tabulation (\\t)"
msgstr "Tabulation (\\t)"
become:
-msgid "Tabulation (\t)"
-msgstr "Tabulation (\t)"

And we are seeing the following on Weblate:
https://snipboard.io/BjQmDC.jpg

Note that Locale::PO has not been updated since 2014...

The real problem behind this is that we have 2 methods to quote strings.
At first glance it seems that Locale::PO::quote was not used before, but
with the introduction of the koha-i18n project we will have scripts that
will use Locale::PO->save_file_fromarray, which uses Locale::PO->quote
=> Those scripts will be used on the translation server for post
processing (security reason, marking potential XSS strings as fuzzy).

Test plan:
0. Do not apply the patch
1. gulp po:update --lang LANG # Replace LANG with your favorite language
   code
2. git commit -a -m"init PO files"
3. Apply this patch
4. Repeate 1.
5. git diff
   => The change is about the "Tabulation" and "New line" strings from
      tools/csv-profiles.tt
6. Translate them (replace the \t and \n with %s) and remove the fuzzy
   flag
7. install the template: cd misc/translator && perl translate install
   LANG
8. Enable the language, use it and go to the "Nouveau profil CSV" view
   => Notice that the \t and \n are correctly displayed.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:45:52 -03:00
3439185bb0
Bug 35141: (QA follow-up) Increment the bad count
Also move earlier print to warn for consistency.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:56 -03:00
706641e747
Bug 35141: Prevent link_bibs_to_authorities from dying on invalid metadata
When fetching the record we need to eval in case of exception

To test:
1 - Apply first patch
2 - perl misc/link_bibs_to_authorities.pl
3 - Note it dies on parser error at record 369
4 - Apply this patch
5 - perl misc/link_bibs_to_authorities.pl
6 - The process completes - with warning thrown on record 369

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:56 -03:00
22c0be31c7
Bug 35141: Catch ES search exceptions in link_bibs_to_authorities, warn, and continue
This patch simplay adds an eval and a warning to link_bibs_to_authorities to catch any errors while searching and continue linking.

To test:
1 - edit /etc/kohia/sites/kohadev/koha-conf.xml and add to elasticsearch stanza
    <request_timeout>0</request_timeout>
2 - perl misc/link_bibs_to_authorities.pl
3 - It dies immediately
4 - Apply patch
5 - perl misc/link_bibs_to_authorities.pl
6 - Now it tries every record, throwing warnings along the way, but completes

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:55 -03:00
bbeab36789
Bug 34678: Allow new entries to overwrite hold_fill_targets
When using background jobs, there is a possibility of a race condition where two jobs will be updating the holds queue for the same biblio. We should try to minimize those cases (see bug 34596)

In the meantime though, we should prevent jobs possibly dying, and allow the most recent update to succeed.

There is a possibility two updates wil assign different items to the same reserve, and that a reserve could end up in the queue twice, however, whichever one is filled first will delete both entries. as filling the hold deletes by reserve id (see bug 24359)

This patch adds a transaction to delete and then inset the new row

To test:
1 - prove -v t/db_dependent/Reserves.t
2 - It fails
3 - Apply patch
4 - t/db_dependent/Reserves.t
5 - It succeeds!

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:24 -03:00
dfad12d079
Bug 34678: Unit test
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:24 -03:00
b9ea3eb988
Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef
This patch makes the effective not for loan status be set the item value
if not defined at itype level.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:05 -03:00
c67d28c5f9
Bug 35167: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2023-10-27 16:44:05 -03:00
b332096265
Bug 35119: Add back classes used for selenium tests
This patch re-instates the classes used for the selenium tests.. I
checked we weren't using them for javascript or css, but didn't think
about tests before.
2023-10-27 16:42:50 -03:00
c0eb930e98
Bug 29523: (follow-up) Adding documentation to swagger.yaml
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>
2023-10-27 16:40:47 -03:00
aeef771dcd
Bug 29523: (follow-up) Comprehensive tests for redaction
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>
2023-10-27 16:40:47 -03:00
ed6791d64e
Bug 29523: Add redaction for inaccessible objects
This patch switches from removing inaccessible items from the responses
to instead redacting fields in innaccessible responses.

This allows for embed traversal and keeps counts etc correct but also
hides the data we want to hide.

We add support for an 'unredact_list' method at the Koha::* class level
allowing for individual classes to specify which fields they wish to
expose to restricted users regardless of their restriction.

It is to be used in combination with the is_accessible method introduced
earlier in this patchset which is used to denote whether the current
user should be allowed to see the full record or only a subset of it as
defined in the unredacted_list.

We undefine any fields not listed in the unredact_list for the API
response. This has the effect of still returning the full object of
keys, but setting most fields to a JSON null.

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>
2023-10-27 16:40:46 -03:00
aa3b7fb50d
Bug 29523: Remove no longer required methods
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>
2023-10-27 16:40:45 -03:00
743fac1fe0
Bug 29523: Remove the FIXME
This patch works through the unit tests and existing code to allow
removal of the FIXME I introduced earlier in the patchset.

We now require the `user` parameter be passed to `is_accessible` which
in turn makes `user` a required parameter for `to_api` in the
`Koha::Patron` case.

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>
2023-10-27 16:40:45 -03:00
2c502d320e
Bug 29523: Cache the restricted branches list
This patch introduces a very localised cache of the restricted branches
list in the logged in patron object.

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>
2023-10-27 16:40:44 -03:00