Bug 32504

Summary: Empty column name, misaligning visibility, and export for basket/orders in table settings
Product: Koha Reporter: Slava Shishkin <slavashishkin>
Component: Staff interfaceAssignee: Slava Shishkin <slavashishkin>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: minor    
Priority: P5 - low CC: aleisha, gmcharlt, Laura.escamilla, lucas, sbcornell, slavashishkin
Version: Main   
Hardware: All   
OS: All   
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.03
Circulation function:
Bug Depends on: 15348    
Bug Blocks:    
Attachments: Bug 32504: Fix typo columnname in columns_settings.yml
Bug 32504: Fix misalignment of visibility of basket orders table columns and missing export columns
Bug 32504: Fix typo columnname in columns_settings.yml
Bug 32504: Fix misalignment of visibility of basket orders table columns and missing export columns
Bug 32504: [22.05] Fix misalignment of visibility of basket orders table columns and missing export columns

Description Slava Shishkin 2022-12-20 14:31:36 UTC

    
Comment 1 Slava Shishkin 2022-12-20 14:51:19 UTC
Created attachment 144739 [details] [review]
Bug 32504: Fix typo columnname in columns_settings.yml

Trivial fix.

To reproduce:
1. Go to /cgi-bin/koha/admin/columns_settings.pl
2. Observe in the section Acquisition > Basket > Orders an empty field in the Column name, the row between fund and supplier_report rows: it was expected estimated_delivery_date value.
3. Apply the patch.
4. Restart Memcached (console: service memcached restart)
5. Reload cgi-bin/koha/admin/columns_settings.pl: that empty row now will have estimated_delivery_date value.
Comment 2 Lucas Gass (lukeg) 2022-12-20 16:22:42 UTC
This does correct the empty row. However when I try hiding estimated_delivery_date value via Table settings I cannot. The last few couples seem mis-configured.
Comment 3 Slava Shishkin 2022-12-21 12:47:56 UTC
Created attachment 144767 [details] [review]
Bug 32504: Fix misalignment of visibility of basket orders table columns and missing export columns

To reproduce:
1. Go to /cgi-bin/koha/admin/columns_settings.pl
2. In the section Acquisition > Basket > Orders uncheck all checkboxes in the table settings
3. Go to a separate browser window to /cgi-bin/koha/acqui/booksellers.pl and open/create a new basket and add one book to it so the basket table will have rows in the "Order" table which we will configure below:
4. Click on the ["Columns" settings] for the table.
5. In the dropdown menu, observe that all Columns are marked as visible and correspond to the current table display.
6. Also check the export table feature: Click on "Export" and choose print, you will see that Columns up to GST (goods_and_services_tax) are displayed, and Fund and Estimated delivery date are missing.
7. Go back to table settings (like it was in steps.1-2)
8. Make the estimated_delivery_date column 'invisible by default' by checking out the appropriate checkbox and saving the changes.
9. Refresh the basket window/page (like in step 3).
10. Observe that in the table the whole columns "Estimated delivery date" is visible but "Fund" is gone.
11. Click on the ["Columns" settings] for the table.
12. In the dropdown menu observe that the wrong column is disabled ("Fund" instead of "Estimated delivery date").
13. Apply the patch.
14. Go through steps 3-12 and make sure that everything mentioned in those steps now works correctly: when you hide any columns in columns_settings.pl they are correctly hidden for the "Order" table, as well when exporting the table, the Fund, and Estimated delivery date columns are now exported.

