Bug 33156 - Batch patron modification tool is missing search bar and other attributes
Summary: Batch patron modification tool is missing search bar and other attributes
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on: 29648
Blocks:
  Show dependency treegraph
 
Reported: 2023-03-07 13:05 UTC by Laura Escamilla
Modified: 2023-12-28 20:44 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06,22.05.13


Attachments
Bug 33156: Fix JS error on batch patron modification (2.30 KB, patch)
2023-03-19 23:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33156: Fix JS error on batch patron modification (2.35 KB, patch)
2023-04-02 19:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 33156: Fix JS error on batch patron modification (2.42 KB, patch)
2023-04-25 12:29 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Laura Escamilla 2023-03-07 13:05:24 UTC
The table that loads on modborrowers.pl was a data table with a search bar and pager at the top.  When choosing a patron attribute from the Patron attribute drop-down at the bottom of the page, if that attribute had an authorized value associated with it, a second drop-down list would appear to the right of the drop-down with the options for that attribute.  Now all that appears is a basic input box and it appears whether or not you've chosen an attribute to edit or not.

Error: Uncaught TypeError: table_settings.push is not a function
    <anonymous> https://staff.cin.bywatersolutions.com/cgi-bin/koha/tools/modborrowers.pl
Comment 1 Katrin Fischer 2023-03-09 21:47:07 UTC
Hi Laura, I just tested this on master and it worked ok.
Which version did you encounter the problem in? Does it still not work for you?
Comment 2 Katrin Fischer 2023-03-09 21:51:17 UTC
Interesting: I don't see an error on the search form, but I see it on the 'result list' after the changes have been made.

Maybe there is 2 different bugs here, one on the form, not present in master, and one for the results?
Comment 3 George Williams (NEKLS) 2023-03-09 21:52:55 UTC
Katrin,

Laura filed this bug on behalf of NEKLS and CIN and both of our consortia are experiencing it on Koha 22.05

George
Comment 4 Katrin Fischer 2023-03-09 21:55:55 UTC
Hi George, 

it took me a while and I cannot reproduce the error with selecting an attribute that is linked to an AV, the form itself seems ok in master, but I can see the JS error now. You have to update an extended attribute in order to see it:

* Go to the patron modification tool
* Add one or more cardnumbers, I used 42
* Select the "show barcode" extended patron attribute at the end of the form and update to yes or no

On the results list, you'll see the error in the console:

table_settings.push({
  columname: "Attributes 1",
  cannot_be_modified: 0,
  cannot_be_toggled: 0,
  is_hidden: 0
});
Comment 5 Katrin Fischer 2023-03-18 10:45:23 UTC
I can also see the error on the form now - not sure why I didn't previously:

Uncaught TypeError: table_settings.push is not a function
Comment 6 Katrin Fischer 2023-03-19 23:04:12 UTC Comment hidden (obsolete)
Comment 7 David Nind 2023-04-02 19:14:50 UTC
Created attachment 149074 [details] [review]
Bug 33156: Fix JS error on batch patron modification

The error currently breaks some of the functionality for
updating patron attributes linked to AV values. With the
bug, the input field will not change to the AV list when selected
from the pull down of patron attributes.

It was probably bug 29648 that changed the data structure
without adapting for the additional data that is pushed
to the object for the patron attribute columns.

To test:
* Create several extended patron attributes
  * Make sure at least one is linked to an AV
  * Repeatable and unique patron attributes can't be
  updated in batch patron modification, so you need some
  that can be modified.
* Go to tools > batch patron modification
* Enter one or more cardnumbers to update
* Verify the table is missing columns, export and configure
* Verify when selecting the AV tied patron attribute, the input
  remains a text one
* Apply patch
* Both should work now as expected

Note: I believe there are some more errors on this page,
but they should better be handled separately. So with this
patch we push configuration again for each column to table
columns, but the very last column keeps missing from the
columns settings.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2023-04-02 19:23:13 UTC
Testing notes (using KTD):

1. For me, the standard table heading (number of entries, search, Columns, Export, Configure, etc) was not appearing on the results page after pressing Save.

2. Another issue I noticed is that if you have multiple patron attributes:
   2.1 Select one of the patron attributes (say a plain text one)
   2.2 Enter a text value
   2.3 Click New
   2.4 Choose a patron attribute that has an authorized value
   2.5 Note that the options for the first patron attribute (the plain text one) has now changed to a dropdown list with the same values as the second one (2.4)
   2.6 Now if you add another new patron attribute (say another plain text one), it changes all the patron attributes listed so far to a plain text input box
   I hope this makes sense!
Comment 9 Jonathan Druart 2023-04-25 12:29:23 UTC
Created attachment 150193 [details] [review]
Bug 33156: Fix JS error on batch patron modification

The error currently breaks some of the functionality for
updating patron attributes linked to AV values. With the
bug, the input field will not change to the AV list when selected
from the pull down of patron attributes.

It was probably bug 29648 that changed the data structure
without adapting for the additional data that is pushed
to the object for the patron attribute columns.

To test:
* Create several extended patron attributes
  * Make sure at least one is linked to an AV
  * Repeatable and unique patron attributes can't be
  updated in batch patron modification, so you need some
  that can be modified.
* Go to tools > batch patron modification
* Enter one or more cardnumbers to update
* Verify the table is missing columns, export and configure
* Verify when selecting the AV tied patron attribute, the input
  remains a text one
* Apply patch
* Both should work now as expected

Note: I believe there are some more errors on this page,
but they should better be handled separately. So with this
patch we push configuration again for each column to table
columns, but the very last column keeps missing from the
columns settings.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Tomás Cohen Arazi 2023-05-05 12:17:19 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 11 Martin Renvoize 2023-05-11 11:02:49 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 12 Lucas Gass 2023-05-15 21:56:56 UTC
Backported to 22.05.x for upcoming 22.05.13
Comment 13 Arthur Suzuki 2023-05-23 14:52:40 UTC
conflicts on 21.11. won't backport