]> git.koha-community.org Git - koha.git/log
koha.git
23 months agoBug 28235: Correct CSS governing max width of custom cover images
Owen Leonard [Fri, 18 Nov 2022 14:02:13 +0000 (14:02 +0000)]
Bug 28235: Correct CSS governing max width of custom cover images

Images shown in the OPAC and staff interface when the
OPACCustomCoverImages and  CustomCoverImages preferences are enabled
should be getting a max-width set in the current CSS, but the order of
the declarations is preventing the correct specificity.

This patch moves the CSS to the correct place in each file so that the
max-width is applied.

To test, apply the patch and rebuild both the staff and OPAC CSS. If you
get an error during the build process you may need to run 'yarn
install.'

- Go to Administration -> System preferences, and enable the
  OPACCustomCoverImages and  CustomCoverImages preferences.
- If you're testing with the default test database you can set the
  CustomCoverImagesURL preference to
  https://static.myacpl.org/public/covers/{normalized_isbn}.jpg
- Perform a catalog search in both OPAC and staff client limiting by
  itemtype = 'Book'.
- The search results in both interface should show several covers
  supplied from the external URL.
- In the staff client, these images should be limited to 140px wide even
  if the source image is larger.
- In the OPAC, view the detail page for one of the results with cover
  images. The image shown on the detail page should be constrained to
  140px wide even if the source image is larger.

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>
23 months agoBug 32261: Add more UI feedback when selecting patron from autocomplete
Jonathan Druart [Fri, 18 Nov 2022 08:55:06 +0000 (09:55 +0100)]
Bug 32261: Add more UI feedback when selecting patron from autocomplete

There is only a tiny change in the color of the selected item, but it's
not obvious.

Test plan:
Regenerate the css files using `yarn build`
Search for patrons and note that the down/up keys let you select a
patron and the background color change.
Note that the background color is not on the container and so is not
similar as the hover rule (when using the mouse). We could change that,
but then the behaviour is weird when you have both the mouse and the
keyboard selecting items in the item list.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32261: Patron autocomplete - do not empty text field
Jonathan Druart [Fri, 18 Nov 2022 08:52:35 +0000 (09:52 +0100)]
Bug 32261: Patron autocomplete - do not empty text field

The jQuery UI autocomplete is supposed to replace the text field with
the 'value' attribute of the selected item. As it does not exist it's
emptied. We should not replace what the user typed in.

Test plan:
Go to the Koha home page
Select "Search patrons" in the header
Type 'edn', it will return 1 result
Use the down key to select the item (it is not obvious but there is a
little change in the color when you select the item)
=> Without this patch the search field is emptied
=> With this patch applied the search field is not modified

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32366: (bug 30460 follow-up) Add tests
Jonathan Druart [Wed, 30 Nov 2022 07:55:13 +0000 (08:55 +0100)]
Bug 32366: (bug 30460 follow-up) Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 30963: Automatically refresh the curbside pickups list
Jonathan Druart [Fri, 4 Nov 2022 15:33:44 +0000 (16:33 +0100)]
Bug 30963: Automatically refresh the curbside pickups list

Librarians would like the page to be automatically refreshed every X minutes.

This patch is suggesting to have a checkbox at the top of the page to
let the user refresh the page given the delay they want.

We could later improve this by setting this value in a localStorage
variable.

Test plan:
Go to the curbside pickup page
Notice the new checkbox at the top
Notice that the "Refresh" button has been moved at the top as well
Play with the checkbox and the input, and confirm that the behaviour is
consistent

Sponsored-by: Association KohaLa - https://koha-fr.org/
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>
23 months agoBug 32236: Fix alignment of checkbox "Use default values" for item batch modification
Katrin Fischer [Wed, 16 Nov 2022 21:49:17 +0000 (21:49 +0000)]
Bug 32236: Fix alignment of checkbox "Use default values" for item batch modification

This moves the label to the right in front of the checkbox.
It also shortens the label by adding an additional longer hint text.

To test:
* Go to cataloguing > item batch modification
* On the first page of the tool, look at the checkbox at the bottom
* Apply the patch
* Verify changes

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 29274: Remove z_reset.t
Jonathan Druart [Wed, 30 Nov 2022 09:51:44 +0000 (10:51 +0100)]
Bug 29274: Remove z_reset.t

From the description of commit d25f3e84374ec8d7c85f8ed805102f67c0a73d77

"""
    Bug 22709: (RM follow-up) Clean up plugin tests

    The plugin tests were failing due to failed rollbacks and run order.
    This patch moves them into their own directory and adds a reset test to
    restore the original state of the plugin system after the tests have
    run.
"""

This is wrong, the tests are run in a random order.

We don't need this file.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoVue bundle - Add main.js.LICENSE.txt
Jonathan Druart [Thu, 1 Dec 2022 09:29:42 +0000 (10:29 +0100)]
Vue bundle - Add main.js.LICENSE.txt

There is a reference to it in main.js, it makes sense to include it in
our codebase

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
23 months agoBug 32351: Fix t/db_dependent/Koha/Charges/Sales.t
Tomas Cohen Arazi [Wed, 30 Nov 2022 18:49:59 +0000 (15:49 -0300)]
Bug 32351: Fix t/db_dependent/Koha/Charges/Sales.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
Tomas Cohen Arazi [Wed, 30 Nov 2022 18:48:18 +0000 (15:48 -0300)]
Bug 32351: Fix  t/db_dependent/Circulation/NoIssuesChargeGuarantees.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix t/db_dependent/api/v1/patrons.t
Tomas Cohen Arazi [Wed, 30 Nov 2022 18:47:22 +0000 (15:47 -0300)]
Bug 32351: Fix t/db_dependent/api/v1/patrons.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Koha/Patrons.t
Tomas Cohen Arazi [Wed, 30 Nov 2022 18:45:20 +0000 (15:45 -0300)]
Bug 32351: Fix Koha/Patrons.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix TemplateToolkit.t
Tomas Cohen Arazi [Wed, 30 Nov 2022 18:42:26 +0000 (15:42 -0300)]
Bug 32351: Fix TemplateToolkit.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix CourseItems.t
Tomas Cohen Arazi [Wed, 30 Nov 2022 18:41:59 +0000 (15:41 -0300)]
Bug 32351: Fix CourseItems.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Circulation.t
Jonathan Druart [Fri, 25 Nov 2022 11:55:39 +0000 (12:55 +0100)]
Bug 32351: Fix Circulation.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Reserves.t
Jonathan Druart [Fri, 25 Nov 2022 11:48:34 +0000 (12:48 +0100)]
Bug 32351: Fix Reserves.t

