koha.git
7 years agoBug 15822: Fix 500 error when searching if items.onloan=0000-00-00
Jonathan Druart [Wed, 23 Nov 2016 10:06:04 +0000 (10:06 +0000)]
Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00

The calls
  output_pref({ dt => dt_from_string( $date ) })
are wrong and should be replaced with
  output_pref({ str => $date })
For better error handling.

Here we fix the problem of items.onloan when searching

Test plan:
- Set items.onloan=0000-00-00 (UPDATE items SET onloan='0000-00-00')
This can come from old data or bad migration
- Execute a search
=> Without this patch you get
Can't locate object method "ymd" via package "dateonly" (perhaps you forgot to load "dateonly"?) at /home/vagrant/kohaclone/Koha/DateUtils.pm line 225.
=> With this patch you won't get the error

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 167c74bfd386287783e101989b804077b1020369)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit a5ce343c9d7d8790a8dbd98b3833ea6cf155c180)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
7 years agoTranslation updates for Koha 16.05.07
Mason James [Mon, 2 Jan 2017 05:06:55 +0000 (18:06 +1300)]
Translation updates for Koha 16.05.07

Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17323: Column search_history.time cannot be null
Jonathan Druart [Tue, 20 Sep 2016 10:40:13 +0000 (11:40 +0100)]
Bug 17323: Column search_history.time cannot be null

When doing a search, with SearchHistory pref switched on:

DBD::mysql::st execute failed: Column 'time' cannot be null [for Statement "
        INSERT INTO search_history(
            userid, sessionid, query_desc, query_cgi, type, total, time
        ) VALUES(
            ?, ?, ?, ?, ?, ?, ?
        )
    " with ParamValues: 0="7874", 1='12338a0bd8da63e32c79ee84f8493a07', 2="kw,wrdl: d", 3='q=d', 4='biblio', 5=6104, 6=undef] at C4/Search/History.pm line 34.

Since MySLQ 5.7, undef does not mean "the default value".
To let the DBMS set the default value (CURRENT_TIMESTAMP), the parameter should not be passed

Test plan:
OPAC+Intranet, swith the 2 SearchHistory syspref on
Do a search
=> Without this patch, you will get an error in the log and the row will not be inserted in the table.
=> With this patch, everything must go fine

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Not verified with MySQL 5.7. But this looks good to me.
Works under Jessie.
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoRevert "Bug 17494: Make sure the same verification token won't be generated twice"
Mason James [Thu, 29 Dec 2016 01:43:41 +0000 (14:43 +1300)]
Revert "Bug 17494: Make sure the same verification token won't be generated twice"

This reverts commit 5f160f675b1de4a12db6717b297c3d7b0a7a5d3d.

7 years agoRevert "Bug 17494: Prevent duplicate tokens from getting stored"
Mason James [Thu, 29 Dec 2016 01:43:26 +0000 (14:43 +1300)]
Revert "Bug 17494: Prevent duplicate tokens from getting stored"

This reverts commit d76cd8a63946572508f4a7d8b8ee8d06c63ddb09.

7 years agoRevert "Bug 17494: (QA followup) Fix exception name"
Mason James [Thu, 29 Dec 2016 01:42:58 +0000 (14:42 +1300)]
Revert "Bug 17494: (QA followup) Fix exception name"

This reverts commit 9a301836714924581b806cd7c728695625ddf3cc.

7 years agoRevert "Bug 17641: Fix t/Biblio/Isbd.t"
Mason James [Thu, 29 Dec 2016 01:05:20 +0000 (14:05 +1300)]
Revert "Bug 17641: Fix t/Biblio/Isbd.t"

This reverts commit 2bc7fc1551e2c4b37fd054a733e36494adda02e3.

7 years agoRevert "Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf...
Mason James [Thu, 29 Dec 2016 00:54:22 +0000 (13:54 +1300)]
Revert "Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml"

This reverts commit a071fb8517a215d451e7bd8fd28cd7386d037485.

7 years agoRevert "Bug 17278: Use available limit when requesting zebra when ccl query is used"
Mason James [Thu, 29 Dec 2016 00:50:55 +0000 (13:50 +1300)]
Revert "Bug 17278: Use available limit when requesting zebra when ccl query is used"

This reverts commit 81e19a289471654f5f89408a2fe5020dbd48e7e9.

7 years agoRevert "Bug 17278: Fix "show all items" link"
Mason James [Thu, 29 Dec 2016 00:50:42 +0000 (13:50 +1300)]
Revert "Bug 17278: Fix "show all items" link"

This reverts commit 24e69d1ccbe0efa5ad49db7cd3bfe09cfab6a6ca.

7 years agoRevert "Bug 17278: Fix test compilation errors"
Mason James [Thu, 29 Dec 2016 00:50:22 +0000 (13:50 +1300)]
Revert "Bug 17278: Fix test compilation errors"

This reverts commit ef94d6ba9da04994dc1fd4f6cb72f51bafbb7ba0.

7 years agoRevert "Bug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t"
Mason James [Wed, 14 Dec 2016 10:29:47 +0000 (23:29 +1300)]
Revert "Bug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t"

This reverts commit 54aee78d6afb0cd1bcb26fc7c7a65e46c372cd0f.

7 years agoRevert "Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics...
Mason James [Thu, 29 Dec 2016 01:59:50 +0000 (14:59 +1300)]
Revert "Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table"

This reverts commit db99e5ff04298683a4b6651f0b906de0336b5646.

7 years agoRevert "Bug 14598: Make C4::Circulation::AddReturn store the right itemtype"
Mason James [Thu, 29 Dec 2016 01:59:32 +0000 (14:59 +1300)]
Revert "Bug 14598: Make C4::Circulation::AddReturn store the right itemtype"

This reverts commit f8e2e2f1e25a9838300a160a094f4c0b3dcfa710.

7 years agoRevert "Bug 14598: (QA followup) Don't die on bad barcode"
Mason James [Thu, 29 Dec 2016 01:59:17 +0000 (14:59 +1300)]
Revert "Bug 14598: (QA followup) Don't die on bad barcode"

This reverts commit 575bbbeaba5a2c808725697b1db263dcef9520da.

7 years agoRevert "Bug 14598 - QA Followup touching CanBookBeIssued subroutine"
Mason James [Thu, 29 Dec 2016 01:56:16 +0000 (14:56 +1300)]
Revert "Bug 14598 - QA Followup touching CanBookBeIssued subroutine"

This reverts commit c28704e5731ad0da1dd26757fa8fa19c39653fcc.

7 years agoRevert "Bug 14598 [QA Followup] - Only fetch bib data if needed"
Mason James [Thu, 29 Dec 2016 01:55:45 +0000 (14:55 +1300)]
Revert "Bug 14598 [QA Followup] - Only fetch bib data if needed"

This reverts commit 8a919ef2bd216483b5e388c4eecab9075ec39aac.

7 years agoRevert "Bug 14598 [QA Followup] - Correct the behavior of GetItem"
Mason James [Thu, 29 Dec 2016 01:55:18 +0000 (14:55 +1300)]
Revert "Bug 14598 [QA Followup] - Correct the behavior of GetItem"

This reverts commit c9433c56385946d14a29dd67a771a5bb5186aecb.

7 years agoRevert "Bug 14598 [QA Followup] - Make unit test pass"
Mason James [Thu, 29 Dec 2016 01:55:06 +0000 (14:55 +1300)]
Revert "Bug 14598 [QA Followup] - Make unit test pass"

This reverts commit cdfabce1b8b3f6a0915f9d13057269847695b9d7.

7 years agoRevert "Bug 14598: (followup) Remove unused and non-existent C4::ItemType include"
Mason James [Thu, 29 Dec 2016 01:53:22 +0000 (14:53 +1300)]
Revert "Bug 14598: (followup) Remove unused and non-existent C4::ItemType include"

This reverts commit b0124b321a57264fcb949f142e6a2a3b001530e7.

7 years agoRevert "Bug 14598: Fix warning from effective_itemtype"
Mason James [Thu, 29 Dec 2016 01:51:52 +0000 (14:51 +1300)]
Revert "Bug 14598: Fix warning from effective_itemtype"

This reverts commit 9f247faaed3275931222a81f20c007ee07ac2dbd.

7 years agoRevert "Bug 14598: [QA Follow-up] Small changes"
Mason James [Thu, 29 Dec 2016 01:50:23 +0000 (14:50 +1300)]
Revert "Bug 14598: [QA Follow-up] Small changes"

This reverts commit 8c14c3b32a57fd9a3be4c7e44a79e1a4b8cc8acf.

Conflicts:
installer/data/mysql/updatedatabase.pl

7 years agoBug 17663: Forgotten userpermissions from bug 14686 (follow-up) v16.05.06-01
Mason James [Wed, 14 Dec 2016 09:42:04 +0000 (22:42 +1300)]
Bug 17663: Forgotten userpermissions from bug 14686 (follow-up)

Move atomic updates to updatedatabase.pl

7 years agoBug 15200 - t/Creators.t fails when using build-git-snapshot
Mirko Tietgen [Tue, 9 Aug 2016 09:52:15 +0000 (11:52 +0200)]
Bug 15200 - t/Creators.t fails when using build-git-snapshot

ttf-dejavu was missing from the build dependencies.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoAdd release notes for the 16.05.06 release v16.05.06
Mason James [Mon, 12 Dec 2016 03:41:40 +0000 (16:41 +1300)]
Add release notes for the 16.05.06 release

Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoVersion 16.05.06
Mason James [Wed, 7 Dec 2016 17:36:41 +0000 (06:36 +1300)]
Version 16.05.06

7 years agoBug 17513: Create GRANT for user@localhost in koha-create
Jonathan Druart [Thu, 27 Oct 2016 14:15:57 +0000 (14:15 +0000)]
Bug 17513: Create GRANT for user@localhost in koha-create

See the bug description for the details.

Test plan:
Use this script to create a new koha installation, using MariaDB
You should not display
"user koha_kohadev doesn't have enough privilege on database koha_kohadev "

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Confirm that this still works (with MySQL).
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17660: #adv is considered as an ad by adblock
Jonathan Druart [Fri, 18 Nov 2016 15:26:17 +0000 (15:26 +0000)]
Bug 17660: #adv is considered as an ad by adblock

So let's rename it!

Test plan:
Edit a $t in any framework, you should be able to unfold the "Advanced
constraints" part

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17419: Fix smsalertnumber and mobile confusion in moremember.pl
Lari Taskula [Mon, 10 Oct 2016 14:06:07 +0000 (17:06 +0300)]
Bug 17419: Fix smsalertnumber and mobile confusion in moremember.pl

members/moremember.pl will set mobile number as smsalertnumber in template if
smsalertnumber is not defined. This will cause incorrect display for SMS number
in patron's Details-tab. This confusion between smsalertnumber and mobile is
already fixed in Bug 14683, but members/moremember.pl was not fixed yet.

This is a minor issue since it won't occur for manually added new patrons due to
fixes already pushed in Bug 14683, but in case patron's smsalertnumber is null
in database, this bug can be replicated:

To test:
1. Set EnhancedMessagingPreferences to "Allow" and make sure SMSSendDriver
   has been set.
2. Add a new patron, give it a mobile/other phone number.
3. Run a SQL query:
   update koha.borrowers set smsalertnumber=NULL where borrowernumber=XXX;
   (replace XXX with your new patron's borrowernumber)
4. Go to patron's details tab and observe that SMS number shows the mobile/
   other phone you provided earlier.
5. Apply patch.
6. Refresh patron's details tab.
7. Observe that smsalertnumber is now empty, as it should be.

Followed test plan, works as expected.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17590 - Exporting reports as CSV with 'delimiter' SysPref set to 'tabulation...
Nick Clemens [Tue, 8 Nov 2016 17:26:36 +0000 (17:26 +0000)]
Bug 17590 - Exporting reports as CSV with 'delimiter' SysPref set to 'tabulation' creates files with 't' as separator

To test:
Set 'delimiter' system preference to 'tabs'
Export a report as csv
Open the file in text editor and note fields separated by character 't'
Apply patch
Export report as CSV
Open file in text editor and note tabs are used to separate fields

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
tabs now, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a...
Kyle M Hall [Wed, 24 Aug 2016 11:13:48 +0000 (11:13 +0000)]
Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds

If the AllowRenewalIfOtherItemsAvailable sys pref is set to allow, and a
borrower has an item checked out that has many items {30+} AND many
holds {70+) on it, loading the checkouts table for this borrower takes
FOREVER to load. The load time takes forever, because of the
factoring that happens to determine if an item is truly
available for renewal.

This patch swaps the use of GetMemberDetails for GetMember
and reorders the subroutine calls to check each items' renewability
from fastest to slowest.

In a test case, the results of pre patch were:
Start of loop: 2016-08-24T11:05:14
End of loop:   2016-08-24T11:05:29
Resulting in 15 seconds being spent in the loop

Post patch results were:
Start of loop: 2016-08-24T11:08:43
End of loop:   2016-08-24T11:08:48
Resulting in only 5 seconds being spent in the loop!

Test Plan:
1) Apply this patch
2) Note there are no changes in functionality for the renewals column of
   the patron checkouts table.

