]> git.koha-community.org Git - koha.git/log
koha.git
3 years agoBug 25508: Only return renewal outcomes to the controller
Martin Renvoize [Wed, 24 Mar 2021 16:38:32 +0000 (16:38 +0000)]
Bug 25508: Only return renewal outcomes to the controller

There are a few cases where the `renew_item` method in
Koha::Account::Line will return `undef`. For these cases, we should not
pass the error up the chain to the controllers as it leads to malformed
error messages in the UI.

Test plan
1 - Make sure FinesMode is on, RenewAccruingItemWhenPaid is off
2 - Checkout an item to a patron and make it overdue (can backdate the
    checkout)
3 - Make sure the itemtype has fines that will be charged
4 - Charge the fines:
    Set finesMode = production
    perl misc/cronjobs/fines.pl -v
5 - Check the fine appears on the patrons account
6 - Pay off the fine
7 - Receive alert after payment that reads: "The fines on
    the following items were paid off, renewal results are
    displayed below:
        No title ( ): Not renewed - Unknown error"
8 - Apply the patch
9 - Repeat steps 1 through 6 and note that you no longer trigger the
    error message.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d4dc15ee36dc108e074e4d1b78edc055b1a22597)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b51efada26130d16264486514c59e8dca12639a9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25508: Add Unit Tests
Martin Renvoize [Tue, 6 Apr 2021 07:48:38 +0000 (08:48 +0100)]
Bug 25508: Add Unit Tests

Enhance the unit tests to check for the return values of
Koha::Account->pay.

Test plan
1/ Apply just this patch
2/ Run t/db_dependent/Koha/Account.t and watch it fail
3/ Apply the rest of the patch series
4/ Run t/db_dependent/Koha/Account.t and watch it pass
5/ Signoff

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 66ad8f77278e7ceb18bc5e027a470fd621e5f9b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8637c8ecbd9ec5eaed6854b55c803d5689d22868)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26312: (follow-up) Fix passing of exception messages
Nick Clemens [Thu, 1 Apr 2021 13:49:19 +0000 (13:49 +0000)]
Bug 26312: (follow-up) Fix passing of exception messages

'error' has special meaning in exceptions so naming the fields:
type, details

Rather than only dealing with a single exception type, we generically
get the ES exception info and pass it up.

I could not recreate timeout still, however, I simply restarted the
ES docker during commit stage to cause NoNodes exceptions

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cc8787bf879630f1c5572008c3637598f56d7aff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 74284f4ddb015de6e6e7a0c97dd6be40d0804f40)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26312: Catch ES Client errors, log, and continue indexing when error encountered
Nick Clemens [Thu, 27 Aug 2020 16:04:57 +0000 (16:04 +0000)]
Bug 26312: Catch ES Client errors, log, and continue indexing when error encountered

This catches a timeout response from the ES server, logs this, and continues the indexing

To test:
1 - perl misc/search_tools/rebuild_elasticsearch.pl
2 - Make the ES server timeout (I don't have good instruction yet)
3 - Watch the job crash
4 - Apply patches
5 - perl misc/search_tools/rebuild_elasticsearch.pl
6 - Make the server timeout
7 - Note the job reports failed commit, and continues

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 26312: (follow-up) Reset buffers even if commit fails

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 26312: (follow-up) Fix whitespace and missing semicolon

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 72e6999db7cbfc077f200930dd28400d1f86831e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d78690a0ab4d38ef3ad430b6ed9bd02b393834b2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27746: prevent regexp undefined warning when checking subfield contents ($oclc)
Petro Vashchuk [Mon, 22 Feb 2021 11:46:44 +0000 (13:46 +0200)]
Bug 27746: prevent regexp undefined warning when checking subfield contents ($oclc)

Some of the books have subfield "a" of field "035" absent
and it's possible to have such
(it doesn't says "Require" in the interface),
which causes "Use of uninitialized value $oclc in pattern match (m//)"
error.

Solved by screening regex with check for empty variables before the
match.

To reproduce:
    1) Edit existing book or create a new one with empty marc
subfield "a" of field "035"
    2) Use the search feature that will find it along with some other
books.
    3) Check /var/log/koha/kohadev/plack-intranet-error.log to find
"Use of uninitialized value $oclc in pattern match (m//)" error.
    4) Apply the patch.
    5) Repeat the search and check the logs again to ensure
that error didn't appear again.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a34e1f9f0d32e4cf0f282016e52166d309b25ef7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f618fb33a80d7f757dc0c95832b6d6c7d71f819)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28112: Z39.50 does not populate form with all passed criteria
Owen Leonard [Wed, 7 Apr 2021 16:27:31 +0000 (16:27 +0000)]
Bug 28112: Z39.50 does not populate form with all passed criteria

This patch adds output of some already-existing template variables in
the Z39.50 search form so that all parameters can be used to prepopulate
the form.

To test, apply the patch and go to Cataloging.

- Click the "New from Z39.50/SRU" button
  - A window should pop up and the form should be empty.
  - Confirm that searching works correctly.
- Perform the same test from a bibliographic detail page using the Edit
  menu -> Replace record via Z39.50/SRU.
  - Some fields in the search form should be prepopulated, e.g. ISBN,
    title, author.
- Paste this link into your browser:
  http://path.to.your.koha/cgi-bin/koha/cataloguing/z3950_search.pl?frameworkcode=&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear
  - The search form should appear with all fields prepopulated.

- Perform the same tests in Acquisitions with the option for adding to a
  basket via an external search.
  - The link for testing all parameters:
    http://path.to.your.koha/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=4&basketno=3&isbn=isbn&issn=issn&title=title&author=author&dewey=dewey&subject=subject&lccall=lccall&controlnumber=controlnumber&stdid=stdid&srchany=srchany&publicationyear=publicationyear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0f33c0a7d58704dba0e4c30b0b8904131adea111)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 439d7b6405d767210204d69138a54f20509a9dbc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28121: Correct the place of the question mark
Séverine QUEUNE [Fri, 9 Apr 2021 13:25:16 +0000 (15:25 +0200)]
Bug 28121: Correct the place of the question mark

Question mark is wonrgly placed when you want to delete a desk.
Test plan :
- Enable 'UseCirculationDesks'
- On Administration > Desks menu, create a new desk
- Try to delete it : note the question mark in inside the quotation
marks
- Apply patch and refresh page
- Question mark should now be after the last quotation mark

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c6e7ec55dca08bbd2b65ea465f304eca7c60903)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4c4f1a8950b5caa98420eb6b6c94cf38237f2ae2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBIC schema changes
Andrew Fuerste-Henry [Sun, 25 Apr 2021 14:37:29 +0000 (14:37 +0000)]
DBIC schema changes

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.10.001
Andrew Fuerste-Henry [Sun, 25 Apr 2021 14:34:28 +0000 (14:34 +0000)]
DBRev 20.05.10.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27726: Increase 'content' field size
Martin Renvoize [Thu, 25 Mar 2021 14:29:06 +0000 (14:29 +0000)]
Bug 27726: Increase 'content' field size

This alternate patch increases the field size from a 255 character
varchar to a 65535 character text field. This allows for more detailed
problem reports to be submitted.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c854a87d221a92051411d822121398f2440ae1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 65c85793737554c76ffc00ea54e7842051b4cb91)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28094: Deal with encoding for overriden sysprefs
Jonathan Druart [Tue, 6 Apr 2021 14:26:23 +0000 (16:26 +0200)]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c32d46b854a73e636b1568eab758868ea9d74a13)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0a677be7f106d5bf5dfec43d1d4ec2d57272e7c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28097: Mock finesModes to disable recalculation
Martin Renvoize [Wed, 7 Apr 2021 11:10:38 +0000 (12:10 +0100)]
Bug 28097: Mock finesModes to disable recalculation

Since bug 8338 the recalcuated zero amount fine is subsequently removed
in _FixOverduesOnReturn which causes this test to fail if finesMode is
'production' and 'CalculateFinesOnReturn' is enabled.

Perhaps we should be 'VOID'ing fines rather than completely deleting
them, but that's a question for another day.

Test plan
1/ Enable finesMode in the staff client
2/ Run the test and watch it fail
3/ Apply the patch
4/ Run the test and watch it pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f3e81738c83f6f2bae869f056ba934fc45315c1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ffd059075fd5788eb5456c52a675303f430a0787)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27991: Message field for OPAC problem reporting should have a maxlength set
Owen Leonard [Thu, 18 Mar 2021 17:59:15 +0000 (17:59 +0000)]
Bug 27991: Message field for OPAC problem reporting should have a maxlength set