itemtypes.notforloan already defaults to 0

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Members.t
Jonathan Druart [Fri, 25 Nov 2022 11:46:27 +0000 (12:46 +0100)]
Bug 32351: Fix Members.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Illrequests.t
Jonathan Druart [Fri, 25 Nov 2022 11:45:26 +0000 (12:45 +0100)]
Bug 32351: Fix Illrequests.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Budgets.t
Jonathan Druart [Fri, 25 Nov 2022 11:42:18 +0000 (12:42 +0100)]
Bug 32351: Fix Budgets.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Fix Acquisition.t
Jonathan Druart [Fri, 25 Nov 2022 11:35:42 +0000 (12:35 +0100)]
Bug 32351: Fix Acquisition.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32351: Holds.t - remove wrong column reference
Marcel de Rooy [Fri, 25 Nov 2022 10:50:01 +0000 (10:50 +0000)]
Bug 32351: Holds.t - remove wrong column reference

Found by bug 32350.
The test does not need this value at all..

Test plan:
Run test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31381: Add tests
Jonathan Druart [Wed, 23 Nov 2022 08:30:33 +0000 (09:30 +0100)]
Bug 31381: Add tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31381: Handle null attributes in list
Nick Clemens [Tue, 22 Nov 2022 19:21:22 +0000 (19:21 +0000)]
Bug 31381: Handle null attributes in list

This patch allows null values to be returned in patron attributes
to prevent a crash when searching patrons

To test:
1 - Add a NULL attribute to a borrower, in sample data, Edna Acosta
    sudo koha-mysql kohadev
    INSERT INTO borrower_attributes (borrowernumber,code,attribute) VALUES (5,'SHOW_BCODE',NULL);
2 - Browse to 'Home->Patrons'
    http://localhost:8081/cgi-bin/koha/members/members-home.pl
3 - Click 'Browse by last name: A'
4 - Datatables error:
    Expected string - got null
5 - Apply patch
6 - Restart all
7 - Browse by last name: A
8 - Success!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32350: Add subtest for bad columns
Marcel de Rooy [Fri, 25 Nov 2022 10:09:57 +0000 (10:09 +0000)]
Bug 32350: Add subtest for bad columns

Test plan:
Run t/db_dependent/TestBuilder.t
And now run the whole test suite :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32350: Use array_minus and ignore nesting
Marcel de Rooy [Fri, 25 Nov 2022 10:02:24 +0000 (10:02 +0000)]
Bug 32350: Use array_minus and ignore nesting

Note: Test will be extended in follow-up. This fixes the
module_bit hash to follow the FK path from user_permissions
to permissions to userflags. One step was missed in the
existing test, although it did not fail. The change here
revealed that now.

Test plan:
Run t/db_dependent/TestBuilder.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32213: Reindent item search fields templates
Owen Leonard [Thu, 17 Nov 2022 15:26:48 +0000 (15:26 +0000)]
Bug 32213: Reindent item search fields templates

This patch reindents three item search field templates so that they have
consistent indentation.

To test, apply the patch and go to Administration -> Item search fields.

Test all aspects of viewing, adding, and deleting item search fields.
Everything should look correct and work correctly.

Signed-off-by: David <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: changed intendation on a tiny bit

23 months agoBug 32126: Fix missing div breaking the form for adding more search fields
Katrin Fischer [Tue, 15 Nov 2022 16:06:09 +0000 (16:06 +0000)]
Bug 32126: Fix missing div breaking the form for adding more search fields

The missing div caused a problem with the JS that controls
visibility of the list of search fields, the form and the toolbar.
With the div added, everything should now work as expected.

To test:
* Add a item search field, everything should work.
* Add a second item search field - intead of the form, you'll see an empty page.
* Apply patch.
* Add second and more search fields, all should work.
* Edit search fields.
* Delete search fields.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32352: Make xt/check_makefile.t check directories in git index
Jonathan Druart [Fri, 25 Nov 2022 11:24:26 +0000 (12:24 +0100)]
Bug 32352: Make xt/check_makefile.t check directories in git index

It's failing if 'node_modules' exists. We could simply skip it, but it
seems that it would be better to actually list directories that are part
of the git index only.

