]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 15142: (follow-up) remove from Zebra UNIMARC config files
Fridolin Somers [Tue, 26 Nov 2019 08:44:08 +0000 (09:44 +0100)]
Bug 15142: (follow-up) remove from Zebra UNIMARC config files

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 15142: Remove titles facet for UNIMARC
Fridolin Somers [Fri, 22 Nov 2019 14:16:51 +0000 (15:16 +0100)]
Bug 15142: Remove titles facet for UNIMARC

There is a facet using 500$a, 501$a and 503$a and Subject index.
In UNIMARC 500$a, 501$a and 503$a are not indexed as Subject.
I propose to remove this facet for UNIMARC, looks like it does not make
sens.

Test plan:
1) Install UNIMARC database
2) Edit some records to have 500$a
3) Perform a search to find those records
4) Check you dont see the titles facet

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23377: (QA follow-up) Use OVERRIDE_SYSPREF
Marcel de Rooy [Fri, 10 Jan 2020 10:49:45 +0000 (10:49 +0000)]
Bug 23377: (QA follow-up) Use OVERRIDE_SYSPREF

SYSPREF_OVERRIDE unfortunately is not supported ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23377: use ENV syspref override instead of complete disable
Ian Walls [Wed, 31 Jul 2019 16:32:23 +0000 (16:32 +0000)]
Bug 23377: use ENV syspref override instead of complete disable

In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog
and AuthoritiesLog to 0.  It does this by disabling syspref caching and saving
the changes to the database (then replacing the original values at completion).

Unfortunately, this disables other key sysprefs from being cached, and results in
a 50% increase in processing time for the script.

This patch instead utilizes the ENV variable override feature of sysprefs, which
preempts the cache in C4::Context->preference().

To test:
1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do)
2. Note the time taken to complete
3. Apply patch
4. Revert the biblio load performed
5. Perform another bulkmarcimport with the same biblios and commandline options
6. Note the time taken to complete
7. Compare times.  The time from step 6 should be about 33% less than the time from step 2
8. Check Cataloguing and Authorities Logs to verify imported records were not logged
9. Profit!

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24200: Try to fix random failures from Borrower_PrevCheckout.t
Jonathan Druart [Fri, 10 Jan 2020 10:48:09 +0000 (11:48 +0100)]
Bug 24200: Try to fix random failures from Borrower_PrevCheckout.t

It failed inconsistently, let's try to use build_sample_item and see if
it fixes the random failures.

Test plan:
 % prove t/db_dependent/Patron/Borrower_PrevCheckout.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24396: Fix Suggestions.t with MySQL 8
Jonathan Druart [Fri, 10 Jan 2020 10:29:15 +0000 (11:29 +0100)]
Bug 24396: Fix Suggestions.t with MySQL 8

 #   Failed test 'DelSuggestion deletes the correct suggestion'
 #   at t/db_dependent/Suggestions.t line 413.
 #          got: 'my title 3'
 #     expected: 'my deleted title'
 t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.

Suggestions were returned in the reverse order. Adding an ORDER BY clause fixes the problem.

Test plan:
 % prove t/db_dependent/Suggestions.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23274: Mock simple_search_compat to cover both search engines
Nick Clemens [Tue, 26 Nov 2019 12:57:17 +0000 (12:57 +0000)]
Bug 23274: Mock simple_search_compat to cover both search engines

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24323: Advanced editor - Display an error message if the record did not save
Cori Lynn Arnold [Tue, 31 Dec 2019 17:10:14 +0000 (17:10 +0000)]
Bug 24323: Advanced editor - Display an error message if the record did not save

Invalid 008 with helper silently fails to save.

This patch adds a "else if" to fall through if the error message isn't
one of the previously defined ones ("syntax" and "invalid") and presents
the human with a generic message that "Something went wrong, cannot
save."

Prior to testing:
a/Verify that Advanced Editor is enabled
b/Download the errorrecord.mrc from bug

To test:
1/Apply patch
2/Go to Cataloging->Advanced Editor
3/Click "Import Record" button and navigate to the record saved from
step b/
4/Add an 003 field (as required by the default cataloging config)
5/Hit "Save to catalog"
6/Verify that a message is passed to the user that the file was unable
to be saved

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24371: Fix "Show all items" avaibility link (use $raw filter) - intra
Jonathan Druart [Fri, 10 Jan 2020 08:56:12 +0000 (09:56 +0100)]
Bug 24371: Fix "Show all items" avaibility link (use $raw filter) - intra

Same fix for the intranet side

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24371: Fix "Show all items" avaibility link (use $raw filter) - opac
Lucas Gass [Tue, 7 Jan 2020 18:54:49 +0000 (18:54 +0000)]
Bug 24371: Fix "Show all items" avaibility link (use $raw filter) - opac

TO TEST:
1. Make an OPAC search with plenty of results.
2. Use the search facets to limit the search in some way, item type, author, etc.
3. Click on 'Limit to currently available items', everything is still fine.
4. Attempt to return to 'Show all items', there will be no search results.
5. Apply patch
6. Ateempt steps 1-4 again.
7. Should work this time.

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 14759: Add test
Jonathan Druart [Thu, 9 Jan 2020 15:17:12 +0000 (16:17 +0100)]
Bug 14759: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 14759: Replace Text::Unaccent with Unicode::Normalize
Martin Renvoize [Wed, 8 Jan 2020 09:13:18 +0000 (09:13 +0000)]
Bug 14759: Replace Text::Unaccent with Unicode::Normalize

