Jonathan Druart [Fri, 18 Dec 2020 13:28:13 +0000 (14:28 +0100)]
Bug 27276: Prevent borrowers-force-messaging-defaults.pl to crash
MySQL 5.7 does not allow queries using 0000-00-00
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f228c9ee9fc7094054b687b26ae4306254922019) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1b4f18148ba2192afb247ac3e8b87676f4647245)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 27055: Fix compatibility with newer Firefox+Selenium version
Fix "submit is not a function error"
A submit button should not be named "submit", in this case, it's id.
https://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript
Fix some uses of get_attribute()
Fix a fail by setting a global implicit_wait_timeout, default value is 0
in our lib. Other libs set it higher which helps to not have to manually
deal with part of the timing issues.
Fix: remove usage of click_when_visible() because it doesn't work with
elements not in the top of the page. Because they are off screen.
Fix: use $driver->quit() in error_handler to not forget an open Firefox.
With the current version, it fills /dev/shm and fails with around 5
Firefox opened.
Also use quit() it at the end of every script.
Fix: filling item fields, to fill only the displayed one (not those
with display:none)
== Test plan ==
1. Update selenium/standalone-firefox to the latest version [1]
2. prove t/db_dependent/selenium/authentication.t
3. It fails with: arguments[0].form.submit is not a function
4. Apply patch
5. Retest
6. Success
[1] In koha-testing-docker you can do it with
docker-compose.yml:
selenium:
- image: selenium/standalone-firefox:2.53.1-americium
+ image: selenium/standalone-firefox
Owen Leonard [Mon, 14 Dec 2020 12:30:03 +0000 (12:30 +0000)]
Bug 27099: Stage for import button not showing up
In the latest version of Chrome, pages where the Humansmg library is
included have a problem where the language footer obscures the bottom of
the page.
The problem traces back to some CSS in the Humanmsg library's CSS file:
html, body {
height: 100%; /* Damn you IE! */
}
Removing the line doesn't have any ill effects that I can see in Chrome
or Firefox, and it fixes the problem in Chrome. IE can be damned.
To test you must have one or more translations enabled in the staff
interface.
- Apply the patch and clear your browser cache if necessary.
- View pages in the staff interface which use the Humansmg library,
e.g.:
- Administration -> System preferences. Choose a category of
preferences which will be numerous enough to require scrolling to
reach the bottom of the page.
- Tools -> Stage MARC records for import. Upload a file to display the
form for staging the import.
- Cataloging -> Advanced MARC editor
On each page the language footer should not obscure the bottom of the
page.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2498cdcc88be798b88d6a23bf6e592cff5a80f45) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 474a12938043c4494fac4effd01ba20dadf9eca0)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
There was no more highlighting when trying to delete an imported quote, as there was before
(see screenshot from the manual https://gitlab.com/koha-community/koha-manual/-/blob/master/source/images/tools/qotd/selectfordelete.png)
It was, however, possible to delete imported quotes, you just don't see which ones you are deleting.
Test plan:
1) Create a CSV with two columns first the name, then the quote (I've attached a CSV that I've done for testing purposes)
2) Go to Tools > Edit quotes for the QOTD feature
3) Click 'Import quotes'
4) Click 'Browse' and choose the CSV created earlier
5) Click on the id of a couple of quotes. Notice those lintes are highlighted
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit eddf09da53b0ad21e2b2649266ca201623372d0c) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2cb19eacba4207b68b6a1f70f672fe2ca8086a04)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Mon, 14 Dec 2020 13:51:17 +0000 (14:51 +0100)]
Bug 27230: Display OPAC description for OPAC_SUG
The authorised values OPAC_SUG displayed at the OPAC show the staff
description.
Test plan:
1. Create an auth value in opac_sug, with different text for the description and OPAC description.
2. Go to the OPAC and open the purchase suggestion form.
3. Note in the Reason for purchase drop down, the descriptions appear, the text entered in the OPAC description field.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7063f2c4763d7fec870a4c326837b8b64e64004f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e650254cf4cb8750f21f13ec49964ac025dbe823)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Wed, 2 Dec 2020 09:34:50 +0000 (10:34 +0100)]
Bug 26956: Allow guarantor's controls to be set when a guarantee is created
With AllowStaffToSetCheckoutsVisibilityForGuarantor and
AllowStaffToSetFinesVisibilityForGuarantor set to Allow, one can only see the
controls for these values in the patron record *after* the patron has been saved
with a guarantor. That makes a frustrating 2-step process. We should be able to
set those values regardless of whether or not there is currently a guarantor on
the account.
Test plan:
Create a guarantee and confirm that the 2 options "Show checkouts to
guarantors" and "Show fines to guarantors" are displayed
Select Yes, save
Confirm that the values have been correctly saved
Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6a461382ba944a8e9f4a7c4e534dca74745f0f55) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a91ca451224aac8435aa3c3ff2ef3f2415093466)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Andrew Isherwood [Thu, 31 Jan 2019 09:40:08 +0000 (09:40 +0000)]
Bug 22243: Fix unescaped apostrophe in Z target
This patch escapes apostrophes in the z39.50 target name prior to them
being embedded in the template.
To test:
- Create a z39.50 target containing an apostrophe in the title
- Note that the Advanced Cataloguer editor does not load
- Apply the patch
- TEST: Note that the Advanced Cataloguer editor does load
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7ffa71fbd1fa0e4b8c036f02b8a73eacbdfac066) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d97b64c83db7ab1740e43af55c243c075e1f359d)
Martin Renvoize [Wed, 16 Dec 2020 19:26:11 +0000 (19:26 +0000)]
Bug 27256: Update click handler for point of sale
This patch updates the click handler to bind to the table element in the
DOM as aposed to the individual buttons by their classes. We then use
the event propogation and filter on the button class to catch the clicks
we want.
Test plan
1/ Add 22 debit_types that can be sold to the system (or reduce the
datatable paging size)
2/ Confirm that items on the second page of results cannot be added for
sale on the point of sale page.
3/ Apply the patch
4/ Confirm items from the second table page can now be added correctly
5/ Clicking add when navigating to such an item should leave the items
table unmodified.
6/ Clicking aa when the table was filtered should reset the filters
bringing the table back to the first page
7/ Signoff
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 68047132a4888db6eb5169e1cd3ceac49aa84b3b) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0b4ebc2bf74c408102c19bb7c2a85279762f691)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Mon, 2 Mar 2020 16:45:58 +0000 (16:45 +0000)]
Bug 24519: Match paycollect form validation for change collection
This patch adds form validation to the Point Of Sale payment page such
that one cannot submit the form with a 'collected' value that is less
than the 'owed' amount.
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>
(cherry picked from commit 080288bce48cf4fa94b19d35a117dd3e1967a4c9) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f5d1436a1d5ee8299841cdab54bb35c437e33700)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Tue, 1 Dec 2020 10:44:04 +0000 (11:44 +0100)]
Bug 27117: Only place_holds permission is needed to adjust pickup locations
The GET /pickup_locations route is requesting the whole reserveforothers
permission whereas only the subpermission place_holds is needed.
Test plan:
0. Don't apply this patch
1. Set the subpermission place_holds but modify_holds_priority
2. Edit a hold and click the pickup library dropdown list
3. You get a JS alert and log displays
GET /api/v1/app.pl/api/v1/holds/5/pickup_locations
403 Forbidden
4. Apply this patch
5. Reload the page, click the dropdown list, modify the pickup location
and save
=> Success!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 69c01ee0f2dccd04cfbe8201ba580a15727f5280) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 05ba6b702e1e267ec110c83f0b3e133a023d7948)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 27205: Check valid pickup location on POST /holds
This patch adds a check for valid pickup location to the POST /holds
route. A 400 code is returned if the supplied pickup library is not
valid.
To test:
1. Apply this patch
2. Run;
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c913bd7d698a8fbc9992f93db426a35c79f330c7) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 01bd125f1fbbf8d54870baf80fcfaacc105c44e0)
Bug 27205: Check valid pickup location on PUT /holds/:hold_id
This patch adds a test for valid pickup locations when updating a hold
through the API.
Tests are adjusted to reflect this change.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1bfe7ea16ef1346585211345ba89d18e303a0c32) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0df97c37d8c7a6989a118187d8867a52fb3bb608)
This patch simply refactors the pickup location check into a method that
can be called on its own. Tests are added, and the tests for
->set_pickup_location should pass unmodified.
To test:
1. Apply the first two patches
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Hold.t
=> SUCCESS: tests pass
3. Apply this refactoring patch
4. Notice the tests are similar, but check for boolean output
5. Repeat 2
=> SUCCESS: New tests pass, set_pickup_location() behavior unchanged.
6. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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>
(cherry picked from commit 865a1dab5c346920c61237c4b7593202328e04f8) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 02df63c430df50d0d6985be23c4e5a98142b8a30)
This patch introduces a method to safely update a hold's pickup
location. It will raise exceptionis if the passed parameters are invalid
or absent.
To test:
1. Apply this patches
2. Run:
$ kshell
k$ prove t/db_dependent/Koha/Hold.t
=> SUCCESS; Tests pass
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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>
(cherry picked from commit 672413ea294679d4b5b30d30839650f6d30b45ca) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 18578794d9e5ac3c5e5c0548989224149bccae60)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> 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>
(cherry picked from commit 295787223e4dbbe116cba20119db05da4992e0b1) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ac140820b76d65c1deff63f4a11e745cb3a1733)
Nick Clemens [Tue, 8 Dec 2020 14:18:35 +0000 (14:18 +0000)]
Bug 27166: [20.05.x] Set destination_loc to item->homebranch
In bug 21020 we used the issue to fetch the item and then the homebranch.
This fails when the item is not issued. We fetch the item already, so we
can use it directly
In 20.05.x we don't have the item object, so we can just use the SIP transaction item
To test:
1 - Have an item belonging to branch A
2 - Check it in via sip at branch B:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 --item CHESS1 -l FPL -m checkin
3 - The read command is blank and there is a warn about uninitialized data
4 - Apply patch
5 - Restart sip server
6 - Check the item in at branch A using the sip cli emulator
7 - Check it in at branch B
8 - This time the checkin should succeed and the output msg should be included
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Tue, 8 Dec 2020 14:18:11 +0000 (14:18 +0000)]
Bug 27166: Unit tests
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Mon, 5 Oct 2020 08:08:24 +0000 (09:08 +0100)]
Bug 26536: Fix incorrectly scoped variable
During work on bug 26076 a variable scope mistake was made when
reverting the logic to use distinct queries for selected accountlines.
This patch restores the script scope of the varaible by removing the
superflous 'my' declaration.
Test plan
1/ Add a set of manual invoices
2/ Select a subset of those manual invoices to 'Writeoff selected'
3/ Confirm that only those selected invoices have been written off.
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 20 Nov 2020 08:18:26 +0000 (09:18 +0100)]
Bug 25583: Disable the "claim returned" button if the feature is disabled
It's possible to display the "Return claims" column on the checkout
list, even if the feature is disabled.
We should disable the link and add an explanation.
Test plan:
- Make sure ClaimReturnedLostValue is empty
- Go to a patron account
- Check out an item
- Make the claims returned column visible in the table of checkouts
=> The button is disabled and a tooltip explains that the feature is
disabled
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>
(cherry picked from commit 3ae3981d3c881bbbd136015ae94e91961236d15e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 188461bdfe00de99886e1a6e865f8a394f35e279)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Mon, 9 Nov 2020 12:57:13 +0000 (12:57 +0000)]
Bug 26946: Set maxlength for cash register name
The cash register names is limited to 24 characters at the database
level and so that restriction should also be reflected in the UI.
Test plan
1/ Add or Edit a cash register ( admin > accounts > cash registers )
2/ Note that you can enter a cash register name longer than 24
characters, but upon save the value is truncated.
3/ Apply patch
4/ Note you can not longer enter a cash register name longer than 24
characters.
5/ Signoff
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 012229c5ea77a009dc708db4370bf499e48dad01)
(cherry picked from commit 57fa54cd7a71a704408cb3630c70bbb53de2b6fd)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Fri, 27 Nov 2020 14:08:24 +0000 (14:08 +0000)]
Bug 27108: Add 21.05 release team to teams.yaml
This patch update the docs/teams.yaml file to add the elected 21.05
release team and update the include to reflect the minor change of
structure.
Test plan.
1/ Apply the patch
2/ Update Koha.pm to state 20.11.00.000
3/ Update preferences to Version to 20.1100000
4/ Navigate to the about page
5/ Note that the 20.11 team is shown on the left and the new 21.05 team
is shown on the right.
6/ Pay particular attention to the 'Packaging manager' on the left and
'Packaging team' on the right. (We have not had a team of packaging
people before, so the template had to be updated to allow for an array
of packaging people).
7/ Signoff.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 27108: (QA follow-up) Fix Agustin and Documentation manager
Jonathan Druart [Fri, 4 Dec 2020 16:05:30 +0000 (17:05 +0100)]
Bug 12430: Fix selenium/regressions.t failure
Test failed with
# Looks like you planned 4 tests but ran 3.
t/db_dependent/selenium/regressions.t .. 2/5
# Failed test 'OPAC - Remove from cart'
# at t/db_dependent/selenium/regressions.t line 109.
Error while executing command: clickElement: An unknown server-side error occurred while processing the command.: Element is not clickable at point (583.7000122070312, 14). Other element would receive the click: <a class="page-link" href="/cgi-bin/koha/opac-search.pl?idx=kw&q=d&offset=420&sort_by=relevance_dsc&count=20" aria-label="Go to the last page"></a>
https://pic.infini.fr//Qhq7pLBq/jT9wZ7F1
The remove from basket link for the biblio 3 is hidden by the floating
toolbar.
David Cook [Tue, 18 Feb 2020 03:02:55 +0000 (03:02 +0000)]
Bug 12430: Add unit tests for C4::Search::buildQuery
This patch adds unit tests for buildQuery, especially focusing on
the use of the (rk=()) wrapper.
Note that the Net::Z3950::ZOOM library is used to test the queries
for CCL validity on top of the string matching used in the
got/expected comparisons.
David Cook [Tue, 17 Jun 2014 06:59:32 +0000 (16:59 +1000)]
Bug 12430: Use releance ranking without QueryWeightFields
The system preference "QueryWeightFields" is mutually exclusive with
the system preference "QueryAutoTruncate" and the * truncation
modifier, when not using QueryParser.
If you use truncation, relevance won't work anymore. (N.B. Relevance
doesn't work probably when using QueryParser, but for a very different
reason beyond the current scope of this bug.)
This patch adds relevance ranking when using truncation (or basically
when QueryWeightFields is disabled).
_TEST PLAN_
1) Turn on "QueryWeightFields" and set "QueryAutoTruncate" to auto
2) Turn off "UseQueryParser"
3) Do a keyword search in the OPAC
4) Note that the results are ordered by biblionumber ascending
5) Apply patch
6) Do the same keyword search in the OPAC
7) Note that the results are never ordered differently
(presumably in relevance order :P)
If you're a stickler, throw in some warns so that you can see
what CCL query is being sent to Zebra.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f6b5dfa4b718fb74654448b5663cb264b5c376b7) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 913cf92b2d8d4b1a948e32c941c903359afa7f02)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Tue, 1 Sep 2020 16:36:43 +0000 (16:36 +0000)]
Bug 26336: Add hint before and remove select after staging with no items
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5cdae4c64b7da609ddeb94d77ffa5bdbb4cb8ca1)
(cherry picked from commit c2d5331cba998adc91c2d4b4c816161ba02fd8ca)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Tue, 1 Sep 2020 13:47:27 +0000 (15:47 +0200)]
Bug 26336: Disable 'Item processing' dropdown if no item
If there is no item to process and they have been ignored during the
stage step, we should not let the user modify the dropdown value
Test plan:
0 - Check the count of import_items
SELECT COUNT(*) FROM import_items;
1 - Import a marc file with items , process the items
2 - Check the count of import items, it has increased
3 - Stage the file again, do not process items
4 - Count of import_items has not increased
5 - Manage the stage batch
Confirm that you cannot modify the "Item processing" value
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cee2e630b4e26ebfaef6cf3f41a79df3cf697b01) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6ed7950630e4b0ca9d4629a726ee1b3909254cad)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 20 Nov 2020 10:27:45 +0000 (11:27 +0100)]
Bug 26976: Display 0 if renewalsallowed is not defined
If the circulation rule "renewalsallowed" is not set (or an empty
string) then the checkout list displays
(0 of renewals remaining)
It should display "0 of 0"
Test plan:
Set renewalsallowed to an empty string
Check an item out
Notice the change
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 01a7dc70670801fab021ba7e4f782542c744bbee) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7e4bab26ca65b28df39cdf7d480b9f4c5e9e3e53)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Joonas Kylmälä [Thu, 3 Dec 2020 13:23:22 +0000 (15:23 +0200)]
Bug 27144: Fix syntax error that prevents deleting patrons
To test:
1) In staff interface open up a patron record
2) Click More -> Delete, and then "Yes, delete"
3) Notice 500 error
4) Apply patch
5) Notice error is now gone when deleting
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 08c34b33e4f9bf8f4f515ca769ed923999d3991f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ccfd83fffaaa8abe640cf6e48af4bc5feca3e354)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Mon, 19 Aug 2019 19:38:52 +0000 (19:38 +0000)]
Bug 23475: Use localStorage to preserve simple search values
To test:
1 - Enable IntranetCatalogSearchPulldown
2 - Perform a search that brings you to a single title
3 - Note the search is not displayed on the details page
4 - Apply patch
5 - Repeat
6 - Note the search is retained on details page
7 - Try with different dropdown values and search terms
8 - Test search terms including accented characters etc
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Bug 23475: (follow-up) Fix selectors and stray use statements
Martin Renvoize [Wed, 25 Nov 2020 14:10:34 +0000 (14:10 +0000)]
Bug 27079: Unit tests
Add a unit test to check for floating point errors in UpdateFine
relating to catching matching CalcFine amounts compared to DB amount
values.
Test plan
1/ Run the unit test and confirm it fails
2/ Apply the second patch in the series
3/ Run the unit test and confirm it passes
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 442802d77629586fe906f1055ce386ace8165d8c)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Martin Renvoize [Wed, 25 Nov 2020 12:58:56 +0000 (12:58 +0000)]
Bug 27079: Floating point comparison correction
We cannot compare calculated values directly as those calculations may
have introduced floating point differences. We have the
Koha::Number::Price->round function to consistently round the floating
point number to a decimal with 2 points precission for comparison.
Test plan
1/ Set a circ rule to have a .15 per day fine and enable finesMode
syspref.
2/ Issue an item of this type to a borrower (making it 12 days overdue
by setting the due date to 12 days in the past)
3/ Run the fines job:
4/ Pay the fine for the patron
5/ Check in the item
6/ Note that the patron does not have an 'Overpayment refund' of $0.00
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 27079: (QA follow-up) Round both sides for clarity
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f99a22f276e429863d4168f7f92c60e66deeb82d)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Mon, 23 Nov 2020 12:09:47 +0000 (12:09 +0000)]
Bug 26518: (QA follow-up) Expect warnings, don't supress them
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a8b89fe66a3e03cc951737a3dfcd235b81c982a7)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Mon, 12 Oct 2020 13:01:22 +0000 (15:01 +0200)]
Bug 26518: Move BiblioAutoLink within the transaction
We don't want the authorities to be created if the biblio insert fails
later
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9038cdd9a45c06266b18167900fd428b0b1395ad)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Fri, 9 Oct 2020 10:09:08 +0000 (12:09 +0200)]
Bug 26518: Hide expected DBI warnings
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1519050205d0f4411ca01e312732e5861da4ac3d)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Tue, 29 Sep 2020 11:29:49 +0000 (13:29 +0200)]
Bug 26518: Raise exception if the insert failed
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b0c39296c5c557bfcb00a762036bb269efd04a46)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Jonathan Druart [Tue, 29 Sep 2020 11:29:33 +0000 (13:29 +0200)]
Bug 26518: Use Koha::Biblio[item] in AddBiblio
Bug 26518: Does not return from the catch block
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a1e9453f1dcd5cc477ccd7fbecadb2a36176a4be)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Fri, 20 Nov 2020 19:11:10 +0000 (19:11 +0000)]
Bug 27070: Add cross_fields type to our searches
This patch adds the 'cross_fields' type to our searches:
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-query-string-query.html#query-string-syntax
Without this patch the search terms seem to all require being in the same field when using Elasticsearch 6
To test:
0 - Set QueryAutoTruncate to 'only if * is added'
1 - Find a record with a title and publisher
2 - Search for a word form the title and confirm the record is returned
3 - Search for a work from the title and the publisher's name
4 - The record is not returned
5 - Apply patch
6 - Repeat #3
7 - The record is returned
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 03f15d13c5bb931c03aa1487a3887bdaa034b06f)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Blou [Tue, 24 Nov 2020 22:03:32 +0000 (17:03 -0500)]
Bug 27082: uncertainprice.pl does not handle pagination
To reproduce:
1- create a basket
2- add more of 20 orders with uncertain price
3- click on uncertain price button
4- on page 1 of list, uncheck uncertain box of an order
5- click on save button
6- orders who were on page 2 are not display anymore in page uncertainprice.pl
7- return to basket view acqui/basket.pl
8- orders who were on page 2 have "rvcd" label and quantity is null
The data in page 2 and beyond is not transmitted, but the code doesn't
handle that. This patch makes sure that all that (empty) data is not (wrongly) processed.
Sponsored by: CCSR
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5bc36cd672ad7d4abf839bed2d48da43f09415e9)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 9935c0bdbfc22096640b79e998cf39118deb969e)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 7db88b60441e69d3d2478276d13977bbf21a8ae5)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 25548: (follow-up) Remove those rewrite redirects in koha-httpd.conf
In etc/koha-httpd.conf for dev install, those rewrite redirects are already commented.
Just remove them.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6267eb7cba91ad8177cc60c4c7cba0b26b473cee)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
David Cook [Wed, 20 May 2020 05:08:05 +0000 (15:08 +1000)]
Bug 25548: Remove Apache rewrite directives that trigger redirects
Historically, we have used Apache rewrite directives to strip
query parameters with no arguments from the query
string (e.g. PARAM=&), and then redirect to the new URL.
However, this slows down user activity, and depending on your
HTTPS and proxy setup can cause suboptimal HTTP downgrades and
upgrades.
Test Plan:
0) Apply patch
1) Build Debian package
2) Install Debian package and reload Apache
3) Open developer tools on your favourite browser
4) Go to Network tab in developer tools
5) Go to /cgi-bin/koha/opac-main.pl
6) Search for "test"
7) Note a 200 status for "opac-search.pl?idx=&q=test"
If you got a 302 status for "opac-search.pl?idx=&q=test"
followed by a 200 status for "opac-search.pl?q=test", you
will know that your Apache configuration wasn't updated.
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 181125242c33d439fb6bdbddccb6a86a03fa8c15)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Wed, 18 Nov 2020 13:15:04 +0000 (13:15 +0000)]
Bug 7607: (follow-up) Address OPAC and limits
This patch adds the same function to the OPAC and adds support for limits
I adjust the class on staff side to match the one already existing on OPAC
On the OPAC when you click the back button the fields are not enabled - on the staff side they are,
I leave this problem for someone else to solve
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 36a6ce301f961b0cefdca70ed9a903a1216e071f)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Thu, 5 Nov 2020 19:00:32 +0000 (19:00 +0000)]
Bug 7607: (follow-up) Disable rather than remove inputs
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a508d3fcbec2c1d64b94fe66b288b28cc6998e37)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Tue, 3 Nov 2020 11:19:23 +0000 (11:19 +0000)]
Bug 7607: Remove empty inputs when submitting search form
This patch surrounds the operator, index, and query fields on the advanced search
page wtih a 'search_set' class.
This allows us to process them as a group and confirm the query is populated before submitting
the other parts to the form
TO test:
1 - Go to advanced search
2 - Use search boxes to search like:
Title: (leave blank)
Author: clinton
keyword: shuffle
3 - Perform search
4 - Note no results as you searched for title:clinton etc.
5 - apply patch
6 - refresh and repeat
7 - search is now correct
8 - Try vaeious searches with 'more options' and selecting different operators
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cc970464ec7c881aaa9d8a33931a29a5951e6103)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This is just a guess but maybe it would help to have the Test::Mojo
object initiated just before the get?
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 926ad3c1a69074b2905d9ef03e639db6ba8d6865)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 258d475d5f4bb306496dc90b9c602fd776a6c545)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Fri, 13 Nov 2020 16:33:40 +0000 (16:33 +0000)]
Bug 26903: [20.05.x] 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>
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: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Thu, 3 Dec 2020 13:30:34 +0000 (13:30 +0000)]
Bug 27142: Don't interpolate batch_type variable
To test:
1 - Create a report like:
SELECT * FROM borrowers LIMIT 50
2 - Run the report
3 - Attempt batch modification - it fails showing every row as an unfound cardnumber
4 - Apply patch
5 - Repeat
6 - Success!
7 - Edit report to:
SELECT * FROM biblio LIMIT 50
8 - Repeat test
9 - Ensure batch modification and deletion work
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>
(cherry picked from commit 9b62806a979fea789661b3d85113b57dbff0e62d) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8338946e4e3f00e4679abf3073ee0f092f054deb)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Wed, 18 Nov 2020 13:29:33 +0000 (13:29 +0000)]
Bug 25942: Fix batch report operations for cardnumbers and biblionumbers
This patch moves the processing for these to a block and adds a comment
in place of whitespace and uses template directives to chomp newlines to improve readability
To test:
1 - Create a report like:
SELECT biblionumber FROM biblio
2 - Run it
3 - Try the various options from the 'Batch operations' button
(You will need to define a marc modification template)
4 - The operations don't find the biblios
5 - Create a report like:
SELECT cardnumber FROM borrowers
6 - Run it
7 - Test the batch operations
8 - They fail
9 - Apply patch
10 - Run each report again and test batch operations
11 - They work!
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 25942: (follow-up) fix filters
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 443c004bc64543b1755bf0579a68ef32aa36cee5)
Jonathan Druart [Fri, 13 Nov 2020 08:32:50 +0000 (09:32 +0100)]
Bug 27007: Don't call GetMarcSubfieldStructure with unsafe in tests
It does not feel correct to call GetMarcSubfieldStructure with the unsafe flag set in tests:
my $mss = C4::Biblio::GetMarcSubfieldStructure( '', { unsafe => 1 } );
Some tests are failing is run twice
Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314.
[x~10]
Use of uninitialized value $code_wanted in string eq at /usr/share/perl5/MARC/Field.pm line 314.
# Failed test 'Value is mapped correctly for column biblionumber'
# at t/db_dependent/Koha/Item.t line 115.
# got: undef
# expected: '483'
[etc.]
Test plan:
Run the tests twice, without the patch it fails, with the patch it
passes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3376a9440050d795ce0738e20b0616b782143f4b)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Tue, 17 Nov 2020 12:11:21 +0000 (12:11 +0000)]
Bug 26984: (follow-up) Don't delete patrons and checkouts in Objects.t
Rather than counting all and assuriing we get 10, we can count all, add 10, and ensure the numbers still match
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 59e4b03d73cb4a103acdf25f858af4efaf6c491f)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit a25b651cf257f41fd0a8c601e70acad74b479724)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This patch adds tests for the change. It also simplifies the delete()
method structure a bit. It fixes the error 500 the tests were raising.
To test:
1. Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass! The new behaviour (code 403) is tested!
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b092bdd20d94a516db0b7c4533149ac52f96aac5)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 29 Apr 2020 11:22:26 +0000 (07:22 -0400)]
Bug 14708: Don't allow merging of other patron records into Anonymous Patron
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e2032ccfd3102247ed2fe639ed0117ba7ac602d8)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 15 Apr 2020 17:48:09 +0000 (13:48 -0400)]
Bug 14708: Don't allow merging of Anonymous Patron into other patron records
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d9a54e0d3387c3ad057a67c7e2b5c668154f65f6)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 15 Apr 2020 17:31:59 +0000 (13:31 -0400)]
Bug 14708: Skip AnonymousPatron in GetBorrowersToExpunge
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f18118f18f8930d4765abecafe43776ef42877d4)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 15 Apr 2020 16:48:02 +0000 (12:48 -0400)]
Bug 14708: Prevent deletion of Anonymous Patron at Koha::Patron::delete
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 63960cbb89ec22c0f984c8d02d140e76af03c18a)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 27 Feb 2019 17:00:03 +0000 (12:00 -0500)]
Bug 14708: Enforce restriction in delete_patrons.pl
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b0ce0d646323de43739c454d0b8e665370768df1)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Kyle M Hall [Wed, 27 Feb 2019 11:59:08 +0000 (06:59 -0500)]
Bug 14708: The patron set as the anonymous patron should not be deletable.
Right now it's possible to delete the anonymous patron at any time. When this happens the system will break just as if anonymouspatron was unset but patrons still have an "always anonymize" privacy setting.
This issue occurs more frequently than one would expect.
We should make it so that the patron set in AnonymousPatron is not deletable.
Test Plan:
1) Apply this patch
2) Set a patron to by AnonymousPatron
3) Attempt to delete that patron from the members toolbar
4) Note the error message!
Signed-off-by: Devinim <kohadevinim@devinim.com.tr> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c1af56eb54043909f7e32b4597baa4f2d4d3e7dd)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit dff16710ae53ebfab8596f27b35a7c8e35f81edf)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit f3cacc62cda58798e8f2de6cfdd636772d2158f0)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d4a15b27b8359a13fa80952ed7e920b7388527fb)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 517dcabdf73acfaf01cde461beb8bac84f86c82e)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7abee7fd6913c178baffafe2ea8cfc33f38c87f6)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit e8f39a001c979fb0ef7ac342dd07062285d0264d)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 308b03a31b95a8808751b98d3b285adcb370f47f)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit bf8ab094705163f50f46451b0dffa00cdd1d4ab9)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 836d9a38727859f06902a7be6790592431fe812e)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit e1400890ec8040ced8e3550eddbfd0d4e8af2347)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 55835ccfaffef48b924857e18bfd964aebda3a0a)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit a386954b8b17925ed213a56878e1d453ba8c7635)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 36d46c6510ee93ffc52f6b914389c66351b16f33)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6bbd13ba031cf4ba592b989e869cba3a95405d4b)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 7edb1a55bc54fd5c68700e703be9deff3d6a0199)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Wed, 11 Nov 2020 03:11:56 +0000 (03:11 +0000)]
Bug 26988: (follow-up) Fix filter and encode api values and escape rendered values
This patch makes the QA tools happy and follows correct procedures for passing data to
and rendering data from the api
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 19a30acaece904aeedcc6a3728e3815895d10c56)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick Clemens [Wed, 11 Nov 2020 02:53:46 +0000 (02:53 +0000)]
Bug 26988: (follow-up) Adjust code to use api field names
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4388d20fb12f77aa733498baa4a287e4fb7c6998)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 26988: (QA follow-up) Make the API return proper library objects
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 14506040292201a78733a9c1746bf7f590205fe3)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 75456ba973f87d3c46d045811ad32dfe2a153e3f)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
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>
(cherry picked from commit 83d471394562b8137fce9b3a538d19efc41fa1e1)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>