Stricture disabled at line 67, column 5. See page 429 of PBP. (Severity: 5)
We should deal with that later instead of ignoring the warnings
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
% perl -wc Koha/ExternalContent/OverDrive.pm
Possible precedence issue with control flow operator (die) at /kohadevbox/koha/lib/WebService/ILS/OverDrive/Patron.pm line 365.
Possible precedence issue with control flow operator (die) at /kohadevbox/koha/lib/WebService/ILS/OverDrive/Patron.pm line 573.
Possible precedence issue with control flow operator (die) at /kohadevbox/koha/lib/WebService/ILS/OverDrive/Patron.pm line 643.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch prevents image size from increasing while uploading by
keeping the original image format
Test plan:
1. Download the attached image large-image.jpg
--> It should be ~170kB and 1000×1500 pixels
2. Enable LocalCoverImages in System preferences
3. Find a record in the staff interface
4. Go to "Images" tab
5. Upload large-image.jpg image
5.1. Click on "Upload"
5.2. Click on "Drop files here or click to select a file"
5.3. Choose picture (large-image.jpg)
5.4. Click on "Process images"
6. Click on image for large image
7. Right-click on the image and save it
--> It is ~930kB and 600x900 pixels
8. Apply the patch and flush browser cache (Crtl+F5) to update js files
9. Detele the previous uploaded image
10. Repeat step 3, 4, 5, 6, 7
--> The image is ~92kB and 600x900 pixels
11. prove t/db_dependent/Koha/CoverImages.t
--> All tests should be successful
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Check that $charge is defined before comparing, to avoid "argument isn't
numeric" error if no charge is defined.
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
In method Koha::Hold->cancel in the section where we charge a cancel
fee there is a if statement "if $charge" after calling sub add_debit.
This allows value "0.00" to be passed to the add_debit and it then
gets caught in statement "unless ( $amount > 0 )" which calls exception
AmountNotPositive. This happens at least when syspref
ExpireReservesMaxPickUpDelayCharge or circulation rule "Expired hold charge"
has value 0.00 and cronscript cancel_expired_holds.pl is run. This patch
fixes the if statement in Koha::Hold->cancel.
To test:
1. Enable syspref ExpireReservesMaxPickUpDelay.
2. Set syspref ReservesMaxPickUpDelay value as 1.
3. Set syspref ExpireReservesMaxPickUpDelayCharge value as 0.00.
4. Make sure you have a waiting hold which has expiration date further
in the past than ReservesMaxPickUpDelay value in your database. If not,
create one.
5. Run cronscript cancel_expired_holds.pl.
=> Exception 'Koha::Exceptions::Account::AmountNotPositive' thrown
'Debit amount passed is not positive' is raised.
6. Set syspref ExpireReservesMaxPickUpDelayCharge value as 0 and run
cronscript again.
=> No exception is raised.
7. Apply this patch and restart services if needed.
8. Create a new waiting hold with expiration date in the past.
9. Run cronscript again.
=> No exception is raised.
=> Confirm that no cancel fee was added for patron.
Also prove t/db_dependent/Koha/Holds.t.
Sponsored-by: Koha-Suomi Oy
Signed-off-by: Bernard Scaife <bernard.scaife@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch removes Baker & Taylor integration following the shutdown of
the company.
To test, apply the patch, run the database update, and restart all.
- In the staff interface go to Administration -> System preferences and
search for 'Baker.' There should be no results.
- If necessary enable at least one cover image service, e.g.
AmazonCoverImages, OpacCoce, GoogleJackets, etc.
- Log in to the OPAC and confirm that cover images display correctly on
these pages:
- Search results
- Bibliographic detail page
- Shelf browser
- Your summary -> Checked out
- Checkout history
- Recent comments
- Lists
Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Test plan, before applying patch:
1) Visit additional contents for HTML customizations:
<staff_url>/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations
2) Click the left side 'Display location' filter. No options show under OPAC or Staff interface
3) Apply patch, restart plack, refresh. All options should now show (and working filter as expected) under OPAC and Staff interface
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Commit 55689d41ba changed Koha::Patron::extended_attributes() and
add_extended_attribute() to pass plain hashrefs to logaction() and
updated tests to expect JSON in the info column. However, logaction()
still had a code path that converted any non-CATALOGUING hashref $infos
to a Dumper() string before the encode_json() at line 151 could fire,
so JSON was never stored and the tests failed.
Remove the catch-all Dumper branch; non-CATALOGUING hashref inputs now
fall through to the existing encode_json() call. The CATALOGUING/MODIFY
biblio-Dumper special case is preserved.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Previously, _unblessed_for_log strips undef/empty fields, so fields
that were blank before an edit were absent from $from_storage. Because
@keys was built only from keys %{$from_storage}, any field that
transitioned from empty to a value was never iterated and the change
went unlogged.
Fix by unioning keys from both old and new state so that added,
changed, and cleared fields are all detected.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Three issues were reported with patron action logging:
1. CREATE followed by extended_attributes() produced two log entries
(CREATE for patron fields + MODIFY for attributes) instead of one.
2. MODIFY that changed both regular fields and patron attributes produced
two separate MODIFY entries instead of one unified entry.
3. DELETE log did not include the patron's extended attribute values.
Fix:
- logaction() now explicitly returns the stored Koha::ActionLog object so
callers can capture the action_id.
- Koha::Patron::store() saves the action_id of the CREATE or MODIFY log it
writes into $self->{_patron_log_id}.
- Koha::Patron::extended_attributes() setter checks for _patron_log_id. If
set, it calls _merge_attribute_log() to fold the attribute changes into
the existing log entry (updating its info and diff JSON) instead of
creating a new MODIFY entry. This covers both the CREATE and MODIFY cases.
- Koha::Patron::delete() now iterates extended_attributes before deletion
and adds attribute.CODE keys to the patron_data snapshot, so the DELETE
diff includes the removed attributes.
- New private helper _merge_attribute_log() decodes an existing action log
entry's info/diff JSON, merges in the attribute change data using
Struct::Diff, and saves the updated entry.
- Tests added to t/db_dependent/Koha/Patrons.t covering all three scenarios.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Exclude fields with undef or empty string values from _unblessed_for_log
so that CREATE and DELETE log diffs only show fields with meaningful values.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
The extended_attributes setter and add_extended_attribute both logged
attribute changes using the old custom {before, after} format passed as
the info string, with no $original argument, so the diff column was never
populated.
Split the existing $change->{before}/$change->{after} into separate
$log_from/$log_to hashrefs and call logaction with the standard signature,
so Struct::Diff generates the diff column as with other MEMBERS/MODIFY
entries.
Update tests to reflect the new info column format (after-state only)
and remove a stray debug Data::Dumper/print left in the test.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Replace the manual unblessed + skip_fields + blessed-stringify logic in
the MODIFY actionlog section with calls to _unblessed_for_log, which
already handles all three concerns. This removes the need for @skip_fields,
the dateexpiry normalisation workaround, and the inline blessed checks.
Also restrict the log_from/log_to hashrefs to only the changed keys, so
the diff column contains only fields that actually changed rather than
the full patron state.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Previously MEMBERS/CREATE and MEMBERS/DELETE logged empty info with no
diff, and MEMBERS/MODIFY stored a custom {field:{before,after}} JSON in
the info column with no diff column entry.
This updates all three to use the standard logaction pattern:
- CREATE: diff({}, patron_data) — all fields shown as added
- MODIFY: diff(old_state, new_state) via Struct::Diff; info column now
holds the full updated patron state (consistent with other modules)
- DELETE: diff(patron_data, {}) — all fields shown as removed
- MODIFY_CARDNUMBER: likewise uses standard pattern with diff column
Password, lastseen and updated_on are excluded from all log payloads.
DateTime objects (inflated date/datetime columns) are stringified to
their ISO representation before JSON serialisation.
Tests updated to verify changes via the diff column rather than the
former custom info format.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
I restored the pretty code for the info file because the page needs to be able to wrap, like it does for other logs.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Changes to patron permissions via member-flags.pl are logged as MEMBERS/MODIFY,
indistinguishable from regular patron field edits. This patch wraps the
before/after permission hashes under a 'permissions' key so that the diff
renderer displays changes as 'permissions.cataloguing' etc., making it clear
the diff relates to permissions rather than first-level patron fields.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch changes Koha::Patron->permissions() to return the same
structure as C4::Auth::getuserflags() for architectural consistency.
Previously, permissions() only returned granted permissions:
{
catalogue => 1,
circulate => { override_renewals => 1 }
}
Now it returns ALL flags (matching getuserflags()):
{
superlibrarian => 0,
catalogue => 1,
circulate => { override_renewals => 1 },
borrowers => 0,
...
}
This provides several benefits:
1. Consistency - Matches established C4::Auth::getuserflags() pattern
2. Simpler checks - Can use "if ($flags->{module})" instead of
"if (exists $flags->{module})"
3. Future compatibility - Enables eventual deprecation of getuserflags()
in favor of the ORM-based $patron->permissions()
4. Helper compatibility - Works with existing _dispatch() logic
The logging functionality still works correctly - the diff will now
show explicit changes from 0 to 1 rather than absence to presence.
Test plan:
1. prove t/db_dependent/Koha/Patron.t
2. prove t/db_dependent/Log.t
3. Verify all tests pass
4. Confirm permissions() now returns all flags with 0/1 values
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch addresses several QA concerns:
1. Fixed duplicate subtest name - renamed second "is_superlibrarian() tests"
to "permissions() tests" which accurately reflects what it tests
2. Fixed incorrect hash assignment - permissions() returns a hashref,
not a hash. Changed `my %permissions` to `my $permissions`
3. Improved test coverage - expanded from 2 to 8 assertions covering:
- Hashref return type verification
- Single flag permission
- No permissions
- Multiple flags
- Granular subpermissions from user_permissions table
4. Refactored permissions() method to use DBIx::Class ORM instead of
raw SQL queries, following Koha::Object architecture principles
All tests now pass without warnings.
Test plan:
1. prove t/db_dependent/Koha/Patron.t
2. prove t/db_dependent/Log.t
3. Verify all tests pass
4. Confirm the test now properly validates the intended behavior
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Subroutines in members/member-flags.pl are combined and moved to Koha::Patron
Removed the html-based english description of each permission from the logging
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Changes to permissions are not logged in the Koha action_logs, making it impossible to trace changes to staff permissions. This patch ensures that all changes to permissions are logged.
Test plan:
1. Go to a staff interface
2. Search for a patron and change their permissions (note their borrowernumber)
3. Go to tools/Log viewer
4. Filter by Module = Patrons, Object = <borrowernumber>.
5. Click on submit
==> No permission changes are logged.
6. Apply the patch
7. Repeat step 1, 2, 3, 4, 5
==> Permission changes are now logged
8. Check that the diff column contains the change:
select diff from action_logs where object= <borrowernumber> order by action_id desc limit 1;
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Add a '_unblessed_for_log() tests' subtest to t/db_dependent/Koha/Biblio.t
that verifies:
- the method returns a plain hashref
- fields with real values (biblionumber, title, author) are present
- timestamp is excluded
- undef fields are excluded
- empty-string fields are excluded
- the ADD action log diff column is populated and does not contain timestamp
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Add _unblessed_for_log to Koha::Biblio, mirroring the same method in
Koha::Patron (bug 40136). It excludes undef/empty-string columns and the
auto-updated timestamp field so that biblio diffs only contain meaningful
values.
Update AddBiblio, ModBiblio and DelBiblio in C4/Biblio.pm to use
_unblessed_for_log instead of raw unblessed when building the hashrefs
passed to logaction, eliminating noise from null columns in ADD/MODIFY/DELETE
diffs.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
The MODIFY path in logaction received the updated biblio as a plain
hashref (not a Koha::Object), so the info column was populated with
raw Dumper output instead of the expected "biblio ..." prefix.
This broke two things: the 'Modification Log' link from the bib record
sidebar (which filters on info LIKE 'biblio%'), and the Object column
in the log viewer (which detects biblio entries via info.substr(0,6)).
Following the same pattern as the Koha::Item MODIFY special case, add
a parallel branch for CATALOGUING MODIFY with a hashref \$infos that
sets the info column to "biblio " . Dumper(\$original). This restores
backward-compatible detection while keeping the diff column correctly
populated from the before/after hashrefs (including _marc changes).
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
The previous commit populated the diff column for biblio ADD/MODIFY/DELETE
logs with changes to biblio table columns (title, author, frameworkcode,
etc.), but lost the MARC-level change tracking that previously stored a
pre-change MARC dump in the info column.
This follow-up extends the diff to also capture MARC field changes by
including a synthetic _marc key in the before/after hashrefs passed to
logaction. MARC fields are represented as tag => array-of-formatted-strings
(e.g. "10 $a Title" for data fields, scalar for control fields), allowing
Struct::Diff to produce readable field-level diffs.
The _marc entries appear alongside biblio column changes in the existing
diff table in the log viewer, using dotted keys like _marc.245.0.
A helper _marc_record_to_diffable() converts a MARC::Record to this
diffable hashref. All three functions (AddBiblio, ModBiblio, DelBiblio)
use record_strip_nonxml (wrapped in eval) to safely capture the MARC even
for records with invalid XML characters, without producing warnings or
affecting the success of the main operation.
C4/Log.pm is also updated to Dumper() a plain hashref passed as $infos,
so the info column contains useful data rather than a stringified ref.
Tests are extended to verify that the diff column is populated and that
_marc changes are captured when MARC content actually changes.
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Previously the CATALOGUING action log entries for biblio operations
stored minimal data: ADD and DELETE logged just the string "biblio",
while MODIFY logged a raw MARC-formatted dump of the pre-change record
as a plain text string. None of these populated the diff column.
This follow-up updates AddBiblio, ModBiblio and DelBiblio in C4/Biblio.pm
to follow the same pattern as Koha::Item::store, passing the Koha::Biblio
object and an original unblessed hashref to logaction so that the diff
column is automatically populated with Struct::Diff JSON reflecting the
changes to the biblio table columns (title, author, frameworkcode, etc.).
For ADD, logaction diffs an empty hashref against the new biblio state,
producing added-field entries for all columns. For DELETE, it diffs the
pre-deletion state against an empty hashref, producing removed-field
entries. For MODIFY, the before-state is captured prior to the update and
the after-state is read back once ModBiblioMarc and _koha_modify_biblio
have completed, so the diff reflects the actual committed changes.
The test for ModBiblio on an invalid MARC record is updated to reflect
that the MARC decoding error is no longer logged in the info column;
the biblio table data is now logged instead.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
When the diff column contains a value that is itself an object (e.g.
a set of granular subpermissions such as
{"override_renewals":1,"manage_curbside_pickups":1}), the previous
renderer would JSON.stringify it into a single unreadable cell.
This follow-up makes fmt() recurse into objects, rendering them as
an indented <ul> list of key: value pairs instead. The <del>/<ins>
colour wrapper then highlights the entire expanded block, making it
clear at a glance which subpermissions were added or removed.
null values (e.g. suspend_until transitioning to/from null) are
rendered as empty, letting the red/green cell background convey
the presence or absence of the value.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Previously the diff column in the log viewer displayed raw Struct::Diff
JSON (e.g. {"D":{"superlibrarian":{"N":1,"O":0}}}), which was not
useful to end users.
This follow-up adds a JavaScript renderer (renderStructDiff) to
viewlog.js that parses the Struct::Diff JSON and presents it as a
compact Field / Before / After table, reusing the existing <del>/<ins>
colour styling already present for the jsdiff compare feature. Nested
diffs (e.g. granular subpermissions) are flattened using dot-separated
key names. Non-Struct::Diff content falls back gracefully to a <pre>
block so that entries from other modules are not affected.
The change benefits all modules that currently populate the diff column:
HOLDS (MODIFY/SUSPEND/RESUME/CANCEL/FILL), CATALOGUING (MODIFY),
APIKEYS (MODIFY/REVOKE/ACTIVATE), and MEMBERS (MODIFY for permissions).
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch makes the template plugin used for rendering the Koha version
use the introduced method.
I did this checks:
```shell
cd koha-tmpl
git grep Koha.Version
```
The places Koha.Version is used, it is used as:
* `Koha.Version.maintenance`
* `Koha.Version.release`
* Assigned to a variable like this `SET koha_version = Koha.Version`
All occurences of the `koha_version` template variable are:
* `koha_version.development`
* `koha_version.major`
* `koha_version.minor`
This implies the newly added `.version` attribute has no undesired side
effects in templates.
Note: plugins-home.tt has a different use of a variable named the same,
which is unrelated.
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ prove t/Koha_Template_Plugin_Koha.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Adds a new REST API endpoint to retrieve Koha version information.
This implementation includes:
- Koha::Status class for instance status information
- /status/version endpoint returning structured version data
- OpenAPI specification with koha_version definition
- REST controller for handling the endpoint
The returned version object includes:
- version: full version string (e.g., '25.06.00.029')
- major: major version number
- minor: minor version number
- release: major.minor version
- maintenance: major.minor.maintenance version
- development: development version (if applicable)
This prepares the foundation for a future /status endpoint that will
include all information displayed in the about page.
To test:
1. Apply the patch
2. Run:
$ ktd --shell
k$ yarn api:bundle
3. Run the tests:
k$ prove t/Koha/Status.t \
t/db_dependent/api/v1/status.t
=> SUCCESS: Tests pass!
4. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Sponsored-by: Cheshire West and Chester Council
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch adds a new PatronAgeRestriction, which acts in the same way
PatronSelfRegistrationAgeRestriction (a restriction on the maximum age
of a borrower), except for the intranet. It will also act as the
maximum age restrictor on the OPAC, in the event that the
PatronSelfRegistrationAgeRestriction is not set.
To test:
== APPLY PATCH ==
a) updatedatabase
b) Set the PatronAgeRestriction syspref to 20, set the
PatronSelfRegistrationAgeRestriction to 30
c) On the OPAC, try to create or modify a patron whose age is 35 years
*) Note the error message presented, suggesting the age exceeds the
maximum
d) On the OPAC, try to create or modify a patron whose age is 25 years
*) Note the submission succeeds
e) On the staff client, try to create or modify a patron whose age is
25 years *) Note the error message presented, suggesting the age
exceeds the maximum
f) Set the PatronSelfRegistrationAgeRestriction to empty
g) On the OPAC, try to create or modify a patron whose age is 25 years
*) Note the error message presented, suggesting the age exceeds
the maximum
h) On the OPAC, try to create or modify a patron whose age is 19 years
*) Note the submission succeeds
i) Set the PatronAgeRestriction to empty
j) On the staff client, try to create or modify a patron whose age is
75 years
*) Note the submission succeeds
k) On the OPAC, try to create or modify a patron whose age is 75 years
*) Note the submission succeeds
== SIGN OFF ==
Sponsored-by: Cheshire West and Chester Council
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Adds POD documentation for _version_check, _timeout_syspref,
_get_session_params, and _dispatch to fix pod_coverage QA failures.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
The change to use find_by_identifier in checkpw_internal means userid
is now checked before cardnumber. This updates the test to reflect that
when an identifier matches both a userid and cardnumber, the userid
match takes precedence.
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/password_validation.t
=> SUCCESS: Tests pass!
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch does what the title says. The code change is clear to
understand.
The check for userid vs. cardnumber is done in the `find_by_identifier`
method so no need to do it here.
Note: When `find_by_identifier` was written, I picked some other place's
logic (API password validation) so `userid` is used first for finding
the patron. Because of this, tests in t/db_dependent/Auth.t need to be
adjusted. I believe this is not an issue, as those tests should be
removed once we move forward with bug 33905, entirely.
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/Auth.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>