The question is: do we actually support test execution outside of a git
directory?

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoKoha 22.12 - start of a new dev cycle
Tomas Cohen Arazi [Mon, 28 Nov 2022 18:26:01 +0000 (15:26 -0300)]
Koha 22.12 - start of a new dev cycle

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoKoha 22.11.00 Rosalie is here! v22.11.00
Tomas Cohen Arazi [Fri, 25 Nov 2022 18:16:58 +0000 (15:16 -0300)]
Koha 22.11.00 Rosalie is here!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months ago22.11.00: Vue bundle
Tomas Cohen Arazi [Fri, 25 Nov 2022 18:13:55 +0000 (15:13 -0300)]
22.11.00: Vue bundle

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoTranslation updates for Koha 22.11.00
Koha translators [Fri, 25 Nov 2022 16:59:04 +0000 (13:59 -0300)]
Translation updates for Koha 22.11.00

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoAdd release notes for Koha 22.11.00
Tomas Cohen Arazi [Fri, 25 Nov 2022 17:22:57 +0000 (14:22 -0300)]
Add release notes for Koha 22.11.00

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months ago22.11.00: Update kohastructure.sql
Tomas Cohen Arazi [Fri, 25 Nov 2022 14:15:50 +0000 (11:15 -0300)]
22.11.00: Update kohastructure.sql

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months ago22.11.00: Update history.txt
Tomas Cohen Arazi [Fri, 25 Nov 2022 13:48:31 +0000 (10:48 -0300)]
22.11.00: Update history.txt

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months ago22.11.00: Update contributors.yaml
Tomas Cohen Arazi [Fri, 25 Nov 2022 13:47:39 +0000 (10:47 -0300)]
22.11.00: Update contributors.yaml

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months ago22.11.00: Update .mailmap
Tomas Cohen Arazi [Fri, 25 Nov 2022 13:46:58 +0000 (10:46 -0300)]
22.11.00: Update .mailmap

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 30808: (follow-up) Minor visual glitch
Tomas Cohen Arazi [Fri, 25 Nov 2022 16:11:00 +0000 (13:11 -0300)]
Bug 30808: (follow-up) Minor visual glitch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 30808: Add a dedications tab to the about page
Martin Renvoize [Fri, 25 Nov 2022 15:35:36 +0000 (15:35 +0000)]
Bug 30808: Add a dedications tab to the about page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 30808: Add support for version codenames
Martin Renvoize [Fri, 25 Nov 2022 15:20:58 +0000 (15:20 +0000)]
Bug 30808: Add support for version codenames

This patch adds the 'Rosalie' codename to the 22.11 release and adds
corresponding support to the about page for displaying it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 30808: Add the 23.05 release team
Martin Renvoize [Fri, 25 Nov 2022 14:30:55 +0000 (14:30 +0000)]
Bug 30808: Add the 23.05 release team

This patch updates the teams.yaml to include the voted in 23.05 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: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31969: Use filter_by_last_update
Jonathan Druart [Wed, 23 Nov 2022 08:53:31 +0000 (09:53 +0100)]
Bug 31969: Use filter_by_last_update

This script has a pattern to delete rows depending on a given
date/number of days, we should use the filter_by_last_update
Koha::Objects method.
No need for another method and tests, everything is already tested
there.

This patch also suggests to rename the reference to "background" and
"bg" with "jobs", which seems more appropriate and not an abbreviation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32304: BackgroundJobs.t: Fix subtest purge
Marcel de Rooy [Mon, 21 Nov 2022 09:53:31 +0000 (09:53 +0000)]
Bug 32304: BackgroundJobs.t: Fix subtest purge

Instead of deleting, I added a count :)
Note that one of the purges eventually deletes my
older jobs..

Test plan:
Run t/db_dependent/Koha/BackgroundJobs.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32304: Fix subtest search_limited
Marcel de Rooy [Fri, 25 Nov 2022 08:13:04 +0000 (08:13 +0000)]
Bug 32304: Fix subtest search_limited

Jenkins reported:
    not ok 1 - No jobs found without userenv

We need to check if there are jobs without borrowernumber.

Test plan:
Run test again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32343: Prevent Koha/Patron.t to fail randomly
Jonathan Druart [Fri, 25 Nov 2022 06:26:42 +0000 (07:26 +0100)]
Bug 32343: Prevent Koha/Patron.t to fail randomly

Highlighted by Bug 32030: fix test builder for boolean

The attribute is named "unique_id", not "unique"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 15348: (follow-up) Fix modals to pre-set input with stored date
Katrin Fischer [Tue, 15 Nov 2022 13:32:43 +0000 (13:32 +0000)]
Bug 15348: (follow-up) Fix modals to pre-set input with stored date

Makes sure that when an estimated delivery day is edited using
the modals on the basket summary or late order pages, the
date input is pre-set to the stored estimated delivery date.

To test:
* Create some order lines with and without estimated delivery date set
* Make sure that on the basket summary the edit link comes up with an
  empty modal
* Close the basket
* Check that on late orders the dates are pre-filled incorrectly as well
* Apply patch
* Refresh basket summary and late order pages
* All edit links now should bring up the modal with the correct date filled in

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 15348: Store estimated delivery date when adding an order
Katrin Fischer [Tue, 15 Nov 2022 12:22:31 +0000 (12:22 +0000)]
Bug 15348: Store estimated delivery date when adding an order

When the estimated delivery date was entered on adding or modifying
and order, it was not saved to the database.

To test:
* Add new order, fill in estimated delivery date
* Save
* Verify the estimated delivery date is empty
* Modify order line, date will also not be saved
* Apply patch
* The date should now save and update correctly

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 15348: (follow-up) Fix filters on input fields
Katrin Fischer [Tue, 15 Nov 2022 11:32:08 +0000 (11:32 +0000)]
Bug 15348: (follow-up) Fix filters on input fields

With bug 30718 we on longer need the KohaDates TT filter
on the inputs. This patch removes them.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32310: Compiled CSS
Tomas Cohen Arazi [Thu, 24 Nov 2022 18:35:39 +0000 (15:35 -0300)]
Bug 32310: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32310: Correct CSS in the staff interface which still uses old color scheme
Owen Leonard [Mon, 21 Nov 2022 18:17:45 +0000 (18:17 +0000)]
Bug 32310: Correct CSS in the staff interface which still uses old color scheme

This patch updates staff interface CSS so that it better conforms to the
color scheme of the updated staff interface.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Tools -> Calendar. Corrected are the borders around the calendar
  and around the "Add new holiday" panel which appears when you click a
  date on the calendar.
- Go to Patrons and perform a search which will return multiple results.
  - Check the checkbox for some patrons. The color of the "Patrons
    selected" box have been updated.
  - Incorrect padding values have also been removed from the adjacent
    patron list and merge buttons.
- Locate a multi-paged DataTable, e.g. Administration -> Authorized
  values. The style of the "Next" and "Previous" buttons have been
  updated.