As shown in the comments on the bug, it appears that Unicode::Normalize
is the most reliable way to strip accents from strings for this use
case.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10352: Get add operations too
Nick Clemens [Fri, 13 Dec 2019 17:08:58 +0000 (17:08 +0000)]
Bug 10352: Get add operations too

When an add for biblio or item is recorded there is no space in the info field

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10352: (follow-up) Show the biblionumber for items in modification logs
Nick Clemens [Mon, 25 Nov 2019 12:09:45 +0000 (12:09 +0000)]
Bug 10352: (follow-up) Show the biblionumber for items in modification logs

This patch adds a link to the the biblio that shows the biblionumber of the item. It makes things a little more obvious

To test:
1 - Find a biblio with an item where an itemnumber on another biblio is equal to that biblionumber
   i.e. In the sample data:
        biblionumber 59 with item with itemnumber 127
        item with itemnumber  59 on biblionumber 23
2 - Edit both items however you wish
3 - On biblionumber 59 click the modification log
4 - You should see "Item 127"
5 - Click "Submit" on the form - this searches as itemnumber
6 - You should see "Item 59"
7 - Apply patch
8 - On biblionumber 59 click the modification log
9 - You should see "Item 127 from Biblio 59"
10 - Click "Submit" on the form - this searches as itemnumber
11 - You should see "Item 59 from Biblio 23"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10352: Use a new object_type parameter instead of the module's name
Jonathan Druart [Mon, 25 Nov 2019 10:28:40 +0000 (11:28 +0100)]
Bug 10352: Use a new object_type parameter instead of the module's name

To dissociate a search on biblio and item, we pass a new "object_type"
parameter to viewlog.pl. If equals 'biblio' we will assume that "object"
contains a biblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10352: Display the correct modification logs for bibliographic records
Jonathan Druart [Mon, 13 May 2019 15:36:14 +0000 (10:36 -0500)]
Bug 10352: Display the correct modification logs for bibliographic records

The 'Modification log" link in the cataloguing module returns confusing
results. The 'object' parameter is the biblionumber, but the all log
from itemnumber=biblionumber will be displayed as well.
Since bug 11473 we have the action_logs.info column that is prefixed by
'item ' or 'biblio ' to disociated an item modification from a biblio
modif.
This patch suggests a quick and dirty approach, use this column to make
sure we are searching for the correct logs.
/!\ As bug 11473 did not update the existing rows, we will no longer display
the logs created prior to this change.

Test plan:
Make sure you have at least 2 bibliographic records with some items
Make sure you have the biblionumbers of those records that match
existing itemnumbers
Edit them (no matter what you change)
Go to the bibliographic detail page (staff) and click "Modification log"
You should see the correct changes.

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24394: Typo when adding a new cash register
Caroline Cyr La Rose [Thu, 9 Jan 2020 19:52:24 +0000 (14:52 -0500)]
Bug 24394: Typo when adding a new cash register

This patch corrects a typo in the cash register template.

To test:
1) Go to Administration > Global system preferences
2) Search for UseCashRegisters
3) Enable UseCashRegisters and save
4) Go to Administration > Cash registers
5) Click on 'New cash register'
6) Notice the title says 'Add new cash_register'
7) Apply patch
8) Refresh and notice it now says 'Add new cash register'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24313: Always display XSLT errors in logs
Jonathan Druart [Fri, 27 Dec 2019 13:55:36 +0000 (14:55 +0100)]
Bug 24313: Always display XSLT errors in logs

From
  commit 295ae33800a322facfdf56795f4c02b2fd53432b
  Bug 20272: Replace error numbers by codes in XSLT_Handler

"""
    Make XSLT_Handler a little bit less noisy by defaulting print_warns to
    false unless $ENV{DEBUG} is set. (See also bug 19018).
"""

I think we should warn the errors in the logs. They are not debug messages here, we should not rely on DEBUG.
If too noisy we should fix the original issues, not hide all the errors (which make the XSLT debugging super hard)

Test plan:
Break a XSLT, reload the page and confirm that there are useful errors in the Koha log file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic...
Jonathan Druart [Tue, 10 Dec 2019 14:24:36 +0000 (15:24 +0100)]
Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only)

If elastic is used as search engine, the bulkmarcimport.pl will not
handle correctly UTF-8 encoded MARCXML

Koha::SearchEngine::Search->new uses a require statement to load the correct Search module.
This is done l.257 of bulkmarcimport.pl:
  257 my $searcher = Koha::SearchEngine::Search->new

Koha::SearchEngine::Elasticsearch::Search will `use MARC::File::XML`, and so resets the arguments set before:
  216     $MARC::File::XML::_load_args{BinaryEncoding} = 'utf-8';

  220     $MARC::File::XML::_load_args{RecordFormat} = $recordformat;

An easy (but dirty) fix could be to move the declaration of my $searcher before in the script.
The tricky (but correct) fix would be to remove the long standing "ugly hack follows" comment.

This patch is the easy, and dirty, fix

Test plan:
Use the command line tool to import MARXCML records that contains unicode characters into Koha

Something like `misc/migration_tools/bulkmarcimport.pl -biblios -file record.marcxml -m=MARCXML`

