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>
Andreas Jonsson [Mon, 9 Sep 2024 16:51:10 +0000 (16:51 +0000)]
Bug 37872: Add guards for enable_plugins
There are ILL-backends that are not implemented as
Koha plugins and does not require plugins to be enabled.
The 'new' method in Koha::Plugins returns undefined if
plugins are disabled. Therefore, calls to this method
must be guarded by a check that plugins actually are enabled.
Testplan for koha-testing-docker:
- Edit /etc/koha/sites/kohadev/koha-conf.xml and disable plugins by
setting <enable_plugins>0</enable_plugins>
- sudo koha-mysql kohadev -e "UPDATE systempreferences SET value='1' WHERE variable='ILLModule';"
- Run restart_all.
- In staff interface, go to About koha -> System information. The page
should load normally (as opposed to returning 500 internal server
error).
Signed-off-by: David Nind <david@davidnind.com> 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>
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>
Owen Leonard [Wed, 30 Oct 2024 17:41:45 +0000 (17:41 +0000)]
Bug 38305: Can't delete or archive suggestions
This patch corrects JS on the suggestions page so that the delete,
archive, and unarchive controls work.
The patch also modifies the markup of the "Delete" button so that it is
consisten with other pages.
To test, apply the patch and go to the suggestions page in the staff
interface.
- Log in to the staff interface as a user with "suggestions_manage"
permission.
- If necessary, create a few suggestions to test with.
- From the table of suggestions, click the secondary menu on the "Edit"
button for one of the suggestions.
- Choose "Delete." You should get a confirmation dialog. Both the "OK"
and "Cancel" options should work as expected.
- Choose "Archive." There won't be a confirmation, and the title
should disappear from the list.
- To test whether the suggestion was archived, search for it using
the sidebar form, checking the "Include archived" checkbox. The
suggestion should show up in the list with an "Archived" label.
- Clicking the "Edit" secondary menu on the archived suggestion
should trigger a menu with an "Unarchive" option. Click that
and confirm that the suggestion is no longer archived.
- Now log in as a user with only "suggestions_delete" permission but not
"suggestions_manage"
- In the list of suggestions each title should have a "delete" button.
- Clicking the delete button should trigger a confirmation dialog.
Both the "OK" and "Cancel" options should work as expected.
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch acknowledges the fact this patchset changed the called method
`libraries_where_can_see_patrons` for `libraries_where_can_see_things`.
And as such the mock was not working.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Nick Clemens [Fri, 1 Nov 2024 11:35:04 +0000 (11:35 +0000)]
Bug 37392: (follow-up) Limit a borrower not in a group and fix tests
The previous patches took into account all the groups for a patron, but missed the case where a patron
didn't have permission to see outside their library, and their library is not in a group.
Code updated and a test added.
Other tests adjusted to ensure the feature to limit patrons was set in those groups.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Lucas Gass [Tue, 17 Sep 2024 17:35:46 +0000 (17:35 +0000)]
Bug 33462: DBIC schema update
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>
Sam Lau [Fri, 7 Jun 2024 19:26:51 +0000 (19:26 +0000)]
Bug 33462: (Follow up) Fix Perl Tidy
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> 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: Laura_Escamilla <laura.escamilla@bywatersolutions.com> 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>
Sam Lau [Fri, 7 Jun 2024 18:44:54 +0000 (18:44 +0000)]
Bug 33462: Add ability to force password change for new patrons entered by staff
This patch attempts to force a password change for new staff created patrons.
This is done by setting the password_expiration_date to an expired date when
adding a new patron. This patch adds a new system preference
'ForcePasswordResetWhenSetByStaff' and a new column to the categories table
'force_password_reset_when_set_by_staff.
To test:
1) Apply patch, restart_all, updatedatabase, and also be sure to update schema.
2) Visit Administration->Sytem Preferences and search for 'EnableExpiredPasswordReset'.
Make sure this is set to enable. Now search for 'ForcePasswordResetWhenSetByStaff'.
This should be defaulted to 'Don't force'.
3) Keep that tab open and visit Administration->Patron categories. Click on edit
on the Board category. Noitce that there is a now a 'Force new patron password reset'
section. Notice that the by default, this is set to follow the
ForcePasswordResetWhenSetByStaff system preference (currently set to don't force).
Click on the dropdown and change it to 'Force'. Save changes
4) Click on the Patrons tab to visit members-home.pl and then click 'New Patron'.
Select on Patron. Fill in the required information and also enter a password.
5) Submit this form and notice that the patron's password expiration date is set
to never. This should be the case because the default for 'Force new patron
password reset' follows the sys. pref. which is still set to 'Don't force' (You
could have some expiry date in this step, but it should at least be set to a
date that is not expired. this depends on whether or not you have a defalut
password expiration date set in patron categories )
6) Log into the OPAC with this patron and notice it works as expected and log in
was successful.
7) Go back to the patron home page and click to add a new patron. This time select
'Board'. Once again fill out the required info, enter a password, and then save
the form.
8) Notice that for this patron, the password expiration date is set for today's
date. This is because we changed the setting for the 'Board' patron category to
force.
9) Log into the OPAC with this patron. You should be redirected to a page with an
error that says: "It's your first login! You need to reset your password." Click
on the reset password link below this message.
10) You should be sent to a page where you can reset your password. Fill in the
form and click 'Update password'. Attempt to sign into the OPAC with this new
password. Everything works as expected.
11) Go back to the staff interface and view this patron's detail page. Notice the
password expiration date is now set to what the default is in the patron
category.
12) Edit this patrons information and set their password expiration date to
yesterday. Go back to the OPAC and try to sign in with this patron again. Note
that this time, you are also redirected but the message says "Error: Your
password has expired!"
13) Go back to the staff interface and visit the sys. pref tab we left open. Set
it to the 'Force' option and save changes.
14) Visit the patron home page and click add patron, now select the patron
category again. Fill in required info and enter password. Submit form and note
that the patron's password expiration date is set to today. Try to login to
the OPAC with this patron, you should be redirected to the page with the error
that says "Error: It's your first login! You need to reset your password."
15) Sign-off :)
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> 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>