- View a patron record and choose More -> Set permissions from the
  toolbar. In the table of permissions, when you hover your mouse over
  one of the headings ("Check out and check in items," "Edit
  authorities," etc.) the color should be correct.
- I don't think this is ever visible in the staff interface, but the
  template has markup in it to display a "Log in" link in the header
  menu if the user isn't logged in. I've removed some redundant CSS
  corresponding to this link and corrected some markup just in case
  there is a situation in which is appears.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32260: Patron autocomplete - Do not display an alert if request is rejected
Jonathan Druart [Fri, 18 Nov 2022 07:00:24 +0000 (08:00 +0100)]
Bug 32260: Patron autocomplete - Do not display an alert if request is rejected

Not sure what is going on exactly, neither if this patch is the correct
way to fix this.
The request is "rejected" at some point (by the browser?), when we
search for patrons using the autocomplete and DT "at the same time".

To recreate:
Don't apply this patch
Go to /cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=5
Search for "edn" then hit enter
You may see an alert, that will disappear
If you don't see the alert, repeat

This patch suggests to ignore the alert if the status of the request is
"rejected".

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32303: Remove DT pagination on system preference search result
Owen Leonard [Tue, 22 Nov 2022 15:19:52 +0000 (15:19 +0000)]
Bug 32303: Remove DT pagination on system preference search result

This patch updates the way we retrieve a DataTable's saved state during
initialization. The change is to prevent cases where making a duplicate
call to DataTables() initializes the table again.

To recreate the bug, search system preferences for the term "last."
Scroll down to the "OPAC preferences" section and observe that there are
two filter forms displayed above it.

Apply the patch and perform the same search again. The extra forms
should be gone.

Confirm that DataTables behavior is still the same:

 - Test pages which use the "saveState" option in DataTables.
   - Type text in the table's search field
   - Reload the page. The search field should still have the string you
     entered, and the "Clear filter" button should be active.
     - Administration -> Libraries
     - Acquisitions -> Vendor -> Receive shipments -> Receive orders
     - Circulation -> Overdues

 - Test pages which don't use the "saveState" option, e.g. the checkout
   screen, patron search results, list of saved reports, etc. The
   behavior of the search form and table operations in general should be
   unchanged.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32046: Compiled CSS
Tomas Cohen Arazi [Wed, 23 Nov 2022 12:35:02 +0000 (09:35 -0300)]
Bug 32046: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32046: (follow-up) Accommodate the inclusion of item information
Owen Leonard [Wed, 16 Nov 2022 15:26:29 +0000 (15:26 +0000)]
Bug 32046: (follow-up) Accommodate the inclusion of item information

If you have item information configured in the MarcItemFieldsToOrder
system preference, the "Select to import" tab will display a basic item
information form which needs to use the same style as other item edit
forms.

In order to make the CSS in addbiblio.css more generic, I've changed
some styles to use a class, .item_edit_form, instead of an ID. This lets
us have multiple <div class="item_edit_form"> in this template without
duplicating IDs. Other instances of <div
id="cataloguing_additem_newitem"> have haa the .item_edit_form class
added.

To test you must have a staged MARC file which includes items and you
must configure the MarcItemFieldsToOrder preference to map those items
in the ordering interface.

As you follow the previous patch's test plan you'll find that when you
click a checkbox or title to expand the information about that title
you'll see "Item record X" headings following by a properly-styled form.

To confirm that the changes to addbiblio.css are not too far-reaching,
test the other affected pages:

 - Item add/edit
 - Batch item modification
 - Batch item deletion

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32046: When adding a new records from a staged files, there are style issues
Owen Leonard [Wed, 16 Nov 2022 12:08:56 +0000 (12:08 +0000)]
Bug 32046: When adding a new records from a staged files, there are style issues

This patch modifies the template for adding a record from a staged file
in order to resolve some layout problems introduced by the staff
redesign.

This patch also corrects an problem with addorderiso2709.js: It included
some template markup. The template variables are converted to a JS
variable to prevent a JS error.

Note that the QA tool's js_in_body error is invalid for this template
which requires that the JS stay inside <head>.

To test you must have at least one MARC file staged for import.

- Apply the patch and go to Acquisitions.
- Locate a vendor and create a basket if necessary.
- Add to the basket and choose the option of adding an order from a
  staged file.
- Click "Add orders" next to one of the staged files.
- On the Add orders from MARC file page, test that everything looks
  correct and works correctly:
  - In the first tab, expanding and collapsing order details by checking
    the checkbox or clicking the title.
  - Test the "MARC" and "Card" preview buttons.
  - Under the Item information tab, confirm that the layout looks
    correct and that the form works correctly, including plugin
    operations like auto barcode fill.
  - Test that, under the Default accounting details tab, changing the
    fund automatically sets the fund for each title in the first tab.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32269: Prevent Circulation.t to fail randomly
Jonathan Druart [Fri, 18 Nov 2022 14:31:10 +0000 (15:31 +0100)]
Bug 32269: Prevent Circulation.t to fail randomly

Highlighted by Bug 32030: fix test builder for boolean

    #   Failed test 'Checkouts with auto-renewal can be renewed earliest on due date if no renewalbefore'
    #   at t/db_dependent/Circulation.t line 343.
    #          got: '2022-11-18T14:16:12'
    #     expected: '2022-12-02T00:00:00'

    #   Failed test 'Checkouts with auto-renewal can be renewed earliest on due date if no renewalbefore'
    #   at t/db_dependent/Circulation.t line 349.
    #          got: '2022-11-18T14:16:12'
    #     expected: '2022-12-02T23:59:00'
    # Looks like you failed 2 tests of 5

We were reaching return $now

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32299: Add page-section to Z39.50 results
Andrew Auld [Tue, 22 Nov 2022 13:56:22 +0000 (13:56 +0000)]
Bug 32299: Add page-section to Z39.50 results

Test plan
Step 1: Navigate to Cataloguing module and click 'New from Z39.50/SRU' to start a search
Step 2: Carry out a search
Step 3: Confirm that the white background to the table of results is missing
Step 4: Apply patch
Step 6: Repeat search
Step 7: Confirm that the white background is now showing.

Signed-off-by: Hammat Wele <hammat.wele@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31378: Tests shouldn't remove all patrons
Tomas Cohen Arazi [Tue, 22 Nov 2022 21:23:07 +0000 (18:23 -0300)]
Bug 31378: Tests shouldn't remove all patrons

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32241: Add page-section to list of records in batch record modificaton (tool)
Owen Leonard [Thu, 17 Nov 2022 19:13:33 +0000 (19:13 +0000)]
Bug 32241: Add page-section to list of records in batch record modificaton (tool)

This patch modifies the batch record modification page template so that
the preview of submitted records is contained in a .page-section
container.

To test, apply the patch and go to Cataloging -> Batch record
modification.

Submit a batch of bibliographic record numbers and a batch of authority
record numbers. In both cases the page which previews the list of
submitted records in a table should be correctly styled.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32198: Add page-section to stock rotation stages list (cat)
Owen Leonard [Thu, 17 Nov 2022 18:50:07 +0000 (18:50 +0000)]
Bug 32198: Add page-section to stock rotation stages list (cat)

This patch adds a .page-section container around relevant areas of the
stock rotation management interface.

Also changed: Removed a .dialog.message container which was not correct.

To test, apply the patch and go to Cataloging -> Stock rotation.

- If necessary, add a rota.
- Click Manage -> Stages on your rota.
  - If neccesary, create one or more stages.
  - The display of stages should look correct.
- From the list of rotas click Manage -> Items.
  - Click "Add items" and use a barcode file to add multiple items at
    once.
  - The page confirming your submission, with a list of items, should
    have a page-section.
  - Return to the view of items in the rota. The display of items should
    look correct.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32238: Add page-section to label creator pages
Owen Leonard [Thu, 17 Nov 2022 19:28:48 +0000 (19:28 +0000)]
Bug 32238: Add page-section to label creator pages

This patch modifies two label creator templates so that a .page-section
container is used to wrap main content.

To test, apply the patch and go to Cataloging -> Label creator.

 - Click Manage -> Label batches.
   - The display of existing batches should look correct.
 - Click "Edit" on one of the label batches.
   - If necessary, submit a set of barcodes or item numbers to add to
     the batch.
   - The display of items in the table of items should look correct.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32254: (follow-up) Add missing div around "Older transactions"
Owen Leonard [Fri, 18 Nov 2022 16:29:46 +0000 (16:29 +0000)]
Bug 32254: (follow-up) Add missing div around "Older transactions"

To test:

- Tools -> Cash summary for <library> and Tools -> Transaction history
  for <register>
  - In the "Older transactions" section, submit start and end dates
    which will return results.
  - The table of results should be styled correctly.

Signed-off-by: David <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32254: (follow-up) Add page section to Cashup history
Katrin Fischer [Thu, 17 Nov 2022 18:45:33 +0000 (18:45 +0000)]
Bug 32254: (follow-up) Add page section to Cashup history

Adds one missing page section on the last table of the
POS transactions page.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32254: Add 'page-section' to various tools pages
Owen Leonard [Thu, 17 Nov 2022 17:24:03 +0000 (17:24 +0000)]
Bug 32254: Add 'page-section' to various tools pages

This patch adds a .page-section div to various pages in the tools
section in order to provide a consistent page structure.

Also changed: Corrected a couple of templates which were missing some
<tr> tags.

This patch includes indentation changes, so please ignore whitespace
when looking at the diff.

To test, apply the patch and view the following pages to confirm that
the primary page content is wrapped in a container with a white
background:

- Tools -> Access files
- Tools -> HTML customizations
  - Additional contents, news or pages-- all use the same template.
  - Check the list of existing entries.
- Tools -> Batch extend due dates
  - Choose a set of criteria that will return results and click
   "Continue".
  - Check the list of checkouts to be updated.
- Tools -> Batch patron modification
  - Submit a batch of patrons for modification.
  - Check the list of patrons to be modified.
- Tools -> Upload patron images
  - Upload one or more patron images
  - Check the view of results
- Tools -> Upload
  - Upload a file and view the results, or perform a search and check
    the view of results.
- Tools -> Patron card creator -> New patron card batch.
  - Submit a set of patrons and check the display of patrons in the
    resulting batch.
- Tools -> Cash summary for <library> and Tools -> Transaction history
  for <register>
  - Confirm that the table of data looks correct

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: David <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31080: Prevent bundles from being nested
Martin Renvoize [Fri, 1 Jul 2022 14:02:58 +0000 (15:02 +0100)]
Bug 31080: Prevent bundles from being nested

This is a follow-up for bug 28854 to prevent bundle type items from
being nested in to other bundles.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31080: Unit tests
Martin Renvoize [Mon, 4 Jul 2022 10:20:31 +0000 (11:20 +0100)]
Bug 31080: Unit tests

Unit tests for add_to_bundle functionality that prevents bundle nesting.

Test plan
1) Run t/db_dependent/Koha/Item.t
2) The test should fail
3) Apply the second patch
4) Re-run the test and watch it pass.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32237: Fix using a list as base for batch record deletion
Géraud Frappier [Wed, 16 Nov 2022 21:54:41 +0000 (16:54 -0500)]
Bug 32237: Fix using a list as base for batch record deletion

