Owen Leonard [Wed, 4 Apr 2018 16:33:34 +0000 (16:33 +0000)]
Bug 20518: Don't show "Messages" header and link on patron details if there are no messages
This patch modifies the patron detail page so that the "Messages" header
is not displayed if there are no messages.
Unrelated: A minor change was made to moremember.pl to quiet an error in
the log, "Use of uninitialized value $print in string eq at
members/moremember.pl line 219."
To test, apply the patch and open the detail page for a patron who has
no messages. There should be no "Messages" header or "add message" link.
Add a message to the patron's account. The message should appear, along
with the "Messages" header and "add message" link.
The error logs should show no errors.
Signed-off-by: Maksim Sen <maksim.sen@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Mon, 15 Jan 2018 14:11:29 +0000 (14:11 +0000)]
Bug 9634: Allow for combining same paraneters in SQL reports
This patch combines report paramters with the same name and data type
(authorised value)
This presereves the past ability to provide all parameters as
'sql_params' in order to preserve existing public report links
To test:
1 - Create a report that takes multiple parameters, e.g.:
SELECT <<cat>> AS one, <<dog|branches>> AS two, <<dog|YES_NO>> as three,
<<cat>> as four, <<dog|branches>> as five
2 - Run this report, note you are asked for five parameters
3 - Apply patch
4 - Update database
5 - Run report, note you are asked for three params
6 - Verify the results reflect the supplied parameters
7 - Export the report and verify results
8 - Alter the URL and provide 5 params as sql_params and no param_name
variables i.e.
http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run+this+report&sql_params=Banana&sql_params=CPL&sql_params=0&sql_params=Orange&sql_params=LPL
9 - Verify results come out as expected. i.e. 5 different values that
are those of the URL.
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds current date and time, formatted as configured.
It makes the timezone name be displayed the system uses it (important
for the 'local' use case).
It removes some warnings too.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds C4::Context->timezone bad timezone handling.
The calculated 'effective' timezone is tested with the right tool and a
fallback to 'local' is added. A warning is printed in the logs.
A test for this is added to about.pl too, along with the right warning
messages in case of problems.
Tests are added for both invalid TZ and to make sure the warning is
raised.
To test:
- Apply the patch
- Run:
$ kshell
k$ prove t/timezones.t
=> SUCCESS: All tests pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Mon, 2 Apr 2018 19:24:25 +0000 (15:24 -0400)]
Bug 18674: Allow TZ SetEnv for plack
It should also be noted that
/etc/apache2/sites-enabled/{configuration file}
should also contain:
RequestHeader add X-Koha-SetEnv "TZ {timezone}"
Where {timezone} is the desired instance timezone.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Mon, 26 Feb 2018 15:00:54 +0000 (15:00 +0000)]
Bug 18674: Added timezone information to about page
Before patch: No timezone section
After patch: timezone section at bottom of
Server information tab.
Actual is what is being used. Config overrides environment variables.
So if there is confusion why the environment variables aren't working,
it will be visible why.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Thu, 1 Feb 2018 18:21:54 +0000 (13:21 -0500)]
Bug 20123: Allow multiple instances of Koha to have different timezones on the same server
Most of Koha depends on the local timezone of the server, except for Koha::Database which support an ENV override with the key TZ.
We should take this a step further. We should not only accept the TZ environment variable for all of Koha, we should really be able to set the timezone in the koha conf file as well so we don't have to pass that environment variable to things like cronjobs and one-off scripts.
Test Plan:
1) Apply this patch
2) Set a timzone in your koha_conf file, that is *not* your local time zone
Available timzones are listed here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
3) Restart apache/plack
4) Perform some actions, check the timestamps in the database and in the
html output, note they are for the set timezone and not the local
timezone.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Koha/Acquisition/Order.t .. 1/2 # No tests run!
# Failed test 'No tests run for subtest "entrydate"'
# at t/db_dependent/Koha/Acquisition/Order.t line 97.
# Looks like you failed 1 test of 1.
# Failed test 'store'
# at t/db_dependent/Koha/Acquisition/Order.t line 99.
Cannot insert order: Mandatory parameter quantity is missing at t/db_dependent/Koha/Acquisition/Order.t line 77.
# Looks like your test exited with 255 just after 2.
It happens when basket.is_standing is 0
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 13 Dec 2017 21:05:50 +0000 (18:05 -0300)]
Bug 19804: Add the new column to the circ rules interface
Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 13 Dec 2017 19:57:40 +0000 (16:57 -0300)]
Bug 19804: Add a 'Fine charging interval' for suspension days
We already have a chargeperiod (Fine charging interval) value which is
taken into account for fine ($) for not for the suspension period.
This patch adds a new column suspension_chargeperiod (Fine day charging
interval) to add the same behaviour when a suspension is calculated.
Test plan:
Add overdue item and play with the circulation rules (and the calendar).
The suspension period must be correctly calculated.
Please provide the different tests you made.
Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 13 Dec 2017 19:56:57 +0000 (16:56 -0300)]
Bug 19804: DBIC Schema changes
Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 13 Dec 2017 19:56:38 +0000 (16:56 -0300)]
Bug 19804: Add new DB column issuingrules.suspension_chargeperiod
Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sun, 5 Nov 2017 01:47:49 +0000 (01:47 +0000)]
Bug 19581: Unit tests
This patch makes a few changes to the tests to take into account the
change to indexing.
To test:
prove t/db_dependent/Koha_Elasticsearch_Indexer.t
Should return green
Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Sun, 5 Nov 2017 01:51:39 +0000 (01:51 +0000)]
Bug 19581: Remove 'split' option from Catmandu fixes for marc
This option in combination with append seems to add null entries in the indexes
for fields that don't exist. These fields then affect sorting. Removing it solves
the issue
To test:
1 - Have an ES setup
2 - Catalog and index some records
3 - View a record in ES:
curl 'localhost:9200/koha_kohadev_biblios/data/4?pretty=yes'
4 - Note there are 'null' entries in the indexes, save this result for
comparison
5 - Apply patch
6 - Reindex, amking sure to delete existing indexes
perl misc/search_tools/rebuild_elastic_search.pl -d
7 - View the record again
8 - Note the null entries are removed
9 - Note indices are otherwise intact
Signed-off-by: David Bourgault <david.bourgault@inlibro.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Fri, 6 Apr 2018 14:59:28 +0000 (14:59 +0000)]
Bug 20122: Explicitly set path to fix emptying cart functionality
This is caused by bib_list not being deleted.
The path was not explicitly set.
This patch adds path=/ explicitly to ensure it
does get deleted.
TEST PLAN
---------
1) search for 'the' in OPAC
2) add several items to cart.
3) look at your cart.
4) empty and close the cart, select all->remove
-- either way window closes and it looks empty.
5) refresh the page
-- cart comes back.
-- in chromium inspecting the page, specifically
the "Application" area, bib_list is shown as
a cookie still.
6) apply patch
7) restart_all and empty cache forcing JS reload
8) repeat steps 1-5
-- this time cart stays empty.
-- and the bib_list cookie is gone
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> using firefox 59.0.2 Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 7 Feb 2018 15:26:53 +0000 (12:26 -0300)]
Bug 20180: [sql_modes] Remove GROUP BY clause in manage-marc-import.pl
Replaced with a distinct.
Fix for:
'koha_kohadev.me.frameworktext' isn't in GROUP BY
t/db_dependent/www/search_utf8.t
NOTE: I added a [% frameworks.count %] into the template file,
and compared master and a branch with this applied when
managing a staged marc import. Values were identical.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Tue, 13 Feb 2018 19:08:25 +0000 (14:08 -0500)]
Bug 20181: Add POD for new plugin
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Tue, 13 Feb 2018 18:50:02 +0000 (18:50 +0000)]
Bug 20181: (follow-up) Ensure test runs
If EnablePlugins was 0, this test before this patch fails.
After this patch, it passes.
TEST PLAN
---------
1) Apply all but this patch
2) Run the following commands
kshell
prove t/Koha_Template_Plugin_KohaPlugins.t
-- two tests fail, if you have the conf or syspref set to 0.
3) Apply this patch
4) Repeat step 2.
-- all tests pass, including the positive and negative case checks.
5) run koha qa test tools
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Mon, 12 Feb 2018 16:15:47 +0000 (11:15 -0500)]
Bug 20181: Unit tests
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Mon, 12 Feb 2018 14:09:20 +0000 (09:09 -0500)]
Bug 20181: Allow plugins to add css and javascript to OPAC
A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template.
Test Plan:
1) Apply this patch
2) Download and install the Kitchen Sink plugin ( v2.1.12 or later )
https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz
3) Install the plugin
4) Restart all the things if you can ( restart_all if you are using kohadevbox )
This will ensure the plugin takes effect right away, it should be
necessary but it won't hurt anything!
5) Load the opac, notice you get an alert message and the background
for your opac is now orange ( assuming you've not customized the
opac in any way )
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Resolve:
ok 33 - Can renew, item is marked not for loan, hold does not block
Can't use string ("1") as a HASH ref while "strict refs" in use at /usr/share/koha/devclone/C4/Items.pm line 557.
Trivial fix. Remove fourth parameter.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Fri, 16 Jun 2017 12:27:29 +0000 (08:27 -0400)]
Bug 18816: Make CataloguingLog work in production by preventing circulation from spamming the log
The system preference CataloguingLog is not recommended for use in
production. This is do to the fact that every checkin and checkout
generates one or more log entires. This seems to be not only bad
behavior, but unnecessary and outside the needs of CataloguingLog as we
have CirculationLog.
Test Plan:
1) Log into staff client
2) Home -> Koha administration -> Global system preferences -> Logs
3) Set only CataloguingLog to 'Log', everything else to "Don't log"
4) Click 'Save all Logging preferences'
5) In MySQL, use your instance DB, and then type 'delete from action_logs;'
6) Have a person checkout and checkin anything.
7) In MySQL, 'select * from action_logs;'
-- there will be data. This is the floodiness that will be removed.
8) Apply this patch
9) Repeat steps 5-7
-- there should be no data.
10) Edit any biblio or item.
11) In MySQL, 'select * from action_logs;'
-- there should be data reflecting the changes made.
12) run koha qa test tools
NOTE: Improved clarity of test plan -- Mark Tompsett
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 5 Apr 2018 13:59:18 +0000 (13:59 +0000)]
Bug 20526: Show and sort by date of request in pending discharges table
This patch adds a "date requested" column to the table of pending
discharges, and updates the DataTables configuration to sort by this
column by default.
The patch also makes some other changes:
- Table information and filtering have been added.
- The "Allow" link has been converted to a Bootstrap-styled buttong with
an icon.
To test, apply the patch and view the table of pending discharge
requests. It should be sorted by default by date requested.
- Confirm that date sorting is correct.
- Confirm that other columns still sort correctly.
- Confirm that buttons look right.
- Confirm that the table information is correct.
- Confirm that the table search form works.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Julian Maurice [Thu, 5 Apr 2018 11:14:39 +0000 (13:14 +0200)]
Bug 20524: Make columns of pending discharges table sortable
Test plan:
1. Enable syspref useDischarge
2. Login to OPAC and ask for a discharge (tab on the left)
3. Login to OPAC with another borrower from another library and ask for
a discharge
4. Login to intranet, you should see a message about pending discharges,
and a link. Click on the link.
5. Confirm that the Patron column is sortable and the Allow column is
not
6. (Optional) You can apply bug 20516 and confirm that the Library
column is sortable too
Signed-off-by: Axelle Clarisse <axelle.clarisse@univ-amu.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Thu, 26 Oct 2017 11:40:04 +0000 (07:40 -0400)]
Bug 11512: Forced holds that violate issuing rules will never be filled
Currently in Koha, if you choose to force a hold from the staff side that would contravened the current issuing rules, that hold will never be filled, as it is always skipped over by CheckReserves.
This patch disallows overrideing except for tooManyReserves which are the only overridden holds that will be trapped.
Test Plan:
1) Apply this patch
2) Attempt to override hold placement, only placements where the patron has too many holds already should be allowed
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 20 Dec 2017 22:10:44 +0000 (19:10 -0300)]
Bug 19712: Fix test mode for delete_records_via_leader.pl
Test plan:
perl misc/cronjobs/delete_records_via_leader.pl
=> Should display a warning
perl misc/cronjobs/delete_records_via_leader.pl --test
=> Should not display a warning and script should not apply changes
perl misc/cronjobs/delete_records_via_leader.pl --confirm
=> Should not display a warning and script should apply changes
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
->find is called on Koha::Object instead of the set class (Koha::Objects)
and raises the following error:
Can't use string ("Koha::Acquisition::Basket") as a HASH ref while
"strict refs" in use at /usr/share/koha/lib/Koha/Object.pm line 275.
This patch also makes sure $basketno refers to an existing basket in DB
I cannot provide a test plan, I have no idea how this code is used.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Wed, 7 Mar 2018 15:39:49 +0000 (15:39 +0000)]
Bug 20350: Add column configuration to table of saved reports
This patch makes changes to the saved reports template to enable a
columns configuration button. Settings for the table have been added to
columns_settings.yml.
To test, apply the patch and go to Reports -> Use saved.
- Confirm that there is a "Column visibility" button in the
table's pagination toolbar.
- Confirm that showing and hiding columns via the button is working
correctly.
- Confirm that the first, second, and last columns cannot be toggled.
Go to Administration -> Columns settings.
- Expand the "Reports" section.
- Find "id=table_reports."
- Make some selections to configure default settings of the reports
table.
- Return to reports and confirm that these defaults are applied.
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Julian Maurice [Wed, 4 Apr 2018 12:08:37 +0000 (14:08 +0200)]
Bug 20516: Show patron's library in pending discharges table
Test plan:
1. Enable syspref useDischarge
2. Login to OPAC and ask for a discharge (tab on the left)
3. Login to intranet, you should see a message about pending discharges,
and a link. Click on the link.
4. Confirm that there is a 'Library' column in the table that is
displaying the patron's library
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Tue, 3 Apr 2018 06:24:56 +0000 (08:24 +0200)]
Bug 20510: Remove unused sub TotalPaid from C4::Stats
Test plan:
0) Do not apply the patch
1) Run git grep TotalPaid and confirm it is only defined and then used once in a test
2) Apply the patch
3) git grep TotalPaid should return nothing
4) prove t/db_dependent/Stats.t should be green
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Alex Arnaud [Wed, 28 Mar 2018 09:03:56 +0000 (09:03 +0000)]
Bug 20261: Fix pagination of the results in authority search
Test plan:
- apply this patch,
- do a search that return more than 20 results,
- click on page 2,
- check that you get results,
- check other pages if possible
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Fridolin Somers [Thu, 13 Oct 2016 07:45:40 +0000 (09:45 +0200)]
Bug 17373: Elasticsearch - Authority mappings for UNIMARC - patch1
This patch starts the UNIMARC mapping for ES.
It is needed to test.
More patches will come.
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Tue, 27 Mar 2018 19:16:16 +0000 (15:16 -0400)]
Bug 20325: C4::Accounts::purge_zero_balance_fees does not check account_offsets
purge_zero_balance_fees is used in cleanup_database.pl to determine which fees can be cleaned up.
It uses a simple SQL query to determine which rows in accountlines need to be removed:
463 my $sth = $dbh->prepare(
464 q{
465 DELETE FROM accountlines
466 WHERE date < date_sub(curdate(), INTERVAL ? DAY)
467 AND ( amountoutstanding = 0 or amountoutstanding IS NULL );
468 }
The function comes with the following warning:
451 B<Warning:> Because fines and payments are not linked in accountlines, it is
452 possible for a fine to be deleted without the accompanying payment,
453 or vise versa. This won't affect the account balance, but might be
454 confusing to staff.
This was a reasonable solution prior to the addition of account_offsets in 17.11. The problem now is that rows in accountlines which are linked as credits in accountlines will *always* have amountoutstanding marked as 0. These are linked to debits via account_offsets. purge_zero_balance_fees will delete credits and leave rows in account_offsets which link to deleted credits.
Sites using the --fees option cleanup_database.pl which upgrade to 17.11 may have all of their credits removed without warning.
Test Plan:
1) Apply this patch
2) prove t/db_dependent/Accounts.t
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Thu, 5 Apr 2018 01:31:38 +0000 (01:31 +0000)]
Bug 20191: Use Test::MockTime to hold time still
The problem is the calls to HTTP::OAI::Header, etc.
may reference gmtime which is continually changing by
the second. By forcing time to lock for all the tests,
except the last one, we can be assured things should
not fail.
TEST PLAN
---------
install libtest-mocktime-perl
apply the patch
restart_all
in kshell, prove t/db_dependent/OAI/Server.t
run koha qa test tools
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Victor Grousset [Fri, 5 Jan 2018 14:03:38 +0000 (15:03 +0100)]
Bug 19953: Record page: acquisition details: add column for invoice
Test plan:
1. create a vendor with minimal info
2. create a basket with minimal info
3. add a item to the basket
4. close the basket
5. receive a shipment
6. on the "receipt summary" click on "receive" for the wanted item (it
should be the only one)
7. items → receive? → tick this checkbox
8. save
9. click on "finish receiving"
10. go to the record → Acquisition details
11. apply this patch
12. refresh the page
13. you should see the new column
Bug 19267: Rancor - Warn before leaving page if record modified
To test:
1 - Open the advanced editor
2 - Make some changes to a record
3 - Click on 'Patrons' or leave the page in some way
4 - Note there is no warning and changes are not saved
5 - Apply patch
6 - Open the advanced editor
7 - Make some changes
8 - Leave the page
9 - Note you get a warning of unsaved changes and can stay on the page
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
In acqui/parcel.pl both the "Pending orders" and "Already received" tables show how many holds there are for the given record. However, the count of holds in the "Pending orders" table confuses librarians because it only lists holds for the particular items in the orderline. Due to that, the holds column may show 0 holds even if there are a dozen record level holds for that bib! This is not what librarians seem to expect, instead it seems that the same total holds in the "Pending orders" table would be preferred.
Test Plan:
1) Find an invoice with an item in the "Already received" table
2) Add one or more record level holds to the record
3) Note the holds column does not count those holds
4) Apply this patch
5) Note the holds column now shows total holds and holds for just those ordered items
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nancy Keener <nkeener@washoecounty.us> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 19812: (QA follow-up) Swap sides for total and item holds
Bug 19812: (QA follow-up) If 0 holds show '0' not '0 / 0'
Bug 19812: (QA follow-up) Remove unnecessary line
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 3 Jan 2018 14:07:17 +0000 (14:07 +0000)]
Bug 19910: Use the delimiter syspref to name download link
To test:
1 - Set delimiter syspref to anything but comma
2 - Download report results as comma separated text
3 - They actually follow the syspref
4 - Apply patch
5 - Download link should now match pref selection
6 - Change pref, note link changes
7 - Verify things still work as expected
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Wed, 17 Jan 2018 19:30:06 +0000 (14:30 -0500)]
Bug 20008: Fix restrictions added from memberentry.pl if TimeFormat is 12hr
Test Plan:
1) Set TimeFormat to 12 hour
2) Add a restriction with an expiration date via memberentry.pl
3) Note the restriction exists, but has no expiration date
4) Apply this patch
5) Repeat step 2
6) Note the restriction exists and has an expiration date!
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 31 Jan 2018 16:47:46 +0000 (13:47 -0300)]
Bug 20115: Make the prefs sortable
If we depend on the order, we should make it sortable.
I let the customization to someone else (we would need an icon to tell
the user it's sortable).
Something does not work here:
If fr-FR and fr-CA is installed, but only 1 is ticked, it will be
considered as last. I do not think it's a blocker as it does not make
really make sense to have it installed but not used (the interface is
also weird, there is a dropdown list with only 1 entry)
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 6 Nov 2017 18:35:50 +0000 (15:35 -0300)]
Bug 19578: Remove MARC punctuation in notices (TT syntax)
Jenkins fails (run 287) on a test in t/db_dependent/Letters/TemplateToolkit.t:
With the historical syntax:
# Your request for an article from tQYRS (c3Av58O0P5xkkIGu) has been canceled for the following reason:
With the TT syntax:
# Your request for an article from tQYRS_ (c3Av58O0P5xkkIGu) has been canceled for the following reason:
The last character of the biblio's title has been removed because it's a punctuation character.
It comes from: C4::Letters::_parseletter
893 $val =~ s/\p{P}$// if $val && $table=~/biblio/;
The same replacement is done for patron's attributes too.
Test plan:
- Confirm that the new tests pass. That should be enough to confirm this change make sense.
Test plan (manual):
- Create a biblio with a title ending with a punctuation (like "with_punctuation_"), or any other fields of biblio/biblioitem
- Generate a notice which will display this field (CHECKIN for instance)
Use the historical syntax and the TT syntax, both should display the title without the punctuation character at the end
CHECKIN historical:
The following items have been checked in:
----
<<biblio.title>>
----
CHECKIN TT syntax:
The following items have been checked in:
----
[% biblio.title %]
----
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Mark Tompsett [Tue, 30 Jan 2018 22:35:39 +0000 (22:35 +0000)]
Bug 20083: (follow-up) use same logic in opac-showmarc
It was correctly pointed out that opac-showmarc would leak
the same way as catalogue/showmarc.pl, and so this patch
moves the authentication step up to the top where it
should be so as to prevent inappropriate data leaks.
TEST PLAN
---------
1) Set your OpacPublic system preference to Disabled
2) Open your OPAC and login
3) Find a biblio with items
4) Go to the opac details, particularly MARC view.
5) Copy the "view plain" shortcut link.
6) log out.
7) Paste the link into the address bar.
-- the information will leak!
8) apply the patch
9) restart_all
10) Refresh the OPAC link
-- log in screen will appear.
11) run koha qa test tools
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andreas Roussos [Fri, 26 Jan 2018 01:12:47 +0000 (14:12 +1300)]
Bug 20083: Information disclosure when (mis)using the MARC Preview feature
The MARC Preview feature in the Staff client (catalogue/showmarc.pl) does not
check whether a user is logged in or not. As a consequence, it can be used to
obtain information that would normally be available to logged-in users only.
For example, you can view any bibliographic record by passing a value to the
'id' argument, but you can also view records as they were imported (normally
done via the 'Staged MARC management' tool).
All three 17.11 installations currently listed at
https://wiki.koha-community.org/wiki/Koha_Demo_Installations
are affected by this issue, as demonstrated by the URLs below:
It should be noted that this only applies to XSLT-enabled installations.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19223: Add methods to correctly handle plugin-generated output
This patch introduces two methods to be used by plugin authors:
->output
->output_html
They are basically wrappers for the helper methods from C4::Output
(output_html_with_http_headers and output_with_http_headers).
Plugin authors can use them, or keep the current flexibility of handling
the headers themselves in their code.
The KitchenSink plugin should be updated to highlight this.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Plugins.t
=> FAIL: The methods are not implemented
- Apply this patch
- Run:
k$ prove t/db_dependent/Plugins.t
=> SUCCESS: Tests pass, and they are meaningful
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 19223: Unit tests for output and output_html methods
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 15:32:55 +0000 (12:32 -0300)]
Bug 19935: Replace GetPendingIssues - Remove the residue
Here we are, no more occurrences of GetPendingIssues, we can remove the
tests and subroutine \o/
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 15:23:42 +0000 (12:23 -0300)]
Bug 19935: Replace GetPendingIssues - SIP
Sounds like we do not need related fields or 'overdue' flag here.
No idea how to confirm there is no regression here.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 15:06:59 +0000 (12:06 -0300)]
Bug 19935: Replace GetPendingIssues - sco-main
Same as previously, we do not need all the prefetched values here, just
a few.
Test plan:
Use the self checkout module to check some items out
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
At first glance we just need the biblio title and the subtitle (in
addition of the fines info), we should not need the prefetch.
Test plan:
Loggin at the OPAC, on the summary page you should see your checkouts
and overdues with the correct values
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 14:47:46 +0000 (11:47 -0300)]
Bug 19935: Replace GetPendingIssues - opac-ics.pl
We only need the biblio title and the barcode, we should not need the
whole prefetch.
Test plan:
On your OPAC summary page export your checkout list using the
"Download as iCal/.ics file" link.
Before and after the patchset, the generated files must be the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We are in the notices part, so we need to fetch all the data to avoid
regressions.
Test plan:
Print a summary slip before and after this patch.
They must be the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Same as previously, we just want Koha::Patron->checkouts->count to know
if a patron has checkouts.
Test plan:
Confirm that you cannot delete a patron's card if they have pending checkouts
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 14:15:02 +0000 (11:15 -0300)]
Bug 19935: Replace GetPendingIssues - Discharges
We should actually use Koha::Patron->checkouts here to avoid the
prefetch.
Test plan:
A patron with checkouts cannot get a discharge
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 14:10:50 +0000 (11:10 -0300)]
Bug 19935: Replace GetPendingIssues - ILSDI
Here we should only access to what we want in the template, but let do
it as it for now.
Test plan:
Hit
/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=542&show_contact=0&show_loans=1
With 42 a borrowernumber with checkouts
Before and after these patches the XML must be the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 18:49:18 +0000 (15:49 -0300)]
Bug 19935: Replace GetPendingIssues - IssueSlip
Luckily we have a good test coverage here!
Test plan:
Print issue slips before and after these patches (with overdues, etc.)
They should be the same.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 18:49:03 +0000 (15:49 -0300)]
Bug 19935: Add Koha::Patron->pending_checkouts
To move this subroutine out of the C4 namespace we face the same
problematic as bug 17553 (with GetOverduesForPatron).
We need to provide an equivalent method and so return all the related
value for a given checkout.
We can acchieve the easily using Koha::Object->unblessed_all_relateds,
but we need to keep in mind that it is a temporary move.
Indeed we will want to use our API to only access/retrive values we really need.
The whole trick could be removed when the current syntax for notices
will be deprecated and removed.
Note: this method returns the same number of elements than ->checkouts
They indeed returns the same things, but it sounds better to me to have a
different method to highlight (from the callers) where does it come
from (C4::Members::GetPendingIssues).
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 16:19:51 +0000 (13:19 -0300)]
Bug 17553: Move GetOverduesForPatron to Koha::Patron->get_overdues
With the help of Koha::Object->unblessed_all_relateds we are going to
replace GetOverduesForPatron without introducing regressions (hopefully)
on both template notice syntaxes.
Test plan:
0/ Do not apply any patches
1/ Check some items in to a given patron, with and without overdues.
2/ Print the overdues slip (Circulation module > Print > Print overdues)
3/ Apply these patches
4/ Print again and compare the result
=> The 2 generated slips must be exactly the same
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 4 Nov 2016 10:23:56 +0000 (10:23 +0000)]
Bug 17553: Move existing tests
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 16:48:28 +0000 (13:48 -0300)]
Bug 19926: Add tests for Koha::Object->unblessed_all_relateds
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 8 Jan 2018 16:19:16 +0000 (13:19 -0300)]
Bug 19926: Add the Koha::Object->unblessed_all_relateds method
In order to refactor our legacy code step-by-step, we will need to
provide code with the exact same behaviors and then improve it.
The same idea appears for the TT syntax for notices: we will want to
deprecate the existing syntax in order to support only one syntax.
Currently we fetch all the values from the related tables, without
knowing which are actually used.
I am suggestion to introduce a Koha::Object->unblessed_all_relateds
method which will return a hash containing all the fields from the
related tables (with the problems we know: collision in column names).
It is the existing behavior of GetOverduesForPatron and GetPendingIssues
for instance, they are used to send notices and so we have to provide
all the data needed.
See dependent bugs to understand the context and test this patch.
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>