This patch adds a maxlength attribute to the form field for entering
checkout notes in the OPAC, matching the character limit of the database
column. A note is added to show the 255 character limit.

To test, apply the patch and enable the AllowCheckoutNotes system
preference.

 - Log in to the OPAC as a user who has checkouts.
 - On the "Your summary" page, the "Report a problem" fields should
   have a hint below them, "255 characters maximum."
 - Try entering text in one of the fields. You should not be able to
   enter more than 255 characters:

   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
   nunc mi, fringilla in mauris quis, hendrerit feugiat mi. Sed ultrices
   mollis nulla sit amet faucibus. Sed volutpat augue risus, eu rutrum
   eros commodo eu. Proin rhoncus nisi vitae magna_

 - Test that your submission is saved correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8bb9cb649bf36a650d3b84c29c5c9ddd3b01caa5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8832d917d6bb1e6ee79150ffc4737f6a39dba185)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28077: Add a colon after the 'Reason' label on edit suggestion page
Séverine QUEUNE [Fri, 2 Apr 2021 12:13:28 +0000 (14:13 +0200)]
Bug 28077: Add a colon after the 'Reason' label on edit suggestion page

This patch corrects the missing colon on the 'Edit purchase suggestion'
page.
To test :
- go to Acquistions > Suggestions
- edit a suggestion
- on 'Suggestion management' bloc, see the colon missing after the
'Reason' label
- apply patch
- refresh the page
- colon should now be displayed

Happy sign off !

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dad0a18c7a8a95c3bca7bf97d010953c5a41a0f1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 03e3f03c97b27a098339e96cd8b2127f9778ab72)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28044: Increase specificity of calendar tables CSS
Owen Leonard [Mon, 29 Mar 2021 10:33:13 +0000 (10:33 +0000)]
Bug 28044: Increase specificity of calendar tables CSS

This patch adds increased specificity to the CSS which should add colors
to the tables of holidays. The default DataTable CSS was overriding the
custom color-coding.

This patch also moves the calendar CSS into a separate file.

To test, apply the patch and go to Tools -> Calendar.

If necessary, add at least one of the following:
- Unique holiday
- Holiday repeating weekly
- Holiday repeating monthly
- Holiday exception

In the table listing each kind of holiday, the color of the table header
should match the colors in the "Key" section under Hints. The color
should be correct regardless of how the table is sorted.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4df8e3ef02b4490dc813b76b853e3fb706d4a301)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 42ebcdd3dfc3fd766e6242d40ef28c55dd7ecfe4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27738: Fix wording
Jonathan Druart [Tue, 6 Apr 2021 12:39:32 +0000 (14:39 +0200)]
Bug 27738: Fix wording

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 41ac4254257b96ba1742cf249fdab57fa2e2b9a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cfc8a25a3a8073c734b793cdac96439bb5d8abc4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code"
Phil Ringnalda [Sun, 21 Feb 2021 18:41:04 +0000 (10:41 -0800)]
Bug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code"

Current code intended to set a fallback of xxu, an unknown state in the US,
but because the preference is always defined, just sometimes unset, it
actually falls back to three spaces, an invalid value. This patch instead
uses the fallback value ||| which means no attempt to code.

Test plan:
1. Without the patch, verify that the value of the system preference
DefaultCountryField008 is empty.
2. Cataloging - New record - Default framework (if you have the Advanced
editor enabled, Settings - Switch to basic editor, this only applies to the
basic editor)
3. On tab 0, click in the text input for field 008 which fills in default
values, then click the Tag editor button at the end of the field
4. In the popup window, verify that the value for 15-17 is shown as ###
indicating three spaces
5. Apply patch, repeat the steps above, verify that the value is now |||

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d5e7d37d8a0427f50d31d922df89ba4b16e15c98)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1837739bbd1aeb65e40a405a7ae674b9eb79792)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28074: Make current_search.offset an integer instead of string
Lucas Gass [Thu, 1 Apr 2021 22:51:07 +0000 (22:51 +0000)]
Bug 28074: Make current_search.offset an integer instead of string

To test:
1. Do a search with 3-4 results, go to the record and use the browse
   controls, when you get to the last record if you attempt to go to the
   'next' you'll end up on a page which says 'record not found.'
2. Do a search with exactly 10 results. Click on the first record, the
   'next' arrow is not a link, you cannot move to the next result.
3. Apply patch
4. Repeat steps 1-2 and the problems should be gone.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5787203a708429bfb746dfa16cfa6fee75a8714a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9e4388038350e2651dbc4aaa0c782503b83dc71c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27900: (QA follow-up) Rephrase link text
Katrin Fischer [Mon, 29 Mar 2021 18:17:37 +0000 (18:17 +0000)]
Bug 27900: (QA follow-up) Rephrase link text

See discussion on IRC from today :)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8a6bb8c6cddbb5b9e7458d6c923f6818794528bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f960191c622144908b937b38ffa1ca6452c972ca)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27900: (QA follow-up) Add missing filter
Katrin Fischer [Mon, 29 Mar 2021 17:53:53 +0000 (17:53 +0000)]
Bug 27900: (QA follow-up) Add missing filter

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6f9d888942b134458796bf9d8a389238492b915d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32dcf9c77e11402926600d27f87971e9c506c3a8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27900: Add a link back to the basket view if no result
Jonathan Druart [Thu, 11 Mar 2021 14:03:07 +0000 (15:03 +0100)]
Bug 27900: Add a link back to the basket view if no result

Since bug 24347 the neworderbiblio view has been removed and we now
display the usual search result.
When adding a new order from a search, if there is no result we should
let the user get back to the basket view.

Test plan:
Add to basket from an existing record
Do a search with no results and confirm that there is a new "Go to the
basket view" link

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 191184f28a5efd95994f42cafbe1e94ffff38475)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e2571bb7fc408468b27313b8aa842483c8dd5a88)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28004: Fix breadcrumbs on authorised_values.tt
Lucas Gass [Tue, 23 Mar 2021 23:08:51 +0000 (23:08 +0000)]
Bug 28004: Fix breadcrumbs on authorised_values.tt

To Test:
  - go to a category with at least one value, see the complete breadcrumb "Home › Administration › Authorized values › Authorized values for category" with link on the 3 first menus
  - create a new category / go to an empty category ; see the incomplete breadcrumb "Home › Administration › Authorized values" with link only on the 2 first menus
  - Apply patch
  - go to category with at least one value, breadcrumbs should look like Home › Administration › Authorized values › Authorized values for category CATEGORY
  - got to category with no values, breadcrumbs should look the same as category with values

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 62848497033c601ea928890f903acf32c72d08d2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9a2c770c7e9d0020b787ecff8f81906ddd751d3b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text
Joonas Kylmälä [Wed, 17 Mar 2021 11:27:27 +0000 (13:27 +0200)]
Bug 27936: Clarify AllowItemsOnHoldCheckoutSIP syspref help text

The waiting reserves have always been impossible to checkout via
SIP2. There was some confusion whether this is actually true but if
you check the commit "Bug 25690: Remove duplicated logic in SIP2
checkouts" (338ba1d769) and the removed code around line

  $self->screen_msg("Item is on hold for another patron.");

you will be sure that it has been impossible to checkout waiting holds.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3aee4f4eca0a7dfbcb4704416f646dfaef39da70)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a7dc8aa2ecc89fa696faaa670aa935cd94fe3013)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28052: Do not check SYSENV values only keys in loop
Colin Campbell [Tue, 30 Mar 2021 11:13:27 +0000 (12:13 +0100)]
Bug 28052: Do not check SYSENV values only keys in loop

Loop is only interested in key values, because 'keys' is omitted
it is checking values as well. This can lead to misleading errors
being logged (e.g. key is undefined)
Extract keys only to loop array as in the other loops below this

Testing:
1 - tail /var/lib/koha/kohadev/sip-output.log
2 - in another tab use the sip cli tester:
   perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m checkin --item CHESS1