When a list was used to select records for batch deletion, the
record IDs were no longer found.

To test:

1. Go to Lists in the intranet.
2. Add a list by clicking on "New list". Choose a random name for it and select private or public and save.
3.Add one or more items into it and save.
4.Go back to the main page and select "Cataloging".
5.Go to "Batch record deletion".
6.In "upload a file" select "Select a list of records" and choose a list and keep the Bibliographic on.
7.Select continue and see that the list of records is not shown.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32167: (bug 14860 follow-up) Populate price fields even if no discount on vendor
Nick Clemens [Thu, 10 Nov 2022 19:24:25 +0000 (19:24 +0000)]
Bug 32167: (bug 14860 follow-up) Populate price fields even if no discount on vendor

On bug 14860 an 'else' was removed, assuming the price fields were set before discount,
this was incorrect. This patch renames the variable and always set the price, only discounting
ecost if a discount, but setting the values even if not

To test:
 0 - Have a vendor with a discount of 0% specified (no discount)
 1 - Export a record from your Koha
 2 - Stage the record for import and match on biblionumber
 3 - Add to a basket in acq from the staged file
 4 - Select the title, and set order price to $10 and do not fill the discount field
 5 - Add the order - note $0 order line
 6 - Repeat with another vendor with a 10% discount and confirm that is correct
 7 - Apply patch
 8 - Repeat 2-4
 9 - Add the order and confirm $10 price
