Commit graph

45777 commits

Author SHA1 Message Date
b25b9b75bb Bug 31249: Use cronlogaction on update_patrons_category.pl
This patch does what the title says.

To test:
1. Run the script
2. Check the action logs
=> FAIL: Boo, no record of the running cronjob
3. Apply this patch
4. Repeat 1-2
=> SUCCESS: Yay!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Liz Rea <liz@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e4d2ef0f46)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 17:01:29 +00:00
Katrin Fischer
90623a2715 Bug 30992: (follow-up) Fix semicolon at line ending
$itemLoopIter->{reservedate}     = $first_hold->reservedate,
$itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;

1st line ends with a comma instead of a semicolon.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ddf182192)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:57:45 +00:00
0f234f9209 Bug 30992: Improve translatability for 'for'
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 92f5e02a8c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:57:26 +00:00
75f2d9742e Bug 30992: Improve translatability for Waiting at|On hold
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eedec9e929)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:57:12 +00:00
cf6ad04957 Bug 30879: DBRev 22.05.05.004
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:51:19 +00:00
905fef6ca2 Bug 30879: Add option to syspref and update display
To test:
1 - Update ComponentSortField system preference and verify biblionumber is an option
2 - Repeat test plan from 30327 and confirm sorting with biblionumber works

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 505e12970d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:47:39 +00:00
ee855d97a8 Bug 30879: Handle index/sorting for UNIMARC
Same as before, but test with UNIMARC setup

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fbf1c32a6f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:47:23 +00:00
8b5dc95fe5 Bug 30879: Allow biblionumber as sort option in Elasticsearch
Repeat previous tests with Elasticsearch engine
You will need to reindex and reset mappings to pickup the changes form the file

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c8c51867c4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:47:07 +00:00
1639f6bfa4 Bug 30879: Add biblionumber as a sorting option in MARC21
This patch updates the Local-Number indexing by adding a zeropad option
to Zebra indexing and adding this to the mapping files

It also updates C4/Search.pm to allow biblionumber as an option

To test:
1 - Apply patches
2 - copy etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl to /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
3 - Restart all, reindex zebra
4 - Browse to: http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=kw&q=a&sort_by=biblionumber_dsc&count=20
5 - Confirm records sorted correctly
6 - Browse to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=kw&q=a&sort_by=biblionumber_asc&count=20
7 - Confirm records sorted correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 230bae0b02)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:46:53 +00:00
b7cb7120f9 Bug 31274: DBRev 22.05.05.003
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:11:35 +00:00
44c7010fc1 Bug 31274: Make sure OPACSuggestionAutoFill is handled as a boolean everywhere
The YAML preference definition defines it as a string ('yes' or 'no' the
possible values). And the opac-suggestions.tt template has one occurence
of the variable being compared to a string.

This patch does:
- fix the template
- fixes opac.pref for 0|1
- adds an atomicupdate that takes care of moving 'yes' and 'no' to their
  respective boolean values.

To test:
1. Change the syspref value to enable/disable
2. Check on the DB that the value is wrong:
   $ koha-mysql kohadev
   > SELECT value FROM systempreferences WHERE variable='OPACSuggestionAutoFill';
=> FAIL: It is either 'yes' or 'no' depending on what you choose.
3. Apply this patch
4. Run:
   $ updatedatabase
5. Repeat 2
=> SUCCESS: Values are now 0 or 1
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c0b7bf01f)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 16:03:53 +00:00
558ee09dd5 Bug 27849: (follow-up) Add test
Compacting the code a bit too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad0aa754ee)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:41:54 +00:00
MJ Ray
a48cf3c941 Bug 27849: Koha::Token may access undefined C4::Context->userenv
The _add_default_csrf_params internal function accesses
C4::Context->userenv without checking that it has been defined. I think
not all of the potential callers of it declare that they require a
defined userenv, so we should test and provide defaults for required
values if it is not defined, to avoid some "Can't use an undefined value
as a HASH reference" HTTP 500 Internal Server Errors.

To test:

Do anything that requires a form with CSRF token, such as editing your
details. Behaviour should be unchanged. To test the failure case, you
would need some customised code that indirectly generates a CSRF token
before setting the userenv up and I am not sure there is any in released
Koha yet.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>