3 - Note errors:
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 1.
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 2.
4 - Apply patch and restart all the things
5 - Repeat 2
6 - Errors mentioned are gone

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cd40febe67b4d75e57311ff1673d0c34299b58fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0a7cf00d207369c3d46d2dc7078fe8e5574abeb2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27397: The description input field when defining numbering patterns is too short
Catherine Ma [Tue, 19 Jan 2021 02:26:54 +0000 (02:26 +0000)]
Bug 27397: The description input field when defining numbering patterns is too short

Test Plan:
1. go to the serials module
2. click on manage numbering patterns in the left hand navigation
3. add or edit a pattern
4. check the description field is as short as the name field, but can
take much more text
5. add patch
6. repeat steps 1-3
7. check the description field is larger than the name field (it should)

Sponsored by Catalyst IT

Works OK!

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 607d7f0a60d8c002dbac7ce22e7bcc128062f208)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 42db687f67885fd0858f5afb19af082f42c187a6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28042: Button corrections in OAI set mappings template
Owen Leonard [Fri, 26 Mar 2021 12:05:44 +0000 (12:05 +0000)]
Bug 28042: Button corrections in OAI set mappings template

This patch makes minor markup changes in the OAI set mappings template
so that the "Add" button looks consistent with other buttons in the
table.

Also changed: Removed unnecessary inline style attributes.

To test, apply the patch and go to Administration -> OAI sets
configuration

- If necessary, create an OAI set.
- Click the "Actions" button and choose "Define mappings."
- In the table of form fields, confirm that the "Add" button is styled
  similarly to the "Delete" button.
- Confirm that the "Add" button works as expected.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0053cc6c3e5a8a5791f96fbcd61a29f92d36fc61)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef75af5285523d2a59390c2ec56fd9eff9d27d68)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28032: Button corrections in point of sale pages
Owen Leonard [Thu, 25 Mar 2021 15:08:03 +0000 (15:08 +0000)]
Bug 28032: Button corrections in point of sale pages

This patch corrects some markup inconsistencies in some templates
related to point of sale:

- Point of sale -> Library details. The "btn-xs" class has been added to
  "Record cashup" and "Cashup all" buttons.
- Administration -> Debit types and Administration -> Credit types:
  - Font Awesome icons are removed from the "save" and "cancel" controls
    in order to keep them consistent with other templates.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d156d5a9fe3b30a0e65f70a5203a8a99bc30e651)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e94709dbb2a775fc424c6eb1236d4d72a02e97e6)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28053: Squash warning in C4::Members
Martin Renvoize [Tue, 30 Mar 2021 11:15:22 +0000 (12:15 +0100)]
Bug 28053: Squash warning in C4::Members

This patch sets guarantess_non_issues_charges to '0' upon creation of
the variable and thus prevents 'Use of uninitialized value
$guarantees_non_issues_charges in numeric gt (>) at
/home/martin/kohaclone/C4/Members.pm line 183.' being thrown when the
patron has guaruntees without any charges.

Test plan
1. Run t/db_dependant/SIP/SIPServer.t and note the warning above is
   thrown at least once.
2. Apply the patch
3. Run the test again and note the warning has gone.

Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 297dbf4a5935931cdb8ebf6b9f00f60e291699df)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d448f7a8b97cfd1bf5717c0aadf7c2694feec0d1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27940: Fix missing email in OpacMaintenance page
Magnus Enger [Fri, 12 Mar 2021 10:28:02 +0000 (11:28 +0100)]
Bug 27940: Fix missing email in OpacMaintenance page

To reproduce:

KohaAdminEmailAddress = Some valid email address
OpacMaintenance = Show

OPAC/cgi-bin/koha/maintenance.pl shows this text:

"Koha online catalog is offline for system maintenance. We'll be back
soon! If you have any questions, please contact the site administrator."

"site administrator" is a link, but it only links to "mailto:", the
actual email address from KohaAdminEmailAddress is missing.

To test:
- Apply the patch
- Reload the maintenance page
- Click on the "site administrator" link and verify it contains the
  address from KohaAdminEmailAddress

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit df3a8d25482e10c748a52cb0a7e66ecf9b854364)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d31f22c89a9b845265a6f47f11e6f3be977aa036)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28054: Reinstate the shebang in SIPServer.pm
Colin Campbell [Tue, 30 Mar 2021 11:49:00 +0000 (12:49 +0100)]
Bug 28054: Reinstate the shebang in SIPServer.pm

Bug 26673 renoved the shebang from SIPServer.pm. This was an error
SIPServer.pm is a program not a perl module, and needs the shebang
for the OS to assign an interpreter unless the command line
calls it as an argument to perl. Restore the shebang

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dfe3753deeddb40610a27ccc48ad71110c2bb350)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9906197508c6ad54d2bec459066c76065093eac0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27921: Log correct timestamp for HOLD MODIFY when set waiting
Jonathan Druart [Thu, 11 Mar 2021 15:11:15 +0000 (16:11 +0100)]
Bug 27921: Log correct timestamp for HOLD MODIFY when set waiting

The HOLD MODIFY log at the end of ModReserveAffect is not using an
up-to-date $hold object.

$hold is modified at
1201         $hold->set_waiting($desk_id);
But not refreshed before logged (and so the timestamp is not logged
correctly).

Test plan:
Turn on HoldsLog
Place an item on hold
Check it in to mark it waiting

Confirm that the timestamp logged is the one from the check in, not when
you created the hold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb03909af62585aa7a280cd49b2008b0e7b2cbb8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 66a698fc7248750b8fda96241db7dcf8883b125b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26999: (follow-up) Simplify code
Tomas Cohen Arazi [Mon, 15 Mar 2021 11:33:49 +0000 (08:33 -0300)]
Bug 26999: (follow-up) Simplify code

Doing
$ git grep pickup_locations_code

shows there's some calculated data that is not actually used anywhere.
We can get rid of it.

This patch also reuses $item_object (which is in the same loop scope) to
avoid an extra DB call.

To test:
1. Run:
   $ git grep pickup_locations_code
=> FAIL: It is only used/set as a comma separated string, inside
request.pl
2. Apply this patch
3. Repeat 1
=> SUCCESS: The unused stuff is not there anymore
4. Open the page for placing some holds
=> SUCCESS: It doesn't explode
5. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0fd2be61e8376ad0db0f8ecf1eacde706cec6816)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ca4b8e15c968b763d58b428a1aed26a293d08b8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26999: Make 'Any library' translatable when placing a hold
Tomas Cohen Arazi [Mon, 15 Mar 2021 11:05:02 +0000 (08:05 -0300)]
Bug 26999: Make 'Any library' translatable when placing a hold

This patch makes the 'Any library' string translatable, by converting it
into a flag and using it accordingly on the request.tt template.

To test:
1. Have the 'Hold pickup library match' set to 'any library' on the
   circultation rules.
2. Open the page to place a hold on a biblio with some items
=> SUCCESS: The item says 'Any library' on the 'Allowed pickup
locations' column.
3. Apply this patch
4. Repeat 2
=> SUCCESS: No behavior change
=> SUCCESS: The string is on the template
5. Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 13bb39f4c670d72686dd6b76cc0757c2f07b04d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d863a6dfc71f7193f533c06c2906de7d17bacfb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28043: Some patron clubs operations don't work from later pages of results
Owen Leonard [Fri, 26 Mar 2021 18:36:19 +0000 (18:36 +0000)]
Bug 28043: Some patron clubs operations don't work from later pages of results

This page changes the way event handlers are defined for some operations
on the patron clubs page. These changes make it possible for the
controls to work on multi-page tables of clubs.

To test, apply the patch and got to Tools -> Patron clubs.

- If necessary, add enough patron club templates and patron clubs that
  there are more than 10 of each.
- Click to the second page of club templates and try to delete a
  template. It should work correctly.
- Click to the second page of clubs and try to delete a club. It should
  work correctly.
- Add one or more patrons to a club (from the checkout or patron details
  page).
- Click to the second page of clubs and try the "Search to hold" menu
  item. It should redirect you to the search page.
- After entering a search, the results page should include "Place hold
  for <club>" links with each result.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 20d5a458f38ef622920f083cac97ef753cf41d95)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1213a22d247d950244281fdcbcc0235581bbcdbc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27999: Display the description of authorized values category
Owen Leonard [Fri, 19 Mar 2021 13:00:32 +0000 (13:00 +0000)]
Bug 27999: Display the description of authorized values category

