Commit graph

49334 commits

Author SHA1 Message Date
27d5e594bc Bug 32478: (QA follow-up) Shebang and chmod for Koha/Config/SysPrefs.t
Test plan:
Run t/db_dependent/Koha/Config/SysPrefs.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4192a6525)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:37 +00:00
David Gustafsson
b99f0ce4cf Bug 32478: Fix syspref NULL values in tests
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 151c76eafb)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:28 +00:00
2e8a84a45d Bug 32478: (follow-up) Tidy code
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 1c3223445d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:20 +00:00
bd169e2c23 Bug 32478: (follow-up) UpdateItemLocationOnCheckin no longer needs flattening
This patch removes a line flattening the arrays generated by get_yaml_pref_hash
as it is no longer necessary

Conditionals are adjusted to avoid warnings in tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.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 22d3c6121a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:58:04 +00:00
David Gustafsson
90ff0af534 Bug 32478: Fix handling of undef values in ItemsDeniedRenewal
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 9c89bf1956)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:57:43 +00:00
David Gustafsson
b7919fd525 Bug 32478: Remove Koha::Config::SysPref->find since bypasses cache
get_yaml_pref_hash also allows invalid YAML and only parses a limited
subset so remove this method to avoid future issues.

To test):

Since tests already exists for C4::Context->yaml_preference and this
is a trivial change, do we really need a test plan for this?

Sponsored-by: Gothenburg University Library
Signed-off-by: Nick Clemens <nick@bywatersolutions.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 342d46e611)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-18 08:55:38 +00:00
8d40340e51 Bug 30002: (QA follow-up) Add .perltidyrc to Makefile.PL mapping
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8040370e78)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7cabedbe0b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:41:28 +00:00
86ecefe829 Bug 30649: (follow-up) Improve database update
This patch implements the proposed switch to use the standard DB handle
and only require Koha::Encryption if necessary.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f8d2291f2e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f742b2a84a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:41:28 +00:00
67d27898df Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env
This patch includes a unit test which checks the memory address
of the $env hashref in middlewares before and after
Koha::Middleware::Env is applied.

It succeeds when the same $env is maintained before and after
this middleware. It fails if the $env has been overwritten with
a new hashref (as evidenced by the new memory address for the
hash).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c7142fe94)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f73dbd00ad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:41:27 +00:00
48003a890b Bug 33967: Fix SetEnv middleware to preserve $env integrity
This patch fixes the Koha::Middleware::SetEnv, so that it
preserves the referential integrity of the $env hash
reference as it passes through the pre-process and post-process
stages of middleware wrapped around the core Koha Plack application.

Test plan:
0a. Apply the patch
0b. vi /etc/koha/sites/kohadev/koha-conf.xml
0c. Uncomment "koha_trusted_proxies"
0d. Add "172.0.0.0/8" to the end of the "koha_trusted_proxies"
0e. koha-plack --restart kohadev
1. vi /etc/apache2/sites-enabled/kohadev.conf
2. Add the following to the OPAC virtualhost:
SetEnv OVERRIDE_SYSPREF_LibraryName "The Best, Truly the Best, Koha Library"
RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName The Best\, Truly the Best\, Koha Library"
RequestHeader add X-Forwarded-For "192.168.100.100"
3. service apache2 restart
4. tail -f /var/log/koha/kohadev/plack.log
5. Go to http://localhost:8080/
6. Note that the plack.log lists 192.168.100.100 as the client IP address
7. Note that the title of the OPAC webpage is
"The Best, Truly the Best, Koha Library Library catalog"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 42823da209)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b139047381)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:41:27 +00:00
6b459bffb6 Bug 33855: Clean up forms and page sections on 'manage MARC imports' page
This patch makes minor changes to the structure of the "Manage MARC
imports" page so that sections are more clearly delineated and forms
have the correct structure.

The patch also shortens the new framework field labels and adds hints
for clarification.

To test, apply the patch and go to Cataloging -> Stage MARC records for
import.

- Import a batch of MARC records.
- Go to Cataloging -> Manage staged records.
- View the batch you just imported.
- You should see three sections:
  - A list of information about the batch
  - Options for changing the matching rules
  - Options for setting frameworks during import.
- Test that the form for applying different matching rules still works
  correctly.
  - Import a batch of records which contains matches (by, for example,
    exporting MARC records from Koha and then reimporting the same
    batch)
  - On the manage page for that batch try changing the matching rule
    applied, switching between "Do not look for matching records" and a
    matching rule which will catch the duplicate records.
- Test that your records are imported correctly according to the
  framework settings you select, both for new records and for replaced
  records.

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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 17d655249a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:41:27 +00:00
738dedd8db Bug 33957: Add normalized_oclc and only fetch when needed
opac-user.tt wants to normalized_oclc number if using syndetics or B&T images

We don't need to fetch it if not, but we need to pass it if so

To test:
1 - Switch all Syndetics prefs to 'Show' or 'Use' except
    SyndeticsClientCode = just enter 'test'
2 - Checkout some items to a patron, ensure the records have:
    - ISBN
    - UPC
    - OCLC number
3 - View opac-user.pl (sign in to opac as the user)
4 - View the network console tab (may need to reload)
5 - Note requests like:
    https://secure.syndetics.com/index.aspx?isbn=1780335792/MC.GIF&client=test&type=xw10&upc=&oclc=
6 - Note that oclc parameter is not filled for record with an oclc number
7 - Apply patch
8 - Reload
9 - Confirm the link now has oclc as expected
10 - Disable syndetics, enable google books or another source
11 - Confirm images display as expected

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a59f757fd7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 67343cbd45)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:04 +00:00
0efca288a2 Bug 33901: (bug 30718 follow-up) Predition pattern - don't set end date to today
If the end date is not set we should not set it to today.
On bug 30718 the following change was wrong:
-$enddate = eval { output_pref( { str => $enddate, dateonly => 1, dateformat => 'iso' } ); };
+$enddate = dt_from_string($enddate)->ymd;

output_pref returns undef if str is empty
After the change we returned today's date.

Test plan:
1. Go to Serials > Manage numbering patterns
2. Click Edit next to one of the existing patterns (e.g. Number)
3. Enter information in the Test prediction pattern section
   -  Frequency: choose one (e.g. 1/month)
   -  First issue publication date: enter a date (e.g. 2023-06-01)
   -  Subscription length: issues + enter a number of issues (e.g. 12)
   -  Locale: leave empty
   -  Begins with: enter a number in the X column, e.g. 42
4. Click Test pattern
=> Without this patch only one issue is shown, no matter how many you enter in Subscription length
=> With this patch applied the end date is not set to today and the
prediction pattern list is correct

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c9a2cf948d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 50165d8e86)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:03 +00:00
fec8edbd3f Bug 33852: Add one more test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 144efca99d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a22ca6877e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:03 +00:00
7b825c7028 Bug 33852: Make jobs.t test the only_current parameter
This trivial patch adds a test to the only_current parameter.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/jobs.t
=> SUCCESS: New tests added, and pass
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.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 76983f5275)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8a5665d4b7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:02 +00:00
1537b10682 Bug 33937: Remove incorrect export in C4::Members
Bug 17600 re-add those exports, but the module does no longer have the
subroutines. We should remove these export.

Test plan:
git grep is your friend

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e7116af438)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4effe3b3d8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:02 +00:00
6b21739774 Bug 33880: Remove Version param from GB::Barcode->new
Looking at the code here
     if (Koha/Auth/TwoFactorAuth.pmoSelf->{Version}){        #--- auto version select
        for(->{Version}=1; ->{Version} <= 40; ++->{Version}) {
            last if ({->{Ecc}}->[->{Version}]
                        >=  + ->[->{Version}]);
        }
   }

in https://metacpan.org/release/KWITKNR/GD-Barcode-1.15/source/Barcode/QRcode.pm#L349

It appears the version parameter is not required, and will default to whatever version has the necessary bits for the input words given

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 20d2236681)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 82cd05381a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:01 +00:00
f412896691 Bug 33899: Add the 23.11 release team
This patch updates the teams.yaml to include the voted in 23.11 release
team and also updates the release date of 22.11 to match the actual
release.