Looks good to me. Working as expected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8c45fe1aaa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:41:29 +00:00
2f2013d2da Bug 30984: DBIC
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:39:39 +00:00
Michael Hafen
a1b1b82945 Bug 28864: Have patron card creator use PatronsPerPage
Add pageLength to members/member.tt
Add aLengthMenu and pageLength to
 patroncards/add_user_search (common/patron_search.tt).
Add aLengthMenu, pageLength, and iDisplayLength to patroncards/edit-batch

Test plan:
1.  Set the PatronsPerPage system preference to any integer other than 20.

2.  Go to Tools -> Patron card creator.
3.  Start a new Card Batch.
4.  Click the 'Add patron(s)' button to open the patron search window.
5.  Do a search.
6.  Add more than 20 patrons to the batch.
7.  Close patron search window.
8.  Click the 'Add patron(s)' button to add the selected patrons to the batch.
9.  Observe that the table of patrons is has 20 as the default per page setting.

10. Apply patch.
11. Reload the batch.
12. Observe that the per page drop down includes the value of PatronsPerPage
     and that value is selected by default.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5ca665f6aa)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:35:58 +00:00
4d330f3697 Bug 30984: DBRev 22.05.05.002
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:29:14 +00:00
6106f6926a Bug 30984: (QA follow-up) Switch from mediumtext to varchar(255)
My research indeicates that tinytext of less than 40 bytes uses
about the same storage as a varchar(255). Also, using
a TEXT field in a complex query may create a temp table.
varchar fields are also more efficient for sorting on.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5266069016)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:26:14 +00:00
1fe48f965c Bug 30984: (QA follow-up) Ternary formatting style
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3a0d75a40)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:26:00 +00:00
5767add2cc Bug 30984: Action logs should log the cronjob script name that generated the given log
When something is changed by a cronjob, and that entity is logged via action logs, we can know what changed, and that it was via a cronjob, but we cannot necessarily know which cronjob made that change. The closest we can come is to find the action logs for the cronjob module which ran before the change which is by no means reliable assuming the CronLog is even enabled.

We should add a new column to action logs to store the name of the script ran for any action logs where the interface is "cron".

Test plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Enable all the Log/Logging sysprefs
4) Run some cronjobs that will generate action logs
5) Note the new action_logs column "script" contains the filename of the
   cronjob that caused the change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 18fd0c89cf)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:25:33 +00:00
ecc6a21ad2 Bug 30468: Restore 'set -e' and remove echos
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4a00658e34)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:22:55 +00:00
5e14e2c693 Bug 30468: koha-mysql does not honor Koha's timezone setting
If I run a query like "SELECT NOW()" from a koha report, I will get a different answer than if I had run it from koha-mysql.
In Koha, we set the timezone for each database connection.
However, koha-mysql does not do this, so instead we are left using the default timezone of the database.

Test Plan:
1) Set your time zone to something other than the database time zone
2) run "SELECT NOW()" using debian/scripts/koha-mysql
   *not* /usr/sbin/koha-mysql
3) Note you get the database timezone's current time
4) Apply this patch
5) Repeat step 2
6) Now you get the correct time!

Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e97b099d58)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:22:41 +00:00
7dcbbb7437 Bug 31269: Define sDefaultContent for DataTables
1. Stage a MARC record for import
2. Once you have one click on 'Manage staged records'
3. You will see an alert that says "Something went wrong when loading the table."
4. If you dismiss that you should see the following error:

DataTables warning: table id=records-table - Requested unknown parameter '' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4

5. Appy patch
6. Try ssteps 1 & 2 again
7. No DataTable errors

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 573db0fca1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:20:08 +00:00
Shi Yao Wang
f28a904348 Bug 30028: Fix patron message delete confirmation to be translatable
Make the message deletion confirmation popup translatable. Test plan
uses fr-CA translations.

Test plan:
1) Switch language to french (fr-CA)
If you do not have the translations, go to
  misc/translator
then do
  ./translate install fr-CA
After it is done, go to administration > global system preference >
l18N/L10N then select Français (fr-CA) under language preference.
Refresh then you should be able to switch languages.
2) Add a message to a patron account from your own branch (or make sure AllowAllMessageDeletion is on)
3) Click "Delete" next to the message
--> a confirmation message appears "Are you sure you want to delete this message? This cannot be undone." with options "Cancel" and "OK".
4) Apply the patch
5) Write a translation in misc/translator/po/fr-CA-messages-js.po :
msgid "Are you sure you want to delete this message? This cannot be undone."
msgstr "Êtes-vous sûr de vouloir supprimer ce message? Cette opération est irréversible."
6) Refresh the translations by going to misc/translator and execute ./translate install fr-CA
7) Refresh and click "Delete" again
--> now the confirmation message is "Êtes-vous sûr de vouloir supprimer ce message? Cette opération est irréversible." with options "Cancel" and "OK"

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 622137294a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:16:54 +00:00
Tim McMahon
ab884f60f2 Bug 30499: Move the include for catalogue-search-box.inc in circ-search.inc to correct keyboard shortcuts
Keyboard shortcuts for catalog search, check in and renew should be following:
1) Alt-q for catalog search
2) Alt-r for check in
3) Alt-w for renew

However on some of the pages shortcuts get mixed up:

1) Alt-w for catalog search
2) Alt-q for check in
3) Alt-r for renew

Affected files are:
circ/pendingreserves.tt
circ/circulation_batch_checkouts.tt
circ/circulation-home.tt
circ/branchtransfers.tt
circ/branchoverdues.tt
circ/set-library.tt
circ/checkout-notes.tt
circ/renew.tt
circ/waitingreserves.tt
circ/transferstoreceive.tt
circ/offline.tt
circ/bookcount.tt
circ/on-site_checkouts.tt
circ/circulation.tt
circ/transfers_to_send.tt
circ/request-article.tt
circ/overdue.tt
circ/reserveratios.tt
offline_circ/list.tt
offline_circ/process_koc.tt
offline_circ/enqueue_koc.tt
plugins/plugins-upload.tt
plugins/plugins-disabled.tt
pos/registers.tt
pos/register.tt
pos/pay.tt
reports/reports-home.tt
reports/dictionary.tt
reports/guided_reports_start.tt
reserve/request.tt
tools/scheduler.tt

This is because the include statement for catalogue-search-box.inc is in the wrong line in circ-search.inc.

To test:
1) Go to an affected page (circulation-home was the first one I noticed)
2) Try the keyboard shortcuts and notice they are incorrect
3) Apply patch and refresh the page
4) Notice that the keys work properly

Signed-off-by: Andrew <andrewfh@dubcolib.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 94191e5bfe)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:13:19 +00:00
Bernardo Gonzalez Kriegel
577eed32b5 Bug 28707: Translate RECEIPT notice
There is a badly crafted regex used when extracting
strings in multiline fields in yaml files
The regex is my own, introduced in Bug 24262, sorry.

This patch correct it a little. Better eyes are welcome.

To test:
1) go to misc translator, update some language
    ./translate update fr-CA

2) check missing strings

    egrep "Total out|Operator ID|August 31" po/fr-CA-installer.po

   first two are from sample notices, third from sample creator data

3) apply the patch, repeat 1)

4) repeat 2), verify the strings are present in the translation file

5) translate some of the new strings, install the language,
   verify strings are present in the translated files
    ./translate install fr-CA
   check fr-CA/optional/sample_creator_data.yml and
   fr-CA/mandatory/sample_notices.yml

There are some 60+ new strings.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 160d96e176)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:11:01 +00:00
25b2ebf8b2 Bug 31251: Use jQuery val() to clear_entry
1. Add some patron attributes that are textarea and some that have an AV category so they are select dropdowns
2. Go to the patron form and add some values to the patron attributes
3. Use the "Clear" button to try and clear the values, doesnt work.
4. Apply patch
5. Try clearing values from patron attributes that are both select dropdowns and textarea. The "Clear" button should work.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3198f6474)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 15:08:42 +00:00
Emmi Takkinen
3e732aa6cf Bug 31238: Fix typo in marc_subfields_structure.pl
After bug 29001 one is unable to save authorised value to frameworks
subfields. This is caused by minor typo in marc_subfields_structure.pl.

