Main Koha release repository https://koha-community.org
Find a file
Petro Vashchuk 43f9758c3d Bug 27508: do nothing if tag label elements don't exist
When JavaScript make copy of DOM set for MARC tag, it tries to reassign
label elements to another id, the problem is there is no check for
existence of that label element, so in case when option
"advancedMARCeditor" is set to "Don't display", labels were absent
which caused JavaScript to crush in the middle of process with uncaught
exception.

This patch wraps this label assignment in try/catch hook like it's done
in the code around for other elements, to allow the script to proceed
when description labels are not present.

To test:
1) Check in the system preferences interface subsection that
   "advancedMARCeditor" is set to "Display".
2) Go to the "Add MARC record" cataloguing section and press "Repeat
   this tag" button near the MARC tag record to ensure that it makes
   duplicate in the interface as expected.
3) Then again in the system preferences interface subsection change
   "advancedMARCeditor" to "Don't display".
4) Return back to the "Add MARC record" interface, refresh the page to
   have no MARC field labels displayed, and try duplicating the tag
   again.
5) Ensure that it doesn't work, also you can notice a JavaScript error
   "Cannot read property "setAttribute" of undefined..." in the
   JavaScript console of your browser.
6) Apply the patch.
7) Repeat the test sequence (changes will be in the step 5), ensure that
   the tag gets duplicated even when description labels are not present.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-27 10:45:54 +01:00
acqui Bug 27485: Rename system preference gist to TaxRates 2021-01-22 14:09:46 +01:00
admin Bug 25054: Display search field aliases in Search Engine Configuration 2021-01-14 14:03:49 +01:00
api
authorities Bug 11299: (follow-up) correct link 2021-01-14 14:03:49 +01:00
basket
bin
C4 Bug 25802: Change addDate to addDuration 2021-01-22 14:59:27 +01:00
catalogue
cataloguing Bug 20971: Prevent Storable::thaw to fail on LastCreatedItem 2021-01-19 16:03:34 +01:00
circ Bug 27011: Remove unused $name variable 2021-01-21 15:40:29 +01:00
clubs Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
course_reserves
debian Bug 26048: Use ErrorDocument middleware for Plack HTTP errors 2021-01-27 10:30:43 +01:00
docs Bug 7143: Update about page for new devs 2021-01-22 14:59:27 +01:00
errors Bug 26048: Use ErrorDocument middleware for Plack HTTP errors 2021-01-27 10:30:43 +01:00
etc Bug 27299: Remove tokenization for phrase register/index with ICU 2021-01-19 15:31:58 +01:00
ill
installer Bug 27491: DBRev 20.12.00.005 2021-01-22 14:59:27 +01:00
Koha Bug 27333: Throw the right exceptions 2021-01-27 10:45:54 +01:00
koha-tmpl Bug 27508: do nothing if tag label elements don't exist 2021-01-27 10:45:54 +01:00
labels
members Bug 27420: Use object accessor for $attr_type->class() 2021-01-19 15:31:55 +01:00
misc Bug 11344: (QA follow-up) Fix empty section warning 2021-01-27 10:45:54 +01:00
offline_circ
opac Bug 26048: Use ErrorDocument middleware for Plack HTTP errors 2021-01-27 10:30:43 +01:00
patron_lists
patroncards
plugins Bug 24633: Add support for gitlab searching of plugins 2020-11-06 15:55:17 +01:00
pos
reports
reserve
reviews
rotating_collections
serials
services
skel
suggestion
svc Bug 11299: Adjust call to check_cookie_auth 2021-01-14 14:03:49 +01:00
t Bug 27333: Regression tests 2021-01-27 10:45:54 +01:00
tags
tmp/modified_authorities
tools Bug 27413: Restore debarred and debarredcomment to batch patron mod tools 2021-01-19 15:32:01 +01:00
virtualshelves
xt Bug 26971: Remove obsolete test file translatable-templates.t 2020-11-09 11:20:43 +01:00
.editorconfig Bug 24774: Set JSON indentation of 2 spaces in .editorconfig 2020-03-19 09:24:52 +00:00
.eslintrc.json
.gitignore
.htaccess
.mailmap
.perlcriticrc
.scss-lint.yml
about.pl
app.psgi
changelanguage.pl
cpanfile
fix-perl-path.PL
gulpfile.js
help.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
INSTALL
Koha.pm Bug 27491: DBRev 20.12.00.005 2021-01-22 14:59:27 +01:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl
Makefile.PL
MANIFEST.SKIP
package.json
README
README.md
README.robots
rewrite-config.PL
yarn.lock

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo