koha.git
5 years agoBug 20509: Search for not defined authority codes
Jonathan Druart [Wed, 27 Jun 2018 18:35:57 +0000 (15:35 -0300)]
Bug 20509: Search for not defined authority codes

This patch adds a new check in
misc/maintenance/search_for_data_inconsistencies.pl to search for not
defined authority codes.

Test plan:
Set some auth_header.authtypecode to not defined authority codes in Koha
(UPDATE auth_header SET authtypecode="XXX" WHERE authid=42;)
Then run `misc/maintenance/search_for_data_inconsistencies.pl`

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9558a118dacd74b77c27f63fc41611945aeff052)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c2387c58f1a4d2ed2fd1180957871634ae5f93ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21011: (follow-up) Fix pod, fix missing homebranch condition, change mode to...
Josef Moravec [Wed, 27 Jun 2018 20:27:09 +0000 (20:27 +0000)]
Bug 21011: (follow-up) Fix pod, fix missing homebranch condition, change mode to executable

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5892ab07118b04a8071b49c40b441df326e15f07)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5ec194dfa9a1198bf5578bd3c7fac613da529f3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21011: Search for items with not defined homebranch and/or holdingbranch
Jonathan Druart [Wed, 27 Jun 2018 18:32:56 +0000 (15:32 -0300)]
Bug 21011: Search for items with not defined homebranch and/or holdingbranch

From bug 5789: scripts can fail if items.homebranch and/or
items.holdingbranch is not defined

This script will help people catching these migration issues.

Test plan:
Update your items table to set some homebranch or holdingbranch to NULL
Run this script
It will display the different items with not defined values in these
fields.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7d47bb311827298ddc30297bbd388e8f8905db48)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b5b74454cd0c5f8cb5b46ac60ca94b37e1503fc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20631: Remove unused RemoveLostItem from C4::Accounts
Katrin Fischer [Wed, 8 Aug 2018 20:34:32 +0000 (20:34 +0000)]
Bug 20631: Remove unused RemoveLostItem from C4::Accounts

RemoveLostItem was 'used' in C4::Accounts, but is not
actually used there.

Call has been removed by
  commit ed9cf81c3aa8fd82f9347556364e9d2e6cef8a82
  Bug 15896 - Use Koha::Account::pay internally for makepayment

To test:
- Verify that the routine was actually not used!

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ccfa48f6ee8ec44d1621874383b10f68d939f34)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8b1944bbd876d2928536b0c457922eb71e9aa54b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20504: Fix lang attribute in html tag on systempreferences page
Katrin Fischer [Thu, 9 Aug 2018 17:46:09 +0000 (17:46 +0000)]
Bug 20504: Fix lang attribute in html tag on systempreferences page

On the system preferences page the lang attribute of the
html tag is always empty.

To test:
- Go to systempreferences
- Check the html source and look at the html tag,
  it should read: <html lang="">
- Apply patch
- Check the html source again: <html lang="en">
  Verify the language code shown matches the currently
  selected language in the staff interface
- Verify the language system preferences work correctly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The problem was actually that
  $lang = $template->param( 'lang' );
should certainly be $lang = $input->param( 'lang' );
and, as it, it overrides the value of 'lang' passed from C4::Auth

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 56c50a66169f956584050a8630a71cfa7d5984cb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 32b01b264277a77dbb79133f5af8eeecbe64d997)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 7996: (QA follow-up) Remove unnecessary permission check view logs template
Katrin Fischer [Mon, 20 Aug 2018 07:04:37 +0000 (07:04 +0000)]
Bug 7996: (QA follow-up) Remove unnecessary permission check view logs template

Permission is checked in the perl file, no need to check again
in the template.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3484db7187ca4ca62a617d9362b8c64c37f60cfd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1aa841e1ed21dc300dc188aa76fd57b33044c95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 7996: Correct wrong permissions for modification log
Nick Clemens [Fri, 17 Aug 2018 11:07:41 +0000 (11:07 +0000)]
Bug 7996: Correct wrong permissions for modification log

To test:
 1 - Create a staff patron with catalogue,borrowers,and view_system_logs
     permissions
 2 - Log in using that patron
 3 - Go to tools
 4 - Click 'Log viewer'
 5 - You get a blank page
 6 - View borrower circ screen, note you do not see 'Modification log'
 7 - Edit a borrower, note you do not see 'Modification log'
 8 - Apply patch
 9 - 'Log Viewer' should now load correctly
10 - You should see 'Modification log' tab during circ
11 - You should see 'Modification log' tab when editing patron

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>
(cherry picked from commit a750ebdbd994ef2a793e632eea4e35bbc7f1ec6d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8b3095f7d533bd2151d710085259f29349faf5b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19511: Local cover images not centered in table column in staff client search...
Owen Leonard [Thu, 26 Jul 2018 15:36:24 +0000 (15:36 +0000)]
Bug 19511: Local cover images not centered in table column in staff client search results

This patch modifies the JavaScript which embeds local cover images in
staff client catalog search results. It now adds the "thumbail" class to
the image, matching Amazon cover images.

To test you should have one or more titles with local cover images
attached. Apply the patch and clear your browser cache if necessary.

Enable both the AmazonCoverImages and LocalCoverImages system
preferences and perform a search which will return titles with local
cover images. Confirm that local covers are styled like Amazon covers.

Tested and confirmed local cover images are appearing quite nicely now.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit afa51869c39e1a450314a6d13098571566cc241c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 683589ec9556d65c9995125c962ce7c471495937)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21144: DBRev 17.11.09.002
Nick Clemens [Tue, 21 Aug 2018 11:49:55 +0000 (11:49 +0000)]
Bug 21144: DBRev 17.11.09.002

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit df06587b763de2acd2d4e1afa3da8ad1841f7577)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4ee626a6f362bbf96342613b7f64f1b0e3b2503e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21144: Add ROADTYPE to default authorised values categories
Katrin Fischer [Thu, 2 Aug 2018 00:19:42 +0000 (02:19 +0200)]
Bug 21144: Add ROADTYPE to default authorised values categories

The ROADTYPE category was missing from the default list of
authorised value categories available.

To test:
- Verify ROADTYPE is not listed as authorised value category
- Apply patch and run database update
- Verify ROADTYPE is now listed
- Add an entry, for example: AV = Avenue
- Add or edit a patron, verify a pull down with your entry
  shows on the form.

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>
(cherry picked from commit 266d7b5fa844b512cf68f4b08d6c07474c2ccc42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c099d4360060829a230eeb243333182346d3d59)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21142: Open uploaded files in utf-8 - batch mod/del
Jonathan Druart [Fri, 17 Aug 2018 15:07:55 +0000 (12:07 -0300)]
Bug 21142: Open uploaded files in utf-8 - batch mod/del

Batch item/record modification/deletion tools does not open uploaded
files in utf-8

Test plan:
Edit and delete records and items using a file which will contain:
valid and invalid barcodes with and without utf-8 chars (💕)

You should see the warning message:
 "The *** 39999000💕001679 does not exist in the database."

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>
(cherry picked from commit f5f31679bf260d17e996fbe8e2e77f695ac7ddfc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0d7ba4634ad795703cbb97e371e07ae9252a6c53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21238: Prevent TemplateToolkit.t to fail on slow servers
Jonathan Druart [Thu, 16 Aug 2018 15:29:43 +0000 (12:29 -0300)]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers

It failed 3x in the last 6 runs (on node 1), we should mock
DateTime->now to prevent it to fail again.

The error is:
koha_1       |         #   Failed test at
t/db_dependent/Letters/TemplateToolkit.t line 724.

When comparing <<today>> replacement:
koha_1       |         # 08/16/2018 14:25<br />
[...]
koha_1       |         # 08/16/2018 14:24<br />

Let's mock DateTime->now to prevent it to fail again.

Test plan:
0. Do not apply this patch
1. Add "sleep(60);" at line ~715, before "# Add a second checkout"
2. Run the tests
=> Fail!
3. Apply this patch
4. Run the tests again
=> Pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d24d77d495a56e76046907ab19e9474cab28169c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fba97f0772ad6fd40b359e626ce9fb82f3d92182)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21230: Prevent Reserves.t to fail randomly
Jonathan Druart [Wed, 15 Aug 2018 15:21:38 +0000 (12:21 -0300)]
Bug 21230: Prevent Reserves.t to fail randomly

