To test:
1. Before applying the patch go to Adminstration > Patron attribute types
2. Create or modify some attributes to be mandatory and some to not be mandatory.
3. APPLY PATCH, updatedatabase, restart_all
4. Go back to Adminstration > Patron attribute types. The patron attributes that were made mandatory should now also have the opac_mandatory field checked.
5. Make sure that you can change the correctly save the new "OPAC mandatory:" field.
6. If the 'Display in OPAC:' field is unchecked the 'OPAC mandatory:' checkbox should be disabled.
7. Mark some patron attributes as 'OPAC mandatory:'.
8. Go to the OPAC self reg page, the field should be required.
9. BAck on Adminstration > Patron attribute types check some attributes as 'OPAC mandatory:' and 'Editable in OPAC:'.
10. As a logged in OPAC user go to "Personal details" and make sure the attribute is required.
11. For the same attriubute as step 9-10 , mark as NOT 'Editable in OPAC:'. Make sure you can still save the form on the OPAC "Personal details" page.
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Add unit tests for the updated mock module
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a diag method to the Mocks::Logger object. This aids in
debugging logging errors by simply outputting all log lines to screen in
a diag statement.
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch makes the script provide links to the staff interface instead
of the OPAC. This way, the links can just be picked to access the
problematic records for fixing them.
To test:
1. Run:
$ ktd --shell
k$ perl misc/maintenance/compare_es_to_db.pl
=> FAIL: Generated links point to the OPAC
2. Apply this patch
3. Repeat 1
=> SUCCESS: Generated links are useful as they point to the staff
interface
4. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
% git grep -l messenger
koha-tmpl/intranet-tmpl/lib/fontawesome/css/brands.min.css
koha-tmpl/intranet-tmpl/lib/fontawesome/webfonts/fa-brands-400.ttf
koha-tmpl/opac-tmpl/lib/fontawesome/css/brands.min.css
koha-tmpl/opac-tmpl/lib/fontawesome/webfonts/fa-brands-400.ttf
The function is unused and can be removed.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
It is never used
% git grep string_list
should not return anything
Signed-off-by: Thibault Keromnes <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch removes a once necessary and now confusing warning
from the RESTOAuth2ClientCredentials syspref.
TO TEST:
a) Notice how the RESTOAuth2ClientCredentials syspref references
installing Net::OAuth2::AuthorizationServer, even though this
module is in the cpanfile and koha-perldeps and has been since
22.11
b) APPLY PATCH
c) Run reset_all in k.t.d
d) Notice how the message is now gone
Signed-off-by: William Lavoie <william.lavoie@inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Port the default notice text to Template Toolkit. Also, add access to
item information in order to give more useful information about the
checked-out item that the note refers to (in this case, the item barcode
instead of the biblionumber)
To test:
1. Apply patch and reset all
2. Enable the system preference AllowCheckoutNotes
3. Go to Administration > Libraries and edit the current logged-in
library to ensure that there is a value in the Email field
4. Check out an item to a patron
5. Ensure the patron has values in the first name and surname fields
6. Log into the OPAC as that patron
7. Click to display the patron's current checkouts
8. Click the + button to the right of a checkout
9. Click the "Add Note" button beneath the table
10. Add some text and submit the note
11. Return to the staff interface and go to the Notices tab for the patron
--> Confirm that there is a notice called "Checkout note" with all the
correct information
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Useful in particular when headings are split across the $a and the $x
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This enhancement changes the search URL for 'see from' headings to look for an 'exact' match.
When using a 'see from' heading, when Koha does a 'contains' search this is quite general and may fetch a bunch of unexpected results.
This enhancement also changes the OPAC authority search to search on all headings when doing a 'see from' search, so the results mirror that on the staff interface. Also important if subheading info is stored in the $x or other subfields, for example.
To test (assume using KTD):
1) In the staff interface, add a new topical term authority. Set the following values:
150$a: Quests
550$a: Travel
2) Add a second topical term authority, this is one we DON'T want showing in 'see from' results. Set the following values:
150$a: Cheques
550$a: Travellers' cheques
3) Do a 'main heading ($a only)' search for 'Quests'. Your new heading should show in the results, with 'Travel' showing as a see from searchable link.
4) Click the 'Travel' search link. Notice you get a few results, including the 'Cheques' heading which we don't want to show.
5) Follow steps 3 & 4 on the OPAC. Notice you get a few results, but your 'Quests' heading doesn't even show, which you may expect it to.
6) Apply the patch and restart services.
7) In the staff interface, go back to the Authorities homepage.
8) Repeat steps 3 & 4. Confirm you get the expected 'Quests' heading in the results, and do not get the 'Cheques' heading.
9) Repeat steps 3 & 4 on the OPAC. Confirm you get the expected 'Quests' heading in the results, and do not get the 'Cheques' heading.
Sponsored-by: Education Services Australia SCIS
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch takes the collapsing-panel functionality of the patron entry
form and generalizes it so that it can be used on the authority search
popup window in cataloging.
To test, apply the patch and rebuild the staff interface CSS.
- Go to Cataloging -> New record (basic MARC editor)
- Switch to tab 1 and click the tag editor link next to tag 100 subfield
a.
- The search form should be expanded in the pop-up window.
- Perform a search. When the window reloads with search results the
search form should be collapsed.
- Confirm that clicking the "Search options" legend works correctly to
expand and collapse the form.
- Collapse the form and click the "Clear form" button. The form should
expand -- This is based on the assumption that the "Clear form" button
would be used when the user wants to initiate a new search.
- Go to Patrons -> New patron and confirm that collapsible sections
still work correctly.
Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This follow-up adds item number as a fallback for display when an item
doesn't have a barcode.
The patch also implements a sidebar sub-menu showing barcodes (or item
numbers) so that the user can jump directly to a particular section. The
sub-menu will show a scrollbar if the record has more than around 15
items.
The patch modifies staff-global.scss to improve readability of the
sidebar sub-menu and removes CSS which was specific to the system
preferences page. This make the sub-menus on the item details and system
preferences pages consistent with each other.
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>
Since we recently updated the patron entry form in the staff interface
to have more visibly-collapsible sections I thought there might be
interest in picking up this old bug.
The patch implements collapsible sections on the item detail page,
allowing the user to hide sections by clicking the item barcode header.
The patch includes relocation of some JS code from the authority and
MARC editors into the global JS file. This is the code that helps jump
the user to a certain scroll point on the page.
To test, apply the patch and clear your browser cache.
- In the staff interface, locate a bibliographic record with items and
view the detail page.
- Click the "Items" tab in the sidebar.
- On the item detail page, each section should have an icon indicating
that they are expanded. Hovering your mouse over the section heading
should highlight the clickable area.
- Test that each section collapses correctly and that the next section
is moved into view.
- Go to Cataloging -> New record. Test that the links to specific tags
under the main tab bar still work to jump you to the correct part of
the page.
- Go to Authorities -> New authority and perform the same test.
Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
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>
This patch makes the `to_api()` method return an proper exception when
the `$self->biblioitem` accessor returns `undef`. This is a bad data
scenario and we could do better in terms of logging the situation.
The new exception will be correctly rendered in the logs by the
`unhandled_exception` Mojolicious helper and no behavior change on the
API.
I wasn't sure to keep the api tests I wrote. I originally added handling
for the specific exception in the controller, but it become obvious it
was not worth: too much code, the `GET /biblios` endpoint would need the
same treatment, etc. And the current `500 Internal server error` is good
enough as a response, and the logs explain the situation correctly.
To test:
1. On a fresh `KTD` pick a biblio (say biblionumber=1)
2. Use your favourite REST tool (Postman?) to access the record with
`Accept: application/json`. i.e.
```
GET kohadev.localhost/api/v1/biblios/1
Accept: application/json
```
=> SUCCESS: All good
3. Delete the related `biblioitems` row:
$ ktd --shell
k$ koha-mysql kohadev
> DELETE FROM biblioitems WHERE biblionumber=1; \q
4. Repeat 2
=> SUCCESS: You get a 500 error
5. Check the logs
=> FAIL: You get a cryptic message about accessing a method on an
undefined object:
```
2025/02/13 13:15:00] [ERROR] GET /api/v1/biblios: unhandled exception (Mojo::Exception)<<Can't call method "to_api" on an undefined value at /usr/share/koha/Koha/Biblio.pm line 1433.>>
```
6. Apply this patch
7. Restart things:
k$ restart_all
8. Repeat 2
=> SUCCESS: You get a 500 error
9. Check the logs
=> SUCCESS: You get a more meaningful exception:
```
[2025/02/13 13:20:00] [ERROR] GET /api/v1/biblios/1: unhandled exception (Koha::Exceptions::RelatedObjectNotFound)<<Exception 'Koha::Exceptions::RelatedObjectNotFound' thrown 'The requested related object does not exist' with accessor => biblioitem, class => Koha::Biblioitem>>
```
10. Run the tests:
k$ prove t/db_dependent/Koha/Biblio.t \
t/db_dependent/api/v1/biblios.t
=> SUCCESS: They pass!
11. Sign off :-D
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a "page-section" wrapping div around reports results
pages where it is missing.
Note: This patch contains indentation changes.
To test, apply the patch and test the following reports, confirming that
the results page looks correct:
- Patrons with the most checkouts
- Acquisitions statistics
- Patrons with no checkouts
- Patrons statistics
- Most-circulated items
- Catalog statistics
- Average loan time
- Circulation statistics
- Lost items
- Catalog by item types
- Holds statistics
Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Now perltidy.t will check 2958 files instead of 2954. Which matches
with the 4 .PL files.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch is the result of running:
```shell
perl misc/devel/tidy.pl *.PL
```
Commiting raised an error about fix-perl-path.PL calling `warn` which I dismiss for the
time being.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds handling for files with the `.PL` extension to the
`tidy.pl` helper script.
It will now consider them Perl files and tidy them as appropriate.
I opted for explicitly listing `PL` instead of making the existing check
case-insensitive because the only files I found with changed case (i.e.
Perl scripts that don't have `.pl`) are:
$ find . -type f -iname "*.pl" ! -name "*.pl"
./fix-perl-path.PL
./build-resources.PL
./rewrite-config.PL
./Makefile.PL
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch restores Any as a budget filter option on the suggestions homepage, but does not allow one to select Any when saving a suggestion
To test:
1 - have two suggestions, one with a fund assigned and one without
2 - go to /cgi-bin/koha/suggestion/suggestion.pl, use Fund filter, confirm it does not offer an Any option
3 - apply patch, reload page
4 - use Fund filter, confirm it shows Any as an option and both Any and None work properly
5 - confirm you cannot select Any when creating a new suggestion
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Bug 38986: Restore Any option to suggestions homepage filter
"Any" should show all suggestions, any fund value and null fund values. One should not be able to create a suggeestion set to "Any"
"None" should show only suggestions with no fund value selected. A new suggestion should default to "None"
To Test:
1: have two suggestions, one with a fund selected and one without
2: go to suggestions homepage, confirm the filter does not have an "Any" option
3: apply patch, reload page
4: confirm the fund filter on suggestion homepage now has both Any and None and they behave as described above
5: confirm the fund filter defaults to Any as you change the branch filter
6: create a new suggestion, confirm its fund defaults to None and cannot be set to Any
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
The new ID column shows numbers like "(#2)". I think the parentheses and
hash symbol are unnecessary and inconsistent with the way we do it in
other places and should be removed.
To test, apply the patch and rebuild the staff interface CSS: Either run
'yarn build' from the command line or if you're using a sandbox, click
the "Actions" menu for your sandbox and choose "Build CSS and JS."
Follow the previous test plan and confirm that the ID column looks
correct.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test
1. Apply patch, yarn build, restart_all
2. System preferences -> ERMModule -> Enable
3. E-resource management -> Agreements -> "+New Agreement"
4. Notice ID is removed from name and put in it's own column
5. Repeat with licenses table
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds unit tests for the to be introduced set_rules endpoint
for setting circulation rule sets.
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This is a follow-up to the previous bug exposing circulation rules over
the API.
We formally define a definition for a circulation rules set including a
new 'context' object the defines the context, library_id,
patron_category_id and item_type_id combination of the rules returned.
This is just a patch I missed in the last submission that I'd meant to
add and it's important for the PUT part of this patchset.
Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk>
Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch moves the English strings out of Output.pm and adds classes
to the pagination markup which can be used as hooks for JavaScript. The
global JS include is modified to look for these hooks and add text
labels to the links.
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>
This patch modifies Output.pm to change the HTML it generates when
creating pagination bars. The changes allow the pagination menu to be
styled like Bootstrap pagination, making them consistent with the
pagination on catalog search results.
To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
- Test pages where the pagination_bar subroutine is called:
- Authorities -> Authority search results.
- Cataloging -> Cataloging search results.
- Cataloging -> MARC Editor -> Edit tag which is configured to use the
unimarc_field_210c value builder.
- Reports -> Saved SQL reports -> Results.
- Tools -> Comments.
- Lists -> List contents.
The pagination bar markup was removed from the templates for these pages
because it wasn't being used:
- Administration -> Patron attribute types.
- Administration -> Record matching rules.
- Tools -> Tags.
Sponsored-by: Athens County Public Libraries
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>
To test:
1. Apply patch
2. reset_all (or start your testing environment in the first place)
3. Enable SMS Notices
a) Find the system preference SMSSendDriver
b) Enter "Email" as the value for SMSSendDriver and save
4. Go to a patron account, and set the following messaging preferences:
Item due:
- Check SMS
- Check Email
- Check Digests only for both
Advance notice
- Select 1 day in advance
- Check SMS
- Check Email
- Check Digest only for both
5. Go to the checkout tab for that patron
6. Set a custom due date for today and check out 2+ items
7. Set a custom due date for tomorrow and check out 2+ more items
8. Run the cron job to generate notices:
misc/cronjobs/advance_notices.pl -v -c
9. Open the Notices tab on that patron's account
--> The patron should have four notices:
Item due reminder (one for SMS and one for email)
Advance notice of item due (one for SMS and one for email)
10. Open each notice and confirm that all information is correct
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
With reference to BZ comment9 and comment10.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Note that --errlog should refer to all output from the wrapper daemon
process only like respawning processes etc.
And that --output should refer to all output from the daemonized
client process (so in our case the SIP server).
Moving a few sip.log occurrences to sip-output in that regard.
Test plan:
Restart koha-sip.
Login to sip server.
Restart koha-sip.
Verify that you see Net::Server messages and traces from the login in the
-output log. The restarts are not found however in -error. See my comment
on the BZ report.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
No need for three files here (and badly specified).
We can just use sip.log.
Test plan:
Run koha-sip and verify that logging is still done as expected.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
1. Turn on the SavedSearchFilters system preference
2. Go to advanced search, select a number of item types and search
3. Save the search
4. Enter a search term (such as power)
5. select the filter. Observe the following message:
Error: Unable to understand your search query, please rephrase and try again.
6. Apply patch
7. Repeat steps 4 & 5, search should work as expected.
8. Sign off!
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
The regexp for the value builder 'hbyymmincr' doesn't allow for numerics in the branchcode,
so the nextnum found is always 0 and multiple Add always generate the same barcode.
This simply allow for numerics within the regex.
Test
- It's a bit complicated. You need
- all your branchcodes to be numerics (01,02,71...)
- all barcodes to already be a bunch of numbers
- Modify the syspref 'autobarcode' to hbyymmincr, the home branch + date one.
- Find an item in the pro-search,
- New -> New Item
- Click on the 'p' to have the value builder create the next barcode.
- Without the patch, the query won't have found anything, so it'll suggest xxxxxx0001
- Click Add. It reprensent the form to enter another one.
- Click on the 'p' edit box, it'll offer you again xxxxxx0001
With the patch, it'll offer valid ones everytime.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
If a column contains a dropdown list (for libraries for instance), the
width of the column will be modified, but DT's fixed header need to be
adjusted.
Test plan:
One example where this problem can be observed is the "holds to pull"
table: "Title" is followed by "Libraries".
Test without and with the patch, and confirm that the display/offset is fixed.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Prevent JS error if ExtendedPatronAttributes is off
"Uncaught TypeError: options.extended_attribute_types is undefined"
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Makes the Cypress tests pass.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Tests pass, with the followup patch.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch removes the search clause for
extended_attributes when there is no patron
attribute types which are searchable by default.
The clause was incorrectly added because the array
extended_attribute_types was rendered as [""]
This seems to be an issue with get_columns from DBIX Class and how that is cast when forcing an array
in the template. It returns an empty string for nothing, a scalar for a single value, and an array for multiple
values.
This patch now checks if the variable is set and has content, and wraps as an array if so. In the case of two attributes,
we do double the array, but this was true before as we always cast the return as an array.
Test plan:
* Make sure that no borrower attribute type is set to "searched by default"
in Koha administration -> Patron attribute types.
* Enable the network monitring in the developer tools in your web browser
(Ctrl + Shift + E in firefox or Ctrl + Shift + I and select the "Network"
tab).
* Go to the patrons view members-home.pl (click patrons in top menu bar).
* Search for a string that will match multiple borrowers (to not be automatically
redirected)
* Examine the ajax-request and make sure that "extended_attributes.code" is NOT
part of the query.
* Also, in koha-testing-docker with selenium enabled,
run 'perl t/db_dependent/selenium/patrons_search.t'
* Now set one patro attribute to searchable and searched by default and add a value for a patron, confirm search works
* Set a second patron attribute to searchable and searched by default and confirm searching works
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Did not run the selenium tests, as they have
been obsoleted.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test:
1/ Turn on POS
2/ Enable Cash registers
3/ Configure some items for sale
4/ Make some POS transactions
5/ Visit pos/register.pl?registerid=x
6/ Notice the problem described
7/ APPLY PATCH and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface )
8/ Look at the table again. The rows should now be correctly highlighted.
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>