Note: this patch also respects Koha.Preference('EDIFACT') setting and when it's enabled it also correctly hides/shows and exports the 'supplier_report' column.
Comment 4 Slava Shishkin 2022-12-21 12:52:03 UTC
(In reply to Lucas Gass from comment #2)

Right, this is fixed. And also export was broken: missed two columns.
Comment 5 Laura Escamilla 2022-12-23 12:48:35 UTC
I am able to hide estimated_delivery_date correctly using both the Columns Settings and Table Settings. However, even if I have the column hidden, it still shows up when the table is being printed. 


(In reply to Slava Shishkin from comment #4)
> (In reply to Lucas Gass from comment #2)
> 
> Right, this is fixed. And also export was broken: missed two columns.
Comment 6 Slava Shishkin 2022-12-27 12:32:30 UTC
Especially for this table, the code logic is hardcoded for exporting all columns regardless of view settings. This behavior is not related to this bug.

(In reply to Laura from comment #5)
Comment 7 Laura Escamilla 2022-12-27 12:43:00 UTC
Thank you for the clarification. All else is working well. 

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>

(In reply to Slava Shishkin from comment #6)
> Especially for this table, the code logic is hardcoded for exporting all
> columns regardless of view settings. This behavior is not related to this
> bug.
Comment 8 Lucas Gass (lukeg) 2023-01-06 18:00:17 UTC
Slava,

Shouldn't we use bKohaColumnsUseNames here? Like we do on detail.tt.
Comment 9 Slava Shishkin 2023-01-10 11:40:03 UTC
Lucas, thank you for your comment.

In this ticket, this is a fix for an existing bug. 

To improve the code for basket.tt, it's better to create a new ticket depending on this ticket.

(In reply to Lucas Gass from comment #8)
> Slava,
> 
> Shouldn't we use bKohaColumnsUseNames here? Like we do on detail.tt.
Comment 10 Katrin Fischer 2023-01-30 22:52:40 UTC
Created attachment 145827 [details] [review]
Bug 32504: Fix typo columnname in columns_settings.yml

Trivial fix.

To reproduce:
1. Go to /cgi-bin/koha/admin/columns_settings.pl
2. Observe in the section Acquisition > Basket > Orders an empty field in the Column name, the row between fund and supplier_report rows: it was expected estimated_delivery_date value.
3. Apply the patch.
4. Restart Memcached (console: service memcached restart)
5. Reload cgi-bin/koha/admin/columns_settings.pl: that empty row now will have estimated_delivery_date value.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2023-01-30 22:52:44 UTC
Created attachment 145828 [details] [review]
Bug 32504: Fix misalignment of visibility of basket orders table columns and missing export columns

To reproduce:
1. Go to /cgi-bin/koha/admin/columns_settings.pl
2. In the section Acquisition > Basket > Orders uncheck all checkboxes in the table settings
3. Go to a separate browser window to /cgi-bin/koha/acqui/booksellers.pl and open/create a new basket and add one book to it so the basket table will have rows in the "Order" table which we will configure below:
4. Click on the ["Columns" settings] for the table.
5. In the dropdown menu, observe that all Columns are marked as visible and correspond to the current table display.
6. Also check the export table feature: Click on "Export" and choose print, you will see that Columns up to GST (goods_and_services_tax) are displayed, and Fund and Estimated delivery date are missing.
7. Go back to table settings (like it was in steps.1-2)
8. Make the estimated_delivery_date column 'invisible by default' by checking out the appropriate checkbox and saving the changes.
9. Refresh the basket window/page (like in step 3).
10. Observe that in the table the whole columns "Estimated delivery date" is visible but "Fund" is gone.
11. Click on the ["Columns" settings] for the table.
12. In the dropdown menu observe that the wrong column is disabled ("Fund" instead of "Estimated delivery date").
13. Apply the patch.
14. Go through steps 3-12 and make sure that everything mentioned in those steps now works correctly: when you hide any columns in columns_settings.pl they are correctly hidden for the "Order" table, as well when exporting the table, the Fund, and Estimated delivery date columns are now exported.

Note: this patch also respects Koha.Preference('EDIFACT') setting and when it's enabled it also correctly hides/shows and exports the 'supplier_report' column.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2023-01-30 22:52:58 UTC
Thx for the fixes Slava, I think that typo was on me.
Comment 13 Tomás Cohen Arazi (tcohen) 2023-01-31 12:41:58 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 14 Jacob O'Mara 2023-01-31 17:46:51 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 15 Lucas Gass (lukeg) 2023-02-03 21:52:48 UTC
Missing dependencies for 22.05.x, no backport.
Comment 16 Aleisha Amohia 2023-06-27 00:28:20 UTC
Created attachment 152704 [details] [review]
Bug 32504: [22.05] Fix misalignment of visibility of basket orders table columns and missing export columns

To reproduce:
1. Go to /cgi-bin/koha/admin/columns_settings.pl
2. In the section Acquisition > Basket > Orders uncheck all checkboxes in the table settings
3. Go to a separate browser window to /cgi-bin/koha/acqui/booksellers.pl and open/create a new basket and add one book to it so the basket table will have rows in the "Order" table which we will configure below:
4. Click on the ["Columns" settings] for the table.
5. In the dropdown menu, observe that all Columns are marked as visible and correspond to the current table display.
6. Also check the export table feature: Click on "Export" and choose print, you will see that Columns up to GST (goods_and_services_tax) are displayed, and Fund and Estimated delivery date are missing.
7. Go back to table settings (like it was in steps.1-2)
8. Make the estimated_delivery_date column 'invisible by default' by checking out the appropriate checkbox and saving the changes.
9. Refresh the basket window/page (like in step 3).
10. Observe that in the table the whole columns "Estimated delivery date" is visible but "Fund" is gone.
11. Click on the ["Columns" settings] for the table.
12. In the dropdown menu observe that the wrong column is disabled ("Fund" instead of "Estimated delivery date").
13. Apply the patch.
14. Go through steps 3-12 and make sure that everything mentioned in those steps now works correctly: when you hide any columns in columns_settings.pl they are correctly hidden for the "Order" table, as well when exporting the table, the Fund, and Estimated delivery date columns are now exported.

Note: this patch also respects Koha.Preference('EDIFACT') setting and when it's enabled it also correctly hides/shows and exports the 'supplier_report' column.

Sponsored-by: Horowhenua Libraries Trust
Comment 17 Aleisha Amohia 2023-06-27 00:37:55 UTC
Have attached a patch for 22.05.x, not sure how the bug status should change sorry but it should get tested before it's backported!