Bug 31609: JavaScript error on Additional contents main page
authorOwen Leonard <oleonard@myacpl.org>
Fri, 23 Sep 2022 14:22:37 +0000 (14:22 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 5 Dec 2022 23:16:10 +0000 (23:16 +0000)
commit13ec1f0de404d1b572c0b22b8ee183876bcfe487
tree42be91c4f11a3bafb48db13febe3e019ac39758f
parent90e4cdb752601d273aa1807a88330da29034305c
Bug 31609: JavaScript error on Additional contents main page

This patch makes a minor modification to the JavaScript
on the Additional contents page to prevent an error when
there are no tabs present on the page.

The JS needs an additional check so that it doesn't run
when there are no tabs.

To test you should have more than one language installed.

- Before the patch, you would see a JavaScript error in
  the console: "Uncaught TypeError: can't access property
  "hash", firstTab[0] is undefined."
- Apply the patch and go to Tools -> Additional
  contents.
- With the patch applied there should be no error on the
  additional contents main page.
- Try creating or editing additional contents entries to
  confirm that the interface still works correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 13ad2132737cdfb2ae7c1daeffd733a383610f09)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt