Bug 35110 - Authorities editor with JS error when only one tab
Summary: Authorities editor with JS error when only one tab
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Fridolin Somers
QA Contact: Katrin Fischer
URL:
Keywords:
: 34541 (view as bug list)
Depends on: 33524 34251
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-19 19:04 UTC by Fridolin Somers
Modified: 2024-01-25 14:12 UTC (History)
2 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.11.00,23.05.05,22.11.12


Attachments
Bug 35110: Authorities editor with JS error when only one tab (1.71 KB, patch)
2023-10-19 19:24 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 35110: (follow-up) Fix comment in addbiblio.tt (1.22 KB, patch)
2023-10-19 19:24 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 35110: Authorities editor with JS error when only one tab (1.76 KB, patch)
2023-10-20 15:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 35110: (follow-up) Fix comment in addbiblio.tt (1.27 KB, patch)
2023-10-20 15:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 35110: Authorities editor with JS error when only one tab (1.81 KB, patch)
2023-10-20 19:57 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 35110: (follow-up) Fix comment in addbiblio.tt (1.32 KB, patch)
2023-10-20 19:57 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 Fridolin Somers 2023-10-19 19:04:05 UTC
Exactly like Bug 34251 for biblios :

When using the an authorities framework with all fields in the same tab, there is thrown a JS error in selectTab( "#tab0XX_panel" );

This is because no nav tabs are build in authorities/authorities.tt as BIG_LOOP has a length(size) of 1
Comment 1 Fridolin Somers 2023-10-19 19:10:55 UTC
... Maybe selectTab() should be moved to cataloging.js ...
Comment 2 Fridolin Somers 2023-10-19 19:16:01 UTC
Also we may have use TT syntax like in tabs build :
[% IF BIG_LOOP.size <= 1 %]

But JS does the job ;)
Comment 3 Fridolin Somers 2023-10-19 19:24:04 UTC
Created attachment 157477 [details] [review]
Bug 35110: Authorities editor with JS error when only one tab

Exactly like Bug 34251 for biblios :
When using the an authorities framework with all fields in the same tab, there is thrown a JS error in selectTab( "#tab0XX_panel" );
This is because no nav tabs are build in authorities/authorities.tt as BIG_LOOP has a length(size) of 1

Test plan :
1) Edit an authority framework, for example 'Meeting Name', to set all sufields in tab 0
   You may use SQL : UPDATE auth_subfield_structure SET tab=0 WHERE authtypecode='MEETI_NAME'
   Don't forget to restart memcached
2) Go to 'Authorities'
3) Click on 'New authority' then 'Meeting Name'
4) Check you don't see any JavaScript error
5) Check you can save
Comment 4 Fridolin Somers 2023-10-19 19:24:18 UTC
Created attachment 157478 [details] [review]
Bug 35110: (follow-up) Fix comment in addbiblio.tt

Change comment in addbiblio.tt since any biblio framework may use only
one tab.
Also fixes indenting using 4 spaces.
Comment 5 David Nind 2023-10-20 15:50:10 UTC
Created attachment 157554 [details] [review]
Bug 35110: Authorities editor with JS error when only one tab

Exactly like Bug 34251 for biblios :
When using the an authorities framework with all fields in the same tab, there is thrown a JS error in selectTab( "#tab0XX_panel" );
This is because no nav tabs are build in authorities/authorities.tt as BIG_LOOP has a length(size) of 1

Test plan :
1) Edit an authority framework, for example 'Meeting Name', to set all sufields in tab 0
   You may use SQL : UPDATE auth_subfield_structure SET tab=0 WHERE authtypecode='MEETI_NAME'
   Don't forget to restart memcached
2) Go to 'Authorities'
3) Click on 'New authority' then 'Meeting Name'
4) Check you don't see any JavaScript error
5) Check you can save

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2023-10-20 15:50:13 UTC
Created attachment 157555 [details] [review]
Bug 35110: (follow-up) Fix comment in addbiblio.tt

Change comment in addbiblio.tt since any biblio framework may use only
one tab.
Also fixes indenting using 4 spaces.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2023-10-20 15:52:03 UTC
Testing notes (using KTD):

1. Issue fixed!

2. Noticed error in the console "downloadable font: Glyph bbox was incorrect" - there is a bug for this already - bug 34973
Comment 8 Katrin Fischer 2023-10-20 19:57:06 UTC
Created attachment 157566 [details] [review]
Bug 35110: Authorities editor with JS error when only one tab

Exactly like Bug 34251 for biblios :
When using the an authorities framework with all fields in the same tab, there is thrown a JS error in selectTab( "#tab0XX_panel" );
This is because no nav tabs are build in authorities/authorities.tt as BIG_LOOP has a length(size) of 1

Test plan :
1) Edit an authority framework, for example 'Meeting Name', to set all sufields in tab 0
   You may use SQL : UPDATE auth_subfield_structure SET tab=0 WHERE authtypecode='MEETI_NAME'
   Don't forget to restart memcached
2) Go to 'Authorities'
3) Click on 'New authority' then 'Meeting Name'
4) Check you don't see any JavaScript error
5) Check you can save

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2023-10-20 19:57:09 UTC
Created attachment 157567 [details] [review]
Bug 35110: (follow-up) Fix comment in addbiblio.tt

Change comment in addbiblio.tt since any biblio framework may use only
one tab.
Also fixes indenting using 4 spaces.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Tomás Cohen Arazi 2023-10-20 20:29:30 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 11 Fridolin Somers 2023-10-26 06:25:57 UTC
Pushed to 23.05.x for 23.05.05
Comment 12 Matt Blenkinsop 2023-11-13 14:20:11 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x
Comment 13 Fridolin Somers 2024-01-25 14:12:22 UTC
*** Bug 34541 has been marked as a duplicate of this bug. ***