If you wish to go further and test the performance benefit:
1) Create a record with 50 items and 100 holds ( 50 waiting, 50 unfilled )
2) Check out one of the waiting holds to a patron
3) Time the amount of time it takes for the checkouts table to load
4) Apply this patch
5) Repeat step 3, you should see an improvement in load time

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug_17484 Search with date range limit (lower and upper) does not work
Koha Team Lyon 3 [Tue, 25 Oct 2016 11:37:47 +0000 (13:37 +0200)]
Bug_17484 Search with date range limit (lower and upper) does not work

If the period is entered without spaces wrapping the hyphen
You can't get any result

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
I can't reproduce the error, search still works after applying the patch

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 16493: [QA Followup] Restore title and author match as an option, make it the...
Kyle M Hall [Wed, 8 Jun 2016 10:53:25 +0000 (10:53 +0000)]
Bug 16493: [QA Followup] Restore title and author match as an option, make it the default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
7 years agoBug 16493: acq matching on title and author
Kyle M Hall [Wed, 11 May 2016 14:19:41 +0000 (14:19 +0000)]
Bug 16493: acq matching on title and author

When you order from a staged file you're getting duplicate warnings that
are inaccurate.  For example, when you order a file of 50 DVDs for
example and they don't have ISBNs they're matching on the books. And
then you have to order them one by one.

This patch replaces the use of FindDuplicates with Koha's match point
system. This means you can select from the same match points defined
and used in the batch record importer, or you can opt to skip matching
altogether!

Test Plan:
1) Import a record with a title, isbn and author.
2) Delete the from the record and stage it again
3) Attempt to add it to a basket via the staged record
4) You should note the gives you the "No records imported" message
5) Apply this patch
6) Create a matcher for ISBN
7) Create a matcher for Author/Title
8) Attempt to add the record to your basket using the ISBN matcher
8) Koha should find no match and import the record to the basket
9) Stage the record again
10) Attempt to add the record to your basket using the Title/Author matcher
11) You should recieve the "No records imported" message.

Signed-off-by: Barbara Fondren <bfondren@roundrocktexas.gov>
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17278: Fix test compilation errors
Jonathan Druart [Tue, 22 Nov 2016 07:33:50 +0000 (07:33 +0000)]
Bug 17278: Fix test compilation errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17278: Fix "show all items" link
Jonathan Druart [Mon, 3 Oct 2016 11:27:21 +0000 (12:27 +0100)]
Bug 17278: Fix "show all items" link

Then we need to remove the "available" part from the query.
They are really awkward patches...

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17278: Use available limit when requesting zebra when ccl query is used
Jonathan Druart [Mon, 3 Oct 2016 09:45:13 +0000 (10:45 +0100)]
Bug 17278: Use available limit when requesting zebra when ccl query is used

When a ccl query is used, the buildQuery subroutine does not handle
the available limit (not an index).
This available limit is handle later in the subroutine.
This affect the author links on the detail page for instance (an=xx).
A much better solution would be to keep an 'available' zebra index up-to-date.

Test plan:
(OPAC or staff interface, it does not matter)
- Launch a search, click on a result and then on an author link to
  launch another query (an:xx)
- Limit to available items without the 'facet'
=> Without this patch you won't get any results
=> With this patch applied you should get relevant result (regarding the
known bugs 16970, 13715, 13658, 5463, etc.)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17663: Forgotten userpermissions from bug 14686
Marcel de Rooy [Sun, 20 Nov 2016 15:35:53 +0000 (16:35 +0100)]
Bug 17663: Forgotten userpermissions from bug 14686

Bug 14686 added in a dbrev:
    (13, 'upload_general_files', 'Upload any file'),
    (13, 'upload_manage', 'Manage uploaded files');

But these were not added in userpermissions.sql somehow :)
So, what now?

This patch:
[1] adds them to userpermissions.sql as should have been done,
[2] adds a dbrev to add them for newer installs that did not run the
    14686 dbrev.

Test plan:
[1] Run this sql statement:
    DELETE FROM permissions WHERE code = 'upload_general_files' OR
        code = 'upload_manage'
[2] Run the db rev.
[3] Check if you see Tools/Upload (with sufficient perms).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17626 (QA followup)
Nick Clemens [Tue, 22 Nov 2016 10:45:56 +0000 (10:45 +0000)]
Bug 17626 (QA followup)

    Fix SAX parser error pointing to INSTALL docs

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17626: Remove existing install instructions and link to the wiki pages instead
Jonathan Druart [Tue, 15 Nov 2016 08:55:04 +0000 (08:55 +0000)]
Bug 17626: Remove existing install instructions and link to the wiki pages instead

Since we are pretty bad to maintain INSTALL files, I'd suggest to point
to the wiki.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17626: Remove INSTALL.distri files
Jonathan Druart [Tue, 15 Nov 2016 08:54:45 +0000 (08:54 +0000)]
Bug 17626: Remove INSTALL.distri files

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17132 - Availability search broken when using Elastic
Kyle M Hall [Mon, 15 Aug 2016 18:12:44 +0000 (18:12 +0000)]
Bug 17132 - Availability search broken when using Elastic

Elastic appears to be indexing onloan as a string, but our code assumes
it is a boolean.

Test Plan:
1) Ensure you are set up using Elastic as your search engine
2) Search only for available items from the advanced search
3) Note you get no results
4) Apply this patch
5) Re-run the search
6) You should now get results!

Signed-off-by: Jennifer Schmidt <jschmidt@switchinc.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml
Tomas Cohen Arazi [Wed, 16 Nov 2016 14:40:21 +0000 (11:40 -0300)]
Bug 17638: Make sure t/db_dependent/Search.t doesn't use a cached koha-conf.xml

This patch makes the tests clean the 'config' namespace for cache before
it runs any tests.

To test:
- Run:
  $ prove t/db_dependent/Search.t
=> FAIL: Self explanatory
- Apply the patch
- Run:
  $ prove t/db_dependent/Search.t
=> SUCCESS: All green
- Sign off :-D

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Cannot reproduce, but I trust everyone telling me it's failing ; )
No regressions spotted
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17559: Fixed HTML element ID of B_streetnumber
Radek Å iman [Thu, 3 Nov 2016 13:45:43 +0000 (14:45 +0100)]
Bug 17559: Fixed HTML element ID of B_streetnumber

There is a duplicate ID in HTML code, because of this:
<input type="text" id="B_address" name="B_streetnumber" size="5"
value="" />
<input type="text" id="B_address" name="B_address" size="40" value="" />

Test plan:
1) Edit a patron and look into its HTML code
2) Find input: name="B_streetnumber"
3) Its ID is B_address - a duplicate within the code in fact
4) Apply the patch
5) Repeat steps 1 and 2
6) The ID is unique now: B_streetnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17645 - Remove obsolete interface customization images
Owen Leonard [Wed, 16 Nov 2016 13:22:08 +0000 (08:22 -0500)]
Bug 17645 - Remove obsolete interface customization images

This patch removes three files which are obsolete following the removal
of the OPAC prog template.

To test, apply the patch and confirm that these files no longer exist in
misc/interface_customization:

- koha3-opac-button-background.png
- koha3-opac-button-background.psd
- koha3-opac-button-background.svg

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17545 [Revised] Make "Add biblio" not hidden by language chooser
Owen Leonard [Fri, 4 Nov 2016 13:34:12 +0000 (09:34 -0400)]
Bug 17545 [Revised] Make "Add biblio" not hidden by language chooser

This alternate patch changes the menu direction so that it "drops" up
instead of down. This avoids the problem of overlapping or being hidden
by the language chooser.

The disadvantage of this patch is that it is not global. However, I
think it's a better long-term solution to the problem.

To test, apply the patch and follow the issue description:

- Make sure more than one language is active for the staff client, so
  that the language chooser bar shows at the bottom of each page
- Do one or more Z39.50 searches, to make sure you have some records in
  the reservoir
- Go to "Cataloging" and do a "Catalog search", so that the reservoir is
  searched. Make sure your search is broad enough that some results from
  the reservoir is shown "below the fold"
- Scroll to the last result and click on the "Actions" menu

The direction of the menu should be up instead of down.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Popup menus on the cataloging search page now pop up instead
of down, which means they avoid being hidden by the language
chooser. Mission accimplished!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17657: Fix locations of item types images
Jonathan Druart [Fri, 18 Nov 2016 08:23:16 +0000 (08:23 +0000)]
Bug 17657: Fix locations of item types images

Koha::ItemType->image_location takes the interface in parameter or
default to OPAC.
From the item types admin page, we need to specify the intranet
interface to retrieve the correct image's url

Test plan:
Go on the item types admin page, see the source of the page and find the
image' urls.
=> Without this patch, they point to the OPAC
=> With this patch, the location is correct

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings
Tomas Cohen Arazi [Thu, 17 Nov 2016 15:29:14 +0000 (12:29 -0300)]
Bug 17653: Remove itemtype-related t/db_dependent/Circulation* warnings

This patch makes t/db_dependent/Circulation* create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation*
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation*
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17647: Remove itemtype-related CancelReceipt.t warnings
Tomas Cohen Arazi [Wed, 16 Nov 2016 19:44:44 +0000 (16:44 -0300)]
Bug 17647: Remove itemtype-related CancelReceipt.t warnings

This patch makes t/db_dependent/Acquisition/CancelReceipt.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Acquisition/CancelReceipt.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Acquisition/CancelReceipt.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 12359: Add HidePatronName functionality to the holds queue
Katrin Fischer [Mon, 10 Nov 2014 19:23:45 +0000 (20:23 +0100)]
Bug 12359: Add HidePatronName functionality to the holds queue

This changes the Holds Queue page to not show the patron's name
and phone number, but only the cardnumber, when HidePatronName
is set to 'Don't show'

