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>
This commit is contained in:
Jacek Ablewicz 2016-09-01 18:13:50 +02:00 committed by Kyle M Hall
parent 39487d634e
commit a1fd726157
2 changed files with 16 additions and 1 deletions

View File

@ -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 };

View File

@ -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 %]