Test plan
1/ Check against https://wiki.koha-community.org/wiki/Release_Teams

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e70ef6b16b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dea8f81e96)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:36:01 +00:00
b5de68a193 Bug 33951: (QA follow-up) Import GetNormalizedOCLCNumber
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b10b840577)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7c948b540e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:25:59 +00:00
e9da250327 Bug 33951: Set normalized_oclc in opac/opac-readingrecord.pl
normalized_oclc is used in the template to build the link to syndetics,
but it's not passed from the controller. Is this patch correct? Is
syndetics broken on this page? Should we remove it or keep it?
Is oclc parameter in the URL unecessary and should be removed?

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e93668796)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9f0a6d53df)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:25:59 +00:00
Hammat Wele
0868a38d59 Bug 32341: (follow-up) Making the label not showed twice when the tables are in responsive mode
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b608c05fd4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9cf10160ec)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:22 +00:00
Hammat Wele
4e5db3401d Bug 32341: (follow-up) Add responsivity to Curbside pickups table and changing button style for finestables
To activate Curbside pickups
    1- Enable the CurbsidePickup system preference
        1.1 Go to Administration > Global system preferences
        1.2 Search for CurbsidePickup
        1.3 Change the value for 'Enable'
        1.4 Click on 'Save all circulation preferences'
    2- Configure time slots for at least one library
        2.1 Go to Administration > Curbside pickup
        2.2 Fill out the form for Centerville (or another library)
            Enable: Check
            Pickup interval: 10 (or other)
            Maximum boss per interval: 3 (or other)
            Patron-scheduled pickup: Check
            Enable for waiting holds only: DO NOT check
        2.3 Add a time slot
            In 'New slot', enter
                Monday
                From: 10:00
                To: 12:00
            Click on 'Add'
    3- Make an appointment from the OPAC
        3.1 Go to OPAC
        3.2 Open mobile mode
        3.3 Connect with a user
        3.4 Click on 'Curbside pickups'
        3.5 Choose the library in 'Pick a library'
        3.6 Choose a date in 'Pickup date'
        3.7 Choose a time range in 'Select a time'
        3.8 Click on 'Schedule pickup'
            => Notice The table is not responsive
    4- Apply the patch
    5- Execute 'yarn build --view opac'
    6- Clean your cache or open your navigator on private mode (to load updated css files)
    7- Perform step 3.1, 3.2, 3.3, 3.4,
    8- click on 'Your pickups'
     => Confirm that the CurbsidePickup table are now displayed correctly and is now responsive.
    9- Click on 'Charges'
     => Confirm that the Charges table are now displayed correctly and is now responsive.

I correct a little bug. The "suspend_hold" button did not work anymore. This change resets it to it's original state.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 16008c24c5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 19ebcd4eb5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:22 +00:00
Hammat Wele
e8a8c9cf8e Bug 32341: (follow-up) Making the remains OPAC tables responsive
Apply the patch and check for the responsivity of the following tables
1- Go to the OPAC
2- Open mobile mode
3- The following tables are not responsive
- Summary - Clubs
- Summary - Recalls
- Summary - Article requests
- Charges - (relative's)
- Search history - Authority
- Checkout history - All
- Checkout history - Checkouts
- Checkout history - On-site
- Recalls history
- Messaging
- Subscription (serial)
- Course reserves - Courses
- Course reserves - Reserves
- Authority search results
4- Apply the patch
5- Execute 'yarn build --view opac'
6- Clean your cache or open your navigator on private mode (to load updated css files)
7- Perform previous step (1-3)
8- Confirm that the tables are now displayed correctly and is now responsive.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6caeb1f627)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d39115e5fd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:21 +00:00
5f48c84df4 Bug 32341: (follow-up) Alternate button style
This patch applies a different button style and does a couple of clean
up tasks: Removing the redundant sorting-related CSS and moving the
responsive button CSS to _common.scss where other DataTable-related
styles are found.

I think this different button style is more consistent with the OPAC's
design. It also eliminates untranslatable strings from the CSS.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9f277e625e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9ae2959186)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:21 +00:00
Hammat Wele
672330a80f Bug 32341: (Fix) Changing the placement of the button
This attachment correct the placement of the responsive button. It is now in its own column at the last column and the '+' and '-' are remplaced by 'Expand' and 'Unexpand' to make it more clear.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68c3ad5fac)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 135ac49bd4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:20 +00:00
Hammat Wele
55ff485b8c Bug 32341: Some OPAC tables are not displayed well in mobile mode
Some OPAC tables are not displayed well in mobile mode, it is absolutely necessary to scroll to the right to read the content properly

This patch fix this problem by making the tables responsive