This patch corrects a parameter in the authorized values template so
that the right value is passed for displaying the description of an
authorized value category.

To test, apply the patch and go to Administration -> Authorized values.

- In the table of authorized values, click on one which has a
  description in the "Description" column.
- On the page titled "Authorized values for category XXX," you should
  see that description under the heading.
- Use the "Show category" dropdown to try some other categories.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 07bf1726e8bb0c35e60ca0a742f4edfb69f0c32b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 50c76e4b5ab213714133ece4ffd5fb3f1efbc5f2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28003: Invoice adjustments using inactive budgets do not indicate that status
Nick Clemens [Fri, 19 Mar 2021 15:02:12 +0000 (15:02 +0000)]
Bug 28003: Invoice adjustments using inactive budgets do not indicate that status

This patch affects the display of existing invoice adjustments to indicate when using an inactive budget

To recreate
1 - In acquisitions go to a vendor
2 - Click 'Receive'
3 - Create an invoice
4 - Finish receiving
5 - Go to Admin->budgets
6 - Duplicate your current budget
7 - Mark the original budget inactive
8 - View the invoice you created
9 - No indication the budget is inactive
10 - Apply patch
11 - Reload the page
12 - The fund shows '(inactive)'
13 - The dropdown to edit the funds also indicates which funds are inactive

Note that adding new adjustments does show only the active budget unless you request to see inactive.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7dcb4287e0642b87b3f66b421ea64ad712e49661)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0164135763b6d6842b57d74630e4831657a7a62c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27937: Set datepicker when date is valid
Nick Clemens [Tue, 16 Mar 2021 13:13:57 +0000 (13:13 +0000)]
Bug 27937: Set datepicker when date is valid

When validating dates in JavaScript it is acceptable to have single digit days or months e.g,:
2011-6-16

When parsing in Koha::DateUtils->dt_from_string we die on these

This patch uses JS to set the datepicker which normalizes the date as Koha expects

To test:
 1 - Add new patron
 2 - Enter birthdate as 2/11/1986
 3 - Complete required fields
 4 - Save
 5 - Get ISE
     The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175
 6 - Apply patch
 7 - Repeat 1-2
 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986'
 9 - Save patron, success!
10 - Edit patron, try setting DOB to 2/1/1986
11 - Change focus and note date is formatted as '02/01/1986', save
12 - Repeat with other settings of system preference 'dateformat'

Signed-off-by: Donna <donna@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 27937: (QA follow-up) Fix indentation

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 08c6e629de50ba0f54cc9550d24b575cd7d820dd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0ec3e78ccbd3092727b498772461814c976ff4d4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27928: FindDuplicate should use simple_search_compat
Nick Clemens [Thu, 11 Mar 2021 13:33:43 +0000 (13:33 +0000)]
Bug 27928: FindDuplicate should use simple_search_compat

This patch switches from calling SimpleSearch directly to using the compat
method so that Elastic is used when it is the chosen search engine

To test:
 1 - Set SearchEngine syspref to 'Zebra'
 2 - Add a suggestion with an existing title, e.g.:
   'E street shuffle'
 3 - Confirm you get a duplication warning
 4 - Change SearchEngine to ES
 5 - Repeat get same warning
 6 - sudo koha-zebra --stop
    'ps aux | grep zebra'  to confirm they are stoped
    'sudo pkill -9 zebra' if they arent;
 7 - Repeat suggestion - no duplication warning (because zebra returns nothing)
 8 - Delete the suggestion
 9 - Apply patches
10 - Restart all the things, stop zebra
11 - Repeat suggestion
12 - Successful warning from ES
13 - prove -v t/db_dependent/Search.t

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 93a297a7a2de41df699d59107e43862518048d6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5a5566ca2169fd14638da139de604d712b48a9fa)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27807: (QA follow-up) Unique values only
Martin Renvoize [Tue, 2 Mar 2021 11:19:42 +0000 (11:19 +0000)]
Bug 27807: (QA follow-up) Unique values only

This patch filters the final _order_by clause such that we only have
unique data fields present and we take the first occurence of a field.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8424f402bed2e71d9080d3adabf5e3255bc79629)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e8f5a07a5c33926a6a38a2ed8d1aa467ed892854)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27807: Add multi-column ordering support to datatables wrapper
Martin Renvoize [Tue, 2 Mar 2021 10:36:06 +0000 (10:36 +0000)]
Bug 27807: Add multi-column ordering support to datatables wrapper

This patch add mutli-column ordering support to the datatables api
wrapper.

Test plan
1/ Add a series of cities to the system with various combinations of
city and state such that you can distinguish sorting on city + state in
city ascending + state ascending, city ascending + state descending etc.
2/ Attempt to sort on the two fields in the table (Click the 'City'
heading to sort on city name, then Shift Click on 'State' to add 'state'
ordering on top.. Shift click again on state to reverse the 'state'
ordering but maintain the 'City' ordering.
3/ Confirm the various ordering comes out correctly.
4/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 548562ca17ae06088e84d8fe9287a9f4043ce80e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2bbff47bcac044236a2b8c8bcf8b35b577f0fc21)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26942: Allow style and link tags in NewsEditor TinyMCE
Lucas Gass [Fri, 22 Jan 2021 22:50:51 +0000 (22:50 +0000)]
Bug 26942: Allow style and link tags in NewsEditor TinyMCE

To Test:
-Make sure the sys pref 'NewsToolEditor' is set to TinyMCE
-Go to any news item and add this line:  <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
-Save the news item
-Re-open the same news item again in TinyMCE.
-The editor has removed that line. Annoying!
-Apply patch
-Try again, the <link> should stay now

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 27fce8b0c2575021400023d9a7460adef20dadd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6eb861dc61444e04200295967e77be514aa73a5f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27963: (bug 23463 follow-up) Fix touch_all_items.pl
Jonathan Druart [Tue, 16 Mar 2021 10:36:17 +0000 (11:36 +0100)]
Bug 27963: (bug 23463 follow-up) Fix touch_all_items.pl

This script is used to fix inconsistencies in the items table. Prior to
bug 23463, ModItem dealt with that.

We need to make some attributes as dirty to make sure the
Koha::Item->store method will fix them.

Test plan:
Be familiar with how touch_all_items is supposed to work and confirm
that the different inconsistencies are fixed.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8f071b01f5c851a6b066e7084643bd6430e6e8d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8244792f264baaa2a81afd90fde3b74755d4e549)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26517: Add unit test
Fridolin Somers [Thu, 24 Sep 2020 07:08:43 +0000 (09:08 +0200)]
Bug 26517: Add unit test

Run prove t/db_dependent/Members.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7697cc23b2efb58547b91abcfe85e5729b90be36)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d3883575b7b5e154f597ead4bf5e5d7fc326cd4e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26517: Avoid deleting patrons with permission
Fridolin Somers [Wed, 23 Sep 2020 14:50:09 +0000 (16:50 +0200)]
Bug 26517: Avoid deleting patrons with permission

The patron deletion script misc/cronjobs/delete_patrons.pl uses C4::Member::GetBorrowersToExpunge() to get patrons that may be deleted.
This method filters patrons from a staff category.
I propose to also filter patrons having permission, so a staff member.
Some small libraries do not define a "staff" category and give permissions to regular patrons.

Test plan :
1) Create a patron on adult type category with expiry date in the past and permission to access staff interface
2) Without patch
3) Run delete script : ./src/misc/cronjobs/delete_patrons.pl -v --expired_before='$(date -I)'
4) You see the patron will be deleted
5) Apply patch
6) Run delete script : ./src/misc/cronjobs/delete_patrons.pl -v --expired_before='$(date -I)'
7) You dont see the patron

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c4c33e532d4abeb66bbbafe0ab75797a8e801349)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 550577ed3a003231284f59ba3084a365a8ed04e5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 28021: Fix Bootstrap classes
Lucas Gass [Mon, 22 Mar 2021 22:38:54 +0000 (22:38 +0000)]
Bug 28021: Fix Bootstrap classes

