Jonathan Druart [Thu, 12 Nov 2020 12:11:13 +0000 (13:11 +0100)]
Bug 26984: Make tests pass if AnonymousPatron is set
There is only 1 place where it can be tricky to not remove them as we
want exactly 10 patrons to be present in the DB
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Frédéric Demians [Tue, 10 Nov 2020 16:00:09 +0000 (17:00 +0100)]
Bug 26992: Fix serial issue and related items deletion on serial collection page
serial-collection.pl uses C4::Items::DelItemCheck() function which is obsolete.
Test plan:
1. Create a subscription with items created when receiving.
2. Receive several issues, and create corresponding items.
3. On Serial collection page (serial-collection.pl), select several issues.
4. Click on button Delete selected issues
5. A confirmation page is displayed. Enable "Delete associated items?".
Then click on "Yes, delete" button.
You get this error: Undefined subroutine &C4::Items::DelItemCheck
6. Apply the patch an repeat steps 3-5.
Check that issues and related items are deleted.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
David Cook [Thu, 29 Oct 2020 04:24:31 +0000 (04:24 +0000)]
Bug 26854: Close STDERR when forking stage-marc-import.pl
We need to close STDERR when forking stage-marc-import.pl,
or else the CGI session with Apache httpd does not properly
finish. This leads to unexpected behaviour across different httpd
versions, operating systems, etc.
This patch closes the STDERR file handle when forking a child
process to do MARC imports, and it re-opens STDERR to a log file
in the logdir directory to catch any import errors.
Test plan:
1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
3. Upload a MARC file with a large number of records (e.g. 30,000 records)
4. Open F12 dev tools
5. Click on "Network" tab
6. Clear all existing network logs
7. Click "Stage for import"
8. After ~30 seconds, the request to stage-marc-import.pl should return a 200 code
9. Immediately, calls to background-job-progress.pl should start, and the "Job progress"
bar should update at a maximum rate of every .5 seconds
(or more realistically 1-2 seconds)
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mason James [Thu, 19 Nov 2020 13:10:28 +0000 (02:10 +1300)]
Bug 26031: Remove 4 failing tests from t/db_dependent/www/search_utf8.t
to test...
1/ apply patch
2/ run test
3/ observe PASS
root@kohadevbox:/kohadevbox/koha# export KOHA_INTRANET_URL="http://kohadev-intra.myDNSname.org:8081"
root@kohadevbox:/kohadevbox/koha# export KOHA_OPAC_URL="http://kohadev.myDNSname.org:8080"
root@kohadevbox:/kohadevbox/koha# prove -v ./t/db_dependent/www/search_utf8.t
1..87
ok 1 - connect to intranet
ok 2 - login to staff interface
ok 3 - load main page
ok 4 - open tools module
ok 5 - go to stage MARC
ok 6 - uploaded file
ok 7 - upload succeeded
ok 8 - reopen stage MARC page
ok 9 - stage MARC
ok 10 - have job ID
ok 11 - job was completed
ok 12 - reopen stage MARC page at end of upload
ok 13 - stage MARC
ok 14 - view batch
ok 15 - imported records into catalog
ok 16 - got search on intranet
ok 17 - got search on intranet
ok 18 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1)"
ok 19 - UTF-8 are multi-byte. Good
ok 20 - UTF-8 chars are correctly present. Good
ok 21 - got opac
ok 22 - got opac
ok 23 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1)"
ok 24 - Base does not contain an idx
ok 25 - UTF-8 are multi-byte. Good
ok 26 - UTF-8 chars are correctly present. Good
ok 27 - view and clean batch
ok 28 - biblio on intranet
ok 29 - biblio deleted
ok 30 - connect to intranet
ok 31 - login to staff interface
ok 32 - load main page
ok 33 - open tools module
ok 34 - go to stage MARC
ok 35 - uploaded file
ok 36 - upload succeeded
ok 37 - reopen stage MARC page
ok 38 - stage MARC
ok 39 - have job ID
ok 40 - job was completed
ok 41 - reopen stage MARC page at end of upload
ok 42 - stage MARC
ok 43 - view batch
ok 44 - imported records into catalog
ok 45 - got search on intranet
ok 46 - got search on intranet
ok 47 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=Ram%C3%B2n)"
ok 48 - UTF-8 are multi-byte. Good
ok 49 - UTF-8 chars are correctly present. Good
ok 50 - got opac
ok 51 - got opac
ok 52 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=Ram%C3%B2n)"
ok 53 - Base does not contain an idx
ok 54 - UTF-8 are multi-byte. Good
ok 55 - UTF-8 chars are correctly present. Good
ok 56 - view and clean batch
ok 57 - biblio on intranet
ok 58 - biblio deleted
ok 59 - connect to intranet
ok 60 - login to staff interface
ok 61 - load main page
ok 62 - open tools module
ok 63 - go to stage MARC
ok 64 - uploaded file
ok 65 - upload succeeded
ok 66 - reopen stage MARC page
ok 67 - stage MARC
ok 68 - have job ID
ok 69 - job was completed
ok 70 - reopen stage MARC page at end of upload
ok 71 - stage MARC
ok 72 - view batch
ok 73 - imported records into catalog
ok 74 - got search on intranet
ok 75 - got search on intranet
ok 76 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=%F0%A0%BB%BAtomasito%F0%A0%BB%BA)"
ok 77 - UTF-8 are multi-byte. Good
ok 78 - UTF-8 chars are correctly present. Good
ok 79 - got opac
ok 80 - got opac
ok 81 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=%F0%A0%BB%BAtomasito%F0%A0%BB%BA)"
ok 82 - Base does not contain an idx
ok 83 - UTF-8 are multi-byte. Good
ok 84 - UTF-8 chars are correctly present. Good
ok 85 - view and clean batch
ok 86 - biblio on intranet
ok 87 - biblio deleted
ok
All tests successful.
Files=1, Tests=87, 127 wallclock secs ( 0.06 usr 0.02 sys + 3.00 cusr 0.99 csys = 4.07 CPU)
Result: PASS
real 2m6.709s
user 0m3.124s
sys 0m1.032s
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Sometimes you know that the merge is useless, since the reporting
tag did not change.
Might be handy in batch processing of authority records.
Test plan:
Pick an authority with a few linked biblio recs (so that it will
immediately merge; lower than MergeLimit).
Open authority record and save it.
Verify that a linked biblio record was merged. Check time in 005.
You proved that this patch does not break the regular process.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Tue, 1 Sep 2020 13:32:46 +0000 (13:32 +0000)]
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities
This script checks that an authority is not being used before deleting it.
We do not need to check biblios for the authority id as we have already verified it is unused.
TO test:
1 - Reset db to koha test database
2 - perl misc/migration_tools/remove_unused_authorities.pl -t
3 - Note a number of unsued authorities
4 - perl misc/migration_tools/remove_unused_authorities.pl -c
5 - Note authorities are removed
6 - Reset db
7 - Apply patch
8 - perl misc/migration_tools/remove_unused_authorities.pl -t
9 - Note results are the same
10 - perl misc/migration_tools/remove_unused_authorities.pl -c
11 - Note results are the same
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 26944: Point help link to automatic item mod in manual
To test:
1 - go to automatic item mod, click help, end up at manual homepage
2 - apply patch, restart, reload page
3 - click link again, go to auto item mod in manual
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 10 Nov 2020 11:32:04 +0000 (12:32 +0100)]
Bug 26846: Fix regressions - Preselect expected and late serials
This is a follow-up for bug 17674. Expected and late serials must be
checked by default.
Test plan:
Have some serial collection and notice that the checkboxes are checked
for expected and late serials
/serials/serials-collection.pl?subscriptionid=42
Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Tue, 3 Nov 2020 09:57:32 +0000 (09:57 +0000)]
Bug 26939: Use AV description in sales table display
Content should use the description rather than the code
Test plan
1/ Enable 'UseCashRegisters'
2/ Make some payments against a cash register
3/ Navigate to the cash register summary page via tools > cashup
registers > register name
4/ Note that the payment type you selected at payment time appears as
the code of the authorized value as aposed to the description.
5/ Apply patch
6/ Refresh page
7/ The payment type should now contain the description
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Tue, 3 Nov 2020 09:47:12 +0000 (09:47 +0000)]
Bug 26938: Prevent flash of unstyled sales table
On the registers page the table has come complex data structures
embedded to allow for all the functionality we bring into the datatable.
We should hide the table on page load and only display it at DataTables
init time once the weird content has been beautified by DataTables.
Test plan
1/ Enable 'UseCashRegisters' and 'EnablePointOfSale'
2/ Add a cash register and make some transactions against it.
3/ Navigate to the 'Register details' page
4/ Note that some 'funky' JSON strings appear in the table briefly
before it is restyled when DataTables loads.
5/ Apply the patch
6/ Rebuild the CSS from the SCSS files
7/ Reload the page (hard reload to get the CSS changes)
8/ Note that the table now only appears once the nice formatting that
DataTables adds is applied.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
By finding the element before the click I hope to get the good element,
even if the page changed in the meanwhile.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 10 Nov 2020 11:55:17 +0000 (12:55 +0100)]
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration
The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.
Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 13 Nov 2020 16:33:40 +0000 (16:33 +0000)]
Bug 26903: Pass record ids and records through to update_index when passed to index_records
When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.
To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Fri, 13 Nov 2020 16:33:12 +0000 (16:33 +0000)]
Bug 26903: Unit tests
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 13 Nov 2020 13:53:15 +0000 (13:53 +0000)]
Bug 27002: Update callers for changed return
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 12 Nov 2020 08:09:56 +0000 (08:09 +0000)]
Bug 27002: Update Koha::Biblio->pickup_locations to return a resultset
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 23 Sep 2020 14:42:40 +0000 (14:42 +0000)]
Bug 26516: Don't accept incorrect values for copyrightdate/publicationyear
The previous patch rejects incorrect values when saving to the db specifically for copyrightdate
An error is thrown for the int conversion when it fails
Rather than catching things when saving we can fix the value when generated, simply returning null when parsing
the record
To test:
1 - Add a new record to Koha making sure data is valid except 260$c:
198-
2 - Save the record
3 - It fails
4 - Apply this patch
5 - Restart all the thigns
6 - Repeat
7 - Success!
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27021: Make chaining ->empty always return an empty resultset
This patch borrows the implementation Martin did on bug 27002, to
woraround this issue, and implements it properly on the
Koha::Objects->empty method.
To test:
1. Apply the regression tests patch
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Objects.t
=> FAIL: Tests fail! The resultset should be empty and it isn't!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Colin Campbell [Thu, 12 Nov 2020 11:42:05 +0000 (11:42 +0000)]
Bug 18267: Refactored Edifact Price Calculations
Refactored the price calculations for Quotes and Invoices
This takes in to account various combinations used by different
vendors. Makes the extraction of basic price, quantity and tax
information more reliable. Tests are in Edifact.t and EdiInvoice.t
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Fri, 13 Nov 2020 12:12:20 +0000 (12:12 +0000)]
Bug 25761: (QA follow-up) Consistent flag names
This follow-up updates the config flag to be consistent with bug 24449
and updates the debian template file to match too.
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Mon, 15 Jun 2020 16:26:14 +0000 (12:26 -0400)]
Bug 25761: Implementation of too_many_overdue has unintended consequences
Bug 24449 implemented the too_many_overdue SIP flag ( position 6 of the
patron status flags ). This has had unintended consequences as
many library use SIP2 for validation to eresource vendors ( Overdrive,
Hoopla, etc ), but do not want overdue checkouts to block the
use of these resources.
Test Plan:
1) Apply this patch
2) Restart all the things!
3) Find a patron with overdue items
4) Run a SIP2 patron information request
5) Note the "too many overdue" flag is set
6) Set the new SIP config option "disable_too_many_overdue" for the
account you used for testing
7) Restart the SIP server
8) Run the same patron information request
9) Notice the "too many overdue" flag is no longer set!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Fri, 13 Nov 2020 10:07:22 +0000 (12:07 +0200)]
Bug 27012: Fix incorrect SQL syntax in hold merging
If you merge two records with holds in them following error happens
without this patch:
[WARN] DBD::mysql::st execute failed: called with 4 bind variables when 3 are needed [for Statement "SELECT * FROM reserves WHERE biblionumber = ? AND (found <> ? AND found <> ? OR found is NULL) ORDER BY reservedate ASC" with ParamValues: 0=Null!, 1=Null!, 2=Null!] at /kohadevbox/koha/C4/Reserves.pm line 2002.
To test:
1) Notice prove t/db_dependent/Reserves.t fails with above error
2) Apply patch
3) Notice prove t/db_dependent/Reserves.t passes
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Fri, 13 Nov 2020 11:41:16 +0000 (13:41 +0200)]
Bug 27012: Add test for C4::Reserves::MergeHolds
This does a basic check whether a hold gets moved to another biblio
when MergeHolds() is called.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Wed, 11 Nov 2020 15:22:20 +0000 (12:22 -0300)]
Bug 26988: (follow-up) Change event to focus
Click event on select element if Firefox does not work as expected, so
this patch changes the event to focus for it to work seamlessly in both
browsers.
https://bugs.koha-community.org/show_bug.cgi?id=26899 Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Tue, 10 Nov 2020 13:35:14 +0000 (13:35 +0000)]
Bug 26988: Add API route to fetch hold pickup locations and use it in the holds table
To test:
1 - Place a number of holds on a record
2 - Have different pickup locations for the holds
3 - Have some libraries that are not pickup locations
4 - Load the holds tab for the record and note libraries not pickup locations are not in dropdowns
5 - Apply patch and restart all things
6 - Reload the holds table
7 - Click on a dropdown, note the spinner, should load successfully
8 - Confirm the dropdown matches the options before the patch
9 - Confirm updating the hold location works
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 11 Nov 2020 13:26:58 +0000 (13:26 +0000)]
Bug 26963: (QA follow-up) Fix up tests and cover case of undefined ccode
While this technically shouldn't happen, if a library creates itemtype limits, then flips the pref, those rules are still in the db until a ccode rule is saved.
To be extra safe, when checking for rules of one type, we should make sure the other type is undef - i.e. if looking for ccode rules, we should confirm the itype is undef for those rules
Additionally, we shouldn't set the barcode now that we are not deleting all items, so we use copynumber for our item identification field as it doesn't need to be unique in the DB
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 11 Nov 2020 14:09:24 +0000 (14:09 +0000)]
Bug 26963: (QA follow-up) Fix cases where we expected a list
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 11 Nov 2020 15:43:57 +0000 (15:43 +0000)]
Bug 26963: (QA follow-up) Update mocked return of pickup_locations
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 11 Nov 2020 12:49:00 +0000 (12:49 +0000)]
Bug 26963: (QA follow-up) Don't delete existing data before tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 11 Nov 2020 16:06:21 +0000 (16:06 +0000)]
Bug 26963: (QA follow-up) Migrate unit tests into pickup_location
We wrote unit tests for _can_pickup_locations as part of this patchset,
but then I inlined the method whilst golfing. This patch moves those
tests into the existing pickup_locations test so we more thoroughly
cover the case where branch transfer limits are in play.
NOTE: The tests all assume that all items have an effective_itemtype and
ccode. I'm pretty sure items all have a type at this point, but I'm less
sure we enforce collection codes?
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 11 Nov 2020 08:57:21 +0000 (08:57 +0000)]
Bug 26963: (QA follow-up) Convert to ResultSets
This patch removes the previously introduced private method by
converting the arrayref returns to ResultSets appropriately and inlining
the filter search queries.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 11 Nov 2020 02:37:55 +0000 (02:37 +0000)]
Bug 26963: (follow-up) Change subroutine name for QA tools
It didn't like the ending _at
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Mon, 9 Nov 2020 13:53:51 +0000 (13:53 +0000)]
Bug 26963: Don't call 'can_be_transferred' for each possible library for each item
Currently When calling Koha::Template::Plugin::Branches::pickup_locations
we call pickup_location for each item of the bib, and for each item we get a list of possible
branches, we then check those branches against the transfer limits, this is inefficent
Given a system with 100 branches, and each branch having an item attached to one bib (100 items)
we will call can_be_transferred ~10000 times - and that will happen for each hold placed on the bib
For me this patch reduced load time from 77 seconds to 18 seconds
To test:
1 - Find a bib
2 - Place 4 title level holds
3 - Add some branches and items for this bib to your system:
INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"A"),pickup_location FROM branches;
INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"B"),pickup_location FROM branches;
INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"C"),pickup_location FROM branches;
INSERT INTO branches (branchcode,branchname,pickup_location) SELECT CONCAT(branchcode,"D"),CONCAT(branchname,"D"),pickup_location FROM branches;
INSERT INTO items (biblionumber,biblioitemnumber,barcode,itype,homebranch,holdingbranch) SELECT 1,1,CONCAT("test-",branchcode),'BKS',branchcode,branchcode FROM branches;
4 - Set systempreferences:
UseBranchTransferLimits = 'enforce'
BranchTransferLimitsType = 'item type'
5 - Find the bib and click the holds tab
6 - Wait for a long time, it shoudl eventually load
7 - Apply patch and restart al the things
8 - Load the page again, it should be much faster
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 11 Nov 2020 01:24:15 +0000 (01:24 +0000)]
Bug 26963: Unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 13 Nov 2020 07:14:40 +0000 (08:14 +0100)]
Bug 22818: Fix the last_insert_id call
DBI last_insert_id: invalid number of arguments: got handle + 3, expected handle + between 4 and 5
Usage: $h->last_insert_id($catalog, $schema, $table_name, $field_name [, \%attr ]) at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 23326.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 12 Nov 2020 13:36:00 +0000 (13:36 +0000)]
Bug 26948: Regression tests
We already mock the send_or_die method from Email::Stuffer; This patch
updates that mock to extract the internal representation of the email
encoded message and looks for a known double encoded representation of a
character in the sample body.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Joonas Kylmälä [Fri, 6 Nov 2020 11:35:39 +0000 (13:35 +0200)]
Bug 26948: Remove double encoding from sent emails
The sent emails from Koha were garbled / double encoded because
Koha::Email now after the refactoring and moving to use Email::Stuffer
handles the encoding itself. Previously the Koha::Email callee had to
handle the encoding. This patch removes the double encoding in the
email subject and content.
To test:
1) Put some UTF-8 characters like ä in the HOLD template subject and body
2) Create hold and check-in an item to make it Waiting and cause the
email to be send
3) Notice the email comes garbled / double encoded
4) Apply patch
5) Repeat step 2) and notice the email comes without any issues in
encoding and look OK.
6) Make sure "prove t/Koha/Email.t" and "prove
t/db_dependent/Letters.t" and passes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 11 Nov 2020 13:55:27 +0000 (14:55 +0100)]
Bug 26990: (bug 22284 follow-up) Prevent hold to be placed if cannot be transferred
There is a missing parameter to CanItemBeReserved, we need to know if
the hold can be placed at a given pickup library.
Test plan:
1 - Set preferences:
UseBranchTransferLimits: enforce
BranchTransferLimitsType: itype
AllowHoldPolicyOverride: Don't allow
2 - Set Centerville 'Book' items to not be allowed to transfer to any other library
3 - Make sure Hold policy is set to 'any library'
4 - Find a record with a Centerville item and other items
5 - Attempt to place an item level hold on the Centerville item (with a
pickup library different than Centerville)
=> Without this patch you are taken to the holds list, but your hold is not placed
Nothing indicates why hold has failed
=> With this patch you cannot select the item from Centerville
"Cannot be transferred to pickup library"
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 11 Nov 2020 17:03:08 +0000 (18:03 +0100)]
Bug 22818: Fix TestBuilder.t
t/db_dependent/TestBuilder.t .. 12/13
# Failed test 'build_object() tests'
# at t/db_dependent/TestBuilder.t line 429.
Can't locate object method "_new_from_dbic" via package "Koha::MessageAttribute" (perhaps you forgot to load "Koha::MessageAttribute"?) at /kohadevbox/koha/Koha/Objects.pm line 98.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This squashed commit fixes:
- a small error in the checkouts related JS
- GetRenewCount now returns 6 values when a call to it succeeds, a
failed call should also return the same number of values. This commit
adds these additional values.
- Some changes in issue.t had broken the tests for unseen renewals (the
unseen tests were using variables that had been moved out of the tests'
scope).
- Also now using Koha::CirculationRules::set_rules to set circ rules
rather than using SQL queries.
- Fixed expected number of return values from GetRenewCount
- Moved unseen tests in issue.t to the bottom of the file to remove the
risk of interference with other test circ rules.
- There was a real mess in C4/Circulation.pm due to a bad rebase back in
February. Frankly it's a wonder anything worked at all. This commit
fixes that problem and reinstates the correct patch for
C4/Circulation.pm
- Somehow I'd never noticed this before but the columns in smart-rules.tt
were misaligned when UnseenRenewals was turned off. This was due to the
display of a <td> not being conditional when it should have been. This
is now fixed.
- This commit also fixes items 1 & 2 descibed by Katrin in comment #74 ->
comment #76.
- Fixed missing check for too_unseen in opac-user.tt, this test did used
to exist but got lost during sizeable rebase a few weeks ago :-(
- Added test for too_unseen to all AUTO_RENEWAL notice templates apart
from de-DE (as previously requested by Katrin)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
As highlighted by Katrin, the selfcheckin module was not aware of this
work. This commits gives it awareness of the too_unseen renew error and
the "seen" argument that can be passed to AddRenewal
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The merging of Bug 23051 has added a paramter that can be passed to
C4::AddRenewal. This bug does also, so the offset of this bug's new
paramter was wrong. This patch fixes it.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Isherwood [Fri, 22 Nov 2019 11:08:53 +0000 (11:08 +0000)]
Bug 24083: Add support for unseen_renewals
This patch adds support for unseen renewals.
Here we retrofit knowledge of unseen renewals and add the display of unseen
renewal counts and warnings, in addition to adding the ability to
specify a renewal as being "unseen".
The functionality added here is goverened by the UnseenRenewals syspref.
Signed-off-by: Sally Healey <sally.Healey@cheshirewestandchester.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 10 Nov 2020 13:11:10 +0000 (14:11 +0100)]
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable
$serialitem is not a Koha::Item there, we need to fetch the item before.
Test plan:
Turn makePreviousSerialAvailable on
Create a subscription
Receive an serial item, mark it "arrived"
Without this patch Koha explodes with
No property notforloan for Koha::Serial::Item at /usr/share/perl5/Exception/Class/Base.pm line 88
Koha::Object::set('Koha::Serial::Item=HASH(0x55dd67c75700)', 'HASH(0x55dd672cec30)') called at /kohadevbox/koha/serials/serials-edit.pl line 273
With this patch applied the notforloan and itype values are correctly
set for the new serial item.
Signed-off-by: Magnus Enger <magnus@libriotech.no> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 15 May 2020 14:09:49 +0000 (11:09 -0300)]
Bug 23019: Add profiles to stage-import-batch and magnage-import-batch pages
This patch adds the logic and the needed UI elements to be able to pre-load an import profile. It also displays which profile was used to stage an import in staged import manager.
To test:
1. Apply all patches
2. Updatedatabase
3. Go to Stage MARC records for Import tool in admin, and upload a file with MARC records.
CHECK => after uploading, there is a fieldset with the legend “Profile settings”
=> inside the fieldset there is a select labeled “Pre fill values with profile”. The only value it has is “Do not use profile”.
4. Change some settings, and set “profile 1” as profile name and click on “Add profile”
SUCCESS => The select now has the new profile selected
5. Change profile select to “Do not use profile”
SUCCESS => Default values are now displayed in the form
6. Reload the page and upload the file again
SUCCESS => the select still has the profile recently added
7. Select the profile, change some parameter in the form and set the profile name to “profile 2”, and click add profile
SUCCESS => there are two profiles now, and if you toggle between them, the parameter changes
8. Select profile 1, change one parameter and click on update profile
SUCCESS => if you toggle that profile with the other, the new parameter of the value is shown when you select profile 1
9. Select profile 2, change some parameter and click Add profile (leaving the name as profile 2)
SUCCESS => the page complains there is another profile with the same name, and asks if you want to replace it.
10. Click on accept
SUCCESS => profile 2 now has the new value in the parameter
11. Select profile 2 and change the name to profile 1
SUCCESS => the page complains there is another profile with that name, and asks if you want to replace it
12. Click on accept
SUCCESS => in profile select there is only one profile called profile 1 that has the values of profile 2
13. Select profile 1 and click remove profile
SUCCESS => there is no profile in profile select.
14. Create a profile and click on “Stage for import”
15. Go to Staged MARC management page
SUCCESS => Improt should have the name of the profile in profile column, and when you click on the file name, there should be the name of the profile in the details.
16. prove t/db_dependent/ImportBatch.t t/db_dependent/api/v1/import_batch_profiles.t
17. Sign off
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 15 May 2020 14:09:56 +0000 (11:09 -0300)]
Bug 23019: Add tests
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 15 May 2020 14:09:51 +0000 (11:09 -0300)]
Bug 23019: Add ImportBatchesProfile schema and set is_boolean to parse_items column
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 15 May 2020 14:09:51 +0000 (11:09 -0300)]
Bug 23019: Add koha_object_class and koha_objects_class methods to ImportBatch.pm schema
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Fri, 15 May 2020 14:09:53 +0000 (11:09 -0300)]
Bug 23019: Update database structure and add atomic update
Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Wed, 6 May 2020 22:38:19 +0000 (19:38 -0300)]
Bug 20936: Add patron's hold history menu in OPAC
This patch adds patron's hold history in OPAC.
To test:
1. apply this patch
2. Find a patron, place several holds and cancel or fulfill them
3. Go to patron's opac
CHECK => There is no 'your holds history' option in menu
4. In admin preferences enable OPACHoldsHistory
5. Go back to patron's opac
SUCCESS => There is a 'your holds history' menu option
=> Holds history displays all holds
6. Change order, and list limit
SUCCESS => All controls work as expected
7. Sign off.
Signed-off-by: Todd <tgoatley@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Agustin Moyano [Sun, 9 Feb 2020 20:53:55 +0000 (17:53 -0300)]
Bug 20936: Add OPACHoldsHistory syspref
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Isherwood [Fri, 16 Oct 2020 14:08:59 +0000 (15:08 +0100)]
Bug 22818: (follow-up) Respond to feedback
This commit implements the feedback from Katrin in comment #103 ->
comment #108:
- Fixed rebase issue mentioned in comment #103
- Fixed ILL notice display mentioned in comment #106
- Fixed bug with metadata display, though not the issue that was
mentioned in comment #107
- Fixed buttons display mentioned in comment #107, in addition to some
more buttons suffering the same issue
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Isherwood [Thu, 15 Oct 2020 13:57:19 +0000 (14:57 +0100)]
Bug 22818: (follow-up) Respond to feedback
This commit fixes this bug, it was broken in a number of ways.
Fixes include:
- Added necessary config block in C4::Letters to enable the TT notice
syntax introduced in an earlier commit to work
- Changed template variables to refer to singular objects rather than
multiple e.g. borrowers -> borrower
- Fixed missing / misnamed variables
This commit also implements the additional syspref checks suggested by
Katrin in comment #87
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Thu, 9 Jul 2020 10:18:26 +0000 (11:18 +0100)]
Bug 22818: (QA follow-up) Sample Notices
Convert the update notices to TT syntax and add them into the
sample_notices file.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>