To test:
      1- Go to the OPAC
      2- Open mobile mode
      3- Go to a bibliographic record detail page in the OPAC (opac-detail.pl?biblionumber=X)
      4- Check the Holdings table
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> we see very narrow columns
            --> unreadable text
      5- Go to to the page 'Summary' (opac-user.pl)
      6- Check the 'Checked out' table
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      7- Check the 'Overdue' table
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      8- Go to the page 'Charges' (opac-account.pl)
      9- Click on 'Show all transactions'
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      10- Go to the page 'Search history' (opac-search-history.pl)
            --> the information is not presented in a table as it is when viewing on a laptop or PC browser screen.
            --> The columns are overflowing to the right
      11- Apply the patch
      12- Execute 'yarn build --view opac'
      13- Clean your cache or open your navigator on private mode (to load updated css files)
      14- Perform previous step (1-10)
      15- Confirm that the tables are now displayed correctly and is now responsive.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb2e0c2efd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e3de75585d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:20 +00:00
4ea1bda1ed Bug 30002: Adjust perltidy
Remove the following 3 options that are not available in perltidy
v20190601 that is the version shipped with bullseye
--add-terminal-newline
--valign-exclusion-list
--extended-continuation-indentation

Extend max line length
--maximum-line-length=120

Prevent perltidy to format lists (see bug 30002 comment 10)
--break-at-old-comma-breakpoints

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d46a959a69)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 761051893e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:19 +00:00
Julian Maurice
1a32d6162e Bug 30002: Remove unused xt/perltidyrc
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aae185cf5d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b895e63fb3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:19 +00:00
Julian Maurice
8356b41bfb Bug 30002: Add .perltidyrc
The options set in this file try to match the current code style without
deviating too much from perltidy's defaults.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dfe6767f60)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 808fced6f6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:18 +00:00
a880011106 Bug 33950: Don't get marcxml if not necessary - opac-readingrecord.pl
We are retrieving normalized_upc from the MARC XML in the controller (opac-readingrec.pl)
for all issues to display, but this is only used if BakerTaylor or Syndetics are enabled.

Test plan:
Have some checkouts and confirm that the checkout history is displayed
the same before and after this patch.
You should also test BakerTaylor or Syndetics and see if they are
working correctly, but I have no idea how to test them!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c4e016f4df)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0db7678c7b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:18 +00:00
773efeb42f Bug 33900: Fix handling of due_digest
Test plan, on k-t-d
1) Go to 'my account'
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter a barcode e.g. 39999000001372 and press checkout
6) Run the following query to force the due_date to be equal to 'todays' date:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-05 23:59:00' where issue_id = 1;

7) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

8) Notice it hangs, it's stuck on an infinite loop on the 2nd while cycle after if ()
9) Cancel the cronjob script, apply patch
10) Run the cronjob script again (step 7), notice it finishes
11) Access patron's notices:
/cgi-bin/koha/members/notices.pl?borrowernumber=51

Check that the 'Item due reminder' notice is there.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fac7bb247a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7bb9bad4ef)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:18 +00:00
d47bbeb69f Bug 33941: Fix wrong URL name in EBSCOPackagesList
This patch fixes a URL pointing to the wrong route which stops filtering from working in the table.

Note: To test you will need some EBSCO credentials

Test plan:
1) In ERM, go to EBSCO > Packages and search for a package
2) It should fail with a warning in the console saying that a required param "package_id" is missing
3) Apply patch
4) Repeat step 1
5) It should now successfully fetch packages

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ab5dc83400)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6b8f272404)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:16:17 +00:00
7ae673c286 Bug 32894: (QA follow-up) Fix tests
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 4d613494ab)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit bf5ccb47fd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:20 +00:00
0aacb33994 Bug 32894: Make ->sharee looks like others
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e84ef47018)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7b20f2fb4f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:19 +00:00
a6002b1090 Bug 32894: (follow-up) Koha::Item->last_returned_by
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 9ad94cf3e0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0e0d1f134d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:19 +00:00
912ef05525 Bug 32894: (QA follow-up) Fix typo
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 70d7bb57d8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fd61089214)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:19 +00:00
91cc29669d Bug 32894: Remove incorrect caching from bundle_items
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8e2d841a29)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 946484de01)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:18 +00:00
0dead55b94 Bug 32894: Fix test
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 45d882de53)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 278769067c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:18 +00:00
c62cf435e2 Bug 32894: Koha::Biblio->biblioitem
Can we do better here?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 994132a60a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e91d18fcdd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:17 +00:00
8c099ab9f7 Bug 32894: Koha::Item->last_returned_by
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3545292513)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 143c0e59c8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:17 +00:00
a06def460f Bug 32894: Remove wrong caching from Koha:: methods - simple
In some of our Koha:: objects we have methods that cache their result and return it in subsequent calls. However there is no invalidation of the cache if the object is modified.

For instance, in Koha/ArticleRequest.pm