This also changes the link to the patron account to use
the borrowernumber instead of the cardnumber, which seems
more consistent.

Fixes a tiny capitalization error: Only item...

To test:
- Look at the holds queue page with holds displayed
- Toggle HidePatronName system preference and observe the change
- Make sure the link works correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Rebased 2016-10-16

Signed-off-by: Chris Kirby <christopherlawrencekirby@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17377: ES - Take control fields into account
Jonathan Druart [Thu, 29 Sep 2016 15:08:36 +0000 (16:08 +0100)]
Bug 17377: ES - Take control fields into account

There is a bug in Koha::SearchEngine::Elasticsearc::Search->json2marc, it
assumes that the MARC::Field constructor always takes >= 5 parameters.
This assumption is wrong for control fields, to create a control field you
need to call the constructor with:
  MARC::Field->new($tag, $value);

Note that I got "Too much data for control field" in the _warning value of my
MARC::Field because too many parameters were passed, and the value was undef.

That broke the result search links (on the staff interface) for DB with
biblio.biblionumber mapped with 001.

Other bugs will certainly be fixed by this patch.
For instance I got:
  GetMarcBiblio called with undefined biblionumber at /home/koha/src/opac/opac-search.pl line 664.
  GetCOinSBiblio called with undefined record at /home/koha/src/opac/opac-search.pl line 665.
in my logs, with this patch I don't get them anymore.

Test plan:
You can try to recreate the different issues and confirm than this patch
fixes them.
Or just run the tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17377: Add tests for json2marc
Jonathan Druart [Thu, 29 Sep 2016 15:41:53 +0000 (16:41 +0100)]
Bug 17377: Add tests for json2marc

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17636: Remove itemtype-related GetIssues.t warnings
Tomas Cohen Arazi [Tue, 15 Nov 2016 20:40:22 +0000 (17:40 -0300)]
Bug 17636: Remove itemtype-related GetIssues.t warnings

This patch makes t/db_dependent/Circulation/GetIssues.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/GetIssues.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/GetIssues.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17646: Remove itemtype-related IssueSlip.t warnings
Tomas Cohen Arazi [Wed, 16 Nov 2016 13:59:26 +0000 (10:59 -0300)]
Bug 17646: Remove itemtype-related IssueSlip.t warnings

This patch makes t/db_dependent/Members/IssueSlip.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Members/IssueSlip.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Members/IssueSlip.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
All test pass successfuly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17644 - t/db_dependent/Exporter/Record.t fails
Kyle M Hall [Wed, 16 Nov 2016 12:40:31 +0000 (12:40 +0000)]
Bug 17644 - t/db_dependent/Exporter/Record.t fails

Test Plan:
1) prove t/db_dependent/Exporter/Record.t fails
2) Apply this patch
3) prove t/db_dependent/Exporter/Record.t succeeds!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17637: Fix tests Auth_with_ldap.t
Jonathan Druart [Wed, 16 Nov 2016 07:44:03 +0000 (07:44 +0000)]
Bug 17637: Fix tests Auth_with_ldap.t

Koha::Patron->delete create a transaction and so we need to use
txn_begin to have nested txn

DBD::mysql::db begin_work failed: Already in a transaction

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17587: Remove itemtype-related IsItemIssued.t warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 15:40:45 +0000 (12:40 -0300)]
Bug 17587: Remove itemtype-related IsItemIssued.t warnings

This patch makes t/db_dependent/Circulation/IsItemIssued.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: [QA Follow-up] Small changes
Marcel de Rooy [Fri, 28 Oct 2016 07:54:20 +0000 (09:54 +0200)]
Bug 14598: [QA Follow-up] Small changes

[1] Renames the dbrev version to XXX; adding a my for $sth, although
    not strictly necessary it feels better.
[2] Circulation.t stumbles over:
    Undefined subroutine &C4::Circulation::GetItem called at ... line 1283.
    Somehow this is related to use_ok instead of a regular use.
    Worked around this by require_ok and adding a regular use.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: Fix warning from effective_itemtype
Jonathan Druart [Thu, 7 Apr 2016 11:03:49 +0000 (12:03 +0100)]
Bug 14598: Fix warning from effective_itemtype

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: (QA followup) use deleted{items|biblioitems} during upgrade
Tomas Cohen Arazi [Wed, 6 Apr 2016 14:34:26 +0000 (11:34 -0300)]
Bug 14598: (QA followup) use deleted{items|biblioitems} during upgrade

If the 'statistics' table contains circulation information about items
that are no longer on the DB it will raise a warning. This patch
makes the updatedatabase.pl script use the deleteditems and deletedbiblioitems
tables to get information for those items on the statistics table.

To reproduce:
- Have your sample DB contain some circulation data on the statistics table
- Make sure some of them have NULL itemtype:
> UPDATE statistics SET itemtype = NULL WHERE type='return';
- Check the upgrade query catches them:
> SELECT s.itemnumber, i.itype, b.itemtype FROM  ( SELECT DISTINCT itemnumber    FROM statistics    WHERE ( type = "return" OR type = "localuse" ) AND itemtype IS NULL ) s  LEFT JOIN  ( SELECT itemnumber,biblionumber, itype      FROM items    UNION    SELECT itemnumber,biblionumber, itype      FROM deleteditems ) i  ON (s.itemnumber=i.itemnumber)  LEFT JOIN  ( SELECT biblionumber, itemtype      FROM biblioitems    UNION    SELECT biblionumber, itemtype      FROM deletedbiblioitems ) b  ON (i.biblionumber=b.biblionumber);
+------------+-------+----------+
| itemnumber | itype | itemtype |
+------------+-------+----------+
|        732 | BK    | BK       |
|        731 | BK    | BK       |
+------------+-------+----------+
2 rows in set (0.00 sec)