The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass

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>
(cherry picked from commit c957b52ef8bba734043157445470bedc36feae5e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c359d56f25a0b346b71a3fd8700b07e4713640d7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20795: Inform the user about this change, add to pod
Jonathan Druart [Wed, 1 Aug 2018 14:22:14 +0000 (11:22 -0300)]
Bug 20795: Inform the user about this change, add to pod

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e97f6ab9be6108cbe4d61ea8dd4b876527bd67ba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40bfb7913da164f03ff44956218a8e314f87aeba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20795: Pass incrreased verbosity to zebra rebuild script
Nick Clemens [Sun, 20 May 2018 14:44:45 +0000 (14:44 +0000)]
Bug 20795: Pass incrreased verbosity to zebra rebuild script

To test:
1 - Run koha-rebuild-zebra with multiple '-v'
2 - Note no increased verbosity
3 - Apply patch
4 - Run the updated koha-rebuild-zebra script with multiple '-v'
5 - Note increased verbosity

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1dfb177d3fff713185bcb0aa86517ef40629fedc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dbdd2b56303be0fab287d861dbd9007bf554f9d8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21164: Fix alignment on new basket form in acquisitions
Owen Leonard [Mon, 6 Aug 2018 18:15:10 +0000 (18:15 +0000)]
Bug 21164: Fix alignment on new basket form in acquisitions

This patch removes some unnecessary "&nbsp;"'s from the template for
creating a new basket in acquisitions. This fixes the alignment on the
form fields.

To test, apply the patch and go to Acquisitions -> Vendor -> New basket.
All the form fields should be correctly left-aligned with each other.

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 2280877fdd9685aecff0b144319ca3bffc39b78a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5fe28bf39877440025e2a7ee1b2db1054be47852)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21185: Incorrect title tag on tags review page
Owen Leonard [Wed, 8 Aug 2018 16:45:28 +0000 (16:45 +0000)]
Bug 21185: Incorrect title tag on tags review page

This patch corrects the title tag on the tags review page.

To test, apply the patch and go to Tools -> Tags. The page title
(probably shown in the browser tab) should start with "Koha ->" instead
of "Home ->".

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ad0f90b797c77b853ff61501310892282f582988)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 718af573c158412e1dc24308d2e1129b70cef861)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19390: Make jQuery selector more specific, so OPAC view link can open in new tab
Katrin Fischer [Fri, 10 Aug 2018 17:18:39 +0000 (17:18 +0000)]
Bug 19390: Make jQuery selector more specific, so OPAC view link can open in new tab

The OPAC view link in the staff result list already had a target="_blank",
but it didn't work, because of the JavaScript for the result list browser
in staff.

The JavaSript code was looking for the links to the detail page in staff
and this also selected the link to the detail page in OPAC. By changing
detail.pl to \detail.pl opac-detail.pl will no longer be selected.

To test:
- Search in the staff interface
- Click "OPAC view" links in staff result lists
- Click "OPAC view' links in detai page
- Verify both now open in a new tab
- Click other links and test that navigation (previous, next,
  return to results) works as expected
- Inside the staff client, you should see something like
  searchid=scs_1533922927978 added to the URLs

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 880afc9035c752bb6fbea0ad5505d8730462ce2c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bed533eb345b91cb9e0e019a37ebb201dcb94726)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 18635: Koha::Patron->guarantees() should return results alphabetically
Nick Clemens [Fri, 19 May 2017 01:08:22 +0000 (21:08 -0400)]
Bug 18635: Koha::Patron->guarantees() should return results alphabetically

To test:
1 - Add the same guarantor to a number of patrons, ensuring random order
alphabetically
2 - View the guarantors record, note unordered list of guarantees
3 - Apply patch
4 - Guarantees are alphabetical

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fe6cb85c5580b582a0047769d88be23757df0ef5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 74a2565c99dc92e390950c7ce340202efba2161c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21033: Remove few warns in acqui/basket.pl
Marcel de Rooy [Tue, 3 Jul 2018 13:52:05 +0000 (15:52 +0200)]
Bug 21033: Remove few warns in acqui/basket.pl

Resolve (line numbers based on 16.11.x):
Use of uninitialized value in hash element at acqui/basket.pl line 337.
Use of uninitialized value in hash element at acqui/basket.pl line 338.
Use of uninitialized value in hash element at acqui/basket.pl line 340.
Use of uninitialized value in hash element at acqui/basket.pl line 342.
Use of uninitialized value in hash element at acqui/basket.pl line 344.

Argument "" isn't numeric in multiplication (*) at koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt line 486.
Argument "" isn't numeric in multiplication (*) at koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt line 591.

Test plan:
If you have older acq data, you may have records in aqorders with field
tax_rate_on_ordering is NULL. These orders will trigger the above warns.
If you do not have, you could simulate by setting this field to NULL.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit af82a1d59709d02b767613539146b59fa10c3ab3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9a6ed1c852c00644349597e59a369bef5a19d9a1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21035: Handle new lines when running reports
Jonathan Druart [Wed, 4 Jul 2018 18:05:25 +0000 (15:05 -0300)]
Bug 21035: Handle new lines when running reports

See https://metacpan.org/pod/Text::CSV_XS#Embedded-newlines

Test plan:

1) Choose two items, say barcode '123' and '456'
2) Change the public note on 123 to read

Line1
Line2

(I.e. type 'Line1', then press Enter, type 'Line2' and click update).
3) Change the public note on 456 to read

Public note has one and only one line.

Click update.
4) Create a report with the followng query:

select barcode, itemnotes from items where barcode in ( '123', '456' )

Let's say that this is report number 10.

5) run ./misc/cronjobs/runreport.pl --format=csv REPORT_ID:

=> You should see both lines

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f16fb888f132703063f0591e329d72d065f4b1d9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4fd18a7df711f5a59f459234ec186b175ee05eb6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21131: Remove the TinyMCE.isDirty() check that caused unexpected behaviour
David Cook [Mon, 30 Jul 2018 04:35:40 +0000 (14:35 +1000)]
Bug 21131: Remove the TinyMCE.isDirty() check that caused unexpected behaviour

When using the WYSIWYG editor for system preferences, the editor only
updates the textarea element if the content is different from the
original content. This means if you change a system preference and
then change it back to the original content, the textarea will have
the 2nd last change you made.

This patch removes the TinyMCE.isDirty() check, which was responsible
for comparing the original and changed content. Every input/keydown/dragend
or TinyMCE command will cause the textarea element to be updated and
trigger the input event which causes the "modified" class to be added
to the element, so that the system preference can be saved.

__TEST PLAN__

_Before applying_
0. Change "UseWYSIWYGinSystemPreferences" to "Show"
1. Change "opaccredits" to "123a"
2. Click "Save all OPAC preferences"
3. Reload the page
4. Change "opaccredits" to "123"
5. Change "opaccredits" to "123a"
6. Click "Save all OPAC preferences"
7. Reload the page
8. Note that "opaccredits" says "123"

_Apply the patch_

_After applying_
1. Change "opaccredits" to "123a"
2. Change "opaccredits" to "123"
3. Click "Save all OPAC preferences"
4. Reload the page
5. Note that "opaccredits" says "123" (and not "123a")
6. Change "opaccredits" to "1234"
7. Click "Save all OPAC preferences"
8. Reload the page
9. Note that "opaccredits" says "1234"

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>
(cherry picked from commit f4cf075fbea353a5cbf11aaead37c92eac8179b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1dfa4318262a908b1df9d8d2454c15a39c84416c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19291: Make breadcrumbs for OPAC search history consistent with other patron...
Owen Leonard [Fri, 27 Jul 2018 17:22:54 +0000 (17:22 +0000)]
Bug 19291: Make breadcrumbs for OPAC search history consistent with other patron account pages

This patch adds the logged-in patron's name to the search history page's
breadcrumb navigation.

To test, apply the patch and view the OPAC search history page with no
user logged in. The breadcrumbs should read:

- Home ->  Search history

Log in and return to the search history page. The breadcrumbs should
read:

- Home -> Owen Leonard -> Your search history

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=21137

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ff3987c023a658e63e46ea8601666916287c8ec5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fe9888e1ab5aa67c4b52efb1dbca5290e9c3dfd7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21056: Add another flush later
Jonathan Druart [Tue, 31 Jul 2018 15:14:54 +0000 (12:14 -0300)]
Bug 21056: Add another flush later

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5abcd3312adc02a14465a0781f735b8494d60f42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 88a2c8886c4cf37e6dff00cffd26674d6ac548e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21056: Changing the logged in library can fail sporadically
Kyle M Hall [Mon, 9 Jul 2018 18:05:29 +0000 (14:05 -0400)]
Bug 21056: Changing the logged in library can fail sporadically

We are getting reports that sometimes changing the logged in library via selectbranchprinter.pl sometimes appears to fail. Flushing the session after updating the branch appears to fix this.

Test Plan:
1) Change your logged in library repeatedly. Hopefully ( sort of ) it will fail to change.
   You may want to try various browsers.