To test:
-be on 20.05.x
-go to any OPAC detail page
-the maincontent stretchs across the entire page
-the action buttons (place hold, save to lists, print, ect) are pushed to the bottom of the page
-apply patch and reload page
-things are better

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoUpdate release notes for 20.05.10 release v20.05.10
Andrew Fuerste-Henry [Tue, 23 Mar 2021 20:44:14 +0000 (20:44 +0000)]
Update release notes for 20.05.10 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoIncrement version for 21.05.10
Andrew Fuerste-Henry [Tue, 23 Mar 2021 20:00:28 +0000 (20:00 +0000)]
Increment version for 21.05.10

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoTranslation fixes for 20.05.10
Andrew Fuerste-Henry [Tue, 23 Mar 2021 19:56:27 +0000 (19:56 +0000)]
Translation fixes for 20.05.10

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoTranslation updates for Koha 20.05.10
Koha translators [Tue, 23 Mar 2021 19:27:32 +0000 (16:27 -0300)]
Translation updates for Koha 20.05.10

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27933: Fix patron search result ordering
Jonathan Druart [Wed, 17 Mar 2021 09:14:43 +0000 (10:14 +0100)]
Bug 27933: Fix patron search result ordering

On bug 27715 we restrict the order by dt params for security reasons.
However in some cases the param passed is "columnname" instead of
"table.columnname".
We should make sure the table is part of the sort fieldname.

Test plan:
Do a "normal" patron search (from the patrons home page) and another
patron search (guarantor for instance).
Sort by cardnumber, date of birth, expiration date, asc, desc and
confirm it works as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1b32e66380d5d7701b3f252e8d2be1cbf1622388)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 18e10f100774dfc87cbcaf9e1ebbd28ab9b63de0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.003
Andrew Fuerste-Henry [Tue, 23 Mar 2021 19:14:22 +0000 (19:14 +0000)]
DBRev 20.05.09.003

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27835: Turn off by default
Jonathan Druart [Wed, 17 Mar 2021 09:34:16 +0000 (10:34 +0100)]
Bug 27835: Turn off by default

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 675088752afcee77ddfd3279e617f0d657f1f81d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c6e90d69380b66375930b2cc77692714ed7d78e1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27835: (follow-up) Update language, remove warn, add feedback
Nick Clemens [Tue, 16 Mar 2021 13:22:26 +0000 (13:22 +0000)]
Bug 27835: (follow-up) Update language, remove warn, add feedback

This patch:
 - Updates lanugage to be clearer 'ChargeFinesOnClosedDays' vs 'ChargeFinesOnCloseDay'
 - Removes a stary warn
 - Add an 'updated' counter and provides feedback in fines.pl

Test plan:
 0 - Apply patches, updatedatabase
 1 - set finesCalendar to 'ignore', ChargeFinesOnClosedDays to "Don't charge"
 2 - Checkout an item due yesterday
 3 - Ensure circ rules have a fine amount and interval set
 4 - Make today a holiday
 5 - perl misc/cronjobs/fines.pl -v
 6 - 0 updated
 7 - ChargeFinesOnClosedDays to "Charge"
 8 - perl misc/cronjobs/fines.pl -v
 9 - 1 updated
10 - set fines calendar to 'use'
11 - perl misc/cronjobs/fines.pl -v
12 - 1 updated (NOTE: This is wrong maybe, but handle on another bug)
13 - set ChargeFinesOnClosedDays to "Don't charge"
14 - perl misc/cronjobs/fines.pl -v
12 - 0 updated

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit deb2f6317a10ec202b2c45dbab663d7a61a43de2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3c73048dbc77781c390f454e7f0b61d4886c5f3b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27835: Add a syspref to control fines calculation on closed days
Jonathan Druart [Tue, 16 Mar 2021 09:16:55 +0000 (10:16 +0100)]
Bug 27835: Add a syspref to control fines calculation on closed days

Bug 27180 added a patch to not update fines on holidays if finesCalendar was set to ignore.
At least it's what it advertised, but not what it did.

It seems that we need to add a new pref to control the calculation of
fines on closed days to answer the different use cases.

Test plan:
With this patch applied you can run the fines.pl cronjob and play with
the new pref ChargeFinesOnCloseDay to generate fines on close days.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 151966d0967786ab235158b4c1a84e19788610b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 513fb7fb683f8e43a368099916500e170a79fcb2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27835: Add new syspref ChargeFinesOnCloseDay
Jonathan Druart [Tue, 16 Mar 2021 09:16:51 +0000 (10:16 +0100)]
Bug 27835: Add new syspref ChargeFinesOnCloseDay

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5007e24e90efeb76fe3d86a8fa832d52af30abc0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 445e8a0db03044cda5b3a2a5c447837b349d8005)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27835: Revert "Bug 27180: (follow-up) Remove unused %is_holiday"
Jonathan Druart [Tue, 16 Mar 2021 08:55:10 +0000 (09:55 +0100)]
Bug 27835: Revert "Bug 27180: (follow-up) Remove unused %is_holiday"

This reverts commit a26d529a2bc7faee3743b4cd1e603ba29411a0b9.

Revert "Bug 27180: Update fines on holidays"

This reverts commit 80e1b4e66f01a07cad9bf37625d879f649edf52a.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c4b4cbd91cc9888e9cdbdf1fe43a10c91bd157b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0cdd5ec6cd34095394a4b6f243ea7ec015df4205)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27597: Remove leading colon in ES query
Jonathan Druart [Wed, 3 Feb 2021 09:33:35 +0000 (10:33 +0100)]
Bug 27597: Remove leading colon in ES query

If we are searching on kw there is a leading colon at the beginning of
the generated query:
  kw:foo becomes :foo

Note that it only happens when there is no other terms before.

Test plan:
0. Don't apply the patch
1. Search for kw:foo
2. Notice the error
  Error: Unable to perform your search. Please try again.
and the logs say
  Failed to parse query [(:foo*)]
3. Apply the patch
4. Repeat the search and notice that you know get:
   "12 result(s) found for 'kw:foo'."

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1ff9160a620519e1626044ff7d9205a0015ac1e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 988e1198298f3281850613d34f2c48e748915c12)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24567: (QA follow-up) Remove warning in regex
Joonas Kylmälä [Tue, 3 Nov 2020 10:27:14 +0000 (12:27 +0200)]
Bug 24567: (QA follow-up) Remove warning in regex

Without this patch we get

Use of uninitialized value $3 in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 943.

This converts the | OR operator to two different regexes so that the
capture group variables will be defined in every case.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ea7e83b2712c48a0c9a157b2fb36eb782b26f34b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24567: Don't strip spaces along with dangling colons
Nick Clemens [Tue, 27 Oct 2020 11:26:53 +0000 (11:26 +0000)]
Bug 24567: Don't strip spaces along with dangling colons

This updates the regex used for removing colons to capture those with space on either side, and remove the colon
while preserving the space

To test:
 1 - Have Koha using ES
 2 - Search for:
    ti:chess AND chess
 3 - You should get a result in sample data, otherwise replace 'chess' with a title in your catalogue
 4 - Search for:
    ti:chess AND kw:chess
 5 - No result
 6 - Enable  DumpTemplateVarsIntranet  and  DumpSearchQueryTemplate
 7 - Repeate search and check page source
 8 - search_query has:
    title:chess ANDchess
 9 - Apply patch
10 - Repeat
11 - Seaerch works!
12 - query is now:
     title:chess AND chess

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 24567: (follow-up) Use dollar sign to refer to captures

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6ce56f1134d99280af30e128f57189b285966180)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 8426: Diacritics not being mapped for searching
Kyle M Hall [Thu, 12 Jul 2012 11:07:07 +0000 (07:07 -0400)]
Bug 8426: Diacritics not being mapped for searching

Add mappings for ︡a to a, and for t︠ to t.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9140ea69150520f7a9b4fcc453020af91bd6ed38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9d321e0533f6e8e4d23d43eecd2cff7f1f6506ea)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27813: Restore default order on suggestion list view
Jonathan Druart [Tue, 2 Mar 2021 11:22:27 +0000 (12:22 +0100)]
Bug 27813: Restore default order on suggestion list view

Prior to 20.05, suggestions on /cgi-bin/koha/suggestion/suggestion.pl sorted by
suggesteddate by default. On 20.05 and later, they're sorting by title instead.
We should go back to the previous behavior.

Test plan:
Create some suggestions
Edit the suggestions.suggesteddate in the DB
List the suggestions and confirm that there are sorted by oldest first

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 25f391b00df34f452e341039abf448c780df1d7d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 75a1c276c73e44ea3e51f6583cbed3675a0413f4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27815: "Remove" in point of sale untranslatable
Owen Leonard [Mon, 1 Mar 2021 12:24:41 +0000 (12:24 +0000)]
Bug 27815: "Remove" in point of sale untranslatable

This patch modifies the Point of Sale template so that the "Remove"
button can be translated. The string in the JavaScript block wasn't
wrapped in the correct function.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

- Update a translation:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  the template: e.g. misc/translator/po/fr-FR-staff-prog.po
- Locate strings pulled from pos/pay.tt for translation to confirm the
  update, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt:189
  #, c-format
  msgid "Remove"
  msgstr "Enlever"

- Install the updated translation:

  > perl translate install fr-FR

- In the staff client, go to Point of Sale.
- Switch to the French translation and click the "Ajouter" button next
  to one of the items for purchase.
- In the "This sale" table, the item you added should have a
  corresponding "Enlever" button.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0381d9e52407fa7172ac18a85e0db8e62edc6c90)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0d233bf98ddb0f57389d1bc43f8ead6a2ca233af)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 23929: [20.05.x] Invoice adjustments should filter inactive funds
Blou [Tue, 26 Jan 2021 20:36:31 +0000 (15:36 -0500)]
Bug 23929: [20.05.x] Invoice adjustments should filter inactive funds

Looking at invoice details, this makes the Adjustments Fund dropdown act
exactly like the Shipping Fund dropdown above, with a Show inactive
checkbox to help filter (by default) the inactive funds out of the list.

Test plan:
0) requires a database with inactive (old) funds along with active ones.
1) Go to invoice details page
2) Click "Add adjustment"
3) Open the drop down beside the Fund label, you should see EVERY fund in database.
4) Compare with behavior of Shipping fund dropdown above.  Not every fund is listed there
5) Apply patch
6) Now behavior is the same, only active fund are listed by default.
7) click "Show inactive" checkbox and see all the funds in the dropdown.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26964: Newly created macros should be selected in the Advanced editor
Phil Ringnalda [Fri, 26 Feb 2021 21:39:37 +0000 (13:39 -0800)]
Bug 26964: Newly created macros should be selected in the Advanced editor

The problem is that the newly created macro isn't selected, because the
return values from the call to create it are accidentally thrown away. There
isn't actually any option to save, just a timeout that automatically saves,
but you can tell you are in this broken state because the Delete macro
button is disabled.

Test plan:

1. Prior to applying the patch, Administration - set the preference
   EnableAdvancedCatalogingEditor to Enable
2. Cataloging - Advanced editor - Macros... - New macro...
3. Give it a name, click OK, notice that the Delete macro button is disabled
4. Apply patch, shift+reload
5. Macros... - New macro...
6. Give it a name, click OK, notice that the Delete macro button is enabled
7. Type something in the editor, delete 999 will do nicely, wait half a
   second to see Saved appear at the far right, close the macro popup
8. Macros..., click the name of your macro, verify it really was saved

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f17d3dd62cfcbe7de3b74573b48e09e42e6b0eab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4073805058c7a1932258cd6f61b6928bcf9a4bbc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27650: Fix variable passed to the template in opac-main
Jonathan Druart [Wed, 10 Feb 2021 06:26:15 +0000 (07:26 +0100)]
Bug 27650: Fix variable passed to the template in opac-main

$template->param(
+    koha_news           => @all_koha_news,

We must not pass an array, the number of elements of the hash passed to the template may be inconsistent.

It's working because of an error earlier in the script:
+    @all_koha_news   = &GetNewsToDisplay($news_lang,$homebranch);

GetNewsToDisplay returns an arrayref

Test plan:
Define at least 2 news to display on the OPAC main page
Hit opac-main.pl
=> All news are displayed
Click one
=> You see the single news you selected

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ca4ef19a2bb400d4348ee84eaddf6af0c429d1c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit af888cd3b84d0b784667dca4d16a00a3c19c3516)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27745: prevent warning for uninitialized value as a hash key
Petro Vashchuk [Wed, 3 Mar 2021 09:32:48 +0000 (11:32 +0200)]
Bug 27745: prevent warning for uninitialized value as a hash key

When you edit and save items with an empty "c - Shelving location"
field, it gets stored into the database as "NULL",
which is allowed in the database, and the field is not "required",
so this seems expected.

But when the search page is rendered, it gets value by location key
($shelflocations->{ $item->{location} }) which gives undef warning.

Solved by checking if $item->{location} is perl true.

To reproduce:
    1) Edit the book or create new one with an empty shelving location.
    2) Use the search feature to have that book in the searched list.
    3) Check plack-intranet-error.log to find "Use of uninitialized
value in hash element" error.
    4) Apply the patch.
    5) Repeat the search and check the logs again to ensure that error
didn't appear again.

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ebf123bf139b28d274ade70016c1af0e3aeffb1b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4b6e421f1f40bd99cba0c380510824f4a45894cd)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27795: Misalignment of TOTAL value in lateorders page
Owen Leonard [Thu, 25 Feb 2021 14:20:14 +0000 (14:20 +0000)]
Bug 27795: Misalignment of TOTAL value in lateorders page

This patch corrects the colspan in the footer of the late orders page.

It also adds a quantity total cell to the footer and changes the
container of the buttons at the bottom of the page from a <p> tag to
the standard <fieldset class="action">.

To test, apply the patch and go to Acquisitions -> Late orders.

In the footer of the late orders page, there should be a total under the
"Quantity" column. The total cost number should be correctly aligned
under the "total cost" header cell.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 42a32bc1727dc4723e07a83cc53e5951a09a20b2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1100dcf0fc69de841eef23f8e1b3c1b390b48fbc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27752: Correct eslint errors in batchMod.js
Owen Leonard [Mon, 22 Feb 2021 15:44:54 +0000 (15:44 +0000)]
Bug 27752: Correct eslint errors in batchMod.js

This patch makes minor changes to batchMod.js in order to address errors
raised by ESLint. These changes include whitespace changes, so diff
accordingly.

To test, apply the patch and go to Tools -> Batch item modification.

- Submit a batch of barcodes for modification.
- Uncheck some checkboxes to hide columns in the table showing your
  submitted items.
- Return to the batch item modification page and submit your batch
  again.
- The columns you selected should still be hidden.
- Submit a batch of items for deletion.
- The same columns should be hidden here too.

To confirm that ESLint is happy with the changes you could open the file
for editing using an editor with ESLint integration, or install ESLint
on the command line:
https://eslint.org/docs/user-guide/command-line-interface

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4add0cbc2d6c3aec6e71d6148ed86cc2e811d1ef)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b0f6062b58b3f93f85e12f00a7ec2d6bc7f35f07)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27776: Remove default sort order of sales table
Martin Renvoize [Wed, 24 Feb 2021 15:53:13 +0000 (15:53 +0000)]
Bug 27776: Remove default sort order of sales table

This patch drops the default sort on table initialisation so that the
table remains sorted in the order in which items are added unless the
user explicitly chooses to apply a sort order.

We also correct a mistake in the targets for disabling sorting on the
'Actions' column and update the hidden 'CODE' column to use the same
syntax as the other definitions for consistency.

Test plan
1/ Enable the point of sale system and set some debit types to allow
sale.
2/ Navigate to the point of sale page and added some items to sell
3/ Update the price for a few lines and note the sort order does not
change.
4/ Update the quantity for a few lines and note the sort order does not
change.
5/ Sort a column using the headers and note it works
6/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 755081fdc394bbf457bee00acf1037a0ba6b29f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bd26b4896474f26bf6d965d6cf0a47334ed842a7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27703: Make ID of category select field unique
Owen Leonard [Tue, 16 Feb 2021 13:27:34 +0000 (13:27 +0000)]
Bug 27703: Make ID of category select field unique

Duplicate element IDs on the authorized values page are invalid and
cause a problem with the JavaScript intended to submit the form when the
category select field changes.

This patch changes the ID of the label and the field and makes the
corresponding change to the JavaScript.

To test, apply the patch and go to Administration -> Authorized values.

 - Click an authorized value category to view its contents.
 - Using mouse or keyboard, make a selection from the "Show category"
   dropdown menu.
 - The form should submit automatically and direct you to the
   corresponding category.
 - Validate the HTML of the page and confirm that there are no errors.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fa349d4cf1c28d486be89c9d84f18fddbaeaf5db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1ee7c0e1224495a4bdd0129f1575c0a0b160311b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27784: Don't parse subdivision authorities as headings
Nick Clemens [Fri, 26 Feb 2021 14:28:42 +0000 (14:28 +0000)]
Bug 27784: Don't parse subdivision authorities as headings

Subdivision authorities are not used for linking, however, they are recognized by
C4::AuthoritiesMarc

While these records are not used for linking, they could provide reference and
should be allowed to exist in the catalog without breaking ES indexing

THis patch simply skips the step of parsing the authorities into the linking form
if the type contains '_SUBD'

To test:
1 - Import a subdivision authority record via Z39 or use the one attached to this bug
2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d
3 - Authority indexing dies:
   Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202.
   Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206.
   Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207.
   Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71.
4 - Apply patches
5 - reindex
6 - Success!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d67fc5e010f5efba79980626beed88755f420c48)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8512ccb4465c01bba9e56cf93eb15aff970cbab0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27784: Unit tests
Nick Clemens [Fri, 26 Feb 2021 14:28:16 +0000 (14:28 +0000)]
Bug 27784: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 5e0dbf0adb63818b08ee77843706255dcaf00051)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e16cd2afc5a2e651ab3b0bf9ab2ff8c40f3c169f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27828: (bug 24469 follow-up) Add missing import
Jonathan Druart [Tue, 2 Mar 2021 10:36:49 +0000 (11:36 +0100)]
Bug 27828: (bug 24469 follow-up) Add missing import

Caused by
  commit 03a9bdc851dcfe114c1676ac55def1e1c5d51970
  Bug 24469: Move the new queries to a dedicated ImportBatch subroutine

Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_acqui_neworderempty_2epl::SetMatchedBiblionumber called at /kohadevbox/koha/acqui/neworderempty.pl line 183

Test plan:
Create a new order from a staged file, select "Add order" next to a
title

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7b4be9486e6e37e724560863f36e4835b6a66f43)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7d94c3cad7c8a8d028d94f4d2e0c81ca00452e89)

3 years agoBug 27808: (QA follow-up) Make sure the update catches the items we want
Tomas Cohen Arazi [Mon, 1 Mar 2021 14:56:23 +0000 (11:56 -0300)]
Bug 27808: (QA follow-up) Make sure the update catches the items we want

This query:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL;

returns 961 rows on the sample data, with 2 items checked out and onloan
set to NULL.

With this tweak, the query only matches the 2 checkout items with onloan
set to NULL:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL AND issues.issue_id IS NOT NULL;

This is the query that needs to be used on the atomic update for
filtering the items to be updated.

This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8df3e02885f94ef8a6f960f693c398b6646daf09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8a59b80e7e7cc812c2b1695e75c2020ba9bf3293)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.002
Andrew Fuerste-Henry [Sun, 14 Mar 2021 18:53:39 +0000 (18:53 +0000)]
DBRev 20.05.09.002

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: DB changes - adjust items.onloan when needed
Jonathan Druart [Mon, 1 Mar 2021 12:34:56 +0000 (13:34 +0100)]
Bug 27808: DB changes - adjust items.onloan when needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb2758839e56c78b5f4d47f28d26053a29ae4d68)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79ef9d3be86757c1c7caefc79a1d51e2c4ec4371)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: Refresh the item object when AddReturn is called
Tomas Cohen Arazi [Fri, 26 Feb 2021 19:55:59 +0000 (16:55 -0300)]
Bug 27808: Refresh the item object when AddReturn is called

This patch changes the original implementation so the item object is
refreshed altogether instead of explicitly pinpointing a specific field
we identified an edge case can leave out from ->store. I propose this
alterate implementation because what this bug highlights is the fact we
don't code thinking calls to things can have side-effects (like this
case, with AddReturn updating the onloan status (and maybe other
things?).

To test:
1. Make sure circ tests pass with and without this patch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 26b57ad5d20e385ff922cc8737afebfece17a3cf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 52babece97c9376b2bc7258a88c753e8f28f33ab)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: Mark the onloan column as dirty in AddIssue
Kyle M Hall [Fri, 26 Feb 2021 14:56:07 +0000 (09:56 -0500)]
Bug 27808: Mark the onloan column as dirty in AddIssue

If any item is currently checked out to a patron, and the item is then checked out directly to another patron without manually checking the item in first, the items.onloan column will remain NULL.

This will only happen if the new checkout will be due the same day as the previous checked.

This is caused by the item being returned without updating the item object from storage afterward. Even though AddIssue will call AddReturn which sets the value of onloan to NULL in the database, we are not passing in the item object by reference, so it's onloan value remains set to a date. Then we set the onloan value to the same date. Because the value does not change in the object, the column does not get marked dirty.

We could update the object from storage first, but it seems more efficient to mark the column as dirty manually to avoid that otherwise unnecessary fetch.

Test Plan:
1) Apply these patches
2) prove t/db_dependent/Circulation.t

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 44a54eb526eff58b860d699ee3c5fb11b3b25fab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4f047c672d25ab5f2ec4dcb716117c7e4b9083f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27808: Add unit tests
Kyle M Hall [Fri, 26 Feb 2021 14:44:30 +0000 (09:44 -0500)]
Bug 27808: Add unit tests

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 36c49aa2a865a069592c5d7695127252a3007f44)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1f8bc45f2d367ed5c7e97c047ddbbb8dafa8ebf5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27794: Add link to biblio in lateorders page
Owen Leonard [Thu, 25 Feb 2021 14:03:43 +0000 (14:03 +0000)]
Bug 27794: Add link to biblio in lateorders page

This patch modifies the late orders page so that the late order title
uses the "biblio-title" include to display a standard title with a link
to the bibliographic detail page.

To test, apply the patch and go to Acquisitions -> Late orders.

In the table of late orders, confirm that the title display correctly
and links to the correct bibliographic record.

Signed-off-by: Severine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 12d50cb5d8529d993ef5abccd84535540c938bee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a557bde38ec57d8b3c2ed8cbee7190935aed2d38)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.001
Andrew Fuerste-Henry [Mon, 8 Mar 2021 16:10:07 +0000 (16:10 +0000)]
DBRev 20.05.09.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoRevert "DBRev 20.05.09.001"
Andrew Fuerste-Henry [Mon, 8 Mar 2021 16:03:33 +0000 (16:03 +0000)]
Revert "DBRev 20.05.09.001"

This reverts commit fa3c0a4cda34a1d7b0d7a008077fd458e4c8e676.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27754: Clear merge markers
Andrew Fuerste-Henry [Mon, 8 Mar 2021 15:52:20 +0000 (15:52 +0000)]
Bug 27754: Clear merge markers

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.09.001
Andrew Fuerste-Henry [Mon, 8 Mar 2021 14:51:21 +0000 (14:51 +0000)]
DBRev 20.05.09.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 7806: [20.05] (follow-up) Update to use sanitize_zero_date
Martin Renvoize [Wed, 24 Feb 2021 15:07:38 +0000 (15:07 +0000)]
Bug 7806: [20.05] (follow-up) Update to use sanitize_zero_date

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 7806: [20.05] Fix remaining occurrences of 0000-00-00
Jonathan Druart [Fri, 18 Dec 2020 14:16:11 +0000 (15:16 +0100)]
Bug 7806: [20.05] Fix remaining occurrences of 0000-00-00

We should remove all SQL queries that contain 0000-00-00 and finally
assume we do not longer have such value in our DB (for date type)

We already dealt with such values in previous update DB entries.
The 2 added by this one haven't been replaced already.

The code will now assume that either a valid date exist, or NULL/undef.

Test plan:
QA review is needed and test of the different places where code is
modified.

Not sure about the change from reports/issues_avg_stats.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: (QA follow-up) Update test for dbic_merge_sorting
Martin Renvoize [Tue, 2 Mar 2021 08:56:14 +0000 (08:56 +0000)]
Bug 27680: (QA follow-up) Update test for dbic_merge_sorting

The order_by handling will now always return an arrayref of ordering
hashrefs even when only one ordering hash is present. This is
interpreted by dbic as equivilent so I just update the test to pass
here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 96aa6877ae39c987214e46d00c70c76591da0174)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4ce9c97007f66687097afc729f257e0836b5ca0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Add support for param[] syntax
Tomas Cohen Arazi [Fri, 26 Feb 2021 17:44:23 +0000 (14:44 -0300)]
Bug 27680: Add support for param[] syntax

While not that common nowadays, it is the syntax PHP uses, and
DataTables also generates such thing in 'traditional' mode. We should
support it as well.

This patch adds support for that. It does so by adding _order_by[] to
the reserved param names, and proper handling on the dbic_merge_sorting
helper.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 27680: (QA follow-up) Minor perlcritic issue

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 79064a88639ba725cc898cb940c85ff3fb1d4bee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 95fda2115d9c0106072eca39ebf7cf6fe02c7edf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Allow traditional multi-params to work
Martin Renvoize [Fri, 12 Feb 2021 19:25:10 +0000 (19:25 +0000)]
Bug 27680: Allow traditional multi-params to work

This patch allows the preceeding test to pass. Strictly, we want a comma
delimited string for our _order_by parameter, but we cannot easily block
a traditional multi-passed parameter.  As such the 'nice' thing to do is
handle it when such a thing is passed as it will pass through validation
regardless.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bc23981b46e67a6d9ee91a2065293ac472341bed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 30f02bee8a6553cbb2828d607aaae9e7d2b6c9f3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Add tests for various ways of passing multi-params
Martin Renvoize [Fri, 12 Feb 2021 14:05:13 +0000 (14:05 +0000)]
Bug 27680: Add tests for various ways of passing multi-params

This patch adds unit test to increase the coverage of parameter that
accept multiple values.  There are a number of different ways end users
can send such parameters and we should test to ensure we are recieving
the correct option.

Options
`?param1=this&param1=that` - traditional multiple pass params
`?param1[]=this&param1[]=that` - php multiple pass params
`?param1=this,that` - comma delimited list param
`?param1=this|that` - pipe delimited list param

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d2a43a77aabd9cf885d6dc9b72458a00bbc28ac9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5191ed911dbbe81c0a262646b58b9a6b6143acad)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Add support for sorting fields with multiple data points
Martin Renvoize [Fri, 12 Feb 2021 13:14:16 +0000 (13:14 +0000)]
Bug 27680: Add support for sorting fields with multiple data points

This patch adds proper handling for sorting a single column that is
constructed of multiple data entities.. i.e `"data": "string1:string2"`

It does NOT add support for filtering on multiple columns yet.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fa1671aba529e55f124eb759f3b09e237a7282fe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17eaec7a486800cfdc1f6b8fde8836738bed6406)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27680: Take first order column for ordering
Jonathan Druart [Fri, 12 Feb 2021 09:53:27 +0000 (10:53 +0100)]
Bug 27680: Take first order column for ordering

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ba7f51f3d12fe2a66b8094d9a10a234a3f4e7c4d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1a62dd04c5eeb3aa1792daa98eaea2fc0800f591)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27754: Correct eslint errors in basket.js
Owen Leonard [Mon, 22 Feb 2021 17:51:16 +0000 (17:51 +0000)]
Bug 27754: Correct eslint errors in basket.js

This patch makes minor changes to basket.js in the staff interface
templates in order to quiet warnings from ESLint. Besides whitespace,
most changes are to correct undeclared or unnecessarily declared
variables.

To test, apply the patch and verify that the cart still works
correctly.

 - Perform a catalog search in the staff interface.
 - Test adding single or multiple items to the cart from the search
   results page.
 - Testing adding and removing titles to the cart from the bibliographic
   detail page.
 - Open the cart and test the various controls in the toolbar to confirm
   that they still work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ae62da0ff6a3fa5df3e01fce656fccc02ce6a55e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7666b52cec8d6004b6824f78667d52de4088f887)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27578: Initialize searchid as blank when not populated
Nick Clemens [Fri, 29 Jan 2021 13:47:22 +0000 (13:47 +0000)]
Bug 27578: Initialize searchid as blank when not populated

This patch simply sets the searchid to a blank string if not passed in

To test:
1 - Add a new biblio and save it
2 - Check the logs: /var/log/koha/kohadev/plack-intranet-error.log (or similar)
3 - Note warn about uninitialized value
4 - Apply patch
5 - Add a new biblio
6 - No warn

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7f0b0e0556127c9ed191b1b741c4cf466b28e1d6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e64e3156d7a10e3d0418432b95e05363e984909c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25777: Disable misleading datatables table information display z3950
David Cook [Wed, 17 Jun 2020 04:34:02 +0000 (04:34 +0000)]
Bug 25777: Disable misleading datatables table information display z3950

This patch disables the table information display on z3950_search.pl,
since it only includes search result counts for that page, which is
misleading to end users.

To test:
1)  Do not apply the patch
2)  Do a Z39.50 search from cataloguing for "test" against Library of
    Congress.
3)  Note the bottom of the page says "Show 1 to 20 of 20" and
    "Showing page 1 of 501"
4)  Do a Z39.50 search from Acquisitions for "test" against Library of
    Congress (Acquisitions -> Vendor -> Basket -> Add to basket -> From
    external source).
5)  Apply the patch and restart Plack
6)  Repeat Step #2
7)  Note the bottom of the page now only says "Showing page 1 of 501"
8)  Note the search bar is gone
9)  Repeat step #4
10) Note the bottom of the page now only says "Showing page 1 of 501"
11) Note the search bar is gone

Squashed and mixed authorship added below
Co-authored-by: Owen Leonard <oleonard@myacpl.org>
Co-authored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2a2a04a641289f6043971dd98037e02fbb30f64f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1e03555d4ca523bd9e4cb4e5ca265acf26e49800)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27798: Add warning to IndependentBranches system preference
Kyle M Hall [Thu, 25 Feb 2021 18:33:31 +0000 (13:33 -0500)]
Bug 27798: Add warning to IndependentBranches system preference

Test Plan:
1) Apply this patch
2) Search system preferences for IndependentBranches
3) Note the warning about changing the setting on a production system

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD Amended patch:
* Fix commit title
* Don't split the syspref's description, otherwise the sentence will be
split in the POs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit fa8a60ddc8ac45404b6159fde5c758e4b0dad60b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 934e033496d3774edf2522aa1f8d140eb2f0af45)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26457: [20.05.x] Throw exception if update of issues table fails
Nick Clemens [Fri, 4 Dec 2020 12:03:52 +0000 (12:03 +0000)]
Bug 26457: [20.05.x] Throw exception if update of issues table fails

While this won't prevent the deadlock, it should catch the case where
a deadlock causes the DB update to fail and provide feedback to the user
and rollback the transaction

I don't know how to trigger the deadlock, I can only confirm that we see it, and
that this should catch it.

To test:
1 - Apply patches
2 - Checkout several items to a patron
3 - Confirm that 'Renew all' feature continues to work as expected and all items are renewed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 26457: Unit test

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 26457: (QA follow-up) Switch to PK index in UPDATE on issues

The deadlock reports tell us that multiple transactions are
waiting for a X lock on a record but using a secondary index
on borrowernumber and itemnumber. Since we have the issue_id
at hand already, we should use that and benefit from the clustered
index (on PK) instead of using a secondary index.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27821: Make sanitize_zero_date support datetime and timestamp
Jonathan Druart [Mon, 1 Mar 2021 10:14:32 +0000 (11:14 +0100)]
Bug 27821: Make sanitize_zero_date support datetime and timestamp

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e3803ee20dc3dfc3d21e5cafa7a76159c8d4aba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3652f652d260bafc8669205d59866db792e56f47)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: (follow-up) Get rid of loop
Tomas Cohen Arazi [Mon, 22 Feb 2021 12:27:12 +0000 (09:27 -0300)]
Bug 27071: (follow-up) Get rid of loop

This patch gets rid of a loop on the librarary's groups siblings, and
acknowledges ->get_hold_libraries returns a proper Koha::Libraries
iterator that can be chained with a new query on the passed branchcode.
This way we only fetch  a count from the DB and no loop needs to take
place on the code.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3495a7e9af70706e3ebba60e3fac7aa3845d1d78)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3525fc03c6d6bb7dbb3e0d49ac8e68444839e82b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27071: (follow-up) Provide a more meaningful error message
Tomas Cohen Arazi [Tue, 9 Feb 2021 15:26:50 +0000 (12:26 -0300)]
Bug 27071: (follow-up) Provide a more meaningful error message

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3e8e15cc64a8b09fc9575af4b9fcbae437293715)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 17bcc1aeea0ad2a60f24a68fa4ba31bf64c15c59)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>