10 - Repeat with discounted vendor, confirm prices are set discounted correctly

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 24606: (QA follow-up) Fix Template.t
Marcel de Rooy [Tue, 22 Nov 2022 15:49:02 +0000 (15:49 +0000)]
Bug 24606: (QA follow-up) Fix Template.t

The test cases here still assumed UTF-8 enocding in the middle
of the process. Can be much simpler.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31891: (bug 27421 follow-up) Remove one additional click
Jonathan Druart [Wed, 16 Nov 2022 06:40:59 +0000 (07:40 +0100)]
Bug 31891: (bug 27421 follow-up) Remove one additional click

From comment 0
"""
Moving marc batch import actions to background jobs has introduced some confusing
clicks to the process. Before this change, after staging a batch one was taken
to a "MARC staging results" page with details of how the staging went and, most
importantly, a link straight to the batch you'd just staged
(at manage-marc-import.pl?import_batch_id).

Now, however, one must click the status bar to get to details of the job
and then click "View batch" from there. Not only is that an extra click
and page load, but neither of those links are particularly large or
obvious.
"""

Test plan:
- Stage a record for import, notice that the "View batch" link appears
when the job is finished
- Add order to basket from a new file, select a file and import
Notice that the "Add staged files to basket" link is displayed when the
job is finished

Note for QA: We should have a js_callback in the background_job include
file instead.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32308: Update Chocolat image viewer CSS to conform to redesign color scheme
Owen Leonard [Mon, 21 Nov 2022 16:30:33 +0000 (16:30 +0000)]
Bug 32308: Update Chocolat image viewer CSS to conform to redesign color scheme

This patch makes minor modifications to the Chocolat CSS so that the
buttons (next, previous, close) are styled with colors that conform to
the new interface color scheme.

Note: You may encounter Bug 32307 when testing.

To test, apply the patch and enable at least two cover image services in
the staff interface: Amazon, Local cover images, and/or Coce.

Locate a bibliographic record which has at least two cover images and
view the detail page. Click on the cover image to trigger the image
viewer overlay.

Confirm that the controls in this view are colored green, matching the
current color scheme.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32045: Use bootstrap tabs to select item tab
Nick Clemens [Tue, 15 Nov 2022 14:13:53 +0000 (14:13 +0000)]
Bug 32045: Use bootstrap tabs to select item tab

When the form to add orders from a staged file is validated, we use
toptabs functionality to switch to the item tab if there are missing fields.

The display now uses bootstrap tabs, so the JS is throwing an error:
Uncaught Error: cannot call methods on tabs prior to initialization; attempted to call method 'option'

This patch simply switches the call to switch tabs

To test:
1 - Stage a file for import
2 - Either use Marc(Item)FieldsToOrder to populate the orders
    or select a budget on the third tab
3 - View the second tab, items info, confirm itemtype is required, but don't populate it
4 - Attempt to save order, nothing happens
5 - Check the JS console (F12)
6 - Note the error:
    Uncaught Error: cannot call methods on tabs prior to initialization; attempted to call method 'option'
7 - Apply patch
8 - Cancel and add from staged file again
9 - Select a budget and save
10 - You now get an error popup: Some required item subfields are not set
11 - Confirm after the error you are shown the items tab
12 - Select itemtype
13 - Save
14 - Confirm orders added successfully

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 30794: Insert blank rule (unlimited) for max_holds
Jonathan Druart [Thu, 17 Nov 2022 08:28:39 +0000 (09:28 +0100)]
Bug 30794: Insert blank rule (unlimited) for max_holds

Related to bug 24669, why didn't we use strip_non_numeric for one occurrence?

Note that there is still a problem, if none of the 3 inputs is filled,
no rule will be created (ie. action ignored)

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32298: Page section added to cataloguing search
Matt Blenkinsop [Mon, 21 Nov 2022 15:20:02 +0000 (15:20 +0000)]
Bug 32298: Page section added to cataloguing search

Added div to "Records found in this catalog".
Added page-section class to "Records found in the reservoir".
Corrected level two heading and removed horizontal line as it is now superfluous.

Test plan:
1) Apply patch from bug 32298
2) Navigate to Cataloging
3) Enter a search into the search field and run the search
4) Verify that the white page section identifier is now visible around both sections

Mentored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: PTFS Europe
Signed-off-by: Hammat Wele <hammat.wele@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32270: Add page section to label layouts
Jacob O'Mara [Fri, 18 Nov 2022 16:13:07 +0000 (16:13 +0000)]
Bug 32270: Add page section to label layouts

Test plan:
1) Navigate to `Cataloguing > Label creator > Manage label layouts`
2) Observe the missing page section surrounding the table
3) Apply patch
4) Observe that missing page section has now appeared

Mentored-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: PTFS Europe
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32010: 2AF selenium tests - Alert can appear when we are waiting for ajax
Jonathan Druart [Mon, 21 Nov 2022 06:55:52 +0000 (07:55 +0100)]
Bug 32010: 2AF selenium tests - Alert can appear when we are waiting for ajax

If we are waiting for ajax (there is a sleep 1s) and the alert pops up
at the same time, Selenium is raising "unexpected alert open"

