Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds tests for Koha::Account->pay, to make sure the
library_id param is used to set the branchcode attribute. The use of
userenv to set branchcode if library_id not passed is removed.
Responsability is left to the callers to pass library_id.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Reserves.t
=> FAIL: Tests fail because branchcode is not set
- Apply this patch
- Run:
k$ prove t/db_dependent/Reserves.t
=> SUCCESS: Tests pass!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 19066: Tests for AddRenewal AddIssuingCharge and ChargeReserveFee
This patch adds some tests that cover functions changed by this
patchset. A bug in ChargeReserveFee is highlighted.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Kyle M Hall [Wed, 9 Aug 2017 16:55:56 +0000 (16:55 +0000)]
Bug 19066: Add branchcode to accountlines
For the purposes of statistics, it appears that it would help many
libraries to have branchcode recorded in the accountlines table. For
payments, the field would contain the code for the branch the payment
was made at. For manual invoices, it would be the code of the library
that created the invoice.
Test Plan:
1) Apply this patch set
2) Create and pay some fees
3) Note the branchcode for those fees and payments is set
to your logged in branch
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Test plan:
Hit /cgi-bin/koha/acqui/parcel.pl
Notice the background color change with and without this patch
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Thu, 20 Dec 2018 22:55:46 +0000 (19:55 -0300)]
Bug 22034: Handle default framework for MARC view with framework
To test:
- Create a record in any framework that is not default
- Search for the record in your catalog
- Switch to the MARC tab
- Change framework pull down to default on top
- Note the page reloads and the framework stay default
- Verify it works for other frameworks
Also test the "labeled MARC" view (you will need the pref viewLabeledMARC turned on)
Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21578: Terminology changes in patron's account section (staff)
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 20:34:59 +0000 (17:34 -0300)]
Bug 22007: Generated with add_missing_filters.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 20:34:52 +0000 (17:34 -0300)]
Bug 22007: Also handle Price and HtmlTags
Those 2 filters should return safe output as well
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 20:20:52 +0000 (17:20 -0300)]
Bug 22007: Remove html filters when KohaDates called with a parameter
Bug 13618 took care of the KohaDates output but not if it is called
with a parameter (eg. [% var | $KohaDates with_hours => 1 %]).
We could avoid unnecessary processing by removing the extra html filter.
Patch generated with the following command:
% perl -p -i -e 's/KohaDates([^%\|]*)\s?\|\s?html\s?/KohaDates $1/g' **/*.inc **/*.tt
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
To recreate:
1 - Set CircAutoPrintQuickSlip to 'clear'
2 - Bring up a patron in circulation
3 - Click in checkout box and hit enter to submit empty
4 - Patron is partially loaded
5 - Apply patch
6 - Restart all the things
7 - Test again
8 - Patron is cleared correctly
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Aleisha Amohia [Tue, 23 Oct 2018 00:06:27 +0000 (00:06 +0000)]
Bug 16939: (follow-up) Adding missing bracket
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Tue, 29 May 2018 18:09:44 +0000 (18:09 +0000)]
Bug 16939: (follow-up) Correction for orderreceive.tt
This patch makes a change to orderreceive.tt which corresponds to the
changes made in the previous patch.
To test, apply the patch and set the AcqCreateItem system preference to
"receiving an order."
- Go to Acquisitions -> Vendor -> Receive shipment.
- Submit the "Receive a new shipment" form.
- Click "Receive" for an order line.
- Fill out the item form and click "Add item."
- The table of existing items should display correctly, with a single
"Actions" column containing an "Edit" and "Delete" button.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 16939: Making all 'add to basket' actions buttons
Edit: Fixing 'clas' typo in addorderiso2709.tt
Edit: Adding actions class to td
Edit: Fixing js error
Edit: circ/reserveratios.tt updated so that the plus icon doesn't show
if there is no link
Edit: fixing logic in circ/reserveratios.tt
Edit: merge conflicts
Edit: updating buttons to bootstrap 3, which i believe fixes the problem
in comment 16
To test:
1) Go to Acqui -> find a vendor -> view a basket
2) Click add to basket -> fill in 'for an existing record' and hit search
3) 'View MARC' and 'Order' buttons should show under an Actions column with appropriate icons
4) Click Order
5) Click add item when you are redirected to the New order page (no need to fill in any details)
6) Confirm that 'Edit' and 'Delete' buttons now show under an Actions column with appropriate icons
7) Go back to your basket and click add to basket -> from a subscription (we are skipping from a suggestion because this already has a button before my patch)
8) Confirm that 'Order' shows as a button with appropriate icon
9) Go back to your basket and click add to basket -> from an external source
10) fill in any fields and click search to bring up results
11) 'Order' should now show as a button with appropriate icons. MARC and Card preview have been moved into a dropdown menu - confirm this works as expected. Links have not been changed when clicking on a row
12) Go back to your basket and click add to basket -> from a staged file
13) 'Add orders' should now show as a button with appropriate icon
14) Go back to your basket and click add to basket -> from titles with highest hold ratios
15) 'X to order' should now show as a button with appropriate icon
Sponsored-by: Catalyst IT Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21909: Make Koha::Account::outstanding_* preserve context
This patch modifies the methods so they preserve the caller's context
(list and scalar).
To test:
- Apply the first patch
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: outstanding_credits and outstanding_debits tests fail
- Apply this patch
- Run:
k$ prove t/db_dependent/Koha/Account.t
=> SUCCESS: We are so happy now :-D
- Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch introduces regression tests for the behaviour to be
introduced. Both outstanding_credits and outstanding_debits methods
should return a Koha::Account::Lines object in scalar context, and a
list of Koha::Account::Line objects in list context.
To test:
- Apply this patch
- Run
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: The current behaviour doesn't match the described
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Mon, 12 Nov 2018 21:21:58 +0000 (18:21 -0300)]
Bug 21817: Centralize the mock of userenv from tests
This patch adds a new method mock_userenv from t::lib::Mocks in order to
simplify the mock of the userenv.
Test plan:
prove all the test files modified by this patch
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21547: (follow-up) Rely on Koha::Patron->set_password checks
This patch makes the controller just call $patron->set_password and use
the exceptions it might raise instead of manually checking the passwor
strength.
No behaviour change should be expected. It also removes some leftovers.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Thu, 11 Oct 2018 10:00:31 +0000 (12:00 +0200)]
Bug 21547: Use set_password in opac-passwd and remove sub goodkey
Remove sql statement to change password by calling set_password.
Remove sub goodkey by calling C4::Auth::checkpw_hash.
Adding the scalar before param Oldkey (from bug 21036).
Rebased on top of 21178 (using set_password instead of update_password).
Test plan:
Try to change password in OPAC with good and bad pw.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Alex Buckley [Wed, 31 Oct 2018 10:27:41 +0000 (10:27 +0000)]
Bug 21754: Automatically clean up outstanding transfers on lost items
This is an alternative to bug 21732 as transfers are automatically cancelled on marking an item lost, and the items holding rbanch is set to the transfers source ('from') branch.
When an item is marked as lost, the routine should also clean up any
outstanding transfers.
Also added tests to t/db_dependent/Circulation.t which check:
* If transfer is automatically deleted when item is marked as lost
* If the items holdingbranch automatically changes when item with
transfers on it is marked as lost.
Test plan:
1. Find a item which is in transfer, i.e. find an item with the text in
the 'Status' field of the table in detail.pl that indicates it is in
transfer
2. Set the item to 'Lost' either by clicking on Edit->Edit items from
the detail.pl page
OR
clicking on the Items tab on the left side of the detail.pl page
3. Notice that the transfer is now cancelled for the item and the items
holdingbranch is the transfers source ('from') branch
4. Run t/db_dependent/Circulation.t
Sponsored-by: Brimbank Library, Australia Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
(fixed the introduction of a whitespace line and removed a double
declare warning from the new tests as part of QA) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Tue, 16 Oct 2018 14:51:40 +0000 (11:51 -0300)]
Bug 21571: Make ACCTDETAILS translatable
This patch makes the notice "ACCTDETAILS" translatable.
Test plan:
1. Switch on TranslateNotices and AutoEmailOpacUser
2. Define templates for different languages for ACCTDETAILS
3. Create a new patron, define an email address, userid and password.
Also pick a different "preferred language" then the default value
4. You should receive the email with the correct, translated, email.
Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 15 Nov 2018 18:56:00 +0000 (18:56 +0000)]
Bug 21844: Include itemcallnumber in lost fine description
To test:
1 - Make sure WhenLostChargeReplacementFee is set to charge
2 - Find an item with a replacement cost (or default) and a call number
3 - Checkout the item to a patron
4 - Mark the item lost
5 - View the fine - the description includes title and barcode
6 - Apply patch
7 - Check the item in
8 - Check it out again
9 - Mark it lost
10 - Note the fine includes the callnumber
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Fri, 26 Oct 2018 16:15:39 +0000 (16:15 +0000)]
Bug 21693: Clean up checkout notes template
This patch modifies the checkout notes template to help compliance with
coding guidelines and interface patterns:
- Convert to Bootstrap grid
- Improve DataTables configuration
- Put buttons into a toolbar and move above selection links
Also corrected: Minor markup error in circ-nav.inc
To test, apply the patch and enable the AllowCheckoutNotes system
preference. Add a few checkout notes via the OPAC.
- Go to Circulation -> Checkout notes.
- Confirm that the page looks correct at various browser widths.
- Confirm that the first and last columns of the table of notes are
not sortable.
- The table should be sorted by default by title.
- Title sorting should ignore articles "a," "an," and "the."
- Test with the CircSidebar preference both on and off.
- With CircSidebar turn on, the checkout notes menu item in the
left hand sidebar should show a count of checkout notes.
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Make sure the directory exists and contains multiple files.
- Go to Tools -> Access files
- Confirm that the page looks correct and the layout adjusts at various
browser widths.
- Confirm that DataTables functionality works correctly, including
correct sorting by date.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Julian Maurice [Wed, 16 Dec 2015 00:25:44 +0000 (01:25 +0100)]
Bug 21789: Example usage of I18N Template::Toolkit plugin
Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Fri, 16 Nov 2018 08:41:04 +0000 (09:41 +0100)]
Bug 21848: Remove Text::Unaccent from C4::Members
At refactoring time the unac_string call was moved to Koha::Patron.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Thu, 13 Dec 2018 12:07:48 +0000 (13:07 +0100)]
Bug 21848: Resolve unac_string warning from Circulation.t
Just add "use utf8".
Test plan:
Run Circulation.t; verify there are no warnings.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Tue, 18 Dec 2018 18:30:28 +0000 (18:30 +0000)]
Bug 22022: Correct ordering for authorised values
To test:
1 - Add a shelving location with code "ZZZZ" and lib "Awake"
2 - Load some items in batch modification
3 - Note shelving location dropdown is wrong
4 - Apply patch
5 - Reload page
6 - Note order is correct
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Katrin Fischer [Tue, 18 Dec 2018 21:43:05 +0000 (22:43 +0100)]
Bug 22024: Correct new installations with missing data
For a new installation the data in the class_* will be
missing as class_sources.sql couldn't be executed. It will
fail with:
DBD::mysql::st execute failed: Cannot add or update a child row:
a foreign key constraint fails (`koha_kohadev`.`class_sources`,
CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`)
REFERENCES `class_split_rules` (`class_split_rule`)) at /usr/share/perl5/DBIx/RunSQL.pm line 273.
As this might have been missed and the web installer can still
be completed, this patch checks for the tables being empty and
adds the default data if they are.
To test:
- Without the patch
- Run the de-DE or another translated installer
- Verify the error is shown
- Complete the installer
- Verify class_sources table is empty
- Apply patches
- Run the database update
- Verify data classification sources, filing rules, and
slitting rules are now complete
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Tue, 11 Dec 2018 15:15:57 +0000 (15:15 +0000)]
Bug 21984: Pass param_name in pagination URL
To test:
1 - Create a report like:
SELECT <<cat>>,<<dog>>,<<cat>> FROM items
2 - Run the report, enter 'CATS' and 'DOGS'
3 - Get results LIKE "CAT | DOG | CAT"
4 - Try to go to page 2
5 - FAIL! (last column is blank)
6 - Apply patch
7 - Run the repot, enter 'CATS' and 'DOGS'
8 - Verify first page looks right
9 - Go to page 2
10 - Results are correct!
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: “Lucas Gass” <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 15:49:44 +0000 (12:49 -0300)]
Bug 21065: Set ON DELETE SET NULL on accountlines.borrowernumber
Note: Why do we have ON UPDATE SET NULL on accountlines.itemnumber? Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 7 Dec 2018 17:14:06 +0000 (14:14 -0300)]
Bug 14334: Remove AutoCommit from tests
And use a DBIx transaction instead.
Test plan:
prove that the test files modified by this patch are passing
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Andreas Roussos [Fri, 23 Nov 2018 17:30:23 +0000 (19:30 +0200)]
Bug 21880: "Relationship information" disappears when accessing paginated results in authority searches
When linking authorities with authorities, if you perform a
search that returns >20 results, the "Relationship information"
section disappears when you click on the pagination hyperlinks.
This patch fixes that.
Test plan:
1) In the Authorities module, edit an authority (or create a new
one) and try to link it with another authority (via UNIMARC
500$a, for example).
2) When the authority finder comes up, search for something that
will yield more than 20 results, then click on the pagination
links -- notice how the "Relationship information" section is
no longer visible.
3) Apply the patch (and restart Plack/memcached, if necessary).
4) Repeat step 2) -- "Relationship information" is now persistent.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Wed, 12 Dec 2018 14:05:19 +0000 (11:05 -0300)]
Bug 21986: Do not escape quotation marks when cataloguing
In several places we escape quotation marks using
$value =~ s/"/"/g;
All the occurrences are wrong and must be removed.
Most of them are leftover of bug 11638 (Remove HTML from
addbiblio.pl), which removes the construction of html from pl scripts.
The problem has been highlighted by bug 13618, I did not track down why
the issue did not exist before (?)
Test plan:
0/ Use strings with quotation marks, like:
'Fiddle tune history : "bad" tunes'
You can also use other html characters to make the tests more complete,
like 'Fiddle tune history : <"bad" tunes>'
1/ authorities/authorities.pl
a. Edit an authority filling different fields with quotation marks
b. Edit it again
=> The display (inputs' values) is wrong, if you save the escaped quotes
will be inserted
2/ cataloguing/addbiblio.pl
Same editing a bibliographic record
3/ cataloguing/additem.pl
Same editing items
4/ members/memberentry.pl
Edit a patron's record and fill some fields with quotation marks
+ fields borrowernotes and opacnotes
=> The quotes are inserted directly in DB (escape is done before the
insert!)
5/ opac/opac-review.pl
For QA only: $js_ok_review is never used
6/ tools/batchMod.pl
For QA only: $value is always undefined at that point
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 7 Dec 2018 13:26:02 +0000 (10:26 -0300)]
Bug 21973: Do not url escape casServerUrl
It is already escaped correctly in
C4::Auth_with_cas::_url_with_get_params using URI::Escape::uri_escape
Note that shibbolethLoginUrl is not and must be url escaped in template
("be consistent, they said")
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 7 Dec 2018 19:49:00 +0000 (16:49 -0300)]
Bug 21931: Do not reset the ES mapping on 3.23.00.050
This update DB entry uses DBIx schema which does not make it crashes if
the table structure is changed.
Which happens on 18.06.00.054, that added search_field.weight
The entry 3.23.00.050 fails with
Unknown column 'me.weight' in 'field list'
This patch removes the reset of the mapping and display a warning to
tell the administrator the mapping must be reset/inserted
Test plan:
Use a 3.22 dump and upgrade it
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Wed, 12 Dec 2018 16:16:50 +0000 (16:16 +0000)]
Bug 21991: Pass param names to report limit tool
To test:
1 - Define a report like:
SELECT barcode, itemnumber
FROM items
WHERE (homebranch = <<Branch|branches>> AND 0 ) OR
<<Branch|branches>>=<<Branch|branches>>
2 - Run it, you get results
3 - Select 'Rows to display' 50
4 - No results
5 - Apply patch
6 - Run report
7 - Change display rows
8 - Results remain!
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Thu, 6 Dec 2018 13:07:18 +0000 (10:07 -0300)]
Bug 21950: Remove filtering for query_cgi and limit_cgi
We must not escape query_cgi and limit_cgi template-side, they are already
escape properly from build_query_compat using uri_escape_utf8.
To fix further problems we should replace all occurrences to make things
clear (I decided to keep the html filter so far, which did not hurt, but uri or url do)
query_cgi is uri_escaped from the pl, so we should displayed as raw
Test plan:
Use wide characters ❤
Search, filter, facets, search history, rss (both interfaces)
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological cases
This patch makes outstanding_* methods be safe regarding pathological
account lines that get converted into another type because of the value
of amountoutstanding
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: Tests fail because pathological account lines are wrongly
picked.
- Apply this patch
- Run:
k$ prove t/db_dependent/Koha/Account.t
=>SUCCESS: All green!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch introduces regression tests for Koha::Account::outstanding_*
methods so they don't pick wrong lines when amountoutstanding matches
what we are looking for (i.e. negative for credits and positive for
debits).
To test:
- Apply this patch
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: Tests fail because pathological account lines are wrongly
picked.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Mark Tompsett [Wed, 5 Dec 2018 03:44:25 +0000 (03:44 +0000)]
Bug 21947: Address other misordered FILTER lines
As per comment #3, this patch changes the order for all
the filters found with the recommended git grep.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Mark Tompsett [Tue, 4 Dec 2018 18:58:17 +0000 (18:58 +0000)]
Bug 21947: Swap the filter order
TEST PLAN
----------
1) start your kohadevbox
2) cd kohaclone
3) git checkout -b bug_21947 origin/master
4) git bz apply 21947
5) reset_all
6) log in to staff client and add a 500$a with lots
of blank lines between strings with some HTML.
7) look at the opac record Title notes tab.
-- does it have <br>-mess? Should not.
8) repeat steps 5-7 on master, and you'll see
a <br>-mess.
9) run qa test tools
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21759: Avoid manually setting amountoutstanding in _FixAccountForLostAndReturned
This patch changes the behaviour in the _FixAccountForLostAndFound
method.
The method will now add the amountoutstanding value for the lost item
fee to the CR credit to be generated. This means that:
- If there's some remaining debt, the same amount will be added to the
CR credit and used to cancel that debt. The final amountoutstanding
will be the same as before, but an offset will be generated as
required.
- If the line was written off, the behaviour remains unchanged, so no
offset.
- If the line was payed and/or written off in full only the payments are
refund, preserving the current behaviour.
To test:
- Apply the regression tests patch
- Run:
$ kshell
k$ prove t/db_dependent/Circulation.t
=> FAIL: Tests fail because the behaviour is not correct
- Apply this patch
- Run:
k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests now pass!
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch tests for a new behaviour in the _FixAccountForLostAndFound
method.
The method will now add the amountoutstanding value for the lost item
fee to the CR credit to be generated. This means that:
- If there's some remaining debt, the same amount will be added to the
CR credit and used to cancel that debt. The final amountoutstanding
will be the same as before, but an offset will be generated as
required.
- If the line was written off, the behaviour remains unchanged, so no
offset.
- If the line was payed and/or written off in full only the payments are
refund, preserving the current behaviour.
Only changes to the 'remaining debt' use cases on this tests are
expected.
To test:
- Apply this patch
- Run:
$ kshell
k$ prove t/db_dependent/Circulation.t
=> FAIL: Tests fail because the behaviour is not correct.
Note: some tests order changes are introduced to avoid calling
discard_changes twice
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Tue, 2 Oct 2018 19:48:02 +0000 (19:48 +0000)]
Bug 21465: Don't throw duplicate userid error if userid belongs to the matched patron
To test:
1 - Export your patrons
a - Create a report 'SELECT * FROM borrowers'
b - Run and save the report as csv (check your delimiter)
c - Delete the borrowernumebr column
2 - Use the Patron Import tool to import the csv from above
3 - Set matching to 'cardnumber'
4 - Set 'If matching record is already in the borrowers table:' to
Overwrite
5 - Import
6 - None are import because of matchign userid (their own)
7 - Apply patch
8 - Repeat
9 - Patrons are successfully overwritten
10 - prove -v t/db_dependent/Koha/Patrons/Import.t
11 - prove -v t/db_dependent/Koha/Patrons.t
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Katrin Fischer [Thu, 6 Dec 2018 11:42:12 +0000 (12:42 +0100)]
Bug 21961: Fix typo in manage_didyoumean permission
The typo in the installer files will cause problems on new
installations as the code for the permission is wrong.
This means that on new installations the Did you mean? section
on the administration page won't show up.
In order to fix this, we need to correct the code in
permissions, but also the permissions for users who
this permission has been given to.
To test:
- Start without the patch
- Use a new installation with the permission typo
- Log in as superlibrarian
- Verify that the "did you mean?" configuration page
is not visible
- Create another staff user with permission to access
staff and manage_didyoumean checked
- Verify configuration page remains invisible
- Apply patch and run database update
- Check both users again, the config page should now sohw
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Fridolin Somers [Thu, 29 Nov 2018 09:50:06 +0000 (10:50 +0100)]
Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.
Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Fridolin Somers [Thu, 29 Nov 2018 09:15:00 +0000 (10:15 +0100)]
Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.
Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Test Plan:
1) Apply this patch
2) Set up 2 items with overdue fines
3) Return one with dropbox mode
4) Note the dropbox account offset is created
5) Return one with full fine forgiveness
6) Note the forgiven account offset is created
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Kyle M Hall [Fri, 16 Nov 2018 14:54:39 +0000 (09:54 -0500)]
Bug 21849: Add unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 6 Dec 2018 12:42:45 +0000 (12:42 +0000)]
Bug 21962: Fix authority search using 'all'
To test:
1 - Set search engine to Zebra
2 - Have some authorities and indexes up to date
3 - Search authorities with option 'search entire record'
4 - No results
5 - Apply patch
6 - Run unit tests, they pass!
7 - Repeat search
8 - Results!
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 6 Dec 2018 12:41:41 +0000 (12:41 +0000)]
Bug 21962: Unit tests
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Mon, 3 Dec 2018 13:05:49 +0000 (13:05 +0000)]
Bug 21405: Fix authorities pagination for Zebra and ES
Bug 20261 introduced an error because search_auth_compat responded
differently for ES and Zebra, now bug 19365 fixed the underlying
difference. This patch restores previous code to fix pagination.
Additionally we add a fix for 10000+ results in ES and remove a double
import of C4::Auth
To test:
1 - Perform an authorities search with 1+ pages using Zebra
2 - Page through results, note you are only offseeting by 1 each time
3 - Perform an authorities search with 10,000+ results in ES
4 - Click on the last page and get an error
5 - Apply patch
6 - Retry Zebra search
7 - Results should paginate correctly
8 - Clicking on last page should return last results
9 - Retry ES results
10 - Results should paginate correct
11 - Clicking on last page should return last results
Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Fri, 7 Dec 2018 08:43:58 +0000 (09:43 +0100)]
Bug 21608: (QA follow-up) Rename revert button
The label 'Revert found status' is replaced by 'Revert waiting status'
or 'Revert transit status' depending on hold.found/hold.intransit.
Note that hold comes from reserveloop in request.pl. The columns/keys
found and intransit are just booleans.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Mon, 26 Nov 2018 18:19:03 +0000 (18:19 +0000)]
Bug 21608: Add value for 'rank-request' when dropdwn disabled
When a field is disabled no value is submitted in the form - this was
causing found holds to be reverted
To test:
1 - Apply all patches except this one
2 - PLace several holds on one bib
3 - Set at least one waiting or intransit
4 - Making no adjustments hit "Update holds"
5 - Waiting/intransit holds are all reset
6 - Mark them waiting/intransit again
7 - Apply this patch
8 - Click 'update holds'
9 - Found status is not accidentally reverted
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 25 Oct 2018 11:45:25 +0000 (11:45 +0000)]
Bug 21608: Disable dropdown for found holds - add button to revert
This patch disables the dropdown for found holds, and adds a new button
to revert the waiting status, setting the hold to priority 1
Additionally we remove some changes from 19469 and update the JS to skip
found holds when updating priority
To test:
1 - Find a record with multiple items
2 - Place 4 holds (or more)
3 - Capture one ohld as waiting, one as in transit
4 - View the holds on the record - switch the last to priority one
5 - Waiting and transit statuses get confused
6 - Apply patch
7 - Observe dropdown is now disabled for waiting holds
8 - Confirm other holds operate as expected
9 - Confirm 'Revert found status' resets hold
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 21608: (follow-up) Use RevertWaitingStatus and do not alter _FixPriority
[EDIT]
Completely removed the changes to Reserves.pm by adding module prefix in
the request.pl script.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Fri, 30 Nov 2018 07:09:23 +0000 (07:09 +0000)]
Bug 21911: Regression test
This tests usuall cases, but note, that administrator could make a
branch with code "%%%" or so, which this test does not cover, and some
functionalities will not work in that case: opac limit override,
holdinbranch facet
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 29 Nov 2018 14:17:37 +0000 (14:17 +0000)]
Bug 21911: Fix OPAC scoping to work with new group system
To test:
0 - Apply patch
1 - Create a library group enabled for opac search limits and add some
libraries
2 - Check the DB (or advanced search dropdown) to get the id of the
group (using 7 as example below)
3 - Add to apache configuration (OPAC virtualhost)
SetEnv OPAC_SEARCH_LIMIT branch:multibranchlimit-7
SetEnv OPAC_LIMIT_OVERRIDE 1
RequestHeader add X-Koha-SetEnv "OPAC_SEARCH_LIMIT
branch:multibranchlimit-7"
RequestHeader add X-Koha-SetEnv "OPAC_LIMIT_OVERRIDE 1"
4 - Ensure OpacAddMastheadLibraryPulldown is disabled
5 - Restart all the things
6 - Visit the opac
7 - Perform a search, confirm it is scoped to the branches in the group
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 29 Nov 2018 14:11:36 +0000 (14:11 +0000)]
Bug 21910: Koha::Library::Groups->get_search_groups should return the groups
To test:
1 - Add a library group (Admin->Library groups)
2 - Enable use as an opac and staff search limit
3 - Add some libraries to the group
4 - Visit advanced search on staff and opac
5 - Note the dropdown has as many empty rows as there are libraries
in the group
6 - Apply patch, restart all the things
7 - Visit staff and opac advanced search
8 - Confirm the group dropdowns are correct
9 - Enable OpacMastheadLibraryPulldown
10 - Ensure the dropdown on opac shows groups correctly
11 - Confirm earchign groups works from all three locations
12 - prove -v t/db_dependent/LibraryGroups.t
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Wed, 7 Nov 2018 01:32:26 +0000 (01:32 +0000)]
Bug 21778: Sort user list by surname,firstname unless user cannot manage patron lists OR edit patrons
To test:
1 - Create four users:
1 superlibrarian (or with both edit patrons and manage patron
lists)
1 with only edit patrons and catalogue
1 with only add to list and catalogue
1 with catalogue but neither edit patrons or manage patron lists
2 - Search patrons signed in as each user
3 - Note different sorting
4 - Apply patch
5 - Try searching with each patron
6 - Results should always be sorted by surname, firstname
7 - Only in the case of neither extra permission should the checkboxes
be absent
Signed-off-by: Devinim <kohadevinim@devinim.com.tr> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Wed, 5 Dec 2018 19:39:02 +0000 (16:39 -0300)]
Bug 21955: Remove Cache::Memory as fallback for L2 cache
If Plack is running with several workers we must not use Cache::Memory
as L2 cache.
If a value is set from a worker, it will not be available from other
workers as the Cache::Memory instance is not shared (of course!)
Moreover we now have Koha::Cache::Memory::Lite that does the same job,
so we should not expect performance regressions by removing it.
See also the email sent to koha-devel for more info
http://lists.koha-community.org/pipermail/koha-devel/2018-December/045004.html
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch introduces a new button in the 'Pay fines' tab on the
patron's account page. This button, labeled 'Normalize account' is only
displayed when outstanding credits are available, that could be used to
pay up existing debts.
When clicking the button, the Koha::Account::normalize_balance method
(bug 21896) is used for the purpose.
To test:
- Apply this patch (on top of 21896)
- On a patron's 'Fines' tab, create a 'manual invoice' (maybe more than
one)
- Go to the 'Pay fines' tab
=> SUCCESS: No 'Apply credits' button is displayed.
- On the 'create manual credit' tab, create a couple credits.
- Go to the 'Pay fines'
=> SUCCESS: 'Apply credits' button is displayed
- Click on 'Apply credits'
=> SUCCESS: Outstanding credits have been used to pay up debts.
- Play with different options (credit excedes debts and vice-versa, they
match, etc)
=> SUCCESS: They all work as expected
- Sign off :-D
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Thu, 29 Nov 2018 13:49:27 +0000 (13:49 +0000)]
Bug 21896: (QA follow-up) Document and Test for FIFO behaviour
A short dicussion lead to the decision to make it explictly clear that
this method will implicitly apply credits against debits in a 'First In
First Out' manor, meaning oldest outstanding debits will be paid off
first.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds the normalize_balance() method to Koha::Account. Its
purpose is to apply outstanding credits (i.e. manual ones ore remaining
amounts like in the case of refunds) to outstanding debts.
To test:
- Apply this patchset
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21896: Add unit tests for Koha::Account::normalize_balance
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>