To test:
1) Follow any of the above test plans to add some
additional_field_values entries
2) Run the following SQL:
update additional_field_values set value = '';
3) Run updatedatabase twice. Notice the first time it tells you how many
entries were removed. The 2nd time it does nothing.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Thu, 25 Jul 2024 16:43:12 +0000 (16:43 +0000)]
Bug 35044: (QA follow-up): Remove useless code
Most definitely a copy paste error. I've tested and retested this
particular JS piece of code, works as intended before and after removing
this badly copy pasted code. I'm surprised this wasn't causing a console
error.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Wed, 24 Jul 2024 18:15:05 +0000 (18:15 +0000)]
Bug 35044: (QA follow-up): Allow for value '0' in additional fields
This now allows for value '0' for an additional field (repeatable or
not).
This still does not allow for an empty '' field in additional fields.
This is consistent with borrower patron attributes, i.e. if you submit
an empty borrower patron attribute entry, it does not store it as empty.
Additionally, if you have a value in a borrower patron attribute but
then submit the form with that field as empty, it gets deleted from the
database.
I agree not being able to save the value '0' is a blocker, but not the
empty.
For consistency sake I'm keeping this as is, I don't see a use-case
where a row with an empty field value is preferred over it not existing.
If we allow for '' values of additional fields, the 'clear' button for
repeatable fields would have to remove the input instead of clearing the
value (or else how would the user remove repeatable fields entries?).
If this is done, it's inconsistent with the repeatable fields from
patron attribute types, as in that instance the 'clear' button only
removes the input contents, not the input element itself.
Pedro Amorim [Wed, 18 Oct 2023 09:31:11 +0000 (09:31 +0000)]
Bug 35044: Add tests
Test plan:
prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Tue, 31 Oct 2023 12:02:24 +0000 (12:02 +0000)]
Bug 35044: Add repetable to REST API spec
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Tue, 17 Oct 2023 13:02:22 +0000 (13:02 +0000)]
Bug 35044: Update: Manual invoices, manual credits and accountlines
Test plan, k-t-d:
Preparation: Create additional fields for table 'accountlines:credit',
visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
1) Add a new manual credit for admin borrower:
/cgi-bin/koha/members/mancredit.pl?borrowernumber=51
2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and
press 'Ok' on the alert box.
3) Fill in all additional fields, click the '+New' and 'Clear' links,
hit 'Save'
4) On the table, click "Details" for the for account line we just
created.
5) Notice the additional fields are there, repeated fields are comma
separated.
6) Repeat the above test plan, but for accountlines:debit instead,
visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit
7) To add a manual invoice, visit:
/cgi-bin/koha/members/maninvoice.pl?borrowernumber=51
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 16 Oct 2023 16:14:53 +0000 (16:14 +0000)]
Bug 35044: Update: Serial subscriptions batch edit
Test plan, k-t-d:
Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field
942$c
Attempt to create a repeatable MARC field (get or set). Notice you're
unable to.
1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and
press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and
'Clear' links, hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Repeat steps 1-4 to create a second subscription
7) Visit serials home and hit "Search":
/cgi-bin/koha/serials/serials-home.pl
8) Check the checkboxes next to the 2 subscriptions and click "Edit
selected serials"
9) Input some values in the additional fields section, click the '+New'
and 'Clear' links, hit 'Save'
10) Verify that both subscriptions now have the new values form the
batch edit.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 16 Oct 2023 09:20:01 +0000 (09:20 +0000)]
Bug 35044: Update: Serial subscriptions
Test plan, k-t-d:
Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field
942$c
Attempt to create a repeatable MARC field (get or set). Notice you're
unable to.
1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and
press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and
'Clear' links, hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Click Edit -> Edit Subscription, repeat steps 4 and 5
7) Go back to subscription additional fields, set all fields as
searchable
8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl
9) Click 'Search'
10) Notice the searchable fields now show in their columns, repeated
fields separated by comma
11) Perform a search using a repeatable field, verify it all works as
expected.
-- Subscription Claims --
Preparation:
1) Define a new claim notice, visit:
/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues
2) Input code, name, click "Email" set a "Message subject" and put
something in the message body. Hit 'Save'.
3) Set a serial as late, visit our original subscription:
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1
4) Click "Edit serials" and status -> "Late". Hit "Save".
5) Link the original subscription to the existing vendor, visit:
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1
6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the
subscription.
Claims:
7) Visit claims:
/cgi-bin/koha/serials/claims.pl
8) Click "Ok"
9) Verify that searchable additional fields all have their respective
column. Repeated fields are shown comma separated.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 16 Oct 2023 14:34:51 +0000 (14:34 +0000)]
Bug 35044: Update: Invoices
Added fixme comment to invoices.tt, the search works so nothing to do
here, but the code is not DRY
Test plan, k-t-d:
Preparation: Create additional fields for table 'aqinvoices':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
1) Add a new invoice for an existing vendor, visit:
/cgi-bin/koha/acqui/parcels.pl?booksellerid=1
2) Input something in the mandatory "Vendor invoice" field.
3) Fill in all additional fields, click the '+New' and 'Clear' links,
hit 'Save'
4) Search for invoices, visit:
http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
5) Click "Search" on the left column of the page
6) Click the invoice we just created. Verify all the fields show
correctly.
7) Go back to the additional fields configuration, set all additional
fields as "searchable"
8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
9) Perform some searches using the additional fields values.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 16 Oct 2023 12:36:06 +0000 (12:36 +0000)]
Bug 35044: Update: Acquisition orders
Test plan, k-t-d:
Preparation: Create additional fields for table 'aqorders':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field
942$c
Attempt to create a repeatable MARC field (get or set). Notice you're
unable to.
1) Add a new order for an existing basket, with an existing record,
visit:
/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76
2) Set the mandatory "Koha item type" for the item. Click the 'Add item'
button below.
3) Notice the accounting details now have quantity:1
4) Set the mandatory "Fund" input in accounting details.
5) At the bottom, fill in all additional fields, click the '+New' and
'Clear' links, hit 'Save'
6) In the orders table shown, click "Modify". Notice all the fields are
presented correctly in the edit form.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 16 Oct 2023 09:32:44 +0000 (09:32 +0000)]
Bug 35044: Update: Order baskets
Test plan, k-t-d:
Preparation: Create additional fields for table 'aqbasket':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
1) Add a new basket, visit:
/cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form
2) Fill in name and all additional fields, click the '+New' and 'Clear'
links, hit 'Save'
3) Notice the basket screen shows repeated fields separated by comma.
4) Notice that only non-null additional fields labels are shown.
5) Edit the basket. Notice all fields are shown as expected.
Additional testing:
Having a repeatable field with multiple instances, go back to the
additional fields configuration and make the additional field
non-repeatable again. Edit the basket again. Notice the multiple text
instances are still shown, but the '+New' link no longer shows.
You're able to remove existing multiple instances, but unable to add new
ones, this is because the field is no longer repeatable.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Fri, 13 Oct 2023 09:58:17 +0000 (09:58 +0000)]
Bug 35044: Preparation:
get_additional_field_values_for_template method
New method to be utilized for retrieval of additional fields of any
class that implements it.
This is to be used when additional_fields are needed to be sent to .tt
files for renderering. Both for form entries and read-only 'show' pages.
Template files:
Updated additional-fields-entry.inc:
Now considers entry of repeatable fields.
Repeatable text fields will have a "+New" link to allow for adding of a
new instance of a repeatable field.
Repeatable AV fields will be shown as checkboxes instead of a dropdown
Update additional-fields-display.inc
When displaying non-editable additional-fields, multiple instances for
each field are now considered.
Label now only shows if field has a non-null value in it.
Option to show value_only
Option to set if its to be displayed on a table cell
Update histsearch.tt and filter-orders.inc
Now calls additional-fields-entry.inc with search_form=1 to prevent
repetable "+New" controls from showing on search inputs.
additional-fields-entry.js
New JS asset to be called by template files who require
additional-fields-entry.inc for repeatable fields controls.
This also handles the need for having the marcfield of type
'get' submitted if it is a disabled dropdown (AV marc field)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Fri, 13 Oct 2023 10:00:22 +0000 (10:00 +0000)]
Bug 35044: Admin: New additional fields 'repeatable' field
There is now a new 'repeatable' checkbox when configuring
(adding or editing) an additional field for a specific table.
It is also displayed in a column in the additional fields panel
for a given tablename.
MARC fields are not allowed to be repeatable.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Thu, 12 Oct 2023 11:10:56 +0000 (11:10 +0000)]
Bug 35044: DB changes + atomicupdate file
Add the 'repeatable' column to additional_fields
Remove the unique key from additional_field_values
as we will now be allowing for repeated instances of the same
field_id + record_id
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37642: Generated letter should use https in header
_wrap_html returns a header referring to http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd and http://www.w3.org/1999/xhtml. These should be https links.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37672: Make V1/RecordSources.pm use more helpers
This patch adapts the controller class to match the current guidelines
by makiing use of the provided helpers.
The tests are adapted.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Tue, 20 Aug 2024 13:49:15 +0000 (13:49 +0000)]
Bug 37687: Restore -not_in operator
Test plan:
1) Compare the API documentation on query parameters and note that'-not_in' is listed as a valid operator.
2) Look at the patch diff - you will see that previously '-not_in' was not included in the list and now is
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Emily Lamancusa [Fri, 9 Aug 2024 17:04:17 +0000 (13:04 -0400)]
Bug 36716: Do special processing based on input id, not column index
When a user clicks "Edit" ( .editrule ) we use JavaScript to loop
through each of the columns in the table to copy the appropriate values
into the input fields. Fields that need special processing are
identified by the column index, which can lead to problems when the
index varies between Koha versions or columns are shown/hidden based
on syspref settings.
In the current main, there is at least one such bug causing the
value for "no automatic renewal before" not to propagate, but to get
silently saved in the "no automatic renewal before (hard limit)" field
instead.
Identifying fields for special processing based on input id rather than
index should fix the above issue and avoid similar regressions.
To test:
1. Create a circulation rule that has:
a) a value (such as 30) in the column "No automatic renewal after"
b) no value in the column "No automatic renewal after (hard limit)"
2. Click the button to edit the circulation rule from step 1
--> The text field for "No automatic renewal after" is blank
3. Save the rule without making any changes
--> "No automatic renewal after" is now blank for this rule, but "No
automatic renewal after (hard limit)" has a date in it
4. Apply patch
5. Repeat steps 1-3
--> "No automatic renewal after" and "No automatic renewal after (hard
limit)" now preserve their values correctly
6. Create a circulation rule that has a non-default value in every field
7. Edit the circulation rule from step 6
--> Confirm that all values are copied to the edit fields correctly
8. Save the rule without making any changes
--> Confirm that the rule saved correctly
9. Create a circulation rule, leaving the following columns blank:
"Current checkouts allowed"
"Current on-site checkouts allowed"
"Holds allowed (total)"
"Holds allowed (daily)"
"Holds per record (count)"
--> The above columns should display as "Unlimited"
10. Edit the rule from step 9
--> The input fields for the above columns should be blank
11. Save the rule without making any changes
--> The above fields should still display as "Unlimited"
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Tue, 23 Jul 2024 16:00:10 +0000 (16:00 +0000)]
Bug 37396: Add missing cud-checkout op to form
To test:
1. Set the system preference 'OverduesBlockCirc' to 'Ask for Confirmation'
2. Enable the BatchCheckout system preference
3. Checkout an item to a patron and backdate the due date so that it is overdue.
4. Attempt to checkout an item or a set of items using the Batch Checkout feature. The batch checkout page will ask you to confirm the checkouts because the 'Patron has 1 overdue item'.
5. Confirm the checkout and go to the patron's holdings table. The items you checked out via the batch checkout were not issued to the patron.
6. Apply patch
7. Repeate batch checkout
8. Confirm the checkout
9, Items are successfully issued!
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Thu, 1 Aug 2024 11:59:58 +0000 (11:59 +0000)]
Bug 37413: Ensure itemnumber is sent
Fix condition to ensure the itemnumber is sent
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Hammat Wele [Wed, 21 Aug 2024 19:08:11 +0000 (19:08 +0000)]
Bug 36111: 856 should not appear as a link in detailed record
Test plan:
1. Add 856 to MARC editor
1.1. Go to Administration > MARC bibliographic frameworks
1.2. Next to Default framework, click Actions > MARC structure
1.3. Search for field 856
1.4. Click Actions > Edit subfields
1.5. Click h
1.6. Check the Editor box
1.7. Click Save changes
2. Catalog a new record with a random URL in 856
2.1. Go to Cataloging
2.2. Click New record
2.3. Fill out the mandatory fields (000, 003, 005, 008, 040,
245, 942)
2.4. Go to tab 8 and enter a value in 856
2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
search to have more than one result)
--> Notice it says "Online resources: Click here to access online"
3.1. Try to click the link
--> Blank page
4. Access the detailed record in the staff interface
--> Notice it says "Online resources: Click here to access online"
4.1. Try to click the link
--> Blank page
5. Search for the title in the opac (a large enough search to have
more than one result)
--> Notice it says "Online resources: Click here to access online"
5.1. Try to click the link
--> Blank page
6. Access the detailed record in the opac
--> Notice it says "Online resources: Click here to access online"
6.1. Try to click the link
--> Blank page
7. Edit the item and add a text in field 856
8. Access the detailed record in the staff interface
--> Notice it says what you put in 856 field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856
field should not be present.
12. Edit the item and add a url in field 856
13. Replay steps 3 through 6, but this time, clicking on the link
should take you to the URL specified in the 856 field.
14. Replay steps 7 through 8, but this time, what you put in 856
field should be present and
clicking on the link should take you to the URL specified in the 856 field.
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com>
Bug 36111: fixed extra space
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com>
Bug 36111: online resource link should be based on the presence of 856
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Brendan Lawlor [Wed, 21 Aug 2024 15:52:24 +0000 (15:52 +0000)]
Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField
This patch updates the call to dayjs to use strict parsing for patron search. See https://day.js.org/docs/en/parse/string-format
To test:
1. Create a patron with dateofbirth 1994-07-27
2. Add dateofbirth to DefaultPatronSearchFields
3. In patron or checkout search, type a cardnumber like '2908800092528'
4. Note the patron with that birth date is found in autocomplete
5. Apply patch and restart_all
6. Repeat step 3 and notice the patron is no longer found
7. In patron or checkout search, try searches using a formatted date
8. Confirm searches for '07/27/1994' and '1994-07-27' find the patron
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Wed, 3 Jan 2024 19:33:07 +0000 (19:33 +0000)]
Bug 35402: Update the OPAC and staff interface to Bootstrap 5
This patch updates the OPAC and staff interface to use Bootstrap 5.
Bootstrap CSS assets are now pulled from node_modules and compiled into
staff-global.css and opac.css at build time. This update lays the
foundations of some other chnages, especially the addition of a dark
mode in the future.
Hundreds of templates have been updated, mostly with updates to the grid
markup. Most of the responsive behavior is still the same with the
exception of improved flexibility of headers and footers in both the
OPAC and staff interface.
The other most common change is to add a new "namespace" to data
attributes used by Bootstrap, e.g. "data-bs-target" or "data-bs-toggle".
Modal markup has also been updated everywhere. Other common changes:
dropdown button markup, alert markup (we now use Bootstrap's "alert
alert-warning" and "alert alert-info" instead of our old "dialog alert"
and "dialog info").
Bootstrap 5 now uses CSS variables which we can override in our own
'_variables.scss' (in both the OPAC and staff) to accomplish a lot of
the style overrides which we previously put in staff-global.scss.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37679: Add DC subtypes to allow-list in opac-export.pl
Bug 37370 added an allow-list of formats for exporting in the OPAC. But
it missed the fact there was a modal for choosing DublinCore subtypes
when Dublin Core is chosen in the first place.
This patch fixes this.
To test:
1. On a fresh KTD, make sure `OpacExportOptions` has all options enabled
2. Go to the OPAC and pick a record detail page
3. Choose Save record > Bibtex
=> SUCCESS: The save dialog for bibtext works
4. Repeat for DublinCore, choose any of the sub formats in the modal
=> FAIL: You get a 400 page
5. Go back to 2
6. Apply this patch, and repeat 4
=> SUCCESS: It works!
7. Without refreshing the page, disable DublinCore in the sysprefs
8. Choose any subformat and proceed
=> SUCCESS: You get a 400! This means the subformats are only considered
if DublinCore itself is enabled
9. Sign off :-D
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Thu, 11 Jul 2024 14:37:19 +0000 (16:37 +0200)]
Bug 31921: Include the modal code from acquisitions-toolbar.inc
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Sam Lau [Tue, 9 Jul 2024 15:20:57 +0000 (15:20 +0000)]
Bug 31921: Add confirmation modal when deleting a vendor
This patch adds a new modal for confirming vendor deletion. It fixes
the previous functionality, showing a confirmation modal for each
vendor and appropriately handling the response.
To test:
1) Visit Acquisitions home. Under where it says 'Manage orders', click
the search bar to bring up the list of vendors.
2) Add a few vendors by clicking 'New' and 'Vendor'. After this, go back
to the vendor search so that all the vendors are showing.
3) For each vendor, click on 'Delete vendor' and ensure the modal shows
properly.
4) Attempt to delete one of the vendors. Go back to the vendor search
and ensure they are deleted correctly.
5) Click on a vendor's name to go their supplier page. Make sure modal
works properly and attempt to delete a vendor from here.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
CJ Lynce [Sun, 4 Aug 2024 20:33:51 +0000 (20:33 +0000)]
Bug 37563: Refund, payout, and discount modals in borrower transactions and Point of Sale have broken/bad formatting of values
This patch corrects formatting of amounts in both the POS and member
accounting module Payment, Discount, and Payout modals.
It also corrects an issue where amounts of a previous modal show up
when clicking on the same modal for a different accountline
the member Accounting page.
Finally, it corrects an issue with the member Accounting Discount
modal in that an amount without both decimal places will not
display.
Steps to test:
1) Login to staff client
2) Enable the 'EnablePointOfSale' system preference
3) Enable the 'UseCashRegisters' system preference
4) Open POS module and configure a cash register
5) In the POS module -> 'Configure items for purchase', create some
items with different costs (divisible by .10, e.g 25 or 1.10, etc.))
6) Use the POS module to make a few transactions
7) Open POS -> 'Cash Summary for [BRANCH]', and open your configured
register
8) Click 'Issue Refund' and check the formatting of the paid and
returned to patron numbers
*** Issue A) See that numbers are not formatted with two decimal places
9) Pull up the 'Accounting' tab for a borrower
10) Create at least 3 invoices for different amounts (divisible by .10,
e.g 25 or 1.10, etc.)
11) Pay TWO of your invoices then open the 'Transactions' tab
12) Create a manual credit for an amount (divisible by .10, e.g 25 or
1.10, etc.)
13) Click the 'Apply discount' button on one of your invoices
*** Issue B) No 'Amount charged' appears
14) Click 'Issue refund' for one of the paid invoices.
*** Issue C) The 'Return to Patron' line does not have 2 decimal places
15) Click 'Issue refund' for another paid invoice
*** Issue D) The 'Amount Paid' shows the amount from the first modal
16) Click 'Apply discount' for one of the unpaid invoices
*** Issue E) The 'Amount charged' line is blank
*** Issue F) The discount line is also blank, should at least have a
0.00 value
17) Click 'Issue Payout' for your manual credit.
*** Issue G) The 'Return to Patron' line does not have 2 decimal places
18) Apply patch
19) Repeat steps 7 & 8 and check the formatting is correct for issue A
20) Repeat steps 13-17 and check behavior and formatting is correct
for issues B-G
21) Celebrate that you are done with all the steps and looking at
numbers, and that all is right in the Koha payment world (maybe)
Sponsored by: Westlake Porter Public Library Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Tue, 18 Jun 2024 15:52:10 +0000 (15:52 +0000)]
Bug 36475: Enable table configurations on patrons print summary
This patch fixes table configuration to the tables shown on the
patron's print summary page, adding default display length and default
sort as well.
I removed the JS for moving around the DataTable controls to make them
display better and instead swapped the <caption>s for <h2>. It's not
perfect but it's better than it was.
Previously table configuration wasn't working because the window.print()
function was firing before the DataTables code had time to run. I've
added a use of onbeforeprint event to make sure we run the DataTables
initiation before automatic printing.
To test, apply the patch and restart services.
- In the staff client, go to Administration -> Table settings ->
Circulation -> print_summary.
- Configure the print-summary-checkouts, print-summary-fines, and
print-summary-holds tables with some custom options (e.g. hide
columns, change default sort).
- In the staff client, find a patron with checkouts, holds, and fines.
- In the toolbar, click Print -> Print summary. A new tab should appear
with the print summary view. A print dialog should appear immediately.
- In the print preview you should see that the tables you configured are
displayed correctly (sort is correct, columns correctly hidden, etc).
- If you print the page or cancel the tab should close.
- If you want to test the table configurations without having the tab
automatically close you can go to Administration -> System preferences
-> IntranetSlipPrinterJS and enter any dummy code, e.g.
"console.log('Testing');" With that preference populated, the
automatic closing isn't included.
- Test other pages which use the slip-print include, e.g. other patron
print options and quick spine labels in Cataloging.
Sponsored-By: Athens County Public Libraries Signed-off-by: Thibaud Guillot <thibaud.guillot@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
There is a typo in holds.yaml which prevents
fetching item as embeded object. Option
"collectionFormat" should be under "x-koha-embed",
not "items" array.
To test prove t/db_dependent/api/v1/holds.t.
Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 29 Jul 2024 11:23:51 +0000 (11:23 +0000)]
Bug 37509: Check Elasticsearch info for both 'about' and 'sysinfo' tabs
1) Notice 'Elasticsearch:' entry at http://localhost:8081/cgi-bin/koha/about.pl?tab=about is empty
2) Apply patch + restart plack
3) Repeat step 1) Notice it now shows elasticsearch info as expected.
4) Verify that Elasticsearch warning http://localhost:8081/cgi-bin/koha/about.pl?tab=sysinfo is the same before and applying patch.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Laura_Escamilla [Wed, 7 Aug 2024 13:44:36 +0000 (13:44 +0000)]
Bug 37586: Added aria-label for Login icon
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Laura_Escamilla [Wed, 7 Aug 2024 13:22:58 +0000 (13:22 +0000)]
Bug 37586: Updated aria-labels for masthead links
Update to my last comment: The Lists aria-label had an accessibility issue as the label did not match the visible text.
New test plan:
Check the OPAC Interface:
* Open the OPAC in a normal-sized browser window.
* You’ll see the text next to the 'Cart', 'Lists', and 'Login' icons clearly.
* Gradually reduce the window size until the text next to these icons disappears.
* Inspect the icon elements. You’ll find that there is no alternative text (like aria-label) provided for 'Cart' and 'Login'. The aria-label for 'Lists' does not match the visible text. It currently says "Show dropdown with detailed list information". This lack of alternative text is an accessibility issue and labels should match visible text.
Apply the Patch:
* Apply the patch
* Restart_all
Verify the Fix:
* Inspect the icons again.
* For the 'Cart' icon, you should see an aria-label attribute with the text "View your shopping cart".
* For the 'Login' icon, you should see an aria-label attribute with the text "Log in to your account".
* For the 'Lists' icon, you should see an updated aria-label attribute with the new text of "Lists".
* These changes will improve accessibility for users relying on screen readers.
Sign Off:
* Sign off and Have an amazing day!
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Hammat Wele [Mon, 19 Aug 2024 17:11:38 +0000 (17:11 +0000)]
Bug 36111: 856$h should not appear as a link in detailed record
Test plan:
1. Add 856$h to MARC editor
1.1. Go to Administration > MARC bibliographic frameworks
1.2. Next to Default framework, click Actions > MARC structure
1.3. Search for field 856
1.4. Click Actions > Edit subfields
1.5. Click h
1.6. Check the Editor box
1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
2.1. Go to Cataloging
2.2. Click New record
2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
245$a, 942$c)
2.4. Go to tab 8 and enter a value in 856$h
2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
search to have more than one result)
--> Notice it says "Online resources: Click here to access online"
3.1. Try to click the link
--> Blank page
4. Access the detailed record in the staff interface
--> Notice it says "Online resources: Click here to access online"
4.1. Try to click the link
--> Blank page
5. Search for the title in the opac (a large enough search to have
more than one result)
--> Notice it says "Online resources: Click here to access online"
5.1. Try to click the link
--> Blank page
6. Access the detailed record in the opac
--> Notice it says "Online resources: Click here to access online"
6.1. Try to click the link
--> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
--> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
field should be present and
clicking on the link should take you to the URL specified in the 856$u field.
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com>
Bug 36111: fixed extra space
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com>
Bug 36111: online resource link should be based on the presence of 856
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Phil Ringnalda [Fri, 9 Aug 2024 22:43:50 +0000 (15:43 -0700)]
Bug 37612: Batch patron modification should accept both cud-show and show ops
Just like with batch item modification, batch patron modification can accept
either a POST of a lot of data, which might be more than Apache's default
URL length limit, or a GET of a little data. Or at least it could, if both
the op 'cud-show' and the op 'show' were accepted. Show isn't doing any
creation or updating or deleting, it just has to be cud-show because it needs
to be able to accept large POSTs. So when it is only getting a little data, it
should be willing to take a GET with op=show just like batch item
modification does.
Test plan:
1. Without the patch, Tools - Patron lists - New patron list - give it a
name and Save
2. Type enough characters in the Patron search input to find a patron (I
like ace for poor often-used Henry Acevedo) and click on a patron in
the list of results
3. Click Add patrons
4. Click Patron lists, and in the Actions menu for your list, choose
Batch edit patrons. Note that the page that loads doesn't show any patrons
or UI to edit them, only a message about "No patron card numbers or
borrowernumbers given."
5. Apply patch, restart_all
6. Repeat step 4, but this time get a page with your patron listed, and a
form to change things about the patron record.
Sponsored-by: Chetco Community Public Library Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
David Cook [Fri, 14 Jun 2024 04:34:47 +0000 (04:34 +0000)]
Bug 37087: Add TCP keepalive support to SIP server
This change adds the ability to enable and configure TCP keepalive
support for the SIP server using SIPconfig.xml.
For the sake of backwards compatibility, it defaults to disabled
and additional parameters default match typical kernel defaults.
Technical detail can be found in the perldoc for C4/SIP/SIPserver.pm
Test plan:
0. Apply the patch
1. koha-sip --restart kohadev
2. apt-get update && apt-get install tcpdump
3. In one window, run "tcpdump -A -n -v -i any 'port 6001'"
4. In another window, run the following:
echo -e "9300CNterm1|COterm1|CPCPL|\r" | nc 127.0.0.1 6001 -v
5. Note in tcpdump output that after the initial flood of packets,
nothing more is received
6. vi /etc/koha/sites/kohadev/SIPconfig.xml
7. In the "server-params" element, add attributes like the following:
custom_tcp_keepalive='1'
custom_tcp_keepalive_time='10'
custom_tcp_keepalive_intvl='5'
8. koha-sip --restart kohadev
9. In one window, run "tcpdump -A -n -v -i any 'port 6001'"
10. In another window, run the following:
echo -e "9300CNterm1|COterm1|CPCPL|\r" | nc 127.0.0.1 6001 -v
11. Note in tcpdump output that after the initial flood of packets,
ACK packets are sent out every 10+ seconds for the idle connection
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Eric Garcia [Tue, 9 Jul 2024 16:04:39 +0000 (16:04 +0000)]
Bug 36496: Add export option to inventory results table
To test:
1. Apply patch and restart_all
2. Cataloging -> Inventory -> Submit
3. In the inventory report notice options to export at the top of the table
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Updated column name from collection_code to collection in table settings.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Fri, 26 Apr 2024 16:22:50 +0000 (16:22 +0000)]
Bug 35026: (QA follow-up): Restore order grouping
This patch restores the grouping of orderlines by fund rather than one line per item. It also re-enables the reading of the barcoe, enumchron and coded_location_qualifier fields as well as passing the sort1 and sort2 values to the orderline.
It also reintroduces some missed functionality for when MarcItemFieldsToOrder is not passed through and can now create order lines and records for an imported file when this is the case
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Fri, 1 Mar 2024 09:49:28 +0000 (09:49 +0000)]
Bug 35026: Fix unit tests
This patch fixes the unit tests that were failing and also removes some tests that should not be introduced until bug 34355
Test plan:
prove t/db_dependent/Koha/MarcOrder.t
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Fri, 1 Mar 2024 09:39:16 +0000 (09:39 +0000)]
Bug 35026: Adjust price field to match UI
Following bug 36036 the price field has been renamed in the UI- this patch removes the logic that was renaming that field in the backend to match this
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Thu, 11 Jan 2024 11:24:38 +0000 (11:24 +0000)]
Bug 35026: Allow multiple records from one marc file
This patch addresses a bug where only one record would be read from a marc file and other records would be lost. All records are now read from the file and displayed in the UI.
Test plan as above
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Tue, 5 Sep 2023 11:06:41 +0000 (11:06 +0000)]
Bug 35026: Add unit tests
This commit adds a set of unit tests for the new methods in Koha::MarcOrder
The two controller functions at the start of the file have not been included as they simply call the functions in these tests
The _stage_file method is also not included as this is a copy of the existing file staging code with the background job functionality removed
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Tue, 28 Nov 2023 17:05:26 +0000 (17:05 +0000)]
Bug 35026: Make add_items_from_import_record DRY
This patch improves the code in add_items_from_import_record to make sure that the code is not repeating itself
It also fixes a minor error in the template file and rebases in changes from bugs 35254 and 33170
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Wed, 11 Oct 2023 15:30:24 +0000 (15:30 +0000)]
Bug 35026: Tidy file
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Wed, 11 Oct 2023 15:20:14 +0000 (15:20 +0000)]
Bug 35026: Refactor addorderiso2709.pl to use the MarcOrder class
This script uses the newly created MarcOrder class to refactor the script into a cleaner controller function. This MarcOrder class will also be used in bug 34355 to automate the creation of order lines from marc records.
Test plan:
1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
3) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
4) Navigate to acquisitions and go into a basket
5) Click Add to basket and select “From a new file”
6) Download the file attached to this bug
7) Import the file and when the job is complete click “Add staged files to basket”
8) Click the checkbox next to the record to display the items and confirm that the data matches the mappings from the file that you imported - there should be 8 items, grouped in 4 pairs of identical items
9) Fill in the required fields and click “Save”
10) That basket should be correctly populated with an order matching the file that you imported
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Wed, 11 Oct 2023 15:12:59 +0000 (15:12 +0000)]
Bug 35026: Add a MarcOrder object class
This patch adds a MarcOrder object class. This will primarily be used for the functionality in bug 34355 to automate order creation from a Marc file. The automation functionality is similar in principle to the functionality in the addorderis02709.pl script so it makes sense to refactor this script to use the same code.
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Lucas Gass [Thu, 25 Jul 2024 21:09:42 +0000 (21:09 +0000)]
Bug 37484: Add data-order attribute to housebound delivery table
To test:
0. APPLY PATCH
1. Enable the HouseboundModule and set at least one staff person a
Chooser and and Deliverer.
2. From a patron account go to the "Housebound" tab and schedule some
deliveries.
3. See that each <td> in the Date column now includes a 'data-order'
attribute in an ISO date format ( 2024-07-01 ) for better sorting.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Paul Derscheid [Wed, 14 Aug 2024 09:24:49 +0000 (09:24 +0000)]
Bug 37643: Check for NaN instead of truthiness if calendar.inc accepts_time
To test:
1) Go to circulation.pl (checking out to a patron)
2) Click the settings in the barcode input
3) Set any due date with the time set to 00:00
4) Note that the picker resets the time to 23:59
5) Apply the patch
6) Repeat 1-3
7) Note that the time (00:00) stays put
8) Sign off
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Thu, 15 Aug 2024 09:37:10 +0000 (09:37 +0000)]
Bug 37647: Remove Text::CSV_XS import
There is an unnecessary import that has been left over from when KBART file processing logic was being handled directly in the API controller. This patch removes that import as it is no longer needed
Test plan:
1) Look at the patch diff and confirm that the import for Text::CSV_XS has been removed
Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Thu, 16 May 2024 11:46:08 +0000 (11:46 +0000)]
Bug 36882: Reapply flatpickr to cloned entry
1) Add a patron attribute type:
http://localhost:8081/cgi-bin/koha/admin/patron-attr-types.pl?op=add_attribute_type
2) Make sure its repeatable + is_date
3) Visit overdues:
http://localhost:8081/cgi-bin/koha/circ/overdue.pl
4) Click the 'add' button under the date custom attribute
5) Click on the newly created input, notice the flatpickr pop up doesnt
show
6) Apply patch. Repeat.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Tue, 21 May 2024 15:09:59 +0000 (15:09 +0000)]
Bug 36907: Add maxlength to OAI set mapping form fields
This patch adds a maxlength attribute to the field, subfield, and value
fields in the OAI set mapping form. This helps prevent an error when the
form data is too long for the database columns.
Unrelated: The patch also adds quotes around two unquoted name
attributes.
To test, apply the patch and go to Administration -> OAI sets.
- If necessary, create a new set.
- Click Actions -> Define mappings.
- Test that each form field is limited correctly:
Field: 3
Subfield: 1
Value: 80
- Test that the form can be submitted successfully with the maximum
number of characters in each field.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 32696: Recalls can inadvertently extend the due date
If an item is due sooner than the recall due date interval then placing
a recall on it can inadvertently extend the book's due date, possibly
causing the recalling patron to receive the item later than they would
otherwise.
Test plan:
=========
1. Turn on recalls with UseRecalls.
2. In circulation rules, set the recall due date interval to 7 days
or any other arbitrary period.
3. Check out an item to one patron & set the due date to be before the
recall due date interval will have elapsed (e.g. the next day)
4. As a second patron, place a recall on the item in question.
5. See that the item's due date is extended to the current date plus
the recalls due date interval.
6. Apply the patch, restart_all;
7. Repeat steps 3. and 4. See that the due date has not been extended.
BTW, the calculation of $due_interval has been changed, because with
the current code and empty 'Recall due date interval' $due_interval
is undefined, despite the intention of the author of the code.
(after calling get_effective_rule $recall_due_date_interval is defined, but
$recall_due_date_interval->rule_value is undefined; the patron gets
a message: '... return the item within days, by ...' - no days count).
Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
David Cook [Thu, 8 Aug 2024 01:19:46 +0000 (01:19 +0000)]
Bug 34346: Show error message instead of 500 for duplicate tags
This change shows a user-friendly error message instead of a 500 error
if adding a duplicate MARC tag to a MARC bibliographic framework.
Test plan:
0. Add patch and koha-plack --reload kohadev
1. Go to
http://localhost:8081/cgi-bin/koha/admin/marctagstructure.pl?searchfield=264&frameworkcode=
2. Click "New tag"
3. Enter "264" in "Tag:" field
4. Click "Save changes"
5. See error message on screen (instead of 500 error)
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 34346: Tidy
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly adjusted error message and added punctuation.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Aleisha Amohia [Tue, 13 Aug 2024 03:07:17 +0000 (03:07 +0000)]
Bug 37623: Make t/db_dependent/Letters.t idempotent
The tests should be unaffected by system preference settings, such as EmailFieldPrimary.
To test:
1. Log into the staff interface
2. Go to Koha Administration -> Global system preferences, and search for EmailFieldPrimary
3. Change the EmailFieldPrimary preference to something other than 'primary email' and 'first valid email address', i.e. any of the following:
4. Run tests t/db_dependent/Letters.t and notice they fail
5. Apply the patch
6. Run the tests again t/db_dependent/Letters.t with different settings of EmailFieldPrimary. The tests should always pass.
Sponsored-by: Pymble Ladies' College Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Matt Blenkinsop [Mon, 19 Aug 2024 13:16:00 +0000 (13:16 +0000)]
Bug 37620: Improve cypress test to reduce random failures
This patch makes some improvements to the Infinite Scroll cypress test to try and prevent random test failures
- Fixes X-Base-Count and X-Total-Count for intercepted requests
- Makes element selection more precise
- Adds an intercepted request returning the requrired result for the filtered search
- Awaits this request before selecting an element from the dropdown
- Awaits all 10 requests triggered by typing "License 50" rather than just the first one
- Ensures that the select dropdown is closed between operations by clicking into another field to remove focus from the select dropdown
Test plan:
1) yarn cypress run --spec t/cypress/integration/InfiniteScrollSelect_spec.ts
or
1) yarn cypress open and select the InfiniteScrollSelect test from the Cypress GUI
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Emmi Takkinen [Tue, 22 Aug 2023 10:45:27 +0000 (13:45 +0300)]
Bug 34585: Add data-code attribute to chargeperiod_charge_at selector
When one tries to edit circulation rule "When to charge"
columns value is always set as "End of interval". This patch adds
data-code attribute to chargeperiod_charge_at selector
to define existing rules value.
To reproduce:
1. Navigate to Circulation and fine rules page.
2. Find or create a rule with a "When to charge" value set as
"Start of interval".
3. Edit rule.
=> Note that "When to charge" value is now "End of interval",
while as the other values should be copied as they were.
4. Apply this patch.
5. Edit rule again.
=> "When to charge" should now be copied correctly.
Sponsored-by: Koha-Suomi Oy Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Phil Ringnalda [Thu, 15 Aug 2024 22:11:44 +0000 (15:11 -0700)]
Bug 37615: Clean up the form for sending cardnumbers from a report to batch patron modification
Since bug 37197 switched reports back to using a POST to send cardnumbers to
batch modification, we should also be using a single textarea rather than
multiple inputs.
Test plan:
1. Reports - Create from SQL - give it a name, and the SQL
select cardnumber from borrowers limit 3
2. Save report - Run report
3. Batch operations with 3 visible records - Batch patron modification
4. Verify that you have the same three cardnumbers in Batch patron modification
as were in the report.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
CJ Lynce [Tue, 6 Aug 2024 14:30:51 +0000 (14:30 +0000)]
Bug 37580: Unique Holidays Description are not editable
Holiday names and descriptions are not editable after creation in
tools/holiday.pl.
This patch corrects this regression.
To test:
1) Login to staff client
2) Open Tools -> Calendar
3) Click on a date and create a holiday with name and description.
4) Save holiday.
5) Click on newly created holiday on calendar and edit the name and
description.
6) Re-Save Holiday.
7) Click again on holiday, and see that name and description changes
did not save.
8) Apply patch
9) Repeat steps 5-7
10) Verify that changes now save.
Sponsored-by: Westlake Porter Public Library Signed-off-by: Martha <msulllivan@rcls.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Thu, 8 Aug 2024 17:54:48 +0000 (17:54 +0000)]
Bug 37595: Double HTML escaped ampersand in pagination bar
This patch removes escaping of ampersands in the part of
guided_reports.pl that builds information for the pagination routine.
The information is going to be escaped in a later step.
To test, apply the patch and go to Reports.
- If necessary, create a report which will return more than 20 results.
- Run the report. You should see a pagination bar at the top of the
table of results.
- View the page source and look for the markup for the pagination menu.
Searching for 'rel="start"' works well.
- Confirm that you see '&' between the link parameters instead of
'&amp;', e.g.
When browsing news in the opac (opac-main.pl), links in the titles of
news are broken. The id pasted in the link is the id from the
additional_contents_localizations instead of the id from
additional_contents.
TEST PLAN:
1 - In intranet create a news with multiple languages
2 - Create a second news
3 - In OPAC, the link of the title of the second news (and maybe the
first) should be broken APPLY PATCH
4 - In OPAC, the link of the title of both news should work
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Tue, 24 Oct 2023 13:12:44 +0000 (15:12 +0200)]
Bug 37628: (follow-up) Remove get_opac_news_by_id
Keep the same behaviour, but wondering why we don't return 'content'
when there is no match.
ie.
+ is( $additional_contents, undef );
should certainly be
+ is( $additional_contents->{content}->count, 0 );
WNC amended patch - tidied
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Fri, 2 Aug 2024 17:42:54 +0000 (17:42 +0000)]
Bug 37562: Add patron title to duplicate patron warning and don't show popup if cannot see patron
This patch passes the suspected duplicate to the template and uses patron title to display very brief info.
If the user cannot view the patron there is no longer a link tot he brief popup and they will only see
'A patron from library X"
There is a FIXME asking if we should use search_limited - I believe we should check all branches, so the staff can ask the patron if they
have an exising account in a consortium depending on rules about multiple cards
To test:
1 - Edit a user to grant catalogue and all borrower permissions except 'view_borrower_infos_from_any_libraries'
2 - Find a patron from a different library and note surname and firstname
3 - Login as the patron above
4 - Enter a new patron with the same surname and firstname
5 - See the 'Duplicate patron' warning
6 - Click to view the patron
7 - No info is listed
8 - Apply patch
9 - Reload and resubmit - or fill out form again
10 - Note that you see 'A patron from library XXX' and no popup link
11 - Add view_borrower_infos_from_any_libraries to the staff
12 - Repeat the duplication and confirm the warning now has patron name and the popup link is visible and works
Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test:
1. Set ProtectSuperlibrarianPrivileges system preference to Allow only
superlibrarians
2. Give superlibrarian permissions to a user (User 1)
3. Give catalogue, borrowers, permissions, and staffaccess permissions
to a second user (User 2)
3. Login as User 2
4. Go to User 1 permission settings page.
5. Hover over the Select all and Clear all links.
6. Check the message that appears contains
ProtectSuperlibrarianPrivileges and not ProtectSuperlibrarian
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 1 Aug 2024 21:48:10 +0000 (21:48 +0000)]
Bug 37552: Wrap auto renewal attempt in eval to ensure script does not die
When libraries have a lot of checkouts, or an AMH, checkins can happen while the cron is running.
This patch simply adds an eval around the auto renewal attempt in case of early check in or other errors.
You can verify cron completed by enabling cronjob log in system preferences and checking the action logs
To test:
1 - Add 'sleep(10);' to automatic_renewals.pl
2 - Set circulation rules to enable automatic renewals
3 - Issue an item to a patron
4 - perl misc/cronjobs/automatic_renewals.pl -v
5 - Confirm item would not be renewed
6 - perl misc/cronjobs/automatic_renewals.pl -v -c
7 - Quickly check in the item
8 - The cronjob dies
DBIx::Class::Row::update(): Can't update Koha::Schema::Result::Issue=HASH(0x586e1a674fb0): row not found at /kohadevbox/koha/Koha/Object.pm line 172
9 - Apply patch
10 - Checkout the item again
11 - perl misc/cronjobs/automatic_renewals.pl -v -c
12 - Quickly checkin the item
13 - You get a warning, but the cron completes
Signed-off-by: CJ Lynce <cj.lynce@westlakelibrary.org> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Johanna Räisä [Fri, 9 Aug 2024 05:58:31 +0000 (08:58 +0300)]
Bug 37591: Fix moredetail.tt performance issue
This patch fixes the performance issue in moredetail.tt by removing the
unnecessary call of checkout_renewals table.
To test:
1. Create lot of checkouts and renewals for a record.
2. Open the moredetail page for the record.
3. Check the timing of the page load.
4. Apply the patch and check the timing of the page load again.
5. The page load should be faster after applying the patch.
Sponsored-by: Koha-Suomi Oy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
CJ Lynce [Fri, 26 Jul 2024 18:53:37 +0000 (18:53 +0000)]
Bug 37382: Report download is empty except for headers if .tab format is selected
When exporting a report in tab delimited format, the downloaded file
would have the header rows but no data results.
Also, misc files are created on the server file system in koha/reports
with data that should have been in the .tab file.
This patch fixes both of these issues.
To test:
1. Login to staff client
2. Go to Reports and create a report from SQL - sample report
SELECT i.barcode, b.title, b.biblionumber, i.itemnumber
FROM items i
LEFT JOIN biblio b on i.biblionumber = b.biblionumber
WHERE i.itemnumber < 50
3. Run the report
4. Click 'Download'->'Tab separated text'
5. Download file
6. Open file in a text editor or favorite spreadsheet app
File will have headers rows, but no other item data
6a. If able, check the server filesystem in koha/reports
There may be files there related to report data. Remove.
7. Apply Patch
8. Repeat steps 3-6,
File will now have the table data, hooray!
8a. If able, check the server filesystem in koha/reports
No new files should be created.
Signed-off-by: Laura ONeil <laura@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Sam Lau [Fri, 26 Jul 2024 20:52:19 +0000 (20:52 +0000)]
Bug 37409: Fix 'Edit' button for items in course reserves list
To test:
1) Set the 'UseCourseReserves' sys pref to 'Use'
2) Go to the Course reserves page
3) Create a new course, fill in the required info and make sure the 'Enabled?' is checked
4) Add a reserve to this course
5) From the course details page, select edit on the reserve you just made.
6) Note it brings you back to the add reserves page, and you are required to enter the barcode/biblionumber again to edit
7) Apply patch, restart_all
8) Press the edit button again
9) Now you are directed towards the correct page for editing
10) Make some changes and press save
11) You should be redirected back to the details page and your changes have been made
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37510: Make Koha::Object->delete throw Koha::Exception
This patch makes Koha::Object->delete wrap DBIC exceptions on FK
constraints and throw a Koha::Exception::Object::FKConstraint exception
instead. This will allow us better handling it from the callers.
To test:
1. Apply the unit tests patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/Koha/Object.t
=> FAIL: A DBIC exception is thrown instead, tests fail
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Thu, 15 Aug 2024 10:21:10 +0000 (12:21 +0200)]
Bug 37429: Set default value for global variables
The global variables needs to be assigned with a default value, or the
value from the previous request will be used.
Global variables are persistent from one request to another, in memory.
This patch:
* groups default value for global variables together
* removes $authorised_values_sth from this list (it is not a global var)
* set $changed_framework to 0 (which fix the issue)
Test plan:
1. Open an existing biblio (detail.pl)
2. Click "Edit record"
3. Change the framework (no need to change any details)
4. Change the framework back to the original one (no need to save anything)
5. Go back to the biblio overview page (detail.pl)
=> The form is populated
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Phil Ringnalda [Fri, 16 Aug 2024 00:44:20 +0000 (17:44 -0700)]
Bug 37614: Printing patron cards from patron lists should be a GET
There's no creating, updating, or deleting about printing patron cards, and
the only time there's a lot of data (selecting individual patrons in a card
creator batch), it doesn't matter if the "Export selected" URL exceeds the
maxlength for Apache since the actual link to create the PDF also will.
Test plan:
1. Without the patch, Tools - Patron lists - New patron list - Name it and
Save
2. Type three characters in the Patron search form (mar works well) to get
at least three patrons. Click on each of three, then click Add patrons
3. You can only print cards from the list of lists, so back to Tools -
Patron lists
4. In the Actions menu choose Print patron cards, in the popup click Export
5. Watch the throbber spin around for a while (it will never stop), then
close the popup, apply the patch, restart_all
6. Tools - Patron lists - Actions menu - Print patron cards - Export
7. Click the PDF link, make sure it has all three of your patrons
8. Tools - Patron card creator - New - Card batch
9. Without putting anything in the textarea, click Add patrons, in the
search popup search for your three characters (mar) again, and click
the checkboxes to the left of three of the names, then Add selected
patrons, then Close, then Add patrons
10. Click the checkboxes for two of the three patrons, then Export selected
card(s), then Export in the popup
11. Hover the link to the PDF, verify that it doesn't have stray 'amp;'
after the & and before label_id= anymore
12. Click the PDF link, verify it has your two patrons
13. Back at the card batch, click Export card batch, then Export
14. Check the PDF to verify it has all three of your patrons
15. Tools - Patron lists - click your list's name to open it
16. Click the card number for a patron, then the Patron lists tab in Checkout
17. Actions menu - Print patron cards - Export, verify the PDF has all three
patrons
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Wed, 10 Jul 2024 15:07:22 +0000 (15:07 +0000)]
Bug 37308: Add user-agent for SUSHI outgoing requests
Signed-off-by: Belal Ahmadi <belal.ahmadi@uwl.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Fri, 9 Aug 2024 10:58:23 +0000 (10:58 +0000)]
Bug 37543: (follow-up) Tidy
Tidy the whole thing
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Rudolf Byker [Thu, 1 Aug 2024 14:14:29 +0000 (16:14 +0200)]
Bug 37543: Use CSRF tokens in connexion_import_daemon.pl
Since version 24.05, due to the changes mentioned at
https://wiki.koha-community.org/wiki/Koha_/svc/_HTTP_API#Changes_coming_in_Koha_24.05 ,
the `connexion_import_daemon.pl` stopped working. The reason for this is that
it did not use CSRF tokens.
To test:
1. Get a Koha instance on 24.05, before applying the patch.
2. Create a plain text file somewhere on the server containing a raw MARC
record (not XML). Let's call it `marc.txt`.
3. On the server, create a config file like this:
```
host: 0.0.0.0
port: 5500
koha: http://localhost:82 # Where 82 is the port of the Koha staff interface.
user: foo # A Koha staff user.
password: Fooo1234 # The Koha staff user's password.
import_mode: stage
```
4. Run `./connexion_import_daemon.pl --config the-config-file-path`
5. In another terminal on the same server (or from anywhere that can reach the
port opened by the `connexion_import_daemon.pl` script,
run `nc localhost 5500 < marc.txt`
6. Observe in the stderr of the daemon script: `Response: Unsuccessful request`
7. Stop the daemon script.
8. Apply the patch and repeat steps 4 and 5.
9. Observe in the stderr of the daemon script:
`Response: Success. Batch number ... - biblio record number HASH(...) added to Koha`
10. Check at /cgi-bin/koha/tools/manage-marc-import.pl for a batch named
`(webservice)`. It should contain one record now. This is how we know that
authentication between the daemon and Koha worked, which is what this
patch tries to address.
Thanks-to: David Cook <dcook@prosentient.com.au> Sponsored-by: Reformational Study Centre <www.refstudycentre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37536: Update conditional to check for 'cud-saveitem'
In additem.pl and additem.tt all instances of 'saveitem' have been updated to 'cud-saveitem'
The javascript needs to be updated in the same way.
Test plan:
- Make sure acqcreateitem is set to "when placing an order"
- Create a basket with some orders
- Close the basket
- Go to your vendor and receive an order
- On the receive page, try to edit your item
=> Without the patch, the pop up page will open and then close, not allowing the item to be edited.
=> With this patch applied you will see the item edit form. Save and
confirm that the parent window is updated with the new value (actually
it's refreshed)
QA notes:
1. git grep 'saveitem'
2. Notice all instances in additem.pl and additem.tt have been updated to 'cud-saveitem'
3. Notice cataloging_additem.js checks if op != 'saveitem'
4. Check the files and verify the change makes sense
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 11 Jul 2024 18:08:08 +0000 (18:08 +0000)]
Bug 36736: Load plugins at the start of background job processing
This patch adds a call to get_enabled_plugins before processing background jobs to ensure
that all plugin hooks are loaded and cached
To test:
1 - Install a plugin that adds new objects e.g. the Contracts plugin
https://github.com/bywatersolutions/fs-koha-plugin-contracts
or the Koha Advent plugin:
https://gitlab.com/koha-community/koha-advent/koha-plugin-fancyplugin
2 - Restart all
3 - Tail all your logs
4 - Stage and import a file containing items
5 - Note in the logs
DBI Exception: DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction
6 - Apply this patch
7 - Restart all
8 - Stage and import again
9 - Success!
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Mon, 12 Aug 2024 12:10:12 +0000 (12:10 +0000)]
Bug 37508: Don't return Internal server error when running report
To test:
1 - Create a report like:
SELECT "a"
FROM borrowers
WHERE <<Test>> != ''
2 - Run report
3 - Enter "password"
4 - Internal server error / stacktrace
5 - Apply patch
6 - Repeat
7 - Get a yellow warning box
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Fri, 9 Aug 2024 09:56:11 +0000 (09:56 +0000)]
Bug 37508: (QA follow-up) Use ->check_columns
Add shebang to Guided.t too.
Test plan:
See also previous commits.
Try sql like:
select access_token from oauth_access_tokens
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Fri, 9 Aug 2024 09:50:44 +0000 (09:50 +0000)]
Bug 37508: (QA follow-up) Move check to Koha::Report, extend
Do not allow password but allow password_expiry_days etc.
Do not allow token, secret and uuid too.
Test plan:
Run t/db_dependent/Koha/Reports.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Aleisha Amohia [Thu, 8 Aug 2024 23:53:47 +0000 (23:53 +0000)]
Bug 37508: (follow-up) Don't pass the column or sql containing password
This patch replaces these variables with a non-translatable message.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
David Cook [Wed, 7 Aug 2024 01:15:10 +0000 (01:15 +0000)]
Bug 37508: Test for errors when returning an aliased password column
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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37508: Throw error if password column is detected in SQL report
This enhancement prevents SQL queries from being run if they would return a password field from the database table.
To test:
1. Run tests and notice they fail t/db_dependent/Reports/Guided.t
2. Apply patch and restart services
3. Create a public report with an SQL report which would access a password column in a database table
4. Try to run the report. Notice you are met with an error and the results are not shown.
5. Access the JSON URL, you should not get the results and should be shown an error
6. Confirm tests pass t/db_dependent/Reports/Guided.t
Sponsored-by: Reserve Bank of New Zealand 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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37370: Return 400 if OpacExportOptions does not contain the passed format
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a164c51d78f375d9d660e2c079cc7e05d2d1d326) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>