We should not wait for the ajax request, but better wait for the
alert actually.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31378: (QA follow-up) Defer store until JSON fields are populated
Tomas Cohen Arazi [Fri, 18 Nov 2022 15:29:55 +0000 (12:29 -0300)]
Bug 31378: (QA follow-up) Defer store until JSON fields are populated

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32178: (QA follow-up) Correct modules import
Tomas Cohen Arazi [Fri, 18 Nov 2022 15:00:06 +0000 (12:00 -0300)]
Bug 32178: (QA follow-up) Correct modules import

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32178: Adapt tests to new auth.session params
Tomas Cohen Arazi [Fri, 18 Nov 2022 14:59:23 +0000 (11:59 -0300)]
Bug 32178: Adapt tests to new auth.session params

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32212: Updated yarn.lock
Tomas Cohen Arazi [Fri, 18 Nov 2022 14:45:06 +0000 (11:45 -0300)]
Bug 32212: Updated yarn.lock

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32268: Prevent XSLT.t to fail randomly
Jonathan Druart [Fri, 18 Nov 2022 13:41:51 +0000 (14:41 +0100)]
Bug 32268: Prevent XSLT.t to fail randomly

Can't call method "itemnumber" on an undefined value at /kohadevbox/koha/Koha/Recall.pm line 343.

We should set item_level and not let TestBuilder pick a value.

This may have been caught (make it more obvious) by the recent change to
TestBuilder for boolean (Bug 32030: fix test builder for boolean)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32010: Make sure the alert will be displayed after the ajax call
Jonathan Druart [Wed, 2 Nov 2022 08:08:46 +0000 (09:08 +0100)]
Bug 32010: Make sure the alert will be displayed after the ajax call

There is a missing wait_for_ajax call at after we click but wait_for_ajax
is waiting for the return of success, and the alert is there.

22:01:57 koha_1       | STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
22:01:57 koha_1       |  /usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
22:01:57 koha_1       |  (eval 541):1 in Selenium::Remote::Driver::__ANON__
22:01:57 koha_1       |  (eval 543):2 in Selenium::Remote::Driver::__ANON__
22:01:57 koha_1       |  /usr/share/perl5/Selenium/Remote/Driver.pm:654 in Selenium::Remote::Driver::_execute_command
22:01:57 koha_1       |  t/db_dependent/selenium/authentication_2fa.t:282 in Selenium::Remote::Driver::get_alert_text
22:01:57 koha_1       |  /usr/share/perl/5.32/Test/Builder.pm:334 in main::__ANON__
22:01:57 koha_1       |  /usr/share/perl/5.32/Test/Builder.pm:334 in (eval)
22:01:57 koha_1       |  /usr/share/perl/5.32/Test/More.pm:809 in Test::Builder::subtest
22:01:57 koha_1       |  t/db_dependent/selenium/authentication_2fa.t:291 in Test::More::subtest
22:01:57 koha_1       |
22:01:57 koha_1       |     # Looks like you planned 7 tests but ran 4.
22:01:57 koha_1       |
22:01:57 koha_1       | #   Failed test 'Enforce 2FA setup on first login'
22:01:57 koha_1       | #   at t/db_dependent/selenium/authentication_2fa.t line 291.
22:01:57 koha_1       | Error while executing command: no such alert at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
22:01:57 koha_1       |  at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.
22:01:57 koha_1       | # Looks like your test exited with 255 just after 4.
22:01:57 koha_1       | [20:59:37] t/db_dependent/selenium/authentication_2fa.t

Test plan:
Confirm that the test pass (execute it in a loop, hundreds of times)
Confirm that the behaviour of 2FA "enforced" (see bug 30588) is still
working as expected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 24606: (QA follow-up) Add test for encoding/decoding
Marcel de Rooy [Thu, 17 Nov 2022 10:15:30 +0000 (10:15 +0000)]
Bug 24606: (QA follow-up) Add test for encoding/decoding

NOTE: I have the impression that this unit test is quite
rudimentary. I do not see the apply function tested?

Test plan:
Run t/db_dependent/Koha/Item/Templates.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
tcohen amended: stray deps
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 24606: (QA follow-up) Fix encoding/decoding
Marcel de Rooy [Thu, 17 Nov 2022 10:02:08 +0000 (10:02 +0000)]
Bug 24606: (QA follow-up) Fix encoding/decoding

We should use OO interface and leave encoding to database
layer.

Test plan:
Add a new item template containing real Unicode chars.
Save. Apply on new item.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32267: (bug 32154 follow-up) Fix Agreements.t
Jonathan Druart [Fri, 18 Nov 2022 13:02:06 +0000 (14:02 +0100)]
Bug 32267: (bug 32154 follow-up) Fix Agreements.t

    #   Failed test at t/db_dependent/Koha/ERM/Agreements.t line 111.
    #     Structures begin differing at:
    #          $got->[0]{user_role_id} = '2'
    #     $expected->[0]{user_role_id} = Does not exist
    # Looks like you failed 1 test of 4.

Another fix may be better, please suggest if you disagree

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32104: Prevent console error on additonal-contents.pl
Lucas Gass [Thu, 3 Nov 2022 22:20:57 +0000 (22:20 +0000)]
Bug 32104: Prevent console error on additonal-contents.pl

To test:
1. Make a new HTML customization, news item, or page with the text editor ( CodeMirror ).
2. Save the content ( not Save and continue )
3. Notice the console error:
4. Apply patch
5. Try 1 & 2 again.
6. No error.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32181: ERM - Fix 'filter by expired' when adding an agreement to EBSCO's package
Jonathan Druart [Fri, 11 Nov 2022 15:31:40 +0000 (16:31 +0100)]
Bug 32181: ERM - Fix 'filter by expired' when adding an agreement to EBSCO's package

We shouldn't change the current route (which will lead to change the
view) when we are adding an agreement to a EBSCO's package

Test plan:
Go to E-Resource management / eHoldings / EBSCO / Packages
Search for a package, select one
Click "Add new agreement"
Use the "Filter by expired" filter
=> Without this patch you are redirected to the package list view
=> With this patch applied the table is filtered as expected

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32093: Make help and code match for bg-days in cleanup_database.pl
Katrin Fischer [Tue, 15 Nov 2022 16:54:47 +0000 (16:54 +0000)]
Bug 32093: Make help and code match for bg-days in cleanup_database.pl

