It will be easier to reuse patron_to_html
Test plan:
Search for patron and confirm that that patron are formatted correctly.
Global patron search and a couple of other places should be enough.
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
To test:
1 - have or make a course reserves course with an instructor
2 - give your instructor a preferred name, confirm the course shows their firstname instead
3 - apply patch, reload page
4 - confirm course now shows their preferred_name instead
5 - edit the patron to remove the preferred name, confirm course shows first name again
Signed-off-by: noah <noah@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Rebased for 25.06.
Resolves:
Use of uninitialized value in string eq at /usr/share/koha/catalogue/MARCdetail.pl line 203.
Test plan:
Make sure that there is a combination of framework/field/subfield having
an entry in marc_subfield_structure where kohafield is NULL.
To force this for default fw on 020$q:
update marc_subfield_structure
set kohafield=NULL
where tagfield='020' and tagsubfield='q' and frameworkcode='';
Pick a biblio in this framework having that field/subfield. Or create
a 020 with $q filled. Hit catalogue/MARCdetail now.
Without this patch, it triggers the warn. With this patch, it does not.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
For reusability and to limit files to the git index
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
If some installs didn't notice the column was missing (not renamed) we
can still do it now.
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
We can reach an inconsistent state if the upgrade DB failed and
new_record_id has been created but renamed.
I don't think we should try to recover from this state, but have a
specific error message in this case. We will guide people asking for
help.
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Amended-by: Jonathan Druart
Added + 1 to the plan
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
To test:
1. Follow the original test plan and compare the resulting tables to:
MariaDB [koha_kohadev]> desc additional_field_values;
+-----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| field_id | int(11) | NO | MUL | NULL | |
| record_id | int(11) | NO | | NULL | |
| value | varchar(255) | NO | | | |
+-----------+--------------+------+-----+---------+----------------+
4 rows in set (0.003 sec)
MariaDB [koha_kohadev]> desc aqbookseller_aliases;
+-----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+----------------+
| alias_id | int(11) | NO | PRI | NULL | auto_increment |
| vendor_id | int(11) | NO | MUL | NULL | |
| alias | varchar(255) | NO | | NULL | |
+-----------+--------------+------+-----+---------+----------------+
3 rows in set (0.004 sec)
MariaDB [koha_kohadev]> desc aqbookseller_interfaces;
+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| interface_id | int(11) | NO | PRI | NULL | auto_increment |
| vendor_id | int(11) | NO | MUL | NULL | |
| type | varchar(80) | YES | | NULL | |
| name | varchar(255) | NO | | NULL | |
| uri | mediumtext | YES | | NULL | |
| login | varchar(255) | YES | | NULL | |
| password | mediumtext | YES | | NULL | |
| account_email | mediumtext | YES | | NULL | |
| notes | longtext | YES | | NULL | |
+---------------+--------------+------+-----+---------+----------------+
9 rows in set (0.003 sec)
The Type field should be the only deviation from the previous version,
Null and Extra should be identical.
2. Run perl ../misc4dev/run_tests.pl --run-db-compare-only --compare-with v24.05.00
3. Sign off
Co-authored-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
- Change `RENAME COLUMN <OLD> TO <NEW>` to `CHANGE COLUMN <OLD> <NEW>
<DATATYPE (required for this syntax)>`.
To test (assuming ktd):
1. Checkout upstream/24.11.x
2. Start ktd with `KOHA_IMAGE=24.11-bullseye(-arm64) DB_IMAGE=mariadb:10.3 ktd up
-d`
3. Checkout upstream/main
4. Run updatedatabase in the Koha container
5. Observe the error regarding the unsupported syntax.
6. Tear everything down again: ktd down
7. Repeat 1-2.
8. Once started up, checkout upstream/main
9. Apply the patch on top of it
10. Run updatedatabase in the Koha container
11. Observe a successful upgrade
12. Sign off
Side Note: I tested this against upstream/25.05.x, but this patch is
based on main.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Adds support for the extendedAttributesFieldGroup configuration option
in base-resource.js composable. This allows developers to specify which
form section/group additional fields should appear in, providing better
control over form organization and UX.
Without this, additional fields always appeared in the default group,
making it difficult to logically organize complex forms with multiple
field groupings.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Additional fields added through Vue.js resource forms were not being
saved to the database. This was caused by using ref() instead of
reactive() for the current_additional_fields_values object. Since
ref() only provides shallow reactivity for objects, changes to nested
properties were not being tracked properly.
This switches to reactive() which provides deep reactivity tracking,
ensuring that all changes to additional field values are properly
captured and submitted when the form is saved.
Test plan:
1) Go to Administration > Additional fields and add an additional field
for erm_agreements
2) Enable ERM and navigate to ERM > Agreements
3) Click to add a new agreement and then fill out the form, making sure
to add something into your new additional field
4) Hit save and navigate to the agreement you have just added
5) There will be no additional field added
6) Apply patch and yarn js:build
7) Repeat steps 3 - 5
8) The additional field should be added and displayed correctly
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Merging patrons only required edit_borrowers permission
but would result in a patron deletion.
This patch requires a new merge_borrowers subpermission
To test:
1. Give a patron the following permissions
catalogue, edit_borrowers, list_borrowers
2. Log into the staff interface as the patron
3. Do a patron search and select 2 patrons
4. Click merge patron - success - a patron got deleted
5. Apply patch, updatedatabase and restart_all
6. Repeat steps 3 and 4 - you can't
7. Add the new permission for merge_borrowers
8. Repeat steps 3 and 4 - now you can
9. prove t/Koha/Auth/Patrons.t
Sponsored-by: CLAMS
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The order of the columns in the yaml file must match the order of the
columns in the template file.
Test plan:
Confirm that, with bug 30633 applied, you can pick "shelving location"
as the default sort order and that the items are correctly sorted by
shelving location.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The table settings for titles have been set by default even though the data type for this table is dynamic
Test plan:
1) Create a provider and harvest some platform data
2) Click into the provider and select the Platform tab
3) The page will crash and the console will show an error
4) Apply patch and yarn js:build
5) Hard refresh the page and click on Platforms again
6) The table should load successfully
Signed-off-by: Michaela <michaela.sieber@kit.edu>
Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
If a patron attribute is not editable at the OPAC it should not be
possible to make it mandatory.
Test plan:
Create a new patron attribute and confirm that checkboxes behaviour is
consistent.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch updates our Select2 initialization script to update the
strings used as title attributes on the "X" control which appears in a
Select2 dropdown when you've made a selection.
The updated text reads "Clear selections" in order to eliminate the
ambiguity of the word "items."
To test, apply the patch and clear your browser cache.
- Go to Catalog -> Item search.
- Make one or more selections in any of the Select2 dropdowns (e.g. Home
library, current library, item type, etc.).
- An "X" should appear at the end of the field after you've made one or
more selections.
- Hover your mouse over the "X." The title which appears should read
"Clear selections."
Sponsored-by: Athens County Public Libraries
Signed-off-by: Slava Shishkin <slavashishkin@gmail.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
As well as the fund list view (admin/aqbudgets.pl)
Signed-off-by: Sarah Berry <sberry@pascolibraries.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch changes target='blank' to target='_blank' in system
preferences.
To test:
1. Apply the patch
2. Check the following system preferences, click on the links,
make sure every click opens in a new tab
- UniqueItemFields
- PatronSelfModificationMandatoryField
- PatronSelfRegistrationBorrowerMandatoryField
- PatronSelfRegistrationBorrowerUnwantedField
- PatronSelfModificationBorrowerUnwantedField
- EmailFieldPrecedence
- BorrowerMandatoryField
- BorrowerUnwantedField
- PatronQuickAddFields
- PatronDuplicateMatchingAddFields
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This is caused by Bug 36742. It exists in main but starts in 24.11.
The OPAC advanced search now automatically applies a limit to the 'Location and availability' section using the patron's logged in library, even if there are multiple libraries in the system.
This feature must be depending on system preference 'SearchMyLibraryFirst'.
1) Set system preference 'SearchMyLibraryFirst' to 'Don't limit'
2) Go to OPAC
3) Authenticate with a user
4) Go to advanced search
5) Check there is no library selected in 'Location and availability'
6) Select a library and submit
7) Clik on 'Return to the last advanced search'
8) Check the library is selected in 'Location and availability'
9) Set system preference 'SearchMyLibraryFirst' to 'Limit'
10) Go to OPAC
11) Authenticate with a user
12) Go to advanced search
13) Check library of patron selected in 'Location and availability'
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The singular form is wrong and only exists in textual context.
This is a result of git grep | xargs sed.
Test plan:
Read the patch.
git grep BorrowerLog
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Test plan:
Read the patch.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Test plan:
Update the version in DB:
> update systempreferences set value="25.1100000" where variable="version";
restart_all
prove t/Koha/Manual.t
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Description from comment 0
When creating an SQL report and it contains the column itemnumber, we
activate batch operations above the table. The itemnumber column can be
renamed, using the syntax [[itemnumber|Exemplarnummer]], which gives us
the option to translate the column name into something nicer for
display.
But: if you then send to batch item edit, the items are not
transmitted.
Test plan:
1) Create a report:
select itemnumber, itemcallnumber from items;
2) Send some items to batch item edit, verify the items are shown above
the item form
3) Update the report:
select [[itemnumber|Exemplarnummer]], itemcallnumber from items;
4) Verify the report still shows as before with the batch options
available and only the column being renamed.
5) Send some items to the batch item edit again
=> verify the items are shown above the item form
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This patch puts back a missing space between "Delete" and the fa
thrashcan. It is atm the lonely button without this space in the modal
No test plan needed. The change is too trivial.
Just check that lines before in the code have the desired space. The
missing space creates a weird sensation while looking at the window.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Now that Debian 13 (and Ubuntu 25.04) set `ssl=on` by default, we should
make the `koha-mysql` helper script disable it by default if not
configured.
This patch does that.
To test:
0. Start a Debian 13 KTD e.g. with:
$ KOHA_IMAGE=main-trixie ktd up
1. Run:
$ ktd --shell
k$ koha-mysql kohadev
=> SUCCESS: You get into the DB shell
2. Apply this patch
3. Run:
k$ debian/scripts/koha-mysql kohadev
=> SUCCESS: It works as step 1!
4. Make sure you enable SSL in my.cnf:
[client]
ssl = on
5. Repeat 1
=> FAIL: You get an error about SSL in the server being disabled
6. Repeat 4
=> SUCCESS: The patch fixes it!
7. This steps imply we reproduced the issue, and it gets fixed, while
keeping the current behavior.
8. Sign off :-D
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This fixes the following bug:
1) Select 1 hold, notice the 'group selected' button is still disabled
2) Select a 2nd hold, notice the 'group selected' button becomes enabled
3) Unselect one of the holds, notice the 'group select' is kept enabled (this is wrong, it should become disabled)
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The patch 'Move creation of hold group into Patron class' is
moving the creation of the hold group logic to the Patron.pm class file
but it didn't remove all the obsolete code.
This is fixed here.
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Run the updated test file:
prove ./t/db_dependent/Koha/Patron.t
Relevant tests worth running to ensure no regressions are added to existing covered functionality:
prove ./t/db_dependent/Circulation*
prove ./t/db_dependent/Hold*
prove ./t/db_dependent/Reserves*
Test plan, k-t-d:
1) Apply patches, enable DisplayAddHoldGroups system preference
2) Do a search for 'test':
<staff_url>/cgi-bin/koha/catalogue/search.pl?q=test
3) Click the 'Select all' link at the top of the search results, click the 'Place hold' button.
4) Enter the 'koha' user
5) Pick a pickup location for each of the holds and click 'Place holds'.
6) Visit the 'koha' patron:
<staff_url>/cgi-bin/koha/members/moremember.pl?borrowernumber=51
7) Click the 'holds' tab. Notice a new 'Group selected' button now exists
8) Pick any number of holds (more than 2) and click the 'Group selected' button. Confirm
9) Notice the hold group shows '1'. If you click on it you're presented the hold group modal.
10) Group multiple holds multiple times.
11) Notice you can't group a hold that has already been found.
12) Notice you can't click the 'Group selected' button unless at least 2 holds are selected.
13) Notice a hold group is deleted if left with 0 or 1 hold e.g. make a group of 2 holds, cancel 1, notice the remaining hold is left without a group.
prove t/db_dependent/api/v1/patrons_hold_groups.t
prove t/db_dependent/Koha/Patron.t
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This table now has 4 total buttons, 3 of which relate to a selection of
holds. Rearranging the buttons is now necessary to present them nicely.
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This adds the UI elements required to group selected holds from the
patron pages as well as 2 new concepts:
Visual group ID:
The visual group ID is designed to be easy to understand from a UI/UX
perspective and not show the user an indefinitely incremented value.
When holds are cancelled, filled or moved to a different group, if the
old group is left empty or with a single hold, the hold group is deleted.
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
list and add actions:
/patrons/{patron_id}/hold_groups
New test file:
prove t/db_dependent/api/v1/patrons_hold_groups.t
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Refactor: Update controller logic to make use of patron->create_hold_group
This ensures consistency when creating a new hold group for a patron,
regardless if on the Staff UI or REST API
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>