2) Apply this patch
3) Note the change no longer fails

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 76a06a7050643add32f4cbccbdc2fb00f66f5485)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0a5dabc27174d5b77783f81c59248f5da8b37c79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21148: Dropdowns styled by the Select2 plugin do not highlight missing required...
Owen Leonard [Thu, 2 Aug 2018 13:46:31 +0000 (13:46 +0000)]
Bug 21148: Dropdowns styled by the Select2 plugin do not highlight missing required fields

This patch adds some CSS to target mandatory fields on the add item
screen which are styled by the Select2 plugin.

To test you must have at least one item field marked mandatory and
linked to an authorized value.

Open the add item form for an existing record. Try to submit the form
without making a selection in the mandatory dropdown. You should get an
alert warning you that you have empty mandatory fields, and the field
should be highlighted in yellow.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 62aacb5865719e27224bf8f1963de1888d2ca05d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9bb74effa31053c685902df48714a61c18d3c6d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21075: Unit tests
Nick Clemens [Fri, 13 Jul 2018 15:13:31 +0000 (15:13 +0000)]
Bug 21075: Unit tests

prove -v t/db_dependent/Reserves/AutoUnsuspendReserves.t

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6e5865ee4feaca3ca5575ce45d11fc88d88dc43d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 77f2da8fb26e68fa87d2858fc1dfc9f223e24821)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21075: AutoUnsuspendHolds should unsuspend holds <= today
Nick Clemens [Fri, 13 Jul 2018 14:45:55 +0000 (14:45 +0000)]
Bug 21075: AutoUnsuspendHolds should unsuspend holds <= today

To recreate:
 1 - Place a hold in your system
 2 - Set that hold (or all holds) to expire today
    update reserves set suspend_until=CONCAT( CURDATE()," 00:00:00");
 3 - Run misc/cronjobs/holds/auto_unsuspend_holds.p
 4 - Note the hold is sitll suspended
 5 - Visit /cgi-bin/koha/reserve/request.pl for the book with the hold
 6 - Note the suspend date is tomorrow (and cannot be set to today]
 7 - Click update holds - the date in db is now set to tomorrow
 8 - Reset to today
 9 - Apply patch
10 - Run the cron again
11 - Visit the page and note hold is unsuspended

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit c0f7aed84d663029b2f1b37ce0391b5a40b10b97)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9e67cff276297fe52e2f8c58ab559758ad5043f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21139: (follow-up) Floating toolbars - Remove unecessary height
Jonathan Druart [Wed, 15 Aug 2018 17:21:47 +0000 (14:21 -0300)]
Bug 21139: (follow-up) Floating toolbars - Remove unecessary height

Found where QAing bug 20935, we actually want the hidden toolbar to be
the exact same height as the visible one.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 592905a4d2d41a1a7b757c48fbac8fc6f025bf9b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 514939a8046cb82a66cfb3966a14020e846face3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21139: No table in toolbar
Jonathan Druart [Wed, 1 Aug 2018 16:18:47 +0000 (13:18 -0300)]
Bug 21139: No table in toolbar

We do not need this selector, we will not have a table in the toolbar

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>
(cherry picked from commit 40577065b60ab87330f1fc0c3e6bbe52f2373e6c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 71adb4380c101b10ddbda95be32806052e75d0d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21139: Floating toolbar - Resize toolbar on window resize
Jonathan Druart [Wed, 1 Aug 2018 15:34:29 +0000 (12:34 -0300)]
Bug 21139: Floating toolbar - Resize toolbar on window resize

Prior to this patch the toolbar was not resized when the window was
resized

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>
(cherry picked from commit 5ecf4da7d49357832b77ee087d968e071ab46b93)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5eecc789af216e56638525961a8c25dd9677c9db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21139: Floating toolbar - Remove horizontal scrollbar on resize
Jonathan Druart [Wed, 1 Aug 2018 15:31:01 +0000 (12:31 -0300)]
Bug 21139: Floating toolbar - Remove horizontal scrollbar on resize

To test:
- add/edit a patron
- resize the window
=> Without this patch a horizontal scrollbar appears when resized
shorter

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>
(cherry picked from commit b5520f3e019f38cbd2ea75be0a13806f68a2f515)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 106ad2d6f01e6bdcf79b54791a437ae31746a059)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21139: Floating toolbars - Remove unecessary height
Jonathan Druart [Wed, 1 Aug 2018 15:28:54 +0000 (12:28 -0300)]
Bug 21139: Floating toolbars - Remove unecessary height

This patch remove some pixels under the toolbar, they were used by the
hidden element.

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>
(cherry picked from commit 2588811ef249f0996527e952e4ef5307c1834a71)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3d0d2a35585b6563148178d41545db09dcc8c007)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21139: Floating toolbar - Remove dup id
Jonathan Druart [Wed, 1 Aug 2018 15:28:37 +0000 (12:28 -0300)]
Bug 21139: Floating toolbar - Remove dup id

We should not have twice the same id, we always use fixFloat() on an
element with an id and then duplicate this element.
The id must be changed (just in case)

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>
(cherry picked from commit 77196e91402cdb59242f80e596f1812d238923c2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit af2ccb13e3001f388a320a0619e22871429e09b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21099: Reposition floating toolbars earlier
Jonathan Druart [Fri, 20 Jul 2018 15:59:16 +0000 (12:59 -0300)]
Bug 21099: Reposition floating toolbars earlier

To recreate:
- Go to the advanced search form
- scrolldown to position the toolbar on top of the window
- scrollup

https://screenshots.firefox.com/NnkFg3iOXqLPxfkd/pro.kohadev.org

The toolbar should have been repositioned earlier

Test plan:
Edit a patron
- scrolldown
- scrollup
- unfold the form in the header (tab "Search patrons", link "[+]")
- scrolldown
- scrollup
Advanced search
scrolldown
scrollup

You should notice the difference with and without this patch

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 68e735b10151d7b70187fa7f9d4ecb2b94b34e6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0d349fba89697bf58d86a9b26d8ebc385d1a8417)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21048: (QA follow-up) Fix authorized value statuses in filter
Marcel de Rooy [Fri, 27 Jul 2018 07:42:06 +0000 (09:42 +0200)]
Bug 21048: (QA follow-up) Fix authorized value statuses in filter

If you select an authorized value status in the filter, you want to keep
it too just like normal statuses as CHECKED.
The variable selected_status was not filled. The minimal fix is adding that
template variable in the script. Note that suggestion.STATUS is out of scope
within a loop using suggestion as loop var.

Note: Adding a regular status like CHECKED as an authorized value with
same code but another description works, but is kind of confusing ;) Not
in the scope of this report though.

Test plan:
Select an authval status in the filter. Apply the filter and verify again
that it is still selected under Suggestion information.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b1e8193a84a8df6d70ad8de16dadb8c4301a706b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f5121183d9049a82645797e18028d600e11a2476)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21048: Fix display of suggestion's status (SUGGEST_STATUS)
Jonathan Druart [Wed, 11 Jul 2018 21:23:49 +0000 (18:23 -0300)]
Bug 21048: Fix display of suggestion's status (SUGGEST_STATUS)

When a suggestion's status is set to a customized value (AV
SUGGEST_STATUS), the description is not always displayed correctly.

Test plan:
- Create different values for the AV SUGGEST_STATUS
- Create several suggestions
- Change the status using the SUGGEST_STATUS values
- Edit the suggestion and change again the status
- View the suggestions for a given patron
(members/purchase-suggestions.pl?borrowernumber=XX), the statuses must
displayed correctly

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b25c063f950076234cf7bb4a496921983a7cc23f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e81fdb07c68fb80bc497190dfd2dd15f24491447)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21031: Apache Rewrite rules don't work for API when using anything but Debian...
David Cook [Tue, 3 Jul 2018 09:04:50 +0000 (19:04 +1000)]
Bug 21031: Apache Rewrite rules don't work for API when using anything but Debian package Plack configuration

The Rewrite rules for Apache don't work unless you're using
debian/templates/apache-shared-opac-plack.conf or
debian/templates/apache-shared-intranet-plack.conf.