sub biblio {
    my ($self) = @_;

    $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() );

    return $self->{_biblio};
}

This pattern exists in several places.

It can lead to confusion and incorrect results, such as:

use Koha::ArticleRequests;
my $ar = Koha::ArticleRequest->new({
    borrowernumber => 42,
    biblionumber => 42,
})->store;
say $ar->biblio->biblionumber;               # Display 42, correct
$ar->set({ biblionumber => 24 })->store;
say $ar->biblio->biblionumber;               # Display 42, wrong
$ar->discard_changes;
say $ar->biblio->biblionumber;               # Display 42, wrong
$ar->delete;

We should remove those caching and rely on DBIC/DBMS caching mechanism instead.

This patch is adjusting the trivial occurrences

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 68216c541b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3347e66824)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 09:10:16 +00:00
86fb8f1079 Bug 33904: Fix 2FA registration when library name has non-latin characters
If the library name contains non-latin characters, the 2FA registration
process will fail with a JS alert coming from a 500 server-side.

The problem is that Auth::GoogleAuth is expecting an already UTF8 encoded string.
We should set the encoding correctly to make Auth::GoogleAuth deal with
the URL escaping internally correctly, then decode on our own (in the
REST API controller)

Test plan:
* Modify your logged in library name and add some non-latin characters
(eg. "my ❤ library")
* Turn on TwoFactorAuthentication
* Go to your account > More > Manage 2FA
* Click the enable button
=> Notice that you see the QR code and that both "issuer" and "key id"
entries display the library name correctly.
* Test the whole 2FA process, confirm that the library name is correctly
displayed on the app you are using.

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 deeb5ebdbd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6678645740)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 08:51:24 +00:00
ff2e43f456 Bug 33904: Add tests
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 dfed7f235d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 80dec321bd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
2023-07-12 08:51:23 +00:00
4c9b086be3 Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates
Bug 22375 added use of KohaDates without the USE statement.

Test plan:
Make sure you have overdues and go to circ/branchoverdues.pl
Without this patch you get a 500
  Template process failed: undef error - : filter not found at /kohadevbox/koha/C4/Templates.pm line 127
With this patch applied you can see the overdue list

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 7eafb103b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5f24345b67)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-07-10 13:57:13 +00:00
John Doe
c24b75f945
Bug 34206: Fix display of vendor options in agreements and licenses forms
Test plan:
1) Go to ERM licenses /cgi-bin/koha/erm/licenses
2) Click 'New license' and click the 'vendor' dropdown
3) Notice how it doesn't bring up any options
4) Apply patch and repeat test plan. Notice how now the vendor options show.
5) Repeat test plan for agreements

The test plan should be done using the 22.11.x branch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-06 14:48:21 +01:00
9547f91915 Update release notes for 22.11.07 release
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-23 15:19:00 +00:00
e7aab76191 Increment version for 22.11.07 release
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-23 14:52:49 +00:00
b67ba0478e Fix translations for Koha 22.11.07
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-23 14:46:32 +00:00
Koha translators
a23f0edbb3 Translation updates for Koha 22.11.07
(cherry picked from commit 8e30f83f9e21611071cbe291a66bd316081c31d5)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-06-23 13:14:26 +00:00
5dc3852308
Bug 34006: Fix value of "Keep current" option on receive so correct fund is saved
Under certain circumstances the "Keep current" option on receive allows
to receive order lines where the fund is otherwise not accessible to the user.
In 22.11 the wrong value is used for the option, so that instead of the fund id
the budget id is used, this can lead to an error 500 if there is no fund with
this id or to a wrong fund being saved.

To test:

1) Create budget and fund
* With the sample data
* Create a new budget "July 2023"
* Create a new fund "Books" under it
* Limit access to Owner and make yourself the owner

2) Create order
* Create a basket
* Create an order line with this access limited fund
* Close the basket

3) Create a staff user with limited permissions
* Edit or create another patron
* Set catalogue and acq permissions without budget_manage_all and order_manage_all (no access to the fund)
* Edit username and password

4) Receive, recreating the error
* Log in as the second user in a separate browser
* Receive shipment
* Create invoice
* Receive
* You should see the fund under the "Keep current" heading selected
* Add quantity received, save
* Fund has changed to Fund_1_2 => data loss :(

5) Receive, verify fix
* Create another order line with your privileged user and the "Books" fund
* Repeat 4)
* After receiving the fund should now remain unchanged

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-06-22 16:20:51 +01:00