In the preservation module, a "Letter template for printing slip" can be selected when creating a processing. This is not a required field; the field is blank by default. When viewing a train that uses a processing where no letter template have been specified, I still see the Print slips button in the Items table actions. When I select items, the button becomes clickable. When I click on it, I get an error page (probably because there is no specified notice for Koha to use!) On master, the error page starts with the lines: Error trace No letter_code at /kohadevbox/koha/preservation/print_slip.pl line 45. at /usr/lib/aarch64-linux-gnu/perl-base/Carp.pm line 289 On a system recently upgraded to 23.11, I am getting a 500 error at /cgi-bin/koha/preservation/print_slip.pl?train_item_id=1&train_item_id=2_blank It would be better if either: - the "Letter template for printing slip" field had the Train item slip selected by default; - or, the Print slip button didn't appear at all when no letter templates are selected in the processing settings.
Created attachment 160707 [details] [review] Bug 35714: Prevent items not linked with processing with a letter code a to be printed Items linked with a processing which does not have a letter code are not supposed to be printed. Currently the code is allowing to "print slip" for items when using the link on top of the table. It results in an error "No letter_code at /kohadevbox/koha/preservation/print_slip.pl line 45." Test plan: Create a processing without a letter code Add 2 items to the waiting list then add them to a train Go to the "show train" view => notice that you cannot print slip for those items Create another processing with a letter code Edit one of the item and set it the new processing => A slip for this item can be printed Edit the other item and the train to make them use the new processing => A slip for those items can be printed
Hi! Thank you for working on a patch. I've run into a few things when testing it out. 1. I set up test process 1 that does not include a letter template. After applying the patch I am still seeing the option to "Print slip" at the top of the table. When I click on that option I still see the "Error trace No letter_code at /kohadevbox/koha/preservation/print_slip.pl line 45. at /usr/lib/aarch64-linux-gnu/perl-base/Carp.pm line 289" error. 2. Next I created a process with a letter code. I changed my item's process to the new one (test process 2). When I submit my change it breaks the item_list table. Essentially it removes the columns and rows and only shows a number, the pencil for editing, the trash can for deleting and the printer symbol for printing the slips. All symbols work and I can print the slip -- but the table needs to be adjusted.
(In reply to Laura Escamilla from comment #2) > Hi! > > Thank you for working on a patch. I've run into a few things when testing it > out. > > 1. I set up test process 1 that does not include a letter template. After > applying the patch I am still seeing the option to "Print slip" at the top > of the table. When I click on that option I still see the "Error trace > No letter_code at /kohadevbox/koha/preservation/print_slip.pl line 45. > at /usr/lib/aarch64-linux-gnu/perl-base/Carp.pm line 289" error. Can you confirm that you have run `yarn js:build` after you applied the patch? > 2. Next I created a process with a letter code. I changed my item's process > to the new one (test process 2). When I submit my change it breaks the > item_list table. Essentially it removes the columns and rows and only shows > a number, the pencil for editing, the trash can for deleting and the printer > symbol for printing the slips. All symbols work and I can print the slip -- > but the table needs to be adjusted. Yes, if at least one item has a process different that the default (the one defined at the train level), then the items are not displayed in a table. This is because we cannot display several items from different process (and so different attributes/columns) in the same table.
So therefore we would have to create a new train in order to change the item to a new process?
1. Can you confirm that you have run `yarn js:build` after you applied the patch? --Yes I ran the yarn build and I am still seeing errors when trying to print slips with processes that do not have a letter code. 2. Yes, if at least one item has a process different that the default (the one defined at the train level), then the items are not displayed in a table. This is because we cannot display several items from different process (and so different attributes/columns) in the same table. --That makes sense! I missed the step of changing my default process on the train when I changed it for the item. Maybe we could add a warning for libraries that says something along the lines of "New item process does not match Train xx's process."? I can see how some staff members might miss this step.
(In reply to Laura Escamilla from comment #5) > 1. Can you confirm that you have run `yarn js:build` after you applied the > patch? > --Yes I ran the yarn build and I am still seeing errors when trying to print > slips with processes that do not have a letter code. Please make sure your browser's cache is correctly flushed. You are not supposed to be able to print slip an item if it has a process without a letter template. If you still recreate can you screenshot and share it please? > 2. Yes, if at least one item has a process different that the default (the > one > defined at the train level), then the items are not displayed in a table. > This is because we cannot display several items from different process (and > so different attributes/columns) in the same table. > > --That makes sense! I missed the step of changing my default process on the > train when I changed it for the item. Maybe we could add a warning for > libraries that says something along the lines of "New item process does not > match Train xx's process."? I can see how some staff members might miss this > step. I will be happy to implement your suggestion if you open a new bug report.
(In reply to Jonathan Druart from comment #6) > Please make sure your browser's cache is correctly flushed. You are not > supposed to be able to print slip an item if it has a process without a > letter template. ie. checkboxes should be disabled.
Created attachment 162350 [details] [review] Bug 35714: Prevent items not linked with processing with a letter code a to be printed Items linked with a processing which does not have a letter code are not supposed to be printed. Currently the code is allowing to "print slip" for items when using the link on top of the table. It results in an error "No letter_code at /kohadevbox/koha/preservation/print_slip.pl line 45." Test plan: Create a processing without a letter code Add 2 items to the waiting list then add them to a train Go to the "show train" view => notice that you cannot print slip for those items Create another processing with a letter code Edit one of the item and set it the new processing => A slip for this item can be printed Edit the other item and the train to make them use the new processing => A slip for those items can be printed Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
It works :) ---- (hmm, when going back to waiting list to make the 2nd processing, I got "you need to configure this module first" I refreshed and it went again, weird, not related to this ticket but leaving that in case that happens to someone else and we can identify the issue)
Created attachment 164292 [details] [review] Bug 35714: Prevent items not linked with processing with a letter code a to be printed Items linked with a processing which does not have a letter code are not supposed to be printed. Currently the code is allowing to "print slip" for items when using the link on top of the table. It results in an error "No letter_code at /kohadevbox/koha/preservation/print_slip.pl line 45." Test plan: Create a processing without a letter code Add 2 items to the waiting list then add them to a train Go to the "show train" view => notice that you cannot print slip for those items Create another processing with a letter code Edit one of the item and set it the new processing => A slip for this item can be printed Edit the other item and the train to make them use the new processing => A slip for those items can be printed Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Not needed in 23.05.x, no backport.