This patch fixes the Rewrite rules for the non-Plack Debian
Apache configuration templates as well as the standard
Apache configuration file that comes with Koha.

__BEFORE APPLYING__
1. Visit /api/v1/app.pl/api/v1/spec on your git dev install
2. This should display a large page of JSON
3. Visit /api/v1/spec on your git dev install
4. This should generate a 404 error

__APPLY PATCH__

__AFTER APPLYING__
5. Visit /api/v1/app.pl/api/v1/spec on your git dev install
6. This should display a large page of JSON
7. Visit /api/v1/spec on your git dev install
8. This should display a large page of JSON (identical to
the one from earlier steps)

Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA with few notes posted separately to Bugzilla.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c6b50f0bac092779f93033c8a3f002cb8722d7d4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 11b6ad197ab279aca89944001a9751a492bdb573)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21094: Syndetics: always use https instead of http
Owen Leonard [Thu, 19 Jul 2018 16:57:42 +0000 (16:57 +0000)]
Bug 21094: Syndetics: always use https instead of http

This patch removes the 'using_https' check in OPAC templates in calls to
Syndetics resources. Instead, https is always used.

To test, apply the patch and enable Syndetics-related preferences. View
the following pages in the OPAC:

- Bibliographic detail page
  - Browse shelf section of the bibliographic detail page
- Search results
- List contents
- Recent comments
  - Recent comments RSS
- User summary page
  - Circulation history

NOTE: I tested with made-up Syndetics credentials. This means my changes
didn't make the template explode, but it doesn't confirm conclusively
that the resources work.

Signed-off-by: John Doe <you@example.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e0548cc1a7a924731bd414fec2f7917f044040a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 40cf253a0df46613340b301a8ce600de2e680a1c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21077: Fix database documentation for statistics.type
Katrin Fischer [Sun, 15 Jul 2018 17:27:03 +0000 (19:27 +0200)]
Bug 21077: Fix database documentation for statistics.type

There's a typo for 'locause', this should be 'localuse'.
Also, 'Credit*' is never used.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0b89cbf6a473e71597bc051d88c2152531648ad8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dc490f7d86c182047a55f875d0db9081fe974996)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21134: Correctly throw the exception in Koha::Patron::Modification->approve
Jonathan Druart [Tue, 31 Jul 2018 15:43:54 +0000 (12:43 -0300)]
Bug 21134: Correctly throw the exception in Koha::Patron::Modification->approve

koha_1       |     # Looks like you planned 20 tests but ran 9.
koha_1       |
koha_1       | #   Failed test 'approve tests'
koha_1       | #   at t/db_dependent/Koha/Patron/Modifications.t line
259.
koha_1       | [Something went wrong]# Looks like your test exited with
255 just after 5.
koha_1       | [21:13:47] t/db_dependent/Koha/Patron/Modifications.t
.....................

"Something went wrong" should never been thrown,
Koha::Patron::Modification->approve raises $@, but it's not defined, it
should raise $_ instead

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e99cfbca7e904b7664163838a334c487c94e462)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c6133753ed661902a9ec3cce14190c7d3d683ef0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21097: Missing optgroup closing tag in orderreceive.tt
David Cook [Fri, 20 Jul 2018 08:13:49 +0000 (18:13 +1000)]
Bug 21097: Missing optgroup closing tag in orderreceive.tt

There is a missing optgroup closing tag in orderreceive.tt. It doesn't
actually cause any display issues (at least in modern browsers), but
it's invalid markup, so this patch fixes it.

_TEST PLAN_
0. Add a budget and add a fund
1. Add a vendor
2. Add a basket
3. Add an order to a basket
4. Close the basket
5. Receive the order
6. Make sure the budget and fund both display when selecting the fund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 12e18f91be2a26501fba502d5f1106d66b06caee)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 881781240cf0c1a487da1d05732dab300d6e1be7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20974: Remove files left behind after removing Solr
Owen Leonard [Thu, 21 Jun 2018 13:37:35 +0000 (13:37 +0000)]
Bug 20974: Remove files left behind after removing Solr

Some files were left behind when Bug 12538 removed support for Solr.
This patch removes them.

To test, apply the patch and fail to observe the existence of these
files:

koha-tmpl/opac-tmpl/bootstrap/en/includes/search/facets.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/search/page-numbers.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/search/resort_form.inc

Perform a search in the OPAC to confirm that nothing broke.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ad34ef74cdee0f204c03cdf88b1db775768a44fe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 517827fb9c2e69d58d8e9345ba2d259de08efded)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21064: Use undefined instead of undef
Nick Clemens [Thu, 12 Jul 2018 10:18:10 +0000 (10:18 +0000)]
Bug 21064: Use undefined instead of undef

To test:
1 - Load the advanced cataloging editor
2 - Refresh the page several times
3 - Check the JS console, you shoudl see an error:
    'undef is not defined'
4 - Apply patch
5 - Try again, should be no error

Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 367f47c416fa9164ccb8d9e5f50772e5a516d6b7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f60c611972fe0442ee66f6ebf3a40f00bd11efcc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21053: Encode URI characters in plugin 008
Jonathan Druart [Wed, 11 Jul 2018 21:55:06 +0000 (18:55 -0300)]
Bug 21053: Encode URI characters in plugin 008

A # (or &) at any position in 008 field of a bib record causes
all subsequent data in field to be overwritten with default values when
record is saved.

These characters need to be correctly encoded before being passed as
parameters of the url

To reproduce:
1. Find and edit a bib record which has an 008 which differs from the
default values for the MARC framework
2. Choose 008 helper
3. Add # in any position before the end of the field noting the current
values of the data
4. Save record
5. Edit record and select 008 helper
6. Review characters after #

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit bfdf896111849454ade806bf49f48f1de5f626be)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 512ee5d57617c63da90be09268a77a0317c9e886)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21076: Don't call autocomplete code after patron found
Nick Clemens [Fri, 13 Jul 2018 17:49:14 +0000 (17:49 +0000)]
Bug 21076: Don't call autocomplete code after patron found

To test:
1 - Enable article requests
2 - Search on staff client
3 - Click 'Request article'
4 - Find a patron
5 - View error in console
6 - Apply patch
7 - Reload
8 - Not error is gone

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5a9bad787458411c790d26b3b115fe3e7e2e0ab2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 50f4e8635056d7b664b846db91d48bf282fef949)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20564: Don't use system to unzip files
Nick Clemens [Tue, 10 Jul 2018 13:48:07 +0000 (13:48 +0000)]
Bug 20564: Don't use system to unzip files

To test:
1 - Setup a zip file for patron images and cover images
2 - Test each tool
3 - Get a '500 error' after upload (note images do upload and attach)
4 - Apply patch
5 - Restart all the things
6 - Test agtain, uploads should complete and results display

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8b806227c130e86712e3e5bda61520447c60671d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0f45f3afdf67193ec849f72955b6de4fbeb17db0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21285: Add missing select2x2.png file
Tomas Cohen Arazi [Wed, 29 Aug 2018 16:46:39 +0000 (13:46 -0300)]
Bug 21285: Add missing select2x2.png file

This file is part of the Select2 jquery plugin, but wasn't added when
the use of the plugin was introduced in Koha.

To test:
- On a high DPI screen (retina mac?) on Chrome or Safari
- Edit an item
=> FAIL: dropdowns using Select2 (like 'Shelving location') don't display the icons (down arrow and cross) and a default value is wrongly selected
=> FAIL: the inspector says the requested select2x2.png file returned a 400 error.
- Apply this patch
- Reload the edit page
=> SUCCESS: Things display correctly! Dropdowns without selected values
by default!
=> SUCCESS: No errors fetching select2x2.png
- Sign off :-D

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 235654a3cfa5b6e323489408ddc7875281bb1f50)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 637469974c3290a43ac259642df0fefdfe2d369f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20800: Keep Koha on Stretch from using broken libhttp-oai-perl
Mirko Tietgen [Tue, 22 May 2018 10:32:19 +0000 (12:32 +0200)]
Bug 20800: Keep Koha on Stretch from using broken libhttp-oai-perl