- Delete the items, and some biblio too.
- Re-run the query
=> SUCCESS: Same results
- Go reset to NULL the itemtypes
> UPDATE statistics SET itemtype = NULL WHERE type='return';
- Run the updatedatabase.pl script:
 $ sudo koha-shell koahdev ; cd kohaclone
 $ perl installer/data/mysql/updatedatabase.pl
=> SUCCESS: No warnings

Note: It is possible that on production sites, if the sysadmin is cleaning the
deleted{items|biblioitems|biblio} tables, there will be warnings. This is expected
as they need to know some data lacks information.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: (followup) Remove unused and non-existent C4::ItemType include
Tomas Cohen Arazi [Fri, 1 Apr 2016 15:25:39 +0000 (12:25 -0300)]
Bug 14598: (followup) Remove unused and non-existent C4::ItemType include

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598 [QA Followup] - Update localuse statistics also
Kyle M Hall [Tue, 19 Jan 2016 14:34:20 +0000 (14:34 +0000)]
Bug 14598 [QA Followup] - Update localuse statistics also

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598 [QA Followup] - Make unit test pass
Kyle M Hall [Tue, 12 Jan 2016 16:04:55 +0000 (16:04 +0000)]
Bug 14598 [QA Followup] - Make unit test pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598 [QA Followup] - Correct the behavior of GetItem
Kyle M Hall [Fri, 18 Dec 2015 14:59:02 +0000 (14:59 +0000)]
Bug 14598 [QA Followup] - Correct the behavior of GetItem

Currently GetItem sets itemtype to the biblio itemtype if no item level
itemtype exists. Instead, it should only do this if item_level-itypes
is not set.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598 [QA Followup] - Only fetch bib data if needed
Kyle M Hall [Fri, 20 Nov 2015 14:23:22 +0000 (14:23 +0000)]
Bug 14598 [QA Followup] - Only fetch bib data if needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598 - QA Followup touching CanBookBeIssued subroutine
Brendan A Gallagher [Thu, 19 Nov 2015 21:13:05 +0000 (21:13 +0000)]
Bug 14598 - QA Followup touching CanBookBeIssued subroutine

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: (DB update) fix NULL itemtypes in statistics on 'return' rows
Tomas Cohen Arazi [Tue, 1 Sep 2015 14:52:17 +0000 (11:52 -0300)]
Bug 14598: (DB update) fix NULL itemtypes in statistics on 'return' rows

This patch introduces an updatedatabase.pl entry that takes care of
updating existing statistics rows.

It does so by looping on the statistics rows, collecting itemnumber occurences
that are have NULL itemtypes.
It then chooses the right itemtype following what is proposed on bug 14651, and
then updates the rows in statistics using the calculated itemtype.

Regards

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: (QA followup) Don't die on bad barcode
Kyle M Hall [Mon, 27 Jul 2015 15:16:56 +0000 (11:16 -0400)]
Bug 14598: (QA followup) Don't die on bad barcode

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: Make C4::Circulation::AddReturn store the right itemtype
Tomas Cohen Arazi [Mon, 27 Jul 2015 14:40:38 +0000 (11:40 -0300)]
Bug 14598: Make C4::Circulation::AddReturn store the right itemtype

This patch makes C4::Circulation::AddReturn correctly store the itemtype
on the 'statistics' table.

To reproduce:
- Checkout master.
- Make a checkout.
- Check the 'statistics' table and notice the itemtype is correctly set
  > SELECT * FROM statistics;
- Check the item in.
- Check the 'statistics' table and notice the itemtype is not set
  > SELECT * FROM statistics WHERE type="return";
=> FAIL: itemtype is set to NULL

To test:
- Apply the regression tests patch
- Run the tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> FAIL: Tests fail
- Apply this patch
- Run the regression tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> SUCCESS: Tests now pass.
- Repeat the 'To reproduce' steps
=> SUCCESS: itemtype is now correctly set (in real life)
- Happily sign off :-D

Sponsored-by: Universidad Empresarial Siglo 21
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table
Tomas Cohen Arazi [Sun, 26 Jul 2015 05:05:16 +0000 (02:05 -0300)]
Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table

This patch adds tests for C4::Circulation::AddReturn(). Both tests are wrapped
inside a subtest, and look for AddReturn storing the right itemtype on the
'statistics' table.

Note: It also refactors the file a bit, to avoid side effects. And uses TestBuilder
to make it independent on already-present db data. It also removes warnings by mocking
C4::Context::userenv

To test:
- Apply the patch
- Run the tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> FAIL: Tests fail bacause AddReturn is not storing the itemtype
- Sign off :-D

Sponsored-by: Universidad Empresarial Siglo 21
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17476: Add a way to bypass dt_from_string processing time for slow servers
Jonathan Druart [Fri, 21 Oct 2016 07:01:30 +0000 (07:01 +0000)]
Bug 17476: Add a way to bypass dt_from_string processing time for slow servers

We already change this value from 1 to 2 but apparently it's not enough
So let's switch it back to on and add a flag (env var SLOW_SERVER) and skip these tests
if set

Test plan:
  prove t/DateUtils.t
and
  SLOW_SERVER=1 prove t/DateUtils.t

should return green

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17641: Fix t/Biblio/Isbd.t
Jonathan Druart [Wed, 16 Nov 2016 09:49:20 +0000 (09:49 +0000)]
Bug 17641: Fix t/Biblio/Isbd.t

On commit cadf5aea814636ccccd85fcc38aa30f751d779c0
    Bug 11592: MARCView and ISBD followup
The prototype of C4::Biblio::GetISBDView has been changed to take a
hashref in parameter.
But the tests have not been updated

Test plan:
  prove t/Biblio/Isbd.t
should return green

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
https://bugs.koha-community.org/show_bug.cgi?id=17637
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 15690: Hardcoded 16 is uncool
Mark Tompsett [Wed, 14 Sep 2016 19:14:02 +0000 (15:14 -0400)]
Bug 15690: Hardcoded 16 is uncool

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Followed test plan in comment #7, works as expectd.
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 15690: CardnumberLength should not be bigger than 16
Jonathan Druart [Tue, 13 Sep 2016 14:43:50 +0000 (15:43 +0100)]
Bug 15690: CardnumberLength should not be bigger than 16

borrowers.cardnumber is a varchar(16), so CardnumberLength should not
have a max > 16

Test plan:
Test different value in CardnumberLength ("20", "20,30", "40,")
Edit a patron a make sure the text display under the cardnumber input is
correct

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17582: Fix authority framework edition
Jonathan Druart [Tue, 8 Nov 2016 14:43:46 +0000 (14:43 +0000)]
Bug 17582: Fix authority framework edition

Step to recreate:
Admin>Authority types > Actions > Marc structure

Test plan
Confirm that this patch fixes the issue

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.
Can edit auth marc structure

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17603: Remove itemtype-related Borrower_Discharge.t warnings
Tomas Cohen Arazi [Wed, 9 Nov 2016 19:45:38 +0000 (16:45 -0300)]
Bug 17603: Remove itemtype-related Borrower_Discharge.t warnings

This patch makes t/db_dependent/Patron/Borrower_Discharge.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Patron/Borrower_Discharge.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Patron/Borrower_Discharge.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17592: Remove itemtype-related maxsuspensiondays.t warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 19:28:07 +0000 (16:28 -0300)]
Bug 17592: Remove itemtype-related maxsuspensiondays.t warnings

This patch makes t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17587: Remove itemtype-related IsItemIssued.t warnings
Tomas Cohen Arazi [Tue, 8 Nov 2016 15:40:45 +0000 (12:40 -0300)]
Bug 17587: Remove itemtype-related IsItemIssued.t warnings

This patch makes t/db_dependent/Circulation/IsItemIssued.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/IsItemIssued.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17575: (followup) Remove missing fine type warnings
Tomas Cohen Arazi [Mon, 7 Nov 2016 19:08:02 +0000 (16:08 -0300)]
Bug 17575: (followup) Remove missing fine type warnings

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17575: Remove itemtype-related warnings from Circulation.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 19:00:21 +0000 (16:00 -0300)]
Bug 17575: Remove itemtype-related warnings from Circulation.t

To test:
- Run:
  $ prove t/db_dependent/Circulation.t
=> FAIL: Lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation.t
=> SUCCESS: All green and no itemtype warnings
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17574: Remove itemtype-related warnings from LocalHoldsPriority.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 18:31:53 +0000 (15:31 -0300)]
Bug 17574: Remove itemtype-related warnings from LocalHoldsPriority.t

To test:
- Run:
  $ prove t/db_dependent/Holds/LocalHoldsPriority.t
=> FAIL: Tests raise lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/Holds/LocalHoldsPriority.t
=> SUCCESS: Tests pass, and no warnings!
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17573: Remove itemtype-related warnings from DecreaseLoanHighHolds.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 18:24:34 +0000 (15:24 -0300)]
Bug 17573: Remove itemtype-related warnings from DecreaseLoanHighHolds.t

To test:
- Run:
  $ prove t/db_dependent/DecreaseLoanHighHolds.t
=> FAIL: Lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/DecreaseLoanHighHolds.t
=> SUCCESS: All green and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17572: [QA Follow-up] Cosmetic changes
Marcel de Rooy [Fri, 11 Nov 2016 08:27:12 +0000 (09:27 +0100)]
Bug 17572: [QA Follow-up] Cosmetic changes

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17572: (followup) Remove test's hardcoded values
Tomas Cohen Arazi [Mon, 7 Nov 2016 18:09:24 +0000 (15:09 -0300)]
Bug 17572: (followup) Remove test's hardcoded values

This patch makes the tests use t::lib::TestBuilder instead of
hardcoding values.

Test plan:
- Run:
  $ prove t/db_dependent/Circulation/issue.t
=> SUCCESS: All tests return green with and without the patch
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17572: Remove itemtype-related warnings from issue.t
Tomas Cohen Arazi [Mon, 7 Nov 2016 17:55:41 +0000 (14:55 -0300)]
Bug 17572: Remove itemtype-related warnings from issue.t

This patch makes t/db_dependent/Circulation/issue.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/Circulation/issue.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/issue.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17420 - record export fails when itemtype on biblio - followup
Fridolin Somers [Mon, 7 Nov 2016 15:07:01 +0000 (16:07 +0100)]
Bug 17420 - record export fails when itemtype on biblio - followup

Same as previous patch for misc/export_records.pl.

Test plan :
- Use syspref item-level_itypes = biblio record
- Run misc/export_records.pl
=> Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ...
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Export Ok, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17420 - record export fails when itemtype on biblio
Fridolin Somers [Mon, 10 Oct 2016 14:46:04 +0000 (16:46 +0200)]
Bug 17420 - record export fails when itemtype on biblio

In Tools, Export data, you can export with a filter on item type.
When item type is on biblio record, you get the error :
export.pl: DBIx::Class::ResultSet::next(): Unknown column 'biblioitems.itemtype' in 'where clause' at /home/koha/src/Koha/Objects.pm line 150

Looks like its because this code use to be a SQL Select and is now a DBIx call :
                          C4::Context->preference('item-level_itypes')
                            ? ( 'items.itype' => $itemtype )
                            : ( 'me.itemtype' => $itemtype )

This patch corrects by using "me.itemtype"

Test plan :
- Use syspref item-level_itypes = biblio record
- Go to Tools > Export data : /cgi-bin/koha/tools/export.pl
- Select an item type
- Click on "Export biblio records"
=> Without patch you get an error 500
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17204: Rancor Z39.50 search fails under plack
Nick Clemens [Fri, 26 Aug 2016 15:04:12 +0000 (15:04 +0000)]
Bug 17204: Rancor Z39.50 search fails under plack

