Browse Source

Bug 17072: 006 not filling in with existing values

When you use the 006 builder to view the existing values in the 006
tag, Koha is not pulling these existing values into the builder
window. Instead, Koha appears to be using defaults.

To reproduce:

1. Open a record in the editor
2. Switch from BKS to another material type.
3. Change as many settings as possible.
4. Close plugin.
5. Reopen plugin - notice your selections are not shown.

Trivial patch, heavilly inspired by Bug 9093.

To test:

1. Apply patch
2. Ensure that issue described above is no longer reproductible

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
16.11.x
Jacek Ablewicz 5 years ago
committed by Kyle M Hall
parent
commit
a1fd726157
  1. 14
      cataloguing/value_builder/marc21_field_006.pl
  2. 3
      koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt

14
cataloguing/value_builder/marc21_field_006.pl

@ -66,6 +66,17 @@ my $launcher = sub {
}
);
$result = "a|||||r|||| 00| 0 " unless $result;
my $material_form_mapping = {
a => 'BKS', t => 'BKS',
c => 'MU', d => 'MU', i => 'MU', j => 'MU',
e => 'MP', f => 'MP',
g => 'VM', k => 'VM', o => 'VM', r => 'VM',
m => 'CF',
p => 'MX',
s => 'CR',
};
my $material_code = substr(($result // ' '), 0, 1);
my $material_configuration = $material_form_mapping->{$material_code};
my $errorXml = '';
# Check if the xml, xsd exists and is validated
@ -86,8 +97,9 @@ my $launcher = sub {
index => $index,
result => $result,
errorXml => $errorXml,
material_configuration => $material_configuration,
);
output_html_with_http_headers $input, $cookie, $template->output;
};
return { builder => $builder, launcher => $launcher };
return { builder => $builder, launcher => $launcher };

3
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt

@ -17,6 +17,9 @@
h4_result = document.getElementById("h4_result");
tr_result = document.getElementById("tr_result");
objXmlControlField = new xmlControlField('[% tagfield %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang %]', '[% marcflavour %]');
[% IF ( material_configuration ) %]
objXmlControlField.idMaterial = "[% material_configuration %]";
[% END %]
objXmlControlField.loadXmlValues();
renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result"));
[% END %]

Loading…
Cancel
Save