Correctly set indicators when cloning a field
in the MARC editor. Prior this fix, a cloned
field would not be saved. Bug introduced in
patch for bug 2207.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
<!-- TMPL_UNLESS NAME='hide_marc'--> // No indicator if hide_marc
// setting a new name for the new indicator
<!-- TMPL_UNLESS NAME='hide_marc'--> // No indicator if hide_marc
// setting a new name for the new indicator
- var indicator = clone.getElementsByTagName('input')[0];
- indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
+ for(var i=0; i < 2; i++) {
+ var indicator = clone.getElementsByTagName('input')[i];
+ indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
+ }
<!-- /TMPL_UNLESS -->
// settings all subfields
<!-- /TMPL_UNLESS -->
// settings all subfields
if(divs[i].getAttribute('name') == 'div_indicator'){
var inputs = divs[i].getElementsByTagName('input');
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
if(divs[i].getAttribute('name') == 'div_indicator'){
var inputs = divs[i].getElementsByTagName('input');
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
+ inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
var CloneButtonPlus;
try {
var CloneButtonPlus;
try {
<!-- TMPL_UNLESS NAME='hide_marc'--> // No indicator if hide_marc
// setting a new name for the new indicator
<!-- TMPL_UNLESS NAME='hide_marc'--> // No indicator if hide_marc
// setting a new name for the new indicator
- var indicator = clone.getElementsByTagName('input')[0];
- indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
+ for(var i=0; i < 2; i++) {
+ var indicator = clone.getElementsByTagName('input')[i];
+ indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
+ }
<!-- /TMPL_UNLESS -->
// settings all subfields
<!-- /TMPL_UNLESS -->
// settings all subfields
if(divs[i].getAttribute('id').match(/^div_indicator/)){
var inputs = divs[i].getElementsByTagName('input');
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
if(divs[i].getAttribute('id').match(/^div_indicator/)){
var inputs = divs[i].getElementsByTagName('input');
inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
+ inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
var CloneButtonPlus;
try {
var CloneButtonPlus;
try {