libhttp-oai-perl in Stretch is 4.03 and broken. Koha depends on
libhttp-oai-perl << 4 for that reason. To make the installation of Koha
on Stretch as easy as possible, this patch adds the alternative
libhttp-oai-3.27-perl which we provide in the Koha repository.

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>
(cherry picked from commit 56813f5c90827df0fd89262917e7f9920f7d9175)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20437: Update debian/control
Mirko Tietgen [Tue, 15 May 2018 17:23:25 +0000 (19:23 +0200)]
Bug 20437: Update debian/control

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9b31bc2d27c6e045a6e7ea079778c47674c135db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20437: Force the dependency on HTTP::OAI < 4.0
Tomas Cohen Arazi [Fri, 16 Mar 2018 18:22:47 +0000 (15:22 -0300)]
Bug 20437: Force the dependency on HTTP::OAI < 4.0

Until HTTP::OAI is patched so it actually works, and bug 17704 fixes the API change Koha-side, we need to explicitly pull the right version. Otherwise people using Debian 9+ derived distros (Ubuntu 16.04+) are seeing production issues.

This implies packaging our custom libhttp-oai-perl distribution in the meantime.

This patch makes Koha require a version lower than 4.0.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 05ebfaf0c04cce35933f81e48de95b307da1c325)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20770: ILL loans OPAC form notes field allow arbitrary input
Andrew Isherwood [Tue, 15 May 2018 15:00:02 +0000 (16:00 +0100)]
Bug 20770: ILL loans OPAC form notes field allow arbitrary input

This patch addresses the lack of sanitization of the "notes" field on
the OPAC "View Interlibrary loan request" page.

To test:

- Apply the patch
- As an OPAC user, create an ILL request
- Navigate to the request's "View Interlibrary loan request" page
- Add the following note:

  Hello
  <h1>TESTING</h1>
  <script>alert('pwned');</script>

- Click "Submit modifications"
- TEST: Observe, when the page reloads, only the following is preserved in the
"Notes" textarea:

    Hello
    TESTING

- As a staff user, naviate to the ILL requests table
- Select "Manage request" for the request you created
- TEST: Observe that the Notes field only contains:

    Hello
    TESTING

- TEST: Observe that no Javascript alert is displayed

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 552873f7d466abee6919414b8d2f5e6c99f9a44f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cc81442349cb07afe242607f2c40acb62e4e76fb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21226: DBRev 17.11.09.001
Nick Clemens [Thu, 16 Aug 2018 14:03:28 +0000 (14:03 +0000)]
Bug 21226: DBRev 17.11.09.001

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21226: Remove xISBN services
Jonathan Druart [Wed, 15 Aug 2018 14:58:12 +0000 (11:58 -0300)]
Bug 21226: Remove xISBN services

OCLC has decided to retire all xISBN services:
https://www.oclc.org/developer/news/2018/xid-decommission.en.html

The code for related features has to be removed from Koha.

Test plan:
You need to be familiar with the different sysprefs (I am not):
- FRBRizeEditions
- SyndeticsEnabled
- SyndeticsEditions
- ThingISBN

Make sure there are no regressions introduced by this patchset.

QA Note: C4/XISBN.pm should be renammed

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>
(cherry picked from commit bce549bc4c0f9fefddb34fe614f6bf79aef882ea)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7cacd4ddb90d55238e0446a67ce4d68a54c58e3e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21226: DB Changes
Jonathan Druart [Wed, 15 Aug 2018 14:36:21 +0000 (11:36 -0300)]
Bug 21226: DB Changes

Remove prefs OCLCAffiliateID, XISBN and XISBNDailyLimit

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>
(cherry picked from commit b19090c4505c0f407a7f3cbfe3c14da5cfecc657)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8111e0c380c9d2c61a2b6b6665b5a7bad3a3e646)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoUpdate release notes for 17.11.09 release v17.11.09
Fridolin Somers [Tue, 28 Aug 2018 14:02:04 +0000 (16:02 +0200)]
Update release notes for 17.11.09 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoIncrement version for 17.11.09 release
Fridolin Somers [Tue, 28 Aug 2018 13:50:19 +0000 (15:50 +0200)]
Increment version for 17.11.09 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoMerge remote-tracking branch 'translate/17.11.09-translate-20180828' into sec_171109
Fridolin Somers [Tue, 28 Aug 2018 13:56:17 +0000 (15:56 +0200)]
Merge remote-tracking branch 'translate/17.11.09-translate-20180828' into sec_171109

5 years agoBug 21199: (QA follow-up) Add show_attributes to perldoc
Martin Renvoize [Mon, 13 Aug 2018 08:54:44 +0000 (09:54 +0100)]
Bug 21199: (QA follow-up) Add show_attributes to perldoc

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d555126d8f8fe8c9a4bdd6563c8fcd82b971fc84)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21199: Hide patron's attributes from ILSDI if required
Jonathan Druart [Thu, 9 Aug 2018 22:34:58 +0000 (19:34 -0300)]
Bug 21199: Hide patron's attributes from ILSDI if required

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dabd86cf6eab70751cc1a476b47cdf9f1648788f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoTranslation updates for Koha 17.11.09
Koha translators [Tue, 28 Aug 2018 13:41:04 +0000 (10:41 -0300)]
Translation updates for Koha 17.11.09

5 years agoBug 21032: Fix using facet for searches made on specific index
Alex Arnaud [Tue, 3 Jul 2018 13:57:00 +0000 (13:57 +0000)]
Bug 21032: Fix using facet for searches made on specific index

Test plan:

  - Try a simple search (OPAC or staff) like "title:foo",
  - click on a facet: badaboum!
  - apply this patch,
  - retry

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 96f253d5ed2f1770b42f06554ebb4c4e14b3afdf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8cfacd7e164178828b0e75743e78d1740ab414b9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21018: Allow uris defined in the item
Jonathan Druart [Wed, 11 Jul 2018 14:29:15 +0000 (11:29 -0300)]
Bug 21018: Allow uris defined in the item

We need to search for uri defined for the itemnumber we passed in
parameter.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 1d888c8d0e9ee2eda9c793cf75fd73a7afeaef16)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0971fed0b85834f20bc2450c7e68e1d252363b56)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21018: Fix TrackClicks for 952$u
Jonathan Druart [Fri, 29 Jun 2018 13:29:30 +0000 (10:29 -0300)]
Bug 21018: Fix TrackClicks for 952$u

Caused by
  commit 51b6cf2aafbfb45b9fcb072403b986fe3c2add53
  Bug 19847: Track links within the records and 404 for others

We should also accept uri stored in items.uri (952$u)

Test plan:
- Turn on TrackClicks
- Defined uri for some items
- At the OPAC click on the link (from opac-detail.pl)
=> Without this patch you will get 404 (redirected from tracklinks.pl)
=> With this patch applied you will be redirected correctly and the
linktracker will be filled correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d14ed73744fa23d4ed649da6d847f4b37cdfce92)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 20bfb6730f3d93d388a538871b94e83d867ac796)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 8604: Patron cards made for patrons which don't have patron images use preceding...
Chris Nighswonger [Wed, 4 Jul 2018 15:23:11 +0000 (11:23 -0400)]
Bug 8604: Patron cards made for patrons which don't have patron images use preceding card's image

This patch corrects referential problems which caused the script to
"re-use" images as well as other sorts of bad image behaviour.

To test:

1. Ensure that you can reproduce the original bug or some variation thereof
using the steps described in either of these two comments:

    https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604#c0

    https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604#c6

    NOTE: This is not an easy bug to reproduce.

2. Once you can reproduce the bug, apply this patch and follow the same steps
used to reproduce the bug.

3. Observe that the symptoms are corrected.

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Reproduced the bug and resolved it with this patch.
Code is hard to read; exact cause of the problem was not fully uncovered.

Fixed spelling 'Destory' => 'Destroy'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit b5e60f15478a998f945ebc59b2c13ce9d37b8818)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 97825af008ba57f7d7229ddb6ce9318e67e22e18)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21122: Fix check-url-quick when utf8 characters in URL's
Liz Rea [Thu, 26 Jul 2018 04:26:15 +0000 (16:26 +1200)]
Bug 21122: Fix check-url-quick when utf8 characters in URL's

To test:

Make a record with a URL that has a UTF8 character, such as:
http://some.nonexistent.tld/MāoriWomenAotearoa.pdf
Run the check-url-quick.pl job, notice it dies at that URL
Apply this patch
Test again, it should work.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 10720d2a5c50b82d565cab9ad70c8498164d81b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1c988ed7fb3ca7d018c9c7e7cea5f22415b95836)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20811: (RM follow-up) fix check for matching
Nick Clemens [Mon, 23 Jul 2018 12:23:07 +0000 (12:23 +0000)]
Bug 20811: (RM follow-up) fix check for matching

Notice should only be triggered if both settings are false

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 12b505f2b797d77e800a17830f71a9c054cd076b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1a07f712c23e62c830117d4c0ca1390044dc25c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20811: (QA follow-up) Prevent calling AddItemBatchFromMarc and ModBiblioMarc...
Marcel de Rooy [Fri, 20 Jul 2018 09:46:58 +0000 (11:46 +0200)]
Bug 20811: (QA follow-up) Prevent calling AddItemBatchFromMarc and ModBiblioMarc without biblionumber

If you use -update but do not find matches (or did not want to match), you
should not call those routines. We should warn and skip this record.

Adding a warn at the start that the choice of options may not be smart.
Note that this needs further attention somewhere else. You could mix
-update with -insert for instance and still see some problems. (May depend
on items with unique barcode etc.)

Test plan:
Run -update without match or isbn.
Or run -update -isbn with a non-matching ISBN.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 15b865c6ee558ef278f911ba3693c38c024c7f11)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8191625667162ac240a5d0e4d180632bcf100884)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20811: (QA follow-up) Make the isbn check work
Marcel de Rooy [Fri, 20 Jul 2018 09:21:11 +0000 (11:21 +0200)]
Bug 20811: (QA follow-up) Make the isbn check work

The following code was never reached, since $isbn was not filled.
    if (!$biblionumber && $isbn_check && $isbn) {
        $sth_isbn->execute($isbn);
        ($biblionumber,$biblioitemnumber) = $sth_isbn->fetchrow;
    }
Solution: Fix the code with two $isbn declarations. Move the checkisbn
condition a level deeper.

Test plan:
Run misc/migration_tools/bulkmarcimport.pl -file bib726.utf8 --update -isbn
Since you do not match on biblionumber, the ISBN should match.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a49a7f08d6dbaf992d70420dae744c75c2ad8aae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5094909140081b02c9688faa07fc630feab91f24)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20811: Fix wrong usage of ModBiblio
Jonathan Druart [Mon, 28 May 2018 18:19:09 +0000 (15:19 -0300)]
Bug 20811: Fix wrong usage of ModBiblio

Since
  commit cefa7c21e28b88351ee8ae0dfefb80a515323df9
  Bug 5635: bulkmarcimport new parameters & features

AddBiblio call has been replaced with ModBiblio, but the return values
are different. We should not replace the value of $biblionumber with
what returns this subroutine.

Test plan:
If you are familiar with bulkmarcimport.pl you should know what to test,
I am not.

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>
(cherry picked from commit d15185025a146656a1ad0d7d5a8eb261581c0f1e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c76d5b4b4a531e408fbaa5a9a7a523a749638764)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 14662: Add empty entries to pull downs in cataloguing form for mandatory subfields
Katrin Fischer [Thu, 2 Aug 2018 13:56:11 +0000 (15:56 +0200)]
Bug 14662: Add empty entries to pull downs in cataloguing form for mandatory subfields

First patch deals with the problem on the item form, this
patch fixes the same problem on catalouging form for the
bibliographic record.

To test:
- Adapt your frameworks:
  - Make sure 942$c is mandatory
  - Link another field to an authorised value, for example: 942$n to YESNO
- Add a new record
  - Verify that the first value of each pull down is preselected,
    there is no way to trigger the 'required' error
- Apply patch
  - Add a record
    - Verify that classification source is preselected according to the
      DefaultClassificationSource system preference
    - Verify that 942$c now defaults to empty
    - Verify all your other mandatory subfields can be set to empty
    - Verify that you can't save before correctly setting them
  - Chane your frameworks
    - Add a default value for 942$c, for example: CF
  - Add another record
    - Verify the itemtype is now preset to your default itemtype
  - Edit an existing record, verify all values show correctly

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>
(cherry picked from commit 038e4011d4e4c1270592d476479062467a7a9be8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b0d692dcaaa38a5e4842b2c1466560f08fd2b0e5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 14662: Add empty entries to pull downs on item form for mandatory subfields
Katrin Fischer [Tue, 31 Jul 2018 23:58:33 +0000 (23:58 +0000)]
Bug 14662: Add empty entries to pull downs on item form for mandatory subfields

The code assumed that if a subfield is marked as mandatory, there should be no
empty entry in the pull downs.

This assumption is not correct, as it leads to the first entry of the
pull down being preselected if there is no default set. Which means you
will never be alerted of any cataloguing errors and errors will be very
hard to find later on.

Correct behaviour would be to preselect the empty value when there is
no default. This means on saving the item an error message is triggered
and the cataloger is forced to set the value.

To test:
- Adapt your frameworks:
  - Make 942$c non-mandatory
  - In 952 make itemtype, classification source and some other pull downs
    like location or collection mandatory
- Add a new item
  - Verify that the first value of each pull down is preselected,
    there is no way to trigger the 'required' error
- Apply patch
  - Add a new item
    - Verify that classification source is preselected according to the
      DefaultClassificationSource system preference
    - Verify that the itemtype is preselected according to 942$c in
      the bibliographic record
    - Verify all mandatory fields can be set to empty
    - Verify that you can't save before correctly setting them
  - Change the 942$c in the record to empty
  - Add another item
    - Verify the itemtype is now empty
  - Change your frameworks and set a default for itemtype (Ex: BK)
  - Repeat default check with another pull down like collection or location

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We do not want empty values for branches (holdingbranch and homebranch
must be mandatory, see bug 21011)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 003a4439802bc4053ed9e5db7719434256788b29)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f8f6c0490f3e21f661bad5734f330b914ea4817b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 18947: LDAP - do not assume anonymous bind if no user or password
Nick Clemens [Wed, 13 Dec 2017 13:27:36 +0000 (13:27 +0000)]
Bug 18947: LDAP - do not assume anonymous bind if no user or password

To test:
Ideally tested on a working ldap server with bind by auth and no
anonymous bind
1  - Define an LDAP config with bind by auth
2  - Don't define user/pass
3  - Define anonymous_bind = 0
4  - Attempt bind by auth
5  - Error is something like:
LDAP search failed to return object : XXXXXXXXX: LdapErr: XXXX-XXXXXX,
     comment: In order to perform this operation a successful bind must
     be completed on the connection., data 0, v2580 at
     /usr/share/koha/lib/C4/Auth_with_ldap.pm line 102.
6  - Define user/pass
7  - Now bind by auth should work
8  - remove user/pass
9  - Apply patch
10 - Attempt again
11 - Bind by auth shoudl succeed

prove -v t/db_dependent/Auth_with_ldap.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8eed0466381435a0426fe9c2ea75fa295d906533)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2cb4bbd8baba9df1177fb965619df0328263541f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20014: Preselect item budget based on id not code
Nick Clemens [Wed, 17 Jan 2018 19:50:31 +0000 (19:50 +0000)]
Bug 20014: Preselect item budget based on id not code

To test:
1 - Have the same fund code in two budgets
2 - Have budget code defined in MarcItemFieldsToOrder
3 - Stage a file with some order items as defined above
4 - Inspect the fuinds drop down in the item, notice two lines are
marked selected
5 - Apply patch
6 - Repeat
7 - Only one field should be selected, with a preference for active
budget

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d1890533c8796873149338831c5de13d5b19cb9e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 41b67901d2a6f46452d590916a0cb57f29a69496)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20773: DBRev 18.05.02.003
Nick Clemens [Tue, 21 Aug 2018 11:25:53 +0000 (11:25 +0000)]
Bug 20773: DBRev 18.05.02.003

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7dab4cd903f9623fb52592e65d57c93b6156d2aa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 31bf49b849a949c9f809d2ca2eaa1cecafb55036)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20773: (bug 20724 follow-up) Add a simple db revision
Marcel de Rooy [Wed, 16 May 2018 13:39:04 +0000 (15:39 +0200)]
Bug 20773: (bug 20724 follow-up) Add a simple db revision

We should correct bad data too.
This is a trivial, pragmatic approach. Instead of doing a complex
calculation with holidays etc. (as was done on 12063), we just add
MaxPickupDelay or 7 days to today probably resulting in a little bonus
time. Only for waiting holds. When the ReservesNeedReturns pref was not
Automatic, there should be no changes.

== Test plan ==
1. git checkout c585f1149770ec401f188e061211501897cec0bf~1
     This the commit before bug 20724's patches.
     We need that to be able to generate "corrupted data"
2. Set ReservesNeedReturns to "Automatically"
3. Place a hold on a specific item
4. The hold should have an *empty* expiration date
     record page → Hold → "Expiration" column
5. Apply this patch
6. Run updatedatabase.pl
7. Refresh the page
8. The hold should have an expiration date (not empty)
9. Celebrate! 🎉🎊🥳

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 20773: (followup) Remove MySQLism

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a4ec768e3787ff3ee426949c0f03188dd4d15e82)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6eb334e244a2cbaf84d8ac874348c1443252e656)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20724: (QA follow-up) Remove two obsolete comment lines
Marcel de Rooy [Wed, 16 May 2018 12:43:27 +0000 (14:43 +0200)]
Bug 20724: (QA follow-up) Remove two obsolete comment lines

No test plan :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 88ac8c499f878a1c0ac622d53742a3d9acea1f64)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20724: Add tests for ReservesNeedReturns
Jonathan Druart [Thu, 10 May 2018 14:40:33 +0000 (11:40 -0300)]
Bug 20724: Add tests for ReservesNeedReturns

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8b6dc6b23ccb26e18c437a578b4e20174ee1ea58)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20724: Move the ReservesNeedReturns logic to AddReserve
Jonathan Druart [Thu, 10 May 2018 14:40:11 +0000 (11:40 -0300)]
Bug 20724: Move the ReservesNeedReturns logic to AddReserve

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1798d22e764bebf46e2915e1c0b7c3360ea8dd51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20724: Correctly mark an hold as waiting - ReservesNeedReturns
Kyle M Hall [Thu, 10 May 2018 12:12:04 +0000 (08:12 -0400)]
Bug 20724: Correctly mark an hold as waiting - ReservesNeedReturns

We need to call Koha::Hold->set_waiting to correctly
calculate the expiration date.

It fixes a regression introduced by
  commit 26634151dbce0bf39ff6c9eda5b58bb993996a2d
  Bug 12063 - Fix QA failures

The expiration date has to be set for waiting holds

== Test plan (time to execute: less than 4min) ==
1. Set ReservesNeedReturns to "Don't automatically"
2. Place a hold on a specific item
3. Check it in and confirm hold
4. The hold should have an expiration date
     record page → Hold → "Expiration" column
5. It should be listed in staff:/cgi-bin/koha/circ/waitingreserves.pl
6. Set ReservesNeedReturns to "Automatically"
7. Place a hold on a specific item
    (which should also behave like we check the item in to
    keep it for the patron)
8. The hold should have an *empty* expiration date
     record page → Hold → "Expiration" column
9. Holds awaiting pickup page should crash
     staff:/cgi-bin/koha/circ/waitingreserves.pl
10. Cancel the hold to remove the corrupted data
     record page → Hold → the red X
11. Apply this patch
12. Place a hold on a specific item
13. The hold should have an expiration date (not empty)
14. It should be listed in staff:/cgi-bin/koha/circ/waitingreserves.pl
15. Celebrate!

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c585f1149770ec401f188e061211501897cec0bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20623: (QA follow-up) avoid fetch() calls in some cases
Victor Grousset [Fri, 11 May 2018 15:43:33 +0000 (17:43 +0200)]
Bug 20623: (QA follow-up) avoid fetch() calls in some cases

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 35d887fece0634eb92d030b959aeb991f10a0239)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20623: (QA follow-up) Remove one find call
Marcel de Rooy [Fri, 11 May 2018 09:33:32 +0000 (11:33 +0200)]
Bug 20623: (QA follow-up) Remove one find call

Imo these somewhat weird lines ask for improvement, but I don't want to change
the exact conditions here. Just removing the need to call find twice.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1bc3bbfdc78bfd559fec841c6ca47ddcbeb0f179)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20623: Fix basket group PDF when itemtype not itemtype table
Victor Grousset [Fri, 20 Apr 2018 09:17:26 +0000 (11:17 +0200)]
Bug 20623: Fix basket group PDF when itemtype not itemtype table

When an item has an itemtype not in the itemtype table. Trying to fetch
it's description lead to an error.
Using authorized values like ccode to populate the itemtypes of the
biblioitems (instead of the itemtype table) can lead to such data.
Or importing records with invalid itemtype codes. Koha doesn't do enough
checks at import to at least warn about these issues.

== Test plan ==
1. first we need an item with an itype not in the item_types table
   1. download a record as MARCXML
   2. find it's item type in administration; and the related code
   3. open the MARCXML file and search for occurences of the code
        and replace them by some non-existing value like "FOOBAR"
   4. also change the barcode so it won't be ignored because
        it's a duplicate
   5. also change the title to easily find it later in the search
   6. tools → "Stage MARC records for import"
   7. upload your file
   8. "stage for import"
   9. click "Manage staged records"
        You should end on the page related to your staged record
   10. "Import this batch into the catalog"

2. now we need it in a basket group
   1. have/create a active budget
   2. have/create a fund
   3. have/create a vendor with minimal info
   4. create a basket with minimal info
   5. add our imported item to the basket
        for example search it by name
   6. go to the basket. URL should be
      /cgi-bin/koha/acqui/basket.pl?basketno=XXXXX
   7. close this basket
        and tick "Attach this basket to a new basket group with the same name"
   8. you will end up in the basket groups lists
   9. go to the "closed" tab
   11. go to the basket group
          your vendor page => Basket groups => Closed

3. export as PDF, it should fail (internal server error)
     this is the bug (no kidding ^_^)
4. apply this patch
5. reexport the basket as PDF
6. it should work
7. create an item type (in administration)
     that has the same code as the one that you put in the MARCXML
8. reexport the basket as PDF
9. check that in the PDF that the description is here:
     table at the bottom of the document → "Document" column

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3811985c3a55b72900ba005c6867059776ee9281)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 18822: Check if we have MARC::Record and convert if not when using ES
Nick Clemens [Fri, 25 May 2018 09:32:58 +0000 (09:32 +0000)]
Bug 18822: Check if we have MARC::Record and convert if not when using ES

The new_record_from_zebra subroutine assumes that when using ES we
always get MARC::Record objects when using ES, but sometimes we get them as xml via Z39 or
internally. This adds a test to new_from_zebra to confirm we have a
record object and to convert it if not

To test:
1 - Perform an advanced search from the advanced editor, make sure to
select 'Local catalog' and a remote source
2 - Error 'Internal search error [Object object]'
3 - Apply patch
4 - Repeat search, success!
5 - Select and deselect various servers, search should still work

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 49db39c060163c3d46de4eff283919cc9af30a97)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 18822: Better error response
Nick Clemens [Mon, 19 Jun 2017 15:21:41 +0000 (11:21 -0400)]
Bug 18822: Better error response

Apply this patch first to see a change in the error feedback - instead
of [Object object] you should get a text readable error

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9e26419e30c88d8a9cd54660752fda89170ae3f8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20900: Add CPL branch in t_Batch.t too
Marcel de Rooy [Mon, 2 Jul 2018 08:41:24 +0000 (10:41 +0200)]
Bug 20900: Add CPL branch in t_Batch.t too

Same fix as previous patch.

Test plan:
Run t/db_dependent/Labels/t_Batch.t (without CPL branch)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1ad0724b804970fe9ca8e8333b1fb0b893c28cf4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20900: Add CPL test branch in rollingloans.t
Marcel de Rooy [Fri, 8 Jun 2018 08:56:10 +0000 (10:56 +0200)]
Bug 20900: Add CPL test branch in rollingloans.t

Trivial fix.

Test plan:
Without this patch and a CPL library, run rollingsloans.t. See warns.
With this patch, no warns.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7e3f399867abdf506ff271c57d652d1b3cdf8a7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21025: Add GetPreparedLetter to Koha::Patron::Discharge
Charles Farmer [Fri, 29 Jun 2018 20:12:59 +0000 (16:12 -0400)]
Bug 21025: Add GetPreparedLetter to Koha::Patron::Discharge

Test plan (shamelessly ripped from Bug20953):

1) Set system preference 'useDischarge' to 'Allow'
2) Choose a patron without checkouts nor fines nor restrictions
3) Log at OPAC and go to patron page /cgi-bin/koha/opac-user.pl
4) Click on 'ask for a discharge' tab
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'What is a discharge? ...'
5) Click on 'Ask for a discharge' link
   => You see /cgi-bin/koha/opac-discharge.pl?op=request
      with text 'Your discharge request has been sent ...'
6) In a new browser tab/page, go to intranet on /cgi-bin/koha/members/discharges.pl
   => You see one discharge requets for the patron
   => Click on 'allow' on patron discharge request
7) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
  => You see link 'Get your discharge'
8) Click on the link to get your generated PDF
  => An error message should appear informing you to contact your website's admin
9) Apply this patch
10) Click again on the link to get your generated PDF
  => This time, a download prompt should appear

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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>
(cherry picked from commit 654abf9966bd340689b1944a7e5266cde7127321)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20698: Remove obsolete template: transfer-slip.tt
Owen Leonard [Mon, 18 Jun 2018 15:29:37 +0000 (15:29 +0000)]
Bug 20698: Remove obsolete template: transfer-slip.tt

This patch removes an unused template file, circ/transfer-slip.tt. Its
use was removed by Bug 7001:

http://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=a9ded4fa008668df8c485fbbc76efa3cc9cc00d7#patch12

To test, apply the patch and confirm that the file has been removed.
Confirm that no references to the template exist in the codebase.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0536b99e6dfdf7e21dcf62963ed3f1449d434d3d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20332: Allow translating some grouped opac results texts
Pasi Kallinen [Mon, 5 Mar 2018 10:10:56 +0000 (12:10 +0200)]
Bug 20332: Allow translating some grouped opac results texts

The grouped OPAC results page has several untranslatable
javascript-added texts, including the selection modifiers "Clear all"
and "Select all" links, and the entries in the shelves/lists dropdown.

Compare to opac-results.tt

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 53e0523207738cd489d77007c8e642b88030d4c6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20090: (RM follow-up) Add missing paren
Nick Clemens [Fri, 13 Jul 2018 11:48:42 +0000 (11:48 +0000)]
Bug 20090: (RM follow-up) Add missing paren

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 43f509b08e7d30bca6c88e094bbfa763d036bf67)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20090: Missing script statement for Novelist Select on some record displays in...
David Kuhn [Thu, 25 Jan 2018 17:27:19 +0000 (09:27 -0800)]
Bug 20090: Missing script statement for Novelist Select on some record displays in OPAC

This patch adds a check for UPCs and well as ISBNs to the Novelist Select conditionals in opac-detail.tt

To test (note that you must subscribe to Novelist Select):

1. If your library does not use the raton ratings feature, activate it for the purposes of this test.

2. Display a record that does not have an ISBN in the 020 field, but has a upc (or other code) in the 024 field. The rating option will

display as 5 radio buttons and a "rate it" button.

3. Apply the patch.

4. Display the same record again. The radio buttons will be replaced with stars. This indicates that the scripts on the page completed.

Rather that using the patron ratings as in indicator, you can also use a web page inspector/debugger such as firebug or the built-in

inspectors in most newer browsers to check for script errors.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I couldn't check with Novelist Select, but read and checked changed made carefully.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7662f4873e97272c677f4912c22aeeec25097bc2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 21023: Remove warning in t/db_dependent/Circulation/Chargelostitem.t
Tomas Cohen Arazi [Fri, 29 Jun 2018 14:52:16 +0000 (11:52 -0300)]
Bug 21023: Remove warning in t/db_dependent/Circulation/Chargelostitem.t

To test:
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation/Chargelostitem.t
=> FAIL: Warning is displayed
- Apply this patch
- Run:
 k$ prove t/db_dependent/Circulation/Chargelostitem.t
=> SUCCESS: Tests pass! No warning!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ce63b26b476415f30cecd7be97b52b60c07341d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 14446: Workaround to resolve uninitialized value in goto warning
Marcel de Rooy [Wed, 4 Jul 2018 14:03:33 +0000 (16:03 +0200)]
Bug 14446: Workaround to resolve uninitialized value in goto warning

Forcing both GetTab calls to list context resolves the warning.
A workaround, not a real fix.

Test plan:
Search for something in the syspref text bar.
Without this patch, you will have a warn: Use of uninitialized value in goto
With this patch, you won't.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d6760f01a674ff52d96a1a342d68a7e5c9a6c8a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20919: Remove unecessary search calls on the biblio detail page
Jonathan Druart [Thu, 14 Jun 2018 14:31:02 +0000 (11:31 -0300)]
Bug 20919: Remove unecessary search calls on the biblio detail page

There is a countanalytics flag that is set for items used in analytical
biblio records. This flag is only used in the template when 'analyze'
has been passed to the script.
In order to avoid unecessary search calls (1 per item), $analyse must be
tested.

Test plan:
0. Do not apply the patch
1. tail -f /var/log/koha/kohadev/zebra-output.log
2. Hit a bibliographic record detail page with several items
3. Notice that the log has 1 line per item:
  11:30:36-14/06 zebrasrv(32) [warn] ir_session (exception)
4. Apply the patch
5. Hit the page again
6. There is nothing in the zebra log file

If you are familiar with analytic records, confirm that you are not
allowed to remove an item that is used in analytical biblio records.

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e4b51adb9a46c72099b950b1976c155f3c7d41f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20953: Prevent several discharge requests on OPAC
Fridolin Somers [Mon, 18 Jun 2018 07:04:19 +0000 (09:04 +0200)]
Bug 20953: Prevent several discharge requests on OPAC

On OPAC, a user can requested a discharge even if one is already pending.
This generates several pending discharges in staff interface that can not be deleted.

This is because request operation leads to page 'opac-discharge.pl?op=request' and user can refresh this page performing a new request.

Perl code must check that operation is allowed.

Patch reoganised the code so that the following FIXME is obsolete :
  'FIXME looks like $available is not needed'
Patch also replaces 'op' arg test to also check undef : input->param("op") // ''

Test plan :
1) Set system preference 'useDischarge' to 'Allow'
2) Choose a patron without checkouts nor fines nor restrictions
3) Log at OPAC and go to patron page /cgi-bin/koha/opac-user.pl
4) Click on 'ask for a discharge' tab
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'What is a discharge? ...'
5) Click on 'Ask for a discharge' link
   => You see /cgi-bin/koha/opac-discharge.pl?op=request
      with text 'Your discharge request has been sent ...'
6) In a new browser tab/page, go to intranet on /cgi-bin/koha/members/discharges.pl
   => You see one discharge requets for the patron
7) Come back to OPAC and refresh page
   => You see /cgi-bin/koha/opac-discharge.pl
   with text 'Your discharge will be available on this page within a few days.'
8) Come back to intranet and refresh /cgi-bin/koha/opac-discharge.pl
   => There is still one requets for the patron
9) Come back to OPAC and enter URL /cgi-bin/koha/opac-discharge.pl?op=get
   => You see /cgi-bin/koha/opac-discharge.pl
      with text 'Your discharge will be available on this page within a few days.'
10) Come back to intranet and refresh /cgi-bin/koha/opac-discharge.pl
   => There is still one requets for the patron
11) Click on 'allow' on patron discharge request
12) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
    => You see link 'Get your discharge'
13) enter URL /cgi-bin/koha/opac-discharge.pl?op=request
    => You see same page and no new discharge requets is created
14) Come back to intranet on patron details page
15) Remove the discharge restriction
16) Come back to OPAC and refresh /cgi-bin/koha/opac-discharge.pl
    => You see text 'What is a discharge?...'
17) enter URL /cgi-bin/koha/opac-discharge.pl?op=get
    => You see same page and no new discharge requets is created

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0c07cc533b4b46db8c633d65b72b249f98227acc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20949: (follow-up) debian/control
Mirko Tietgen [Fri, 15 Jun 2018 10:34:51 +0000 (12:34 +0200)]
Bug 20949: (follow-up) debian/control

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 00b732db48d209908bd1982bbb007678335e7593)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 20949: Koha depends on Clone
Mirko Tietgen [Fri, 15 Jun 2018 10:10:19 +0000 (12:10 +0200)]
Bug 20949: Koha depends on Clone

Clone was not declared a dependency before. It used to be a dependency
of Hash::Merge but isn't in the recent version.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f1a54e09d99eea391b71ceafc291cbca8c838da2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19502: Add POD for max_result_window
Julian Maurice [Mon, 25 Jun 2018 12:14:43 +0000 (14:14 +0200)]
Bug 19502: Add POD for max_result_window

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c3576b1adedc4dbcabb1eb833f33194f66db63bf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
5 years agoBug 19502: Remove debug warn
Julian Maurice [Mon, 25 Jun 2018 12:14:32 +0000 (14:14 +0200)]
Bug 19502: Remove debug warn

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1b01e7db0e19f69ab77660cd3a26b1636a7b01e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>