There as a mismatch between the parameter name in documentation (bg-days)
and what was checked in the code (bg-jobs). This makes both match.

To test:
* Apply patch
* Make sure you have some background_jobs older than one day
* Verify the help of the script documents the parameter bg-days
* Run the cleanup_database.pl job
  Example:  ./misc/cronjobs/cleanup_database.pl --bg-days  --confirm -v
* Verify there are no errors and the lines have been deleted as expected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32212: (bug 32030 follow-up) Restore bootstrap 4
Jonathan Druart [Thu, 17 Nov 2022 06:48:54 +0000 (07:48 +0100)]
Bug 32212: (bug 32030 follow-up) Restore bootstrap 4

During the development of the eRM module I've tried to use bootstrap 5
(and vue-bootstrap), but I didn't manage to make it work without
modifying the version used in Koha. This change is actually not needed
and we can keep version 4.
See commit 8c32f186d5a62e742621c35cfacff5b22bb42b71
Bug 32030: ERM - Remove BootstrapVue3

Test plan:
% yarn install
% git diff
you should notice the version change in yarn.lock

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32242: Add selenium tests
Jonathan Druart [Thu, 17 Nov 2022 13:32:49 +0000 (14:32 +0100)]
Bug 32242: Add selenium tests

This is not testing the thing at the correct level, but at least we test
the whole workflow.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32242: Resolve encoding issue when sending to Net::Stomp
Marcel de Rooy [Thu, 17 Nov 2022 09:29:42 +0000 (09:29 +0000)]
Bug 32242: Resolve encoding issue when sending to Net::Stomp

This is meant as a quick fix. It should be enhanced later on by
letting Net::Stomp do the UTF8 conversion.

Test plan:
Run batch mod items. Add a Unicode char in the notes.
Check if job runs and results are correct.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32224: Add prettier to yarn commands
Jonathan Druart [Thu, 17 Nov 2022 07:53:40 +0000 (08:53 +0100)]
Bug 32224: Add prettier to yarn commands

xt/vue_tidy.t was failing with:
  error Command "prettier" not found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32224: Add cypress to yarn commands
Jonathan Druart [Wed, 16 Nov 2022 08:19:12 +0000 (09:19 +0100)]
Bug 32224: Add cypress to yarn commands

Either I am missing something obvious, or we need to add cypress to the scripts of package.json

With /kohadevbox/node_modules only (ie. without $SYNC_REPO/node_modules), I cannot run
  yarn run cypress run

`cypress run` is working with an adjusted PATH (see https://gitlab.com/koha-community/koha-testing-docker/-/issues/313#note_1173792905) but I think both should work.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32248: Remove t/00-checkdatabase-version.t
Jonathan Druart [Thu, 17 Nov 2022 13:52:25 +0000 (14:52 +0100)]
Bug 32248: Remove t/00-checkdatabase-version.t

Since bug 25078 we do no longer use updatedatabase.pl. This test was
there to make sure the RM(aints) was replacing the XXX correctly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31937: Fix Patrons::search_unsubscribed - sharpen condition
Marcel de Rooy [Wed, 26 Oct 2022 15:00:53 +0000 (15:00 +0000)]
Bug 31937: Fix Patrons::search_unsubscribed - sharpen condition

The condition is fine as long as we only have GDPR consents.
But if you dont, you would have trouble. I know :)
Lets prevent that here, although the table still has an ENUM. So
double safety.

Test plan:
Run t/db_dependent/Koha/Patrons.t
Bonus: Run cleanup_database.pl and check for unusual number of
locked accounts:
     misc/cronjobs/cleanup_database.pl --confirm -v --sessions

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 32131: Make sure we login before we restore original pref's value
Jonathan Druart [Wed, 16 Nov 2022 07:59:13 +0000 (08:59 +0100)]
Bug 32131: Make sure we login before we restore original pref's value

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>
23 months agoBug 32131: Move set_ERM_sys_pref_value to before
Jonathan Druart [Wed, 16 Nov 2022 07:57:40 +0000 (08:57 +0100)]
Bug 32131: Move set_ERM_sys_pref_value to before

We cannot (yet) move login to before, but we can set the pref before all
the tests. We need to login in before anyway to retrieve the value of
the pref.

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>
23 months agoBug 32131: Cypress tests are failing if ERMModule is off
Pedro Amorim [Sat, 12 Nov 2022 20:32:21 +0000 (19:32 -0100)]
Bug 32131: Cypress tests are failing if ERMModule is off

This patch solves this by enabling the system preference before each test,
right after login. It also sets the system preference back to its original
initial value after the tests finish running.

To test:
1) Disable ERMModule system preference
2) Run cypess tests: yarn cypress open / yarn cypress run
3) Verify that tests run successfully
(Optional): While tests are running, visit the system preferences panel and verify that the system preference is now "Enable".
4) Wait for the tests to finish and confirm that the system preference is set back to its original "Disable" value.

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>
23 months agoBug 32240: Prevent erm_users.t to fail if checkout exist
Jonathan Druart [Thu, 17 Nov 2022 08:51:42 +0000 (09:51 +0100)]
Bug 32240: Prevent erm_users.t to fail if checkout exist

We should not (never) remove all patrons before tests

Test plan:
0. Don't apply the patch
1. Check an item out
2. Run the tests
=> Fail
3. Apply the patch
4. Create a patron with the erm permission
5. Run the tests
=> Must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23 months agoBug 31774: Add 'page-section' to list of imported records
Katrin Fischer [Wed, 16 Nov 2022 19:12:52 +0000 (19:12 +0000)]
Bug 31774: Add 'page-section' to list of imported records

To test:
* Stage a MARC file with a few records
* Look at the import results
* The list of imported records doesn't have the white
  page section background
* Apply patch
* Refresh page and verify the table now is contained

Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>