Without this patch you will notice that unicode characters will not be displayed correctly

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Add test descriptions
Martin Renvoize [Mon, 2 Dec 2019 09:22:31 +0000 (09:22 +0000)]
Bug 23974: Add test descriptions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Add tests for issue on closed day
Martin Renvoize [Mon, 2 Dec 2019 09:00:18 +0000 (09:00 +0000)]
Bug 23974: Add tests for issue on closed day

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Test Notes
Martin Renvoize [Fri, 29 Nov 2019 17:09:06 +0000 (17:09 +0000)]
Bug 23974: Test Notes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Add POD for hours_between
Martin Renvoize [Fri, 29 Nov 2019 16:44:45 +0000 (16:44 +0000)]
Bug 23974: Add POD for hours_between

Add a bit of missing POD whilst we're working in here

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: (follow-up) Add same day loan tests
Martin Renvoize [Fri, 8 Nov 2019 13:37:17 +0000 (13:37 +0000)]
Bug 23974: (follow-up) Add same day loan tests

Hourly loans can be short enough to not cross a day boundary and as such
we should test for that scenario in the hour_between tests too.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Both methods should have the same logic/construction
Jonathan Druart [Tue, 5 Nov 2019 16:44:36 +0000 (17:44 +0100)]
Bug 23974: Both methods should have the same logic/construction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Add tests for days_between
Jonathan Druart [Tue, 5 Nov 2019 16:13:53 +0000 (17:13 +0100)]
Bug 23974: Add tests for days_between

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Add new tests for hours_between
Jonathan Druart [Tue, 5 Nov 2019 15:23:00 +0000 (16:23 +0100)]
Bug 23974: Add new tests for hours_between

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23974: Improve readability
Jonathan Druart [Tue, 5 Nov 2019 14:18:38 +0000 (15:18 +0100)]
Bug 23974: Improve readability

This patch does not change anything, just a bit of cleaning

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoUpdate release notes for 19.11.02 release v19.11.02
Joy Nelson [Wed, 22 Jan 2020 16:08:25 +0000 (16:08 +0000)]
Update release notes for 19.11.02 release

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoIncrement version for 19.11.02 release
Joy Nelson [Wed, 22 Jan 2020 15:46:35 +0000 (15:46 +0000)]
Increment version for 19.11.02 release

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoTranslation updates for Koha 19.11.02
Koha translators [Wed, 22 Jan 2020 15:19:46 +0000 (12:19 -0300)]
Translation updates for Koha 19.11.02

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoRevert "Bug 24181: Make our datepicker inputs sexy"
Joy Nelson [Tue, 21 Jan 2020 19:47:45 +0000 (19:47 +0000)]
Revert "Bug 24181: Make our datepicker inputs sexy"

This reverts commit 8dab309040d2f275a301f0312239a9f272be7284.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoRevert "Bug 24181: Move the icon back into the input"
Joy Nelson [Tue, 21 Jan 2020 19:47:26 +0000 (19:47 +0000)]
Revert "Bug 24181: Move the icon back into the input"

This reverts commit 40b69281616beb86a6c1eaf2c84c7fd0cd7c23f8.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoRevert "Bug 24181: Compiled CSS"
Joy Nelson [Tue, 21 Jan 2020 19:43:42 +0000 (19:43 +0000)]
Revert "Bug 24181: Compiled CSS"

This reverts commit 124b7ce31c25dbef5dedf7766edc673071b3fa33.

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24228: Make ->to_api params a hashref
Tomas Cohen Arazi [Mon, 23 Dec 2019 15:03:12 +0000 (12:03 -0300)]
Bug 24228: Make ->to_api params a hashref

This patch makes the parameters for Koha::Object(s)->to_api a hashref
preparing the ground for new parameters. The proposed syntax is:

$object->to_api(
    {
        embed => {
            'items' => {
                'children' => {
                    'homebranch' => {}
                }
            }
        }
    }
);

Tests are added for the Koha::Objects implementation and tests for
Koha::Object are adjusted to the new syntax, and a test for the single
result accessor is added as well.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects
Agustin Moyano [Thu, 19 Dec 2019 18:50:49 +0000 (15:50 -0300)]
Bug 24228: Add parameters to Koha::Object(s)->to_api to automatically embed objects

This patch makes Koha::Object(s)->to_api have an 'embeds' parameter that
using dot notation (e.g. resource.related_resource.another_one) allows
embedding objects recursively.

To test:
1. Apply this patch
2. prove t/db_dependent/Koha/Object.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Special care for booleans
Tomas Cohen Arazi [Wed, 15 Jan 2020 12:45:24 +0000 (09:45 -0300)]
Bug 23893: Special care for booleans

This patch acknowledges the fact that in D8 the Mojo::JSON->true and
Mojo::JSON->false values don't translate into integers when passed to
DBIC. It works correctly on D9 onwards, but we haven't formally
deprecated Jessie. This is adding back this translation, in the right
place now that all mappings code has been integrated into
Koha::Object(s) directly.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Catch dt_from_string exceptions
Tomas Cohen Arazi [Fri, 27 Dec 2019 18:21:30 +0000 (15:21 -0300)]
Bug 23893: Catch dt_from_string exceptions

This patch adds exception handling to the attributes_from_api() method.
This can happen with invalid date/datetimes, for example.

Tests are added:

1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Remove Overloaded method from Koha::Patron
Jonathan Druart [Fri, 27 Dec 2019 16:03:16 +0000 (17:03 +0100)]
Bug 23893: Remove Overloaded method from Koha::Patron

That way we are dealing with any date fields for any Koha::Object

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: (QA follow-up) Explicit date format
Tomas Cohen Arazi [Fri, 27 Dec 2019 15:15:39 +0000 (12:15 -0300)]
Bug 23893: (QA follow-up) Explicit date format

This patch makes the input date format explicit. It also adds a missing
POD.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: No special care for booleans
Jonathan Druart [Fri, 27 Dec 2019 14:21:27 +0000 (15:21 +0100)]
Bug 23893: No special care for booleans

Tests pass without that changes. If we need them they should be at
Koha::Object anyway.

About the date, I also think that that should be moved to Koha::Object
(we can guess it, like we do in Koha::Object->store, retrieve the
datatype and adjust). Also we can send a DT object to DBIC, no need for
an sql formatted date

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Use in /patrons
Tomas Cohen Arazi [Tue, 12 Nov 2019 13:00:14 +0000 (10:00 -0300)]
Bug 23893: Use in /patrons

This patch makes the patrons endpoint use the new methods from
Koha::Object.

To test:
1. Apply this patch
2. Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Use in /cities
Tomas Cohen Arazi [Tue, 12 Nov 2019 12:59:53 +0000 (09:59 -0300)]
Bug 23893: Use in /cities

This patch makes the cities controller use the new methods from
Koha::Object.

To test:
1. Apply this patch
2. Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/cities.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Add new_from_api and set_from_api to Koha::Object
Tomas Cohen Arazi [Mon, 11 Nov 2019 19:07:03 +0000 (16:07 -0300)]
Bug 23893: Add new_from_api and set_from_api to Koha::Object

This patch introduces the following methods to the Koha::Object class:
- set_from_api
- new_from_api

This methods are going to be used when writing API controllers that map
to the attributes to the DB schema ones.

To test:
1. Apply this patchset
2. Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Implement Koha::Object->from_api_mapping
Tomas Cohen Arazi [Mon, 11 Nov 2019 18:03:28 +0000 (15:03 -0300)]
Bug 23893: Implement Koha::Object->from_api_mapping

This patch implements the from_api_mapping method, that calculates (and
caches) the reserve mapping from the to_api_mapping method.

A generic to_api_mapping is added to simplify things a bit in the generic
to_api method and so the mappings are reusable in the way they are in
from_api_mapping.

To test:
1. Apply this patches
2. Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23893: Unit tests
Tomas Cohen Arazi [Mon, 11 Nov 2019 18:03:29 +0000 (15:03 -0300)]
Bug 23893: Unit tests

This patch introduces tests for the implemented methods.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24277: Fix date received editing when receiving an order
Jonathan Druart [Mon, 23 Dec 2019 15:19:47 +0000 (16:19 +0100)]
Bug 24277: Fix date received editing when receiving an order

Bug 8417 added the ability to edit the date received, but a merge
conflict was wrongly resolved during a rebase of
  commit 20d9ed618fbe3cdcb9c04444a1f8a584b0364069
  Bug 13321: Rename variables

Test plan:
Create an order
Receive it
Set a date (different from today)
=> The date you picked should have been set in DB for the order

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24277: Regression tests
Tomas Cohen Arazi [Wed, 8 Jan 2020 13:55:40 +0000 (10:55 -0300)]
Bug 24277: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24253: DBRev 19.11.01.003
Joy Nelson [Sat, 18 Jan 2020 15:40:15 +0000 (15:40 +0000)]
Bug 24253: DBRev 19.11.01.003

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24263: (QA follow-up) Atomic update fixes
Tomas Cohen Arazi [Wed, 8 Jan 2020 13:11:07 +0000 (10:11 -0300)]
Bug 24263: (QA follow-up) Atomic update fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24263: Replace borrowers.relationship with NULL when was empty string
Jonathan Druart [Wed, 18 Dec 2019 13:04:58 +0000 (14:04 +0100)]
Bug 24263: Replace borrowers.relationship with NULL when was empty string

When you create a new patron, its relationship field is populated with
an empty string when we are expecting NULL.

Otherwise the about page will display a warning about a missing/wrong
relationship in data (that is not in the syspref)

Test plan:
0/ Do not apply the patches from this bug report
1/ Create a new patron (child)
2/ Notice that relationship column in DB is set to an empty string
3/ Go to the about page, notice the invalid warning about relationship
values not in the syspref
4/ Apply DB changes and tests
5/ Execute the update DB entry
=> The value in DB is now NULL when was ""
6/ Execute the tests
=> It fails
7/ Apply the last patch
8/ Add and edit a patron (child)
=> relationship is set to NULL in DB
9/ Execute the tests
=> They pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24263: DB changes
Jonathan Druart [Wed, 18 Dec 2019 13:08:34 +0000 (14:08 +0100)]
Bug 24263: DB changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24263: Add tests
Jonathan Druart [Wed, 18 Dec 2019 13:04:35 +0000 (14:04 +0100)]
Bug 24263: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24329: DBRev 19.11.01.002
Joy Nelson [Sat, 18 Jan 2020 15:30:32 +0000 (15:30 +0000)]
Bug 24329: DBRev 19.11.01.002

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24329: Add a test
Jonathan Druart [Sun, 5 Jan 2020 22:08:28 +0000 (23:08 +0100)]
Bug 24329: Add a test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24329: Prevent update of timestamp on action_logs updates
Martin Renvoize [Thu, 2 Jan 2020 13:03:07 +0000 (13:03 +0000)]
Bug 24329: Prevent update of timestamp on action_logs updates

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24329: Correction to updatedatabase
Martin Renvoize [Thu, 2 Jan 2020 12:56:19 +0000 (12:56 +0000)]
Bug 24329: Correction to updatedatabase

Ensure timestamp is not overwriteen during upgrade when applying updates
for bug 3820

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24445: Add z3950 to makefile (bug 13937 follow-up)
Mason James [Fri, 29 Nov 2019 12:11:15 +0000 (12:11 +0000)]
Bug 24445: Add z3950 to makefile (bug 13937 follow-up)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24016: (QA follow-up) Format code to adhere to perltidy format
Joonas Kylmälä [Tue, 17 Dec 2019 13:59:55 +0000 (13:59 +0000)]
Bug 24016: (QA follow-up) Format code to adhere to perltidy format

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv...
Lari Taskula [Tue, 12 Nov 2019 12:18:27 +0000 (12:18 +0000)]
Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv alone

Koha::Patron::Message->store has this

    my $userenv = C4::Context->userenv;
    $self->manager_id( $userenv ? $userenv->{number} : undef);

This breaks in REST API when userenv is not set.

Let API user pass manager_id without relying on C4::Context->userenv.

To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe success

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message
Lari Taskula [Tue, 12 Nov 2019 12:24:30 +0000 (12:24 +0000)]
Bug 24016: Add a failing test for overwrite-able manager_id in Koha::Patron::Message

To test:
1. prove t/db_dependent/Koha/Patron/Messages.t
2. Observe failure

t/db_dependent/Koha/Patron/Messages.t .. 2/12
   Failed test 'Manager id should be overwrite-able even if defined in userenv'
   at t/db_dependent/Koha/Patron/Messages.t line 90.
          got: '1100'
     expected: '1101'
 Looks like you failed 1 test of 12.
t/db_dependent/Koha/Patron/Messages.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/12 subtests

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: DBRev 19.11.01.001
Joy Nelson [Wed, 15 Jan 2020 00:18:59 +0000 (00:18 +0000)]
Bug 23233: DBRev 19.11.01.001

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: (RM follow-up) Rename syspref in test
Martin Renvoize [Tue, 17 Dec 2019 09:07:44 +0000 (09:07 +0000)]
Bug 23233: (RM follow-up) Rename syspref in test

The AllowItemsOnHoldCheckout system preference was renamed to
AllowItemsOnHoldCheckoutSIP to clarify it's use, but one case was missed
in the test suit.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: (follow-up) Correct test description
Joonas Kylmälä [Tue, 22 Oct 2019 11:20:39 +0000 (11:20 +0000)]
Bug 23233: (follow-up) Correct test description

AllowItemsOnHoldCheckout is not checked anymore but instead only
whether the tmp_holdsqueue is empty or not.

Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: (follow-up) Add description to atomic upgrade
Joonas Kylmälä [Tue, 22 Oct 2019 11:04:48 +0000 (11:04 +0000)]
Bug 23233: (follow-up) Add description to atomic upgrade

Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: (follow-up) Remove accidentally left comment
Joonas Kylmälä [Tue, 22 Oct 2019 11:00:51 +0000 (11:00 +0000)]
Bug 23233: (follow-up) Remove accidentally left comment

The line

t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 );

was removed from below this comment line but the comment explaining
what it does was forgotten.

Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: Remove use of AllowItemsOnHoldCheckout from C4::Items::GetItemsInfo
Kyle M Hall [Mon, 1 Jul 2019 12:56:09 +0000 (08:56 -0400)]
Bug 23233: Remove use of AllowItemsOnHoldCheckout from C4::Items::GetItemsInfo

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: Remove use of AllowItemsOnHoldCheckout from Koha::Item::has_pending_hold...
Kyle M Hall [Mon, 1 Jul 2019 11:19:33 +0000 (07:19 -0400)]
Bug 23233: Remove use of AllowItemsOnHoldCheckout from Koha::Item::has_pending_hold, it can cause false data to be returned

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23233: AllowItemsOnHoldCheckout is misnamed and does not indicate it is for SIP...
Kyle M Hall [Fri, 28 Jun 2019 18:07:39 +0000 (14:07 -0400)]
Bug 23233: AllowItemsOnHoldCheckout is misnamed and does not indicate it is for SIP-based checkouts only

The system preference AllowItemsOnHoldCheckout only affects SIP based checkouts. I believe we should rename it AllowItemsOnHoldCheckoutSIP so it matches AllowItemsOnHoldCheckoutSCO. We should also update the description as well.

As far as I know AllowItemsOnHoldCheckout has never affected anything except SIP traffic. That does not preclude the addition of another AllowItemsOnHoldCheckout syspref that would affect the staff interface, but that would be an enhancement and is outside the scope of this bug report.

Test Plan:
1) Test AllowItemsOnHoldCheckout via SIP
2) Apply this patch
3) Test AllowItemsOnHoldCheckoutSIP via SIP
4) Note there is no difference!
5) Note the syspref description has been update to mention SIP

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23261: (RM follow-up) Add missing uri filter
Martin Renvoize [Fri, 3 Jan 2020 10:49:15 +0000 (10:49 +0000)]
Bug 23261: (RM follow-up) Add missing uri filter

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24327: Redirect to the login form if AnonSuggestion misconfigured
Jonathan Druart [Thu, 2 Jan 2020 10:38:18 +0000 (11:38 +0100)]
Bug 24327: Redirect to the login form if AnonSuggestion misconfigured

Test plan:
Turn on AnonSuggestion but set AnonymousPatron to an invalid value
Go to /cgi-bin/koha/opac-suggestions.pl?op=add
=> You see the login form

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24327: Add warning to the about page is AnonSugggestions but AnonymousPatron
Jonathan Druart [Thu, 2 Jan 2020 10:26:49 +0000 (11:26 +0100)]
Bug 24327: Add warning to the about page is AnonSugggestions but AnonymousPatron

This patch adds a warning to the about page if AnonSuggestions is set
but AnonymousPatron.

Test plan:
Turn on AnonSuggestions and set AnonymousPatron to 0
=> You see a warning on the about page
Turn on AnonSuggestions and set AnonymousPatron to an invalid value
=> You see a warning on the about page
Turn off AnonSuggestions
=> No warning
Turn on AnonSuggestions and set AnonymousPatron to a valid value
=> No warning

Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24054: Typo in ClaimReturnedWarningThreshold system preference
Bernardo Gonzalez Kriegel [Sun, 29 Dec 2019 10:40:37 +0000 (07:40 -0300)]
Bug 24054: Typo in ClaimReturnedWarningThreshold system preference

Fixed type: cliams -> claims

To test:
1) Apply the patch
2) Go to System preferences > Circulation preferences > ClaimReturnedWarningThreshold
3) Check the text is fixed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24104: Item search - Prevent "Edit" dropdown button to overflow
Jonathan Druart [Mon, 25 Nov 2019 15:48:15 +0000 (16:48 +0100)]
Bug 24104: Item search - Prevent "Edit" dropdown button to overflow

Making it displays on the left fixes the problem.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24328: Fix bibliographic frameworks install (linkid)
Jonathan Druart [Thu, 2 Jan 2020 12:12:58 +0000 (13:12 +0100)]
Bug 24328: Fix bibliographic frameworks install (linkid)

With strict mode enabled (tested with MariaDB 10.4.11)

ERROR 1366 (22007) at line 8029: Incorrect integer value: '' for column
`koha_kohadev`.`auth_subfield_structure`.`linkid` at row 769

Test plan:
Insert the .sql files from this patch and confirm that you can now
insert them correctly

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24314: Update de-DE MARC21 frameworks for updates 28+29 (May and November 2019)
Katrin Fischer [Sun, 29 Dec 2019 03:36:35 +0000 (03:36 +0000)]
Bug 24314: Update de-DE MARC21 frameworks for updates 28+29 (May and November 2019)

This updates the MARC framework files in the de-DE (German) installer
to the latest MARC standard. The files also include some translation
changes and fixes.

Files have been generated using the po files on translate.koha-community.org.

To test:
- Run the de-DE installer on a fresh database
- Verify that all files are installed without errors
- Verify that the frameworks are correctly in place

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
MARC21 files load without problems, no qa errors.
Loaded into 'en' install (delete fw then load) all frameworks look good.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24312: Update MARC21 frameworks to Updates 28+29 (May and November 2019)
Bernardo Gonzalez Kriegel [Fri, 27 Dec 2019 13:09:22 +0000 (10:09 -0300)]
Bug 24312: Update MARC21 frameworks to Updates 28+29 (May and November 2019)

MARC21 format changes

Bibliographic
-------------
Update 28 (May 2019)

New subfield f in 540
New subfield g in 506,540
New subfield q in 506,540
New subfield 2 in 540
New subfield 2 in 100,110,111,130,240,
                  700,710,711,730,758
                  800,810,811,830
New subfield 7 in 856
New code b in 007/01 Sound Recording

Update 29 (November 2019)

New field 688
New subfield i in 041
New subfield t in 041
New subfield g in 751
Renamed subfield g in 041

Authority
---------
Update 28 (May 2019)

New subfield 0 and 1 in 024
Renamed subfield 2 in 024
New subfield 7 in 856

Update 29 (November 2019)
No changes

To test:
1) Remove all your frameworks
2) Check mandatory bibliographic and authority files load without problem
3) Check new fields/subfields

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 10469: Display more when editing subfields in frameworks
Owen Leonard [Fri, 13 Dec 2019 23:42:28 +0000 (23:42 +0000)]
Bug 10469: Display more when editing subfields in frameworks

This patch removes the accordion feature from the MARC subfields
structure editor. The form is not long, and I think in this case the
accordion makes the process more difficult to navigate.

To test, apply the patch and go to Administration -> MARC frameworks ->
Framework structure -> Subfield structure -> Edit. Choose a tag with
multiple subfields to best test the changes.

The whole form should apppear, and tabs functionality should work
correctly. Test that making changes under multiple tabs works correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24173: Advanced Editor: Show subtitle & published date on the search page
Cori Lynn Arnold [Wed, 18 Dec 2019 18:18:59 +0000 (18:18 +0000)]
Bug 24173: Advanced Editor: Show subtitle & published date on the search page

To test:

Prior to patch:
1/Verify that EnableAdvancedCatalogingEditor syspref is set to "enable"
2/Go to Cataloging
3/Click on "Advanced Editor" button
4/In left hand box put "specious" under Keywords and hit "enter"
5/verify that "Library of Congress" (or some other server) Z39.50 is checked
6/Verify that there are no headings for "Subtitle" and "Published"

Apply Patch
1/Go to Administration->Koha to MARC mapping
2/Add or verify that there are entries for "biblio.subtitle" and
"biblio.copyrightdate"
3/Go to Cataloging
4/Click on "Advanced Editor" button
5/In left hand box put "specious" under Keywords and hit "enter"
6/verify that "Library of Congress" (or some other server) Z39.50 is checked
7/Verify that there are headings for "Subtitle" and "Published" and the
data matches with the fields from Koha to MARC mapping when you click on
"View MARC" link for that record.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24212: Increase size of OPAC 'send list' dialog box for IE
Aleisha Amohia [Wed, 11 Dec 2019 05:07:31 +0000 (05:07 +0000)]
Bug 24212: Increase size of OPAC 'send list' dialog box for IE

To test:
1) Create a list and view it in the OPAC (ensure you are using Internet
    Explorer as a browser)
2) Click Send list
3) Notice the dialog box cuts off the content in the window
4) Close the popup, apply the patch
5) Click Send list again
6) Confirm the dialog box shows the entire window
7) Confirm the box is resizable and has scrollbars

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24063: Add Sami language characters to Zebra
Pasi Kallinen [Tue, 19 Nov 2019 09:26:01 +0000 (11:26 +0200)]
Bug 24063: Add Sami language characters to Zebra

Some Sami languages need few more characters to be mapped, or
are otherwise very hard to search for.

Test plan:

1) Catalogue a new record with title "Ǩoǯeŋa"
2) Make sure zebra indexed that record, then try to search for
   it with the text "kozena"
3) Apply patch
4) Redo 2, now the record should be found.

Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24181: Compiled CSS
Martin Renvoize [Fri, 3 Jan 2020 15:53:18 +0000 (15:53 +0000)]
Bug 24181: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24181: Move the icon back into the input
Jonathan Druart [Thu, 5 Dec 2019 15:33:00 +0000 (16:33 +0100)]
Bug 24181: Move the icon back into the input

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24181: Make our datepicker inputs sexy
Jonathan Druart [Thu, 5 Dec 2019 15:27:35 +0000 (16:27 +0100)]
Bug 24181: Make our datepicker inputs sexy

They are skinny and different from others.
Not that a problem, I am too.
But I do not think it is what they need.

Test plan:
Edit a patron and take a look at the input for "Date of birth"
=> Before this patch they are not looking great
=> After this patch they are beautiful

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23957: Compiled CSS
Martin Renvoize [Fri, 3 Jan 2020 15:44:09 +0000 (15:44 +0000)]
Bug 23957: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23957: (follow-up) Disable both place hold buttons
Owen Leonard [Tue, 10 Dec 2019 13:36:19 +0000 (13:36 +0000)]
Bug 23957: (follow-up) Disable both place hold buttons

This follow-up adds the correct markup to the second of two "Place hold"
buttons so that it is disabled when the first is disabled.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23957: Remove button style with famfamfam icon background and replace with Font...
Owen Leonard [Sun, 3 Nov 2019 23:45:44 +0000 (23:45 +0000)]
Bug 23957: Remove button style with famfamfam icon background and replace with Font Awesome

The patch modifies the markup and CSS related to the holds template in
the staff client when holds policy override is necessary. The CSS
background image is replaced with a Font Awesome icon. <input>s are
replaced with <button>s to allow for the icon markup.

To test, apply the patch and regenerate the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Enable the AllowHoldPolicyOverride system preference.
 - Start the process of placing a hold for a patron on a title which
   would not normally be available for hold. For instance: The patron
   already has too many holds.
 - On the hold confirmation screen the "Place hold" buttons should
   appear with a little yellow "warning" icon.
 - Clicking either of the two "Place hold" buttons should trigger a
   confirmation dialog. Test both the "Confirm" and "Cancel" options.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23956: Replace famfamfam calendar icon in staff client with CSS data-url
Owen Leonard [Sun, 3 Nov 2019 22:31:39 +0000 (22:31 +0000)]
Bug 23956: Replace famfamfam calendar icon in staff client with CSS data-url

This patch modifies the staff client CSS so that the backround image for
datepicker input fields is defined as a data-url rather than a reference
to an image file.

To test, apply the patch and regenerate the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - In the staff client, view any form which includes a datepicker-styled
   input. For instance, patron entry: date of birth, expiry; Aquisitions
   -> Late orders -> Filter results.
 - Confirm that the calendar icon looks correct.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23956: Compiled CSS
Martin Renvoize [Fri, 3 Jan 2020 15:42:12 +0000 (15:42 +0000)]
Bug 23956: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23261: (follow-up) Use logged_in_user and move test
Nick [Tue, 17 Dec 2019 02:07:47 +0000 (02:07 +0000)]
Bug 23261: (follow-up) Use logged_in_user and move test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23261: Add notice for login/registering to RBdigital results
Nick Clemens [Wed, 3 Jul 2019 19:11:54 +0000 (19:11 +0000)]
Bug 23261: Add notice for login/registering to RBdigital results

To test:
 1 - You will need a valid library RBDigital account
 2 - Fill in the RecordedBooks system preferences
 3 - Open the catalog, perform a search with RBDigtal resuls, 'love' often works
 4 - Click to the results
 5 - Note if not logged you don't see availability
 6 - Log in with a patron with no email, note you do not see any notice that you must register your email with RBDigital
 7 - Apply patch
 8 - Reload results, you now see a notice to register with rbdigital, do so unless you already have an account
 9 - Add your associated email to the koha account
10 - Reload results, note you see availability
11 - Log out, reload results
12 - Note you see a promp to login to see availability

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23889: Compiled CSS
Martin Renvoize [Thu, 2 Jan 2020 14:38:03 +0000 (14:38 +0000)]
Bug 23889: Compiled CSS

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23889: Use same css class on the basic editor view
Jonathan Druart [Mon, 16 Dec 2019 14:11:27 +0000 (15:11 +0100)]
Bug 23889: Use same css class on the basic editor view

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23889: Improve style of menu header in advanced cataloging editor
Owen Leonard [Thu, 24 Oct 2019 14:15:41 +0000 (14:15 +0000)]
Bug 23889: Improve style of menu header in advanced cataloging editor

This patch updates the style of dropdown menu headers to make it apply
more globally and changes the advanced cataloging editor template so
that the correct class is applied to the menu header.

To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Test the interfaces where these kinds of menu headers can be found:

 - Catalog search results: The "Sort" menu (Popularity, Author, etc.
   headings).

 - Saved report results: Run a report which returns a column of
   biblionumbers or itemnumbers. Check the "Batch operations" menu
   (Bibliographic records or item records headings).

 - Advanced cataloging editor: The settings menu (Change framework
   header).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24267: (QA follow-up) Remove two calls, add transaction
Marcel de Rooy [Fri, 20 Dec 2019 07:14:32 +0000 (07:14 +0000)]
Bug 24267: (QA follow-up) Remove two calls, add transaction

Call to GetAuthorizedHeading is already done just before calling ImportBreedingAuth.
Call to GuessAuthTypeCode is not used.
Adding transaction to test (check your database, kidclamp ;)

Test plan:
Add new authority via Z3950 in the interface.
Run t/db_dependent/Breeding.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24267: Unit tests
Nick Clemens [Thu, 19 Dec 2019 17:37:23 +0000 (17:37 +0000)]
Bug 24267: Unit tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24267: Improve ImportBreedingAuth
Nick Clemens [Wed, 18 Dec 2019 18:27:33 +0000 (18:27 +0000)]
Bug 24267: Improve ImportBreedingAuth

git grep ImportBreedingAuth - there is only one call to this routine
from SearchZ3950Auth

We pass it a MARC record, '2' for overwrite_auth

We then check for this record in the DB and get the breeding id,
however, when overwrite_auth is 2 we always add the auth to the batch
and return the new breeding id.

We don't actually use any of the other parameters returned here either

To recreate:
1 - Browse to Authorities
2 - Select New form Z3950
3 - Perform a search that returns results
4 - SELECT COUNT(*) FROM import_auths
5 - Repeat the search
6 - SELECT COUNT(*) FROM import_auths
7 - There are 20 more records
8 - SELECT * FROM import_auths - note the repeated rows

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24316: (follow up) Fix es-ES web installer
Bernardo Gonzalez Kriegel [Mon, 30 Dec 2019 23:55:41 +0000 (20:55 -0300)]
Bug 24316: (follow up) Fix es-ES web installer

Same correction, as other languages, removing
obsolete authorised value MANUAL_INV.

Same test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 24316: Remove obsolete sample data for MANUAL_INV authorised value
Katrin Fischer [Sun, 29 Dec 2019 22:21:06 +0000 (23:21 +0100)]
Bug 24316: Remove obsolete sample data for MANUAL_INV authorised value

Bug 23049 replaced the MANUAL_INV authorised value by a dedicated table,
but missed to remove the authorised value sample data from the non-English
installers.

This patch corrects this oversight.

Note:
The German (de-DE) file was changed a bit more, adding 2 missing translations
for the new RETURN_CLAIM_RESOLUTION and to match the sequence of the en
file.

To test:
- Verify the SQL file changes are valid by loading those files OR
- Run the installers for each language on an empty database
- Verify there is no error loading the optional authorised value data

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with 24317 and a small followup for this bug for es-ES

Tested doing clean install for de-DE es-ES fr-CA it-IT nb-NO pl-PL
up to loading of all mandatory & optional data.
All languages load without problems.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
4 years agoBug 23783: Show languages from MARC21 field 041 in OPAC
Katrin Fischer [Sat, 2 Nov 2019 00:19:33 +0000 (00:19 +0000)]
Bug 23783: Show languages from MARC21 field 041 in OPAC

This copies the changes made in bug 20364 for the staff
interface to the OPAC.

Some slight changes have been made in comparison:
- OPAC uses the class "separator" for the characters
  that are used between repeatable tags. "sep" as
  used in the original patch set has some CSS rules
  attached to it that break display, so it makes
  double sense to change it.
- We revently removed ending . from the display in
  OPAC - so it's done here too.

To test:
1) Apply patch
2) Do a search in the OPAC and check the results look correct
3) Check some biblio detail pages and verify that they look correct
4) Add some 041 subfields (a, b, d, h, j) in any combinations
5) Repeat 2 and 3

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>