Martin Renvoize [Wed, 23 Oct 2024 12:08:22 +0000 (13:08 +0100)]
Bug 37354: (QA follow-up) Reset periodPicker on rule change
This patch clears the periodPicker values when the applied circulation
rules change. This prevents selection of one booking period against one
set of rules and then a change of item to an itemtype where different
rules should apply but the old selected period remaining and thus 'rule
breaking' being allowed.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Mon, 21 Oct 2024 15:36:49 +0000 (16:36 +0100)]
Bug 37354: Fix circ rule selections
Only expose the bookings calendar picker input if we have enough detail
already defined to pick the corresponding circulation rules.
We currently use the item pickup location for selecting which rules to
apply, this corresponds to hard coding CircControl=ItemHomeLibrary +
ItemHomeOrHolding=holdingbranch for this use case. We can't easily
change this to match those rules dynamically without rethinking the 'Any
item' functionality and displays in the flatpickr. We may revisit this
at some point in the future should that become a requirement.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Sun, 14 Jul 2024 07:57:22 +0000 (08:57 +0100)]
Bug 37354: Add visual hint at usual loan periods
This patch adds a visual hint to the datepicker to highlight dates that
line up with normal loan and renewal lengths.
We use bold to highlight such dates.
Test plan
1) Repeat the test plan for the previous patch
2) Note that once you have selected your first date, that date will
become bold, the date a 'Loan period' after the start date will also
be bold and you'll also have bold dates for the number of 'Renewals
allowed' at each 'Renewal period' beyond the initial 'Loan period'
date.
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Sun, 14 Jul 2024 06:39:33 +0000 (07:39 +0100)]
Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod)
This patch sets the flatpickr maxDate in the bookings range picker to
the startdate selected + issuelength + renewals * renewalperiod
circulation rules.
Test plan
1) Set an item in a test biblio to 'bookable' from the items tab.
2) Note the itemtype of the above item
3) Add circulation rules for the above item type, in particular the
'Loan period', 'Renewals allowed' and 'Renewal period' options.
4) Go back to your biblio and 'Place booking'. Select a user, pickup
location and item.
5) Open the booking dates flatpickr.
6) Select a start date.
7) Note that the date that is 'Loan period' + 'Renewals allowed' *
'Renewal period' is now greyed out and cannot be selected or any date
beyond it either.
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Andreas Roussos [Tue, 16 Apr 2024 14:13:45 +0000 (14:13 +0000)]
Bug 36603: Copy the ISNI number over automatically
When linking authorities with other authorities in UNIMARC
instances it would be good if Koha automatically copied the
contents of subfield 010$a [aka INTERNATIONAL STANDARD NAME
IDENTIFIER (ISNI)] into the corresponding 5xx$o subfield
(should such an ISNI number exist in the source record).
This patch enables the enhancement outlined above.
For more information, please see the offical IFLA UNIMARC
Authorities Format Manual (online ed., 1.0.0, 2023), pp. 350,
363, 385. This is actually where we got this idea from ;-)
Note #1: it only applies to the Personal Name, Corporate
Body Name, and Family Name authority types.
Note #2: the default MARC Authorities framework that ships
with UNIMARC Koha instances does *not* include a
subfield $o for fields
200 (Authorized Access Point - Personal Name),
210 (Authorized Access Point - Corporate Body Name),
220 (Authorized Access Point - Family Name).
This is per the offical IFLA Manual, and effectively
means we can push the ISNI number to the same array
used for other subfields (@subfield_loop) without
worrying about overwriting any previous value.
Test plan:
0) Have a UNIMARC Koha test instance up and running. Then,
carry out the following steps in the Staff interface.
1) Stage for import the sample MARC authority data attached
to this Bug report (filename: sample-auths.mrc, contains
one Personal, one Corporate Body, and one Family Name).
Go to 'Cataloging > Stage records for import' and upload
the file. Make sure you select 'Authority' in the 'Record
type' dropdown menu. Leave all other settings untouched at
their default values. Click the 'Stage for import' button.
Then, import the staged records into your Catalog. Go
to 'Cataloging > Manage staged records'. Click on the
filename link in the second column. At the bottom of the
page, confirm you can see all three authorities included
in the .mrc you uploaded, then click on the button named
'Import this batch into the catalog'.
2) Enable the authority finder plugin for authority fields
500, 510 and 520. This can be done as follows:
a) Go to 'Administration > Authority types' and click on
'Actions->MARC structure' for the 'NP' (Personal Name)
authority type.
b) Search for tag 500; then click on 'Actions->Subfields'
for that tag.
c) Click 'Edit' next to subfield 'a' (Entry element), then
pick 'NP' from the 'Thesaurus' dropdown menu. Save your
settings and you're good to go! When editing a Personal
Name authority from now on, the 'Tag editor' button next
to subfield 500$a will launch the authority finder.
Repeat b) and c): search for tag 510, edit $a, pick 'CO'.
Repeat b) and c): search for tag 520, edit $a, pick 'FAM'.
3) Go to Koha's 'Authorities' module. At the top search bar,
filter on Personal Name authorities and perform a search.
Pick any one of the results, and edit it. Go to tab '5',
expand field 500 and use the button next to subfield $a
to launch the authority finder. Type '0000' inside the
'Search entire record:' text box, and click on 'Search',
then 'Choose'.
Notice that the ISNI number from the source record did
*not* get copied to subfield 500$o. The same will happen
if you try to Choose an authority for field 510 and 520.
4) Apply this patch.
5) Repeat step 3), this time the ISNI number from the source
record will be copied to 500/510/520 $o automatically!
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 38166: Make core status graph strings translatable
This patch makes several strings translatable. I usually dealth with
this by adding my statuses like `NEW` to the status graph shippped by
the backend I was working with, and solved the translation step inside
of the plugin itself.
But really, the core status graph should be translatable so core
backends (like the to-be FreeForm) and backend authors can rest assured
they only need to care about their custom statuses.
To test:
1. Make sure you have 35570 applied so it is easier to test
2. Enable the ILLModule syspref.
3. Install a language you're familiar with. I pick es-ES for the sake of
this testing steps to be readable:
$ ktd --shell
k$ koha-translate --install es-ES --dev kohadev && restart_all
4. Enable (language sysprefs) and switch to your language (click at the
left bottom on the language name).
5. Create a new ILL request
=> FAIL: Notice some buttons are not in your language
6. Jump to the ILL requests list
=> FAIL: The status displays as 'New request'
7. Apply this patch
8. Generate the translation entries for the core status graph strings:
k$ gulp po:extract
k$ gulp po:update # I had to run it twice to complete, unrelated error
9. Edit the relevant -messages.po file. In my case:
k$ vim misc/translator/po/es-ES-messages.po
Note: it is easier on VScode which shows you the changed lines in colors
on the scroll bar. The idea is to find the new strings that relate to
Koha::ILL::Request and translate them
10. Translate the strings that relate to this patch (at least 'New
request' and some of the buttons in the ILL request detail).
11. Install the new translations:
k$ koha-translate --update es-ES --dev kohadev && restart_all
12. Refresh the ILL requests list
=> SUCCESS: The request status is translated!
13. Manage the ILL request
=> SUCCESS: The buttons you translated, are translated!!
14. Sign off :-D
15. Grant tcohen some cookies next time
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Janusz Kaczmarek [Wed, 29 May 2024 19:40:45 +0000 (19:40 +0000)]
Bug 36991: Add ability to scan call numbers index/search field
Some libraries ask for the ability to scan/browse the call numbers index.
Test plan:
==========
1. Have an installation with items with callnumbers (in ktd with standard
test data set: add some callnumbers to the items).
2. Go to Advanced search > More options; choose Call number in the first
drop list and mark Scan indexes. Enter one of the call numbers you
assigned to the items and perform the search. You should get no
results.
3. Apply the pach; restart all; when using ES:
koha-elasticsearch --rebuild -r -d kohadev
4. Repeat p. 2. You should get a list with at least one call number.
The link should lead you to the record(s) with items with the selected
call number.
This should work for ES and for Zebra, but for Zebra you would need to
replace /etc/koha/zebradb/ccl.properties with the repository version; and
you will get one token results on the list, like for other indexes.
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>
Test plan:
% git grep EmbedItemsInImportBiblio
should not return anything
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Kyle M Hall [Tue, 29 Oct 2024 11:44:10 +0000 (11:44 +0000)]
Bug 28965: (QA follow-up) Fix misc qa issues
* Tidy code
* Fix number of unit tests
* Fix use of delete
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a route for publicly retrieving lists.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 28965: filter_by_public() and filter_by_readable()
This patch adds helper methods for lists resultsets. Tests are added for
their behavior.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/Virtualshelves.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jake Deery [Thu, 31 Oct 2024 11:49:09 +0000 (11:49 +0000)]
Bug 37577: Add additional fields for ERM packages
This bug adds support for additional fields in the ERM module's
packages, similar to how Bug 35287 added support for additional fields
in the ERM module's licences, and Bug 37576 added support for additional
fields in the ERM module's agreements.
To test (k.t.d):
a) APPLY PATCH
b) Run cypress --spec t/cypress/integration/AdditionalFields_spec.ts
1) Note how the tests pass
c) Add new additional fields for 'erm_packages'
1) Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_packages
2) Create field one called 'text non-repeatable'
3) Create field two called 'text repeatable', check 'repeatable'
4) Create field three called 'av non-repeatable', pick LANG authorised
value
5) Create field four called 'av repeatable', pick LOC authorised value,
check repeatable
d) Create new local package
1) Go to /cgi-bin/koha/erm/eholdings/local/packages/add, notice the new
additional fields section
2) Complete all mandatory fields for a new package
3) Experiment with the four different additional field types – it
may be useful to watch the Cypress-generated test video for
guidance
4) Select some AV options from the AV fields, deselect them, notice
the repeatable one allows for multiple selection, the non-repeatable
one does not
e) Save the package, then view it
1) To view the package, click its name in the table list on
/cgi-bin/koha/erm/eholdings/local/packages
2) notice the additional fields on display
3) also notice that the authorised values are in their human-readable
form, and not their coded form
f) Edit the package, then view it again
1) Go to /cgi-bin/koha/erm/eholdings/local/packages/edit/1
2) Play around again with the fields. Save.
3) Repeat step e, have the edits shown up?
g) Test searchability
1) Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_packages
2) Edit one of the fields and make sure searchable is checked (ensure
you choose a field that has some data in it)
3) Go to /cgi-bin/koha/erm/eholdings/local/packages
4) Notice that the searchable field(s) are now columns in the table
5) Notice that searchable AV fields contain a drop-down
6) Notice that searchable text fields have an input field
7) Perform a search on the additional field
8) Notice that the searching is working as expected
h) SIGN OFF
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37576: Add additional fields for ERM agreements
This bug adds support for additional fields in the ERM module's
agreements, similar to how Bug 35287 added support for additional fields
in the ERM module's licences.
To test (k.t.d):
a) APPLY PATCH
b) Run cypress --spec t/cypress/integration/AdditionalFields_spec.ts
1) Note how the tests pass
c) Add new additional fields for 'erm_agreements'
1) Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_agreements
2) Create field one called 'text non-repeatable'
3) Create field two called 'text repeatable', check 'repeatable'
4) Create field three called 'av non-repeatable', pick LANG authorised
value
5) Create field four called 'av repeatable', pick LOC authorised value,
check repeatable
d) Create new agreement
1) Go to /cgi-bin/koha/erm/agreements/add, notice the new additional
fields section
2) Complete all mandatory fields for a new licence
3) Experiment with the four different additional field types – it
may be useful to watch the Cypress-generated test video for
guidance
4) Select some AV options from the AV fields, deselect them, notice
the repeatable one allows for multiple selection, the non-repeatable
one does not
e) Save the agreement, then view it
1) To view the licence, click its name in the table list on
/cgi-bin/koha/erm/agreements
2) notice the additional fields on display
3) also notice that the authorised values are in their human-readable
form, and not their coded form
f) Edit the agreement, then view it again
1) Go to /cgi-bin/koha/erm/agreements/edit/1
2) Play around again with the fields. Save.
3) Repeat step e, have the edits shown up?
g) Test searchability
1) Go to /cgi-bin/koha/admin/additional-fields.pl?tablename=erm_agreements
2) Edit one of the fields and make sure searchable is checked (ensure
you choose a field that has some data in it)
3) Go to /cgi-bin/koha/erm/agreements
4) Notice that the searchable field(s) are now columns in the table
5) Notice that searchable AV fields contain a drop-down
6) Notice that searchable text fields have an input field
7) Perform a search on the additional field
8) Notice that the searching is working as expected
h) SIGN OFF
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Thu, 7 Nov 2024 13:16:44 +0000 (14:16 +0100)]
Bug 38391: Redraw the filters row on table redraw
We used to adjust the filters row when the column visibility changed.
It was working, but at the initialization of the table this event if
fired once per columns. On the items table it means 36x.
When a filtering/sorting, the draw event is triggered once, but the
column-visibility.dt is called 36x
Test plan:
Try with and without this patch and compare the delay between the query
is received and the page is redrawn.
You can test with 1000 libraries on the items table.
"Show filters" then filters using the global search.
On Firefox you will notice that the response is received but the table
not redrawn directly.
With this patch it should be redrawn pretty fase.
Another test would be to add the following 2 lines:
+ let i = 0;
table_dt.on("draw", function(){
+ console.log("redraw filters %s".format(i));
if ( add_filters ) {
_dt_add_filters(this, table_dt, filters_options);
}
Open the console and notice that "redraw filters" is logged only once.
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>
Martin Renvoize [Tue, 1 Oct 2024 15:45:07 +0000 (16:45 +0100)]
Bug 17976: Unit tests
Add unit tests for the newly introduced overdue fines relation accessor.
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Tue, 1 Oct 2024 14:55:06 +0000 (15:55 +0100)]
Bug 17976: Add overdue_fines accessor to Koha::Checkout
This patch adds a new filtered relation accessor to the Koha::Checkout
object to return just overdue fine type account lines related to the
checkout.
Whilst this is easy to chain in code, it's not available via TT and so
this accessor is useful for the notices case.
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Tue, 1 Oct 2024 14:53:11 +0000 (15:53 +0100)]
Bug 17976: Update test to include fines
This patch updates the existing test to include checking the alternative
to items.fine syntax.
We could use the account_lines relation, however that would include
other charges linked to the checkout, for example rental charges.
I opt to add a new accessor to give us more options and refine to just
overdue fines.
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Emily Lamancusa [Thu, 24 Oct 2024 15:37:56 +0000 (11:37 -0400)]
Bug 22421: (follow-up) Use checkout accessor to get correct issue_id
In some cases, we may want to update an AccountLine that is linked to a
checkout without knowing whether it is a current or old checkout. In
these cases, use the AccountLines ->checkout accessor to ensure we get
the issue_id correctly, regardless of whether it is a current issue or
and old_issue.
This also applies when generating a new AccountLine based on an existing
AccountLine (for example, adding a credit to refund a previously charged
fine)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Emily Lamancusa [Thu, 24 Oct 2024 15:24:11 +0000 (11:24 -0400)]
Bug 22421: (follow-up): Check issue during add_credit
Additional handling for the case where a credit is added with an
issue_id after the issue is returned.
add_credit will keep the same method signature, where the issue_id
parameter may now refer to a current issue or an old issue. It will then
internally determine whether it is a current or old checkout and handle
it appropriately.
If the caller is updating an account line, or adding a credit to refund
an existing debit, they may not need to know whether it is for a current
checkout or an old checkout. In this case, they can use the account
line's ->checkout accessor to pass in the appropriate issue_id
regardless of whether it is a current or old checkout.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Thu, 8 Feb 2024 14:18:31 +0000 (14:18 +0000)]
Bug 22421: DBIC schema update
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Thu, 6 Jun 2019 12:25:01 +0000 (13:25 +0100)]
Bug 22421: (follow-up) Correct checkout relation
The Koha::Account::Line->checkout relationship accessor needed an update
to respect the new fields and foreign keys introduced here.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Thu, 6 Jun 2019 11:43:51 +0000 (12:43 +0100)]
Bug 22421: Ensure old_issue_id is populated in accountlines
Update C4::Circulation::MarkIssueReturned to handle moving issue_id to
old_issue_id in accountlines.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Thu, 6 Jun 2019 11:40:11 +0000 (12:40 +0100)]
Bug 22421: Add missing constraints
DB update to add a new old_issue_id field to accountlines and set
foreign key constraints for both the new field and the existing issue_id
field.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Thu, 6 Jun 2019 11:26:47 +0000 (12:26 +0100)]
Bug 22421: Add tests for new constraints
Test plan:
* Read the updated tests and verify that they make sense and do not
remove anything previously tested for.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Janusz Kaczmarek [Tue, 24 Sep 2024 21:05:32 +0000 (21:05 +0000)]
Bug 37998: Tabs and backslashes in the data break item search display
If the item data (e.g. callnumber) contains a tab or backslash OR the
title part contains a backslash, the DataTable displaying the item
search results stops throwing an error modal "Something went wrong when
loading the table. 200: OK." and a JS console log: "DataTables warning:
table id=results - Invalid JSON response. For more information about
this error, please see http://datatables.net/tn/1".
Test plan:
==========
1. Make an item search w/o any parameters.
2. From the first result page choose a record and modify the title (245 $a)
to contain " \ " string. Repeat the item search. You should see a modal
"Something went wrong when loading the table. 200: OK.".
3. Remove the " \ " from the title. Verify that the problem no longer occurs.
4. In the same record, insert the string " \ " or a tab (copied from a text
editor) into item data (itemcallnumber, enumchron, barcode etc.).
5. Repeat the item search. You should see again a modal "Something went wrong
when loading the table. 200: OK.".
6. Apply the patch; restart_all.
7. Repeat p. 2, 3, 4, and 5. Verify, that the problem is solved.
Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 38100: Items with damaged status are shown in OPAC results as "Not available" even with AllowHoldsOnDamagedItems
Items with damaged status are shown on the OPAC results page as "Not
available" even with AllowHoldsOnDamagedItems set to 'Allow', which is
misleading for the users. 'other/Damaged' status should be assigned
only if AllowHoldsOnDamagedItems is set to 'Don't allow'.
Test plan:
==========
1. Check that AllowHoldsOnDamagedItems system preference is set to
'Allow'.
2. In librarian interface, change the damaged status of an item by
setting it to 'Damaged'.
3. In OPAC, make a search for the record with this item attached. Use
common words from title to get a list and not a single record.
4. Note that the item in question is labelled as 'Not available'
(Damaged).
5. Apply the patch; restart_all.
6. Repeat p. 3. Note that the item is now labelled as 'available for
loan'.
7. Set AllowHoldsOnDamagedItems system preference is set to 'Don't
allow'.
8. Repeat p. 3. Note that the item is now labelled as 'Not available'.
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37987: Speed up downloading reports in .tab format
Downloading SQL report in .tab format was significantly
slower after changes made in bug 37382. Apparently using
HTML::Scrubber to redeclare content variable after
mapping it is slow. Instead sending whole map function
as parameter to module speeds up downloading to couple
of seconds as it was before.
To test:
1. Find or create report that returns several thousand rows
(e.g. SELECT * FROM items LIMIT 4000).
2. Run report and attempt to download it as .tab file.
=> Notice that this takes a lot of time (around 20 seconds).
3. Apply this patch.
4. Download report again.
=> Dowloading should now take couple second.
=> Confirm that the content of .tab file still contains table
data.
Sponsored-by: Koha-Suomi Oy Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Wed, 6 Nov 2024 13:44:08 +0000 (13:44 +0000)]
Bug 38379: Remove obsolete Bootstrap classes from installer templates
This patch makes some minor markup changes to the installer and
onboarding templates so that obsolete Bootstrap grid classes are
removed. The patch also adds another breakpoint to the grid classes to
that the content adjusts well at smaller viewport sizes.
To test, apply the patch and rebuild the staff interface CSS.
- Drop and recreate the Koha database. Run 'restart_all' if necessary.
- Navigate to the staff interface. You should be presented with the
installer login. The form should be centered on the page.
- Log in and follow the installer and onboarding steps to confirm that
the layout looks correct on each page.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Thu, 7 Nov 2024 08:40:03 +0000 (09:40 +0100)]
Bug 38130: Allow sorting and filtering on library id and name
On the item list of the bib detail page and the patron search we want
the library columns ('holding library', 'home library' and 'library') to
be sorted by library names and to make them searchable on library id and
name.
Concerns about this approach (comment #8):
"""
If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc.
We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO.
"""
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Wed, 9 Oct 2024 07:18:07 +0000 (09:18 +0200)]
Bug 38130: Add the ability to filter item by library name
On the item list of the bibliographic record page you actually can filter
items by library, either using the dropdown list on top of the column
or using the library_id (branchcode) in the global search.
But you cannot search using the library's name in the global search.
This patch add yet other embeds to allow this.
I am not sure this is needed, we won't be able to do the same for item
type and AV, so maybe it is not worth 2 additional JOINS.
Maybe we should tell people you should use the column filters when a
dropdown list is there, instead of: "it works, sometimes".
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 31 Oct 2024 19:23:08 +0000 (19:23 +0000)]
Bug 37478: Rename strict to skip_bad_records and add POD
Option name changed, POD updated.
The reason not to do this by default is that it is an extra record conversion
to check the validity, so may slow down the import.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 22 Aug 2024 11:26:52 +0000 (11:26 +0000)]
Bug 37478: (follow-up) Add MARC::Lint to cpanfile
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>
Nick Clemens [Thu, 25 Jul 2024 16:37:17 +0000 (16:37 +0000)]
Bug 37478: Add strict mode to bulkmarcimport
This patch adds a conversion from MARC -> XML -> MARC to catch any parsing errors.
If errors are found, we then lint the record to catch any problems, output the
warnings, and skip the record.
To test:
1 - Download the sample records from this bug report
2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v
fails!
3 - perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v
fails!
4 - Apply patch
5 - Repeat 2 & 3 - no change
6 - Add -st switch to the commands:
perl misc/migration_tools/bulkmarcimport.pl -b --file=520_nosubfield.mrc -v -st
perl misc/migration_tools/bulkmarcimport.pl -b --file=003_subfielda.mrc -v -st
7 - The records are now skipped, and the script completes
8 - Confirm the warnings generated are useful
9 - Sign off!
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>
Bug 31224: Revert to $metadata->record in `marcrecord2csv`
This patch reverts the change for marcrecord2csv as
`$biblio->metadata_record` doesn't support a list of itemnumbers, and it
feels we should discuss in another context whether to add it as a
parameter, or make it a Koha::Items iterator. The Koha::Item object is
actually retrieved in marc2csv so there's room for easy improvements
without adding technical debt (i.e. bad method signatures for a single
use case).
This fixes a feature:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/Exporter/Record.t
=> FAIL: Test fails because the 'items' are not being filtered on the
passed itemnumbers (i.e. all items are picked for generating the CSV).
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 31224: Move item field removal up to $metadata->record
This patch addresse the fact Koha needs to strip out stray item field in
MARC records coming from the DB. While this is not ideal, it has worked
so far, limiting the negative effects of bad data to Koha users.
I put a FIXME because I think it deserves to be revisited colectively at
some point. I filed bug 38406 to track the discussion around this.
The `marcmarcrecord2csv.t` tests cover this behavior and I thought
removing it was not in the scope of this bug.
I decided to move the removal one step up in the call chain so it
applies to all calls to `$metadata->record`, not only those that ask to
include items. This is the right thing to do while we keep this
behavior.
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/Record/marcrecord2csv.t
=> FAIL: Item information gets extracted from more items than expected
(i.e. the item in the MARC record is not stripped out so 'Withdrawn'
shows 3 times instead of 2).
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Run:
k$ prove t/db_dependent/Koha/Biblio/Metadata.t
=> SUCCESS: Tests pass! The behavior change in $metadata->record works
as intended!
5. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 38342: Pass the value to exception to avoid warnings
This patch makes the exception on bad enum values in Koha::Object->store
not print a warning in the event of stringifying the exception.
To test:
1. Run:
$ ktd --shell
k$ prove t/db_dependent/Koha/Booking.t
=> FAIL: You get this warnings:
```
Use of uninitialized value in sprintf at /kohadevbox/koha/Koha/Exceptions/Object.pm line 84.
```
2. Apply this patch
3. Repeat 1
=> SUCCESS: No more uninitialized values warnings
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Owen Leonard [Fri, 30 Aug 2024 17:35:06 +0000 (17:35 +0000)]
Bug 30699: Fix various HTML validity errors in staff interface templates
This patch fixes several HTML validity issues in various staff
interface templates. Most of these changes won't be visible in the
interface.
- Advanced search:
- Remove stray </a> tags
- Fix duplicate IDs by adding loop.index to repeated dropdown menus
- Circulation
- Fix mismatched label and form field id in checkouts table footer
- Fix mismatched label and form field id claim returned modal
- Remove invalid href attribute from button in claim returned modal
- Wrap relatives' checkouts tab in conditional so that panel doesn't
appear when tab has been hidden
- Fix duplicate id attributes in patron messages-related markup
- Remove redundant class attribute from patron messages-related markup
- Acquisitions -> Vendor -> Basket -> Add to basket -> From staged file
- Remove invalid "size" attribute from hidden form fields
- Circulation -> Holds awaiting pickup
- Fix mismatched label and form field id
- Patron -> Accounting -> Pay fine -> Submit cash amount higher than the
charge
- Remove invalid href attribute from button in confirmation modal
- Fix errors in tab markup WRAPPERs in html_helpers.inc to prevent
mismatched aria-labelledby attributes
- Footer language selector:
- Fix markup to correct errors in aria-controls
- Remove invalid href attribute from cookie consent modal
Sponsored-by: Athens County Public Libraries Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Lari Taskula [Wed, 2 Oct 2024 18:44:27 +0000 (18:44 +0000)]
Bug 35126: Remove onload from opac-addbybiblionumber.pl
To test:
Case a) Adding to a new list
1. Enable virtualshelves system preference
2. Search for any record and click it
3. On the right hand side of record view, click "Save to your lists"
4. A new pop up opens.
5. Under "Add to a new list", give any name to the list
6. Under "Add to a new list", click "Save"
7. Observe popup closing
8. Observe record view page reloading
Case b) Adding to an existing list
1. Enable virtualshelves system preference
2. Search for any record and click it
3. On the right hand side of record view, click "Save to your lists"
4. A new pop up opens.
5. Under "Add to a list", select an existing list
(it can be the same as the one you created in case a, it does not matter here)
6. Under "Add to a list", click "Save"
7. Observe popup closing
8. Unlike case a, observe record view page NOT reloading
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Phil Ringnalda [Fri, 1 Nov 2024 19:33:32 +0000 (12:33 -0700)]
Bug 38329: Remove orphan confirm_deletion() in supplier.tt
The JavaScript function confirm_deletion() in supplier.tt has either
been an unused orphan since bug 28082 two years ago, or since the switch
from YUI to Bootstrap 12 years ago. Doesn't matter which, nothing calls
it, and if it was called, it would fail by trying to GET with
op="delete" rather than POST with op="cud-delete".
Test plan:
1. Acquisitions - New vendor, enter a name and Save
2. Click the name of your new vendor, so your URL is at supplier.pl
3. Click Delete vendor to verify that deleting still works without this
unused code which would fail
Sponsored-by: Chetco Community Public Library Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Ewa Gozd [Tue, 5 Nov 2024 10:31:47 +0000 (10:31 +0000)]
Bug 38283: fixed wrong ending tag in patron search modal
Fixed mis-matched a/button tags on "Close" button.
To test:
- Apply patch
- In staff interface: Go to acquisitions > suggestions
- Create a new suggestion
- Click on "Set to patron"
- Verify the close button in the modal looks correct and works
Signed-off-by: Jan Steinberg <jan.steinberg@gesis.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 37863: Fix checking if a patron is already in the list adding users to a patron card batch
If the patron is already in the card batch it won't add it and it will show an error message
Test plan:
1 Create or edit an patron card batch
2 Try adding twice or more the same patron. It will show a success message everytime and you will end up with the same patron several times in the card batch
3 Apply patch, restart services
4 Repeat step 2. The first time you click on add user, it will do it and show the success message (Patron 'Patron name' added.), but after that it won't add the user and it will display an error message (Patron 'Patron name' is already in the list.)
Jonathan Druart [Thu, 31 Oct 2024 14:12:54 +0000 (15:12 +0100)]
Bug 38312: Do not hide patron search form behind the fixed header
On the patron search form (/members/members-home.pl) if you open the
patron search form *from the header search*, part of the form will be
hidden behind the fixed header (the one with the select/clear, actions)
Before: https://snipboard.io/oF2gBA.jpg
After : https://snipboard.io/QqMiRH.jpg
Using z-index: 1000 as the header as 999
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Mon, 17 May 2021 16:14:16 +0000 (17:14 +0100)]
Bug 28294: Remove updateWrongTransfer
This patch removes the last remaining use of updateWrongTransfer and the
method itself.
We replace it with a call to request_transfer that passes the 'replace'
reason of 'WrongTransfer' through to Koha::Item::Transfer->cancel.
Test plan
1/ git grep updateWrongTransfer to confirm there are no more uses of the
method.
2/ Confirm an incorrect transfer still behaves as expected at
circulation returns.
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>
Pedro Amorim [Tue, 29 Oct 2024 14:01:05 +0000 (14:01 +0000)]
Bug 38287: Add missing rule_value access
Test plan:
1) Access circuation rules:
http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl
2) Scroll down to "Default checkout, hold and return policy". Enter nothing. Hit 'Save'.
3) Notice on page reload there is a Koha:: object on the bookings inputs
4) Save again -> ERROR
5) Apply patch. Repeat.
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Marcel de Rooy [Fri, 4 Oct 2024 09:04:18 +0000 (09:04 +0000)]
Bug 37365: (QA follow-up) Add borrowernumber to referrer url
Since we post to add_message, we need to ensure that the
borrowernumber is added to the referrer url. This 'tric' is
already done there for another form.
Test plan:
See original plan.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Tue, 5 Nov 2024 15:15:46 +0000 (15:15 +0000)]
Bug 38359: Update css class
col-sm-offset-* no longer exists in bootstrap 5 and we should use offset-sm-* instead
Test plan:
1) Enable ILLModule sys pref
2) Attempt to create a new ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Notice there is no left offset (as was before bug 35402
4) After creating the request, see the detail page:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
5) Verify same issue happens here.
6) Apply patch. Repeat test plan.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 35987: Fix broken See highlighted items below link
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Test plan with KTD:
- Issue a couple of items to a patron, and make sure one of them is
overdue.
- Make sure "Always show checkouts automatically" is not checked
- Reload the page
- Click on the link in "Overdues: Patron has ITEMS OVERDUE See
highlighted items below"
- Nothing happens
- Apply the patch, restart_all, reload the "Check out" page for the
patron
- Click on the link again, and the active loans should be shown
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Phil Ringnalda [Fri, 1 Nov 2024 16:13:50 +0000 (09:13 -0700)]
Bug 38325: Cannot delete invoice while viewing it
The link to delete while viewing an individual invoice needs to be updated to
use submit-form-link so it can POST with op='cud-delete'.
Test plan:
1. Home - Acquisitions, click Search with an empty Vendor: input
2. Click Receive shipments, enter a number in the Vendor invoice input,
click Next
3. In the left sidebar, click Invoices, click Search without any parameters
4. In the row for your invoice, click the invoice number link
5. Next to the Save button, click the Delete link, click OK in the
confirmation alert
6. You'll see the page reload, and the URL change to include ?op=delete,
but your invoice remains undeleted.
7. Apply patch, reload the page
8. Click Delete, click OK in the confirmation alert
9. Click Search with no parameters, just to make sure the message about
"Sorry, but there are no results for your search" really truly means
that your invoice was deleted and now you don't have any invoices
Sponsored-by: Chetco Community Public Library Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Jonathan Druart [Thu, 31 Oct 2024 13:41:19 +0000 (14:41 +0100)]
Bug 30397: Remove duplicate entry from length menu of patrons search
If you have 20 in PatronsPerPage, there will be two 20 entries in the
length menu of the patrons search.
jQuery.unique is stupid it seems, it requires the array to be sorted (?)
let x = [1, 2, 1, 2]
jQuery.unique(x);
Array(4) [ 1, 2, 1, 2 ]
x = [1, 1, 2, 2]
jQuery.unique(x);
Array [ 1, 2 ]
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Phil Ringnalda [Fri, 1 Nov 2024 02:44:35 +0000 (19:44 -0700)]
Bug 38309: Cannot delete additional fields
Deleting an additional field tries to do a GET of ?op=delete... which no
longer works with CSRF protection. It needs to be a POST with op=cud-delete.
Test plan:
1. Administration - Additional fields, click any table name
2. New field, fill in a name and Save
3. In the row for your field, click Delete
4. You have a blank page
5. Apply patch, click the browser Back button, refresh the page
6. In the row for your undeleted field, click Delete
7. Your field is deleted
Sponsored-by: Chetco Community Public Library Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 1 Aug 2024 18:01:25 +0000 (18:01 +0000)]
Bug 37550: CheckItemPreSave should run barcodes through barcodedecode
In Koha::Item we run a barcode through barcodedecode before any save.
We should do the same when checking barcodes to avoid a duplicate error
when the barcode is cleaned before it is written to the DB
To test:
1 - Follow previous test plan
2 - Note that after this patch is applied there is no exception
All items are skipped as duplicate barcodes
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 1 Aug 2024 18:00:57 +0000 (18:00 +0000)]
Bug 37550: Unit test for CheckItemPreSave
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Nick Clemens [Thu, 1 Aug 2024 17:37:35 +0000 (17:37 +0000)]
Bug 37550: Move item check after error handling
To test:
1 - Grab the sample file on this bug report
2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=spaceditems.pl -v
3 - An exception for 'Duplicate ID' is thrown and script dies
4 - Apply patch
5 - run script again
6 - The script finishes, no items are added, but record is
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
When using a direct link to a news (koha.url/cgi-bin/koha/opac-main.pl?news_id=XXX), the link is broken if the news is expired.
Formerly, a using AdditionalContent->get( id => "my_news_id") on an
expired news was returning a news, and calling get without id was
returning all news but the expired ones.
This patch adds tests to check this behaviour by adding one expired news and performing following new tests:
1 - It may not be returned by AdditionalContent.get()
2 - It must be returned by AdditionalContent.get() using its id
This patch fixes the behaviour by addind the new behaviour or
AdditionalContent.get:
1 - Any news must be returned by AdditionalContent.get() using its id;
TEST PLAN:
1 - Apply patch
2 - Remove the changes made to Koha/AdditionalContents.pm
3 - Run tests -> one test must fail
4 - Create a news with a expired expiration date, notice the id of the
news in the url of the modification panel
5 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
it does not work
6 - Reapply the whole patch
7 - Run test -> all test must pass
8 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
it does work now
Signed-off-by: Olivier V <olivier.vezina@inLibro.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch replaces the call to ModItemTransfer in circ/returns.pl with
a call to Koha::Item->request_transfer and
Koha::Item::Transfer->transit.
Test plan
1) Set 'AutomaticItemReturn' to "Don't"
2) Check an item in at a location other than it's 'home' or 'holding'
branch
3) Note you should be asked a about returning the item to another branch
4) Opting to not proceed should NOT result in a row in the
branchtransfers table
5) Option to proceed (either with a print slip or just 'OK') should
result in a branchtransfer from the current checkin branch to the
home or holding branch depending on the circulation rules.
5a) The item should be marked as immediately in transit in, i.e. the
'datesent' set to today.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Emmi Takkinen [Mon, 28 Oct 2024 10:03:26 +0000 (12:03 +0200)]
Bug 38257: Do not use js_includes.inc in two different files
Downloading cart didn't work because js_includes.inc file
was included both in basket.tt and intranet-bottom.inc.
This patch removes related codeline from basket.tt.
To test:
1. Search for items and add one or more search results to your cart.
2. Open cart.
3. Attempt to download items from your cart.
=> Either nothing happens.
4. Apply this patch, restart services if needed.
5. Again attempt to download.
=> Download menu should now work as expected.
Sponsored-by: Koha-Suomi Oy Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Emmi Takkinen [Thu, 24 Oct 2024 11:57:46 +0000 (14:57 +0300)]
Bug 38257: Fix cart pop up functionalities
Almost all functionalities in cart pop up were broken
due changes made in bug 37033. Also following errors
were displayed in browsers console:
> Uncaught TypeError: antiClickjack is null
> Uncaught TypeError: $(...).dataTable is not a function
This happens because when 'intranet-bottom.inc' is loaded
after other .inc files in page.
To test:
1. Search for items and add one or more search results to your cart.
2. Open cart.
3. Attempt to use one or more functionalities (download, remove item etc.).
=> Either nothing happens or table is loaded again with no items in
table. However items are still displayed in cart when it's opened again.
4. Apply this patch, restart services if needed.
5. Again attempt to download, remove items, print etc. from cart
=> Everything should now work as expected.
Sponsored-by: Koha-Suomi Oy Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 31224: Adapt GET /public/biblios/:biblio_id controller
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 31224: Expand coded values using metadata_record in Server.pm
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Tue, 18 Oct 2022 15:46:08 +0000 (16:46 +0100)]
Bug 31224: Update instances of metadata->record
We can now call metadata_record directly on the Koha::Biblio object.
This aptch updates all modules and controllers to use
Koha::Biblio->metadata_record directly where appropriate. The
exceptions are where we don't require any filtering or the filtering
makes sense to do after the initial fetch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Tue, 18 Oct 2022 15:44:39 +0000 (16:44 +0100)]
Bug 31224: Support 'interface' on metadata_record
We replace the 'opac' boolean with an 'interface' param here to allow
for ViewPolicy filtering depending on 'opac', 'intranet' or 'nothing'
being passed.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Martin Renvoize [Tue, 18 Oct 2022 15:25:35 +0000 (16:25 +0100)]
Bug 31224: Convert C4::Record::marcrecord2csv
Update marcrecord2csv to user RecordProcessor directly for embedding
listed items.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 31224: Use metadata_record in opac-MARCdetail.pl
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch introduces a higher-level method for retrieving a 'prepared'
record for using in specific contexts. In particular, I only focused on
embedding item information and OPAC view filtering. But we could add a
way to get the record through the ViewPolicy also for staff.
The virtue of this patch is that it explains better than my words why I
think having the *embed_items* and *opac* parameters in
Koha::Biblio::Metadata->record is not ideal. And makes the other
implementation feel like is done at the wrong level.
I know it's been done like that to act as a drop-in replacement fro GetMarcBiblio,
which was a good first step. But we need to revisit how it is used, in general, to come
up with a more refined and useful design. So we do not port the same
design problems from C4::* into Koha::*.
Try to think how it would be used in contexts like opac-MARCdetail.pl or
any other OPAC controller script.
Thanks!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
David Cook [Tue, 20 Aug 2024 00:12:21 +0000 (00:12 +0000)]
Bug 22223: Add filter to make item URLs safe in template output
This change adds a "safe_url" filter which takes a text input and
returns a Perl URL object which stringifies to a safe URL.
This change is only needed in the OPAC as the staff interface
handles the item URL display using Javascript not Template Toolkit.
0. Apply patch and koha-plack --restart kohadev
1. Create an item for a record using the following URL
https://koha-community.org?url=https%3A%2F%2Fkoha-community.org
2. Go to the OPAC for that record and verify that the URL is
not double-escaped
3. Create a malicious payload (talk to QA/security team for this if necessary)
4. Note that the malicious payload is escaped
5. prove t/Koha/Plugins/SafeURL.t
6. Celebrate!
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Mon, 4 Nov 2024 11:32:34 +0000 (11:32 +0000)]
Bug 36822: (QA follow-up): Fix now time in tests
This is to prevent the scenario of tests failing if they take long to run, e.g.:
# Failed test 'updated_on correctly saved on newly created user'
# at t/db_dependent/Auth_with_shibboleth.t line 317.
# Structures begin differing at:
# ->[0] = '2024-11-04 11:20:13'
# ->[0] = '2024-11-04 11:20:14
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Fri, 25 Oct 2024 14:41:56 +0000 (14:41 +0000)]
Bug 36822: LDAP - Add discard_changes
Test plan:
1) Apply only LDAP rearrangement patch
2) Run that test file (to prove the rearrangement does not break tests):
$ prove t/db_dependent/Auth_with_ldap.t
3) Verify tests pass
4) Apply LDAP test patch on top
5) Run the test file. Notice it fails.
6) Apply this patch. Run LDAP tests again. Verify tests pass.
Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Fri, 25 Oct 2024 14:38:09 +0000 (14:38 +0000)]
Bug 36822: LDAP - Rearrange Auth_with_ldap.pm so it picks up on mock config from test file
Without this rearrangement, C4::Context->config('useldapserver') is always 0.
It seems that because its inside a BEGIN block, the mock coming from .t file does not get picked up
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Fri, 25 Oct 2024 14:36:23 +0000 (14:36 +0000)]
Bug 36822: Shibboleth - Add discard_changes
Test plan:
1) Apply only Shibboleth tests patch
2) Run that test file:
$ prove t/db_dependent/Auth_with_shibboleth.t
3) Verify tests fail with the updated_on error message.
4) Apply this patch. Repeat 2) Verify tests now pass.
Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pedro Amorim [Tue, 29 Oct 2024 11:12:04 +0000 (11:12 +0000)]
Bug 37872: Consider enable_plugins = 0 when fetching plugin backends
This patch builds on top of Andreas patch checking for Koha::Plugins->new() instead as the enable_plugins is already done there.
It also adds a check in reply to Joubu's observation, which is indeed an additional bug.
Test plan:
1) Apply tests patch. Run the tests. Notice it fails
2) Apply the remaining patches. Run the tests. Notice they pass.
Additional (and better) tests can be written, but for now I think this is good enough.
Additional tests should be written on top of bug 36197 (which adds a dummy ILL backend plugin for testing), at:
https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36197&attachment=171371
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> 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>