To test:
1. Edit e.g. default frameworks subfield 952$8
2. Add or change fields authorised value
3. Save your changes
=> note that on subfield listing there is no mention that 952$8 is linked to any authorised value
=> if you edit 952$8 authorised value input is empty
4. Apply this patch.
5. Repeat steps 1.-3.
=> authorised value should now be saved

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c39e47cbf3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 14:37:08 +00:00
2256a16b9b Bug 29012: DBRev 22.05.05.001
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 14:32:20 +00:00
294ed32d06 Bug 29012: (QA follow-up) Use q{} instead of '' in smart-rules.pl
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f8e77b4e8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 14:28:19 +00:00
Kevin Carnes
387900a65c Bug 29012: Add default values for blank circulation rules that weren't saved to the database
There are 5 fields that are not set if no value is provided when saving/editing a rule in Administration->Circulation and fines rules
- issuelength
- hardduedate
- unseenrenewalsallowed
- rentaldiscount
- decreaseloanholds

This is problematic because it gives the impression these rules are set as blank, but in reality they don't exist and the rule will fal back to the higher level

To test:
1 - Set a rule for
    Patron category: Teacher
    Itemtype: All
    Hard due date: (Today)
    Lona period: 10
2 - Set a rule for
    Patron category: Teacher
    Itemtype: Books
    Hard due date: (leave blank)
    Loan period: 10
3 - Expected behaviour is Book item will checkout to teacher for 10 days, all other types will be due yesterday at 25:59:00
4 - Checkout an non-book item type to teacher
5 - Hard due date applies
6 - Checkout a 'book' item type to teacher
7 - Hard due date applies - FAIL

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cf397ac3bc)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 14:27:30 +00:00
a39825d1a1 Bug 31247: Fix OPAC authentication when 2FA is enabled
Silly mistake from bug 28786, the $type should be compared to "opac"
instead of "OPAC", erk!

Test plan:
Turn 2FA on
Set it up for an user
Login at the OPAC
=> Without this patch you keep being redirected to the auth form screen
=> With this patch applied you are able to successfully login

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7bb0d2a5e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 14:23:39 +00:00
8da1b675ff Bug 31247: Add tests
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9891b84fe)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-29 14:23:17 +00:00
33fb60358f Revert "Bug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7"
This reverts commit c3c006713b.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-28 14:48:28 +00:00
dd958e6248 Revert "Bug 31219: Prevent JS injection in patron extended attributes"
This reverts commit ddaa78bdab.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-28 14:48:14 +00:00
9e1f020b56 Update release notes for 22.05.05 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-26 14:35:00 +00:00
b9bac60ca8 Increment version for 22.05.05 release
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-26 14:28:35 +00:00
Koha translators
5dbef1e1a5 Translation updates for Koha 22.05.05
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-26 11:18:21 -03:00
ddaa78bdab Bug 31219: Prevent JS injection in patron extended attributes
We are sanitizing other attributes but "extended patron attributes".

Test plan:
Make a patron attribute editable at the OPAC
Edit an existing patron, or register a new one
Use a script tag in the new value ("<script>alert("booh!")</script>" for
instance)
With this patch the value is remove if containing an HTML tag that is
not br b i em big small strong (see C4::Scrubber)

Signed-off-by: Mark Hofstetter <koha@trust-box.at>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-26 14:08:41 +00:00
c3c006713b Bug 31499: Add libhttp-tiny-perl 0.076 dependency for ES7
no testing info provided

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 486f5af303)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-20 19:35:14 +00:00
Joonas Kylmälä
b2a66cd307 Bug 31455: (QA follow-up) Make table creation O(N)
We can insert the indices before the main loop to a hash,
this way we don't have to look up during each loop iteration
the index from an array which in the worst case might take O(N)
thus making the total time complexity O(N^2).

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 223d9d3a99)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-16 15:21:55 +00:00
d8956d387d Bug 31455: Make batchMod sort by order scanned
To test:
1. In batch item deletion and batch item modification add some
   barcodes.
2. Notice they are being sorted by item number, not in the order
   scanned.
3. Appply patch and restart services.
4. Try scanning items again in both batch item deletion and batch item
   modification.
5. The found barcodes should now sort by order scanned.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5c2b2ac09a)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-16 15:21:38 +00:00
346be764e7 Bug 30909: Retain permanent_location if mapped
If items.permanent_location is mapped to a MARC subfields we must retain
the value, not using items.location

Test plan:
1 - Map permanent_location to a marc field
2 - Expose that field in the item editor
3 - Change the location of the item and retain the permanent location on saving
4 - note that permanent location has not changed

Test the different other situation, when adding and editing: Empty the field, change only location, change only permanent_location, etc.

Signed-off-by: andrew <andrewfh@dubcolib.org>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2668a6857)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-16 15:16:46 +00:00
e8405efbec Bug 31223: Do not explode if plugins disabled
This patch makes the code skip calculating the plugin-related task
codes => class mapping if plugins are entirely disbaled.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Plugins/BackgroundJob.t
=> FAIL: Tests explode with: Can't call method "GetPlugins" on an
undefined value at... Koha/BackgroundJob.pm line 424.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7867106d43)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-12 14:56:37 +00:00
b34e91b50e Bug 31223: Regression tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 28896d9c30)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-12 14:56:22 +00:00
Johanna Raisa
cf96c9802a Bug 23202: Fix screen freeze when ordereing several items
This patch fixes adding multiple items on order acquisitions

The error is: Uncaught TypeError: $(...).parent(...).attr(...) is undefined

Test plan:
1) Set dateaccessioned.pl plugin to ACQ framework's 952$d field.
2) Create basket to a vendor and add order from a new empty record.
3) Add date acquired value from calendar.
4) Add multiple items and see that the view freezes.
5) Apply the patch
6) Reload the page and repeat the steps 3 and 4.
7) See that the items are added.

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

JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d2d78e2581)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-08 14:44:33 +00:00
e0b8c2fcc8 Bug 31244: Fix 500 if logout and not logged in
Can't use an undefined value as a HASH reference at /kohadevbox/koha/C4/Auth.pm line 985
        C4::Auth::checkauth('CGI=HASH(0x5603b7dc4300)', 0, 'HASH(0x5603b2633238)', 'intranet', undef, 'intranet-main.tt') called at /kohadevbox/koha/C4/Auth.pm line 186
        C4::Auth::get_template_and_user('HASH(0x5603b7b83d08)') called at /kohadevbox/koha/mainpage.pl line 40

Test plan:
Open a private window
Hit /cgi-bin/koha/mainpage.pl?logout.x=1

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1ae5454b01)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 20:27:56 +00:00
1ce81043ca Bug 31246: <span> displayed in 'Additional fields' section
This patch avoids escaping HMTL data in the additional fields section.

To test:
1. Open the additional fields section
   http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/admin/additional-fields.pl
=> FAIL: there are some nasty <span> </span> texts in there
2. Apply this patch
3. Reload
=> SUCCESS: Things display nicely again!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7272f9886)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 20:25:10 +00:00
e20879a8f5 Bug 31120: Items will renew for zero ( 0 ) days if renewalperiod is blank/empty value
If the rule renewalperiod is the blank empty string instead of being null/undefined or non-existant, Koha will interpret the renewal period as being zero days instead of falling back to the issuelength rule.

It makes sense to me that a literal 0 here should make it renew for zero days even though that is nonsensical.

Test Plan:
1) Delete all your rules
2) Create an all/all/all rules with an empty string for renewal base
   period
3) Note that renewing an item does nothing
4) Apply this patch
5) Restart all the things!
6) Renew again
7) Note the renewal uses the issuelength rule as intended

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b010d99df)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 20:18:18 +00:00
d23293acb5 Bug 31120: Add unit tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 511ae8298e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 20:17:54 +00:00
Jérémy Breuillard
c7b78eb133 Bug 21982: Circulation statistics wizard does not count deleted items
By default statistic assistant filter is set on the
existing items and doesn't mind about deleted items.
The patch corrects this. Items belong to the same library.

Test plan:
1)Make sure to have at least 1 or more item(s) in deleteditems database table
2)Home > Reports > Circulation statistics
3)Fill up 'Issuing library', 'Home library' and 'Holding library'
4)Submit
5)Notice that only statistics for active items are shown
6)Apply patch and repeat from 2) to 5)
7)Now active items and deleted items are shown

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 610f287db9)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-09-02 19:51:04 +00:00