Commit Graph

6359 Commits

Author SHA1 Message Date
Mathieu Saby bbe88ece22
Bug 32722: Make several subfields and a field non mandatory in default UNIMARC biblio framework
801 should not be mandatory except in data exchange context (IFLA Manual)
In UNIMARC several subfields are mandatory only if the field is used.
This possibility is not available in MAR21, and Koha is currently not
able to manage this information in a useful way : it blocks the
validation of a record if the mandatory subfield is void, regardless
of the mandatory status of the field.
In consequence those subfields must be declared non mandatory in default framework.

Test plan:

1/ Open a UNIMARC Koha without patch. Try to create a record with
minimal information : 200$a and 100$a. A lot a alerts are displayed,
preventing Koha to add the record
2/ Apply the patch
3/ Run reset_all or restart KTD (to remake a fresh koha from scratch)
4/ Try to create a record with minimal information : 200$a and a 100$a.
There should only be 2 alerts, regarding 099$t and 942$c field.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 30a1c4bb45)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-30 22:54:27 +01:00
Paul Derscheid 4fec57bf41
Move 241101000.pl into db_revs and set execute bit
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-14 13:48:30 +01:00
Paul Derscheid 74cf5110e9
Increment version for 24.11.01 release
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-01-06 13:42:01 +01:00
Andrew Fuerste Henry 47edc459e2
Bug 38522: (follow-up) Edit db_rev and preserve comment
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1a4820322e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 16:37:53 +01:00
Martin Renvoize 0dc6a25738
Bug 38622: Update sample patron data with preferred_name
This patch updates the sample_date, as used in koha-testing-docker, with
the new preferred_name field.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a5e3b45019)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:13:58 +01:00
Paul Derscheid ce331152c0
Revert "Bug 38622: Update sample patron data with preferred_name"
This reverts commit d52992f85c.
2024-12-12 14:13:20 +01:00
Martin Renvoize d52992f85c Bug 38622: Update sample patron data with preferred_name
This patch updates the sample_date, as used in koha-testing-docker, with
the new preferred_name field.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a5e3b45019)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:05:23 +01:00
Emmi Takkinen ce964ef098
Bug 38602: Do not check if columns bookings.creation_date and bookings.modification_date from information_schema
If one has multiple databases in use adding columns
bookings.creation_date and bookings.modification_date is added
just to first updated database and skipped in other updates.
This happens because we check if these columns already exist
in database from information_schema. We should instead make
this check with method column_exists.

To test:
1. Apply this patch.
3. Drop columns bookings.creation_date and bookings.modification_date:
ALTER TABLE bookings DROP COLUMN creation_date;
ALTER TABLE bookings DROP COLUMN modification_date;
2. Revert your database back to version 24.0600028:
UPDATE systempreferences SET value = "24.0600014" WHERE variable = "version";
3. Run updatedatabase.pl.
=> Check that columns were added.

If you happen to have two databases:
1. Check if you have columns in your bookings table:
SELECT DISTINCT TABLE_SCHEMA, TABLE_NAME FROM
INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN
('creation_date', 'modification_date');
=> Note that columns exist only in one of the databases.
2. Make sure you're using database missing columns
from booking table.
3. Apply this patch.
4. Revert back to version 24.0600028.
5. Run updatedatabase.pl
=> Check that columns were now added to database.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a84195d7da)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:51 +01:00
Katrin Fischer f0775513bc
Bug 38522: DBRev 24.11.00.002
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 855638123e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:38 +01:00
Andrew Fuerste Henry e025474615
Bug 38522: update kohastructure.sql
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 73c7acd33f)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:35 +01:00
Andrew Fuerste Henry 44426aab39
Bug 38522: Increase erm_agreements.license_info length
to test:
1- try to save an agreement with 81+ characters in License Info
2- it does not save
3- apply patch, updatedatabase
4- repeat 1, it works!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2512392b2a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-12 14:04:27 +01:00
Katrin Fischer 8d8a66d344
Bug 37292: DBRev 24.11.00.001
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c6c3e8f9c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-11 17:31:14 +01:00
Paul Derscheid 9407c76d51
Revert "Bug 37292: DBRev 24.12.00.002"
This reverts commit 0df147125d.
2024-12-11 17:30:46 +01:00
Katrin Fischer 0df147125d
Bug 37292: DBRev 24.12.00.002
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 7c6c3e8f9c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 15:25:53 +01:00
Tomas Cohen Arazi 9def7d040c
Bug 37292: Add an index on oauth_access_tokens.expires
This patch adds a needed index to the column.

To test:
1. On a fresh KTD, run:
   $ ktd --shell
  k$ koha-mysql kohadev
   > SHOW CREATE TABLE oauth_access_tokens;
=> FAIL: There's no 'KEY' entry for the `expires` column
2. Apply this patch
3. Run:
  k$ updatedatabase
=> SUCCESS: A message tells the index was added
4. Repeat 1
=> SUCCESS: The index was actually added to the DB
5. Run:
  k$ reset_all
6. Repeat 1
=> SUCCESS: The index is created at install time too!
7. Run:
  k$ updatedatabase
=> SUCCESS: Nothing explodes, no message about index being created
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 2e63ece6ae)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2024-12-10 15:25:41 +01:00
Katrin Fischer 9bbb73fa26
Koha 24.11 is here!
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 20:38:56 +01:00
Jonathan Druart a072d5ff47
Bug 22421: Fix KEY names
There is a mismatch in KEY names.
We should use the ones auto-generated by the server, not pass specific
ones.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 15:07:44 +01:00
Katrin Fischer 3f033e8aae
Bug 37592: Make db_rev file executable again
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 15:07:43 +01:00
Jonathan Druart b13f0349fd
Bug 37592: (follow-up) Fix comments in db_rev
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 15:07:42 +01:00
Martin Renvoize aceccc7e51
Bug 37592: (follow-up) Fix timestamp vs datetime in db_rev
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 15:07:42 +01:00
Katrin Fischer 16d01084c1
24.11.00: Update kohastructure.sql
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:43 +01:00
Jonathan Druart 493698bf32
24.11.00: Adjust COMMENTs in DB revs
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:43 +01:00
Paul Derscheid 31517e506a
Bug 37592: (QA follow-up) Ensure consistent NOT NULL placement and make implicit behavior explicit
- Explicitly set `NOT NULL` constraints for `creation_date` and `modification_date` in `kohastructure.sql` to clarify the implicit behavior of `DEFAULT CURRENT_TIMESTAMP`.
- Adjusted the `modification_date` column definition in the atomic update file to place `NOT NULL` before `ON UPDATE` for consistency.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:42 +01:00
Paul Derscheid 4e5034eb08
Bug 37592: (QA follow-up) Update db_rev to align DBIx::Class with database schema for creation_date, modification_date
- DBIx::Class appears to determine column nullability based on database metadata.
  When columns are added via `ALTER TABLE` without explicitly specifying `NOT NULL`,
  the metadata may indicate `IS_NULLABLE = "YES"`, causing DBIx::Class to generate
  `is_nullable => 1` in the schema files. This behavior might not account for the
  implicit `NOT NULL` enforcement of `DEFAULT CURRENT_TIMESTAMP`.
- Adding `NOT NULL` explicitly in the `ALTER TABLE` statements ensures the database
  metadata reflects the intended constraints, potentially resolving this issue.
- Additionally, comments in the atomic update and `kohastructure.sql` are aligned
  for consistency and clarity.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:41 +01:00
Jonathan Druart c0a8cf18f7
Bug 38436: Adjust DB update output
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:41 +01:00
Katrin Fischer 1d012c39d3
Bug 38436: DBRev 24.06.00.064
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-20 19:11:51 +01:00
Jonathan Druart 4e12775e4f
Bug 38436: Rename columns_settings.columnname in DB
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-20 14:01:54 +01:00
Katrin Fischer 5bb6f8c1cb
Revert "Bug 38299: [DO NOT PUSH] Test dbrev"
This reverts commit 0be29ed976.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-19 09:11:25 +01:00
Jonathan Druart c654f4cb40
Bug 38299: (follow-up) (discussion) Move failure into same level
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-18 17:44:40 +01:00
Martin Renvoize 5a5a0dbbce
Bug 38299: (discussion) Move failure into same level
This patch adds the failures in at the same level as the rest of the
revision output (i.e. indented under the specific database revision) and
uses the standard failure coloring instead of the local update_error
class.

This is a proposal and may need more work to clarify and perhaps remove
the duplicated/collected errors at the bottom of the update. Now that we
hard stop if an update fails, I'm not sure collecting errors at the
bottom makes as much sense as it once did?

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-18 17:44:39 +01:00
Emily Lamancusa c79d533a04
Bug 38299: Use say_failure when printing update errors to the console
Bug 35681 added subroutines to print colored output from database
updates. Incorporate the subroutine say_failure into the error handling
in the upstream code, so that errors caught upstream can take advantage
of this new subroutine and display in red.

To test:
1. Apply patch for test dbrev
2. From the kshell, run updatedatabase
--> The messages for success, info, warning, and failure that were
    explicitly printed in the dbrev are colored, but the database error
    is not colored.
3. Apply other patches
4. Run updatedatabase again
--> All messages including the database error are now colored

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-18 17:44:38 +01:00
Emily Lamancusa 0be29ed976
Bug 38299: [DO NOT PUSH] Test dbrev
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-18 17:44:37 +01:00
Martin Renvoize 36a387db22
Bug 36822: (follow-up) Catch MySQL 8 failure in update
We add a CAST to the fetch of 0000-00-00 dates in the database. This
prevents an error in MySQL 8.0 throws htat aborts the update.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:43 +01:00
Katrin Fischer cd20298738
Bug 33641: DBRev 24.06.00.063
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:41 +01:00
Nick Clemens b2d02523b2
Bug 33641: (follow-up) Change return_branch to checkin_library
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:41 +01:00
Nick Clemens cf8e2abd2e
Bug 33641: DB update
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:39 +01:00
Thibaud Guillot 9a316e042b
Bug 38434: Fix to define the same structure as kohastructure.sql
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:21 +01:00
Martin Renvoize 2152ac1c66
Bug 38011: (QA follow-up) Improve database update output
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-12 17:50:17 +01:00
Katrin Fischer c1c19672f7
Bug 34355: DBRev 24.06.00.062
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:21 +01:00
Matt Blenkinsop 28e32ee1a4
Bug 34355: (QA follow-up) Add permission marc_order_manage to govern control of account creation
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:15 +01:00
Matt Blenkinsop 6b85d06c19
Bug 34355: Add match_field and match_value to allow multiple accounts in the same file directory
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:14 +01:00
Matt Blenkinsop 30431cdebb
Bug 34355: DB schemas and atomicupdate
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:11 +01:00
Katrin Fischer bc884904e2
Bug 38394: (follow-up) Remove some more say_failure
Using a false template some more occurences of say_failure
were accidentally added. This removes them again.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:10 +01:00
Katrin Fischer 4c2149b74f
Bug 38011: DBRev 24.06.061
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:08 +01:00
Martin Renvoize 6753323d1b
Bug 38011: (QA follow-up) Improve database update
This patch ensure's we fix errant values in subscriptions prior to
adding the foreign key constraint.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:08 +01:00
Matt Blenkinsop 54cf322ad1
Bug 38011: Add a foreign key between vendors and subscriptions
Test plan:
prove t/db_dependent/Koha/Subscription.t
prove t/db_dependent/Koha/Acquisition/Booksellers.t

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

Amended-by: Jonathan Druart
Rename $rs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 17:43:06 +01:00
Katrin Fischer 8db1d0432f
Bug 33766: (QA follow-up) Fix spelling in system preference description and sysprefs.sql
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 15:35:35 +01:00
Katrin Fischer 8496235596
Bug 33766: DBRev 24.06.00.060
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 15:35:34 +01:00
Paul Derscheid 28eae4835f
Bug 33766: (follow-up) Fix ambiguous "Login" field
This follow-up fixes some problems w/ the unconventional
parts of the first commit. We now use conditionals in
a BLOCK to map the selected value from the preference
to string representations which should now be easily
translatable.

To test:
- Check that the label for
    - The masthead inc
    - The opac-auth template
    - The opac-main template
    - The opac-password-recovery template
    - The opac-registration-confirmation template
    - The opac-reset-password template
    - The sco-main template
  reflect the changes you made to the syspref

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 15:35:31 +01:00
Paul Derscheid cd58b70b76
Bug 33766: Fix ambiguous "Login" field
This patch introduces a new syspref 'OPACLoginLabelTextContent' which can be set
to the following values
- Cardnumber
- Username
- Cardnumber or Username

To test:
- Check that the label for
    - The masthead inc
    - The opac-auth template
    - The opac-main template
    - The opac-password-recovery template
    - The opac-registration-confirmation template
    - The opac-reset-password template
    - The sco-main template
  reflect the changes you made to the syspref

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-11 15:35:30 +01:00