Bug 35058 - No contents displaying when an authority record is saved
Summary: No contents displaying when an authority record is saved
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 34075
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-14 22:05 UTC by Katrin Fischer
Modified: 2024-07-04 20:37 UTC (History)
1 user (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.11.00
Circulation function:


Attachments
Bug 35058: Automatically show authority tab 0 if DefaultAuthorityTab is empty (2.25 KB, patch)
2023-10-16 11:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35058: Automatically show authority tab 0 if DefaultAuthorityTab is empty (2.30 KB, patch)
2023-10-16 19:42 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-10-14 22:05:36 UTC
I believe this has to do with our changes for tabs:

When an authority record is edited and saved, you get directed to the authority detail page, but only the tabs themselves and no contents show.
Comment 1 Owen Leonard 2023-10-16 11:30:15 UTC
Created attachment 157181 [details] [review]
Bug 35058: Automatically show authority tab 0 if DefaultAuthorityTab is empty

The change to the authority detail page made by Bug 34075 didn't take
into account the possibility that the DefaultAuthorityTab tab preference
might be empty. This leads to a JavaScript error and no tabs being
shown.

We can avoid this situation by initializing the tab_object variable as
an empty object.

To test, apply the patch and go to Authorities to repeat the test plan
for Bug 34075:

1. Locate and view the detail page for an authority record.
2. The page should default to the 0XX or first tab.
3. Go to Administration -> System preferences and set the
   DefaultAuthorityTab preference to a number that won't be found
   in your authority record (e.g. there are no 3XX tags defined).
4. Return to the detail page and verify that the first tab is displayed.
5. Set DefaultAuthorityTab to 1XX or greater, one that exists in your
   record.
6. Reload the detail page and confirm the correct tab is selected.
7. Test the case where DefaultAuthorityTab is undefined by directly
   updating the database. In koha-testing-docker you can run this
   command:

   echo "update systempreferences set value = 3 where variable = 'DefaultAuthorityTab';" | koha-mysql kohadev

   Return to the authority detail tab to confirm that the first tab is
   displayed.
Comment 2 Katrin Fischer 2023-10-16 19:42:18 UTC
Created attachment 157211 [details] [review]
Bug 35058: Automatically show authority tab 0 if DefaultAuthorityTab is empty

The change to the authority detail page made by Bug 34075 didn't take
into account the possibility that the DefaultAuthorityTab tab preference
might be empty. This leads to a JavaScript error and no tabs being
shown.

We can avoid this situation by initializing the tab_object variable as
an empty object.

To test, apply the patch and go to Authorities to repeat the test plan
for Bug 34075:

1. Locate and view the detail page for an authority record.
2. The page should default to the 0XX or first tab.
3. Go to Administration -> System preferences and set the
   DefaultAuthorityTab preference to a number that won't be found
   in your authority record (e.g. there are no 3XX tags defined).
4. Return to the detail page and verify that the first tab is displayed.
5. Set DefaultAuthorityTab to 1XX or greater, one that exists in your
   record.
6. Reload the detail page and confirm the correct tab is selected.
7. Test the case where DefaultAuthorityTab is undefined by directly
   updating the database. In koha-testing-docker you can run this
   command:

   echo "update systempreferences set value = 3 where variable = 'DefaultAuthorityTab';" | koha-mysql kohadev

   Return to the authority detail tab to confirm that the first tab is
   displayed.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Katrin Fischer 2023-10-16 19:42:59 UTC
Easy fix, going to PQA directly.
Comment 4 Tomás Cohen Arazi (tcohen) 2023-10-18 18:44:24 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-10-25 07:42:59 UTC
Depends on Bug 34075 not in 23.05.x