MetaSearcher.pm forks children to handle searching each server. When the
process waits for the children it never continues.

The simplest solution here is to exclude the metasearcher service from
running under plack

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t
Jonathan Druart [Mon, 7 Nov 2016 11:10:04 +0000 (11:10 +0000)]
Bug 17564: Fix t/db_dependent/Acquisition/OrderUsers.t

ModReceiveOrder takes now a 'order' parameter and is mandatory.
This new test file has been added after the first submission of bug
13321 and has not been updated during the rebases.

Test plan:
  prove t/db_dependent/Acquisition/OrderUsers.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17589 - Improper method type in Koha::ItemType(s)
Kyle M Hall [Tue, 8 Nov 2016 17:12:27 +0000 (17:12 +0000)]
Bug 17589 - Improper method type in Koha::ItemType(s)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17394 - exporting checkouts with items selects without items in combo-box
Fridolin Somers [Tue, 4 Oct 2016 10:36:11 +0000 (12:36 +0200)]
Bug 17394 - exporting checkouts with items selects without items in combo-box

In checkouts table, the is an export form (when some exports syspref are enabled).
When selecting some checkouts and selecting "ISO2709 with items" in export format combo-box, clicking on "Export" will select "ISO2709 without items" in the export format combo-box.
This is quite strange.
Its because the form as 2 inputs with same name and id "output_format" : an hidden input (the wanted arg for tools/export.pl) and a select (the export format combo-box).
So an action meant on the hidden input impacts the select.

This patch corrects by changing id and name of the export format combo-box : issues-table-output-format

TEST plan :
- Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile
- Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx
- Show checkouts table
- Select some checkboxes in "Export" column
- Select "ISO2709 with items" in export format combo-box
- Click on "Export"
=> Without patch, the export format combo-box changes to "ISO2709 without items"
=> With patch, the export format combo-box does not changes
- Check the export file contains the items
- Check exports "ISO2709 without items" and "CSV" are OK

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)
Matthias Meusburger [Fri, 21 Oct 2016 15:04:58 +0000 (17:04 +0200)]
Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17494: (QA followup) Fix exception name
Tomas Cohen Arazi [Fri, 4 Nov 2016 15:18:57 +0000 (12:18 -0300)]
Bug 17494: (QA followup) Fix exception name

This patch changes the exception name to match the package name. And
also adds a test for the thrown exception message.

Also creates a general Koha::Exception::Patron::Modification exception
to make the new one inherit from it, following the common use in the codebase.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17494: Prevent duplicate tokens from getting stored
Kyle M Hall [Mon, 31 Oct 2016 11:15:02 +0000 (11:15 +0000)]
Bug 17494: Prevent duplicate tokens from getting stored

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17494: Make sure the same verification token won't be generated twice
Jonathan Druart [Thu, 27 Oct 2016 08:04:30 +0000 (10:04 +0200)]
Bug 17494: Make sure the same verification token won't be generated twice

Well, this patch does not enforce the unique constraint but mimic what
is already done in C4::ImportExportFramework and Koha::Upload where
md5_hex is used.

Test plan:
Have a look at the code and confirm that it adds more randomness to the
hashed string

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 16493: [QA Followup] Restore title and author match as an option, make it the...
Kyle M Hall [Wed, 8 Jun 2016 10:53:25 +0000 (10:53 +0000)]
Bug 16493: [QA Followup] Restore title and author match as an option, make it the default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 16493: acq matching on title and author
Kyle M Hall [Wed, 11 May 2016 14:19:41 +0000 (14:19 +0000)]
Bug 16493: acq matching on title and author

When you order from a staged file you're getting duplicate warnings that
are inaccurate.  For example, when you order a file of 50 DVDs for
example and they don't have ISBNs they're matching on the books. And
then you have to order them one by one.

This patch replaces the use of FindDuplicates with Koha's match point
system. This means you can select from the same match points defined
and used in the batch record importer, or you can opt to skip matching
altogether!

Test Plan:
1) Import a record with a title, isbn and author.
2) Delete the from the record and stage it again
3) Attempt to add it to a basket via the staged record
4) You should note the gives you the "No records imported" message
5) Apply this patch
6) Create a matcher for ISBN
7) Create a matcher for Author/Title
8) Attempt to add the record to your basket using the ISBN matcher
8) Koha should find no match and import the record to the basket
9) Stage the record again
10) Attempt to add the record to your basket using the Title/Author matcher
11) You should recieve the "No records imported" message.

Signed-off-by: Barbara Fondren <bfondren@roundrocktexas.gov>
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 16792: Add Font Awesome Icon and mini button to Keyword to MARC mapping section
Hector Castro [Tue, 21 Jun 2016 19:24:20 +0000 (13:24 -0600)]
Bug 16792: Add Font Awesome Icon and mini button to Keyword to MARC mapping section

Improve Admin > Keyword to MARC mapping to fit with others interfaces in Koha.
This bug change "Delete" link with a mini-button and introduce the trash icon.

To test:
-Apply patch
-Goto Admin > Keyword to MARC mapping
-Select one framework
-Add some mappings
-Notice about the new button with trash icon

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17544 - : Remove t::lib::Mocks dependency from populate_db.pl
Tomas Cohen Arazi [Thu, 3 Nov 2016 13:17:32 +0000 (10:17 -0300)]
Bug 17544 - : Remove t::lib::Mocks dependency from populate_db.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
7 years agoBug 17084 - Automatic debian/control updates (unstable)
Nightly Build Bot [Fri, 28 Oct 2016 22:59:58 +0000 (00:59 +0200)]
Bug 17084 - Automatic debian/control updates (unstable)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Mason James <mtj@kohaaloha.com>