Bug 6713, editing matching rules broken

Was a template error, but also a bug that had been in there for a
while fixed too

Please test by editing a matching rule, match sure no new match checks
are added, and that the matchpoint components survive.

Then try importing some marc records using that match rule

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Chris Cormack 2011-08-12 10:23:59 +12:00
parent fc84823b81
commit 9b38eccf73
2 changed files with 50 additions and 50 deletions

View file

@ -126,7 +126,7 @@ sub add_update_matching_rule {
# match checks
my @mc_nums = sort map { /^mc_(\d+)_id/ ? int($1): () } $input->param;
foreach my $mc_num (@mp_nums) {
foreach my $mc_num (@mc_nums) {
# source components
my $src_components = [];
my @src_comp_nums = sort map { /^mc_${mc_num}_src_c_(\d+)_tag/ ? int($1): () } $input->param;

View file

@ -250,42 +250,42 @@ function CheckRuleForm(f) {
</li>
</ol>
[% FOREACH component IN matchpoint.components %]
<fieldset class="rows" id="mp_[% component.mp_num %]_c_[% component.comp_num %]">
<fieldset class="rows" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]">
<legend>Matchpoint components</legend>
<ol>
<li>
<label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_tag">Tag: </label>
<input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_tag"
name="mp_[% component.mp_num %]_c_[% component.comp_num %]_tag"
<label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag">Tag: </label>
<input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag"
name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_tag"
value="[% component.tag |html %]"
size="3" maxlength="3" />
</li>
<li>
<label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_subfields">Subfields: </label>
<input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_subfields"
name="mp_[% component.mp_num %]_c_[% component.comp_num %]_subfields"
<label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields">Subfields: </label>
<input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields"
name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_subfields"
value="[% component.subfields |html %]"
size="10" maxlength="40" />
</li>
<li>
<label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_offset">Offset: </label>
<input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_offset"
name="mp_[% component.mp_num %]_c_[% component.comp_num %]_offset"
<label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset">Offset: </label>
<input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset"
name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_offset"
value="[% component.offset |html %]"
size="5" maxlength="5" />
</li>
<li>
<label for="mp_[% component.mp_num %]_c_[% component.comp_num %]_length">Length: </label>
<input type="text" id="mp_[% component.mp_num %]_c_[% component.comp_num %]_length"
name="mp_[% component.mp_num %]_c_[% component.comp_num %]_length"
<label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length">Length: </label>
<input type="text" id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length"
name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_length"
value="[% component.length |html %]"
size="5" maxlength="5" />
</li>
[% FOREACH norm IN component.norms %]
<li id="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n_[% norm.norm_num %]">
<label for="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n__[% norm.norm_num %]_norm">Normalization rule: </label>
<input type="text" id="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n__[% norm.norm_num %]_norm"
name="mp_[% norm.mp_num %]_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm"
<li id="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]">
<label for="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm">Normalization rule: </label>
<input type="text" id="mp_[% norm.mp_num %]_c_[% component.comp_num %]_n__[% norm.norm_num %]_norm"
name="mp_[% matchpoint.mp_num %]_c_[% component.comp_num %]_n_[% norm.norm_num %]_norm"
value="[% norm.norm |html %]"
size="20" maxlength="50" />
</li>
@ -362,37 +362,37 @@ function CheckRuleForm(f) {
<ol>
<li>
<label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag">Tag: </label>
<input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag"
name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_tag"
<input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag"
name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_tag"
value="[% src_component.tag |html %]"
size="3" maxlength="3" />
</li>
<li>
<label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
<input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_subfields"
name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_subfields"
<label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields">Subfields: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields"
name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_subfields"
value="[% src_component.subfields |html %]"
size="10" maxlength="40" />
</li>
<li>
<label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
<input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_offset"
name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_offset"
<label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset">Offset: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset"
name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_offset"
value="[% src_component.offset |html %]"
size="5" maxlength="5" />
</li>
<li>
<label for="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
<input type="text" id="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_length"
name="mc_[% src_component.mc_num %]_src_c_[% src_component.comp_num %]_length"
<label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length">Length: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length"
name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_length"
value="[% src_component.length |html %]"
size="5" maxlength="5" />
</li>
[% FOREACH norm IN src_component.norms %]
<li id="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]">
<label for="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
<input type="text" id="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm"
name="mc_[% norm.mc_num %]_src_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm"
<li id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]">
<label for="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm"
name="mc_[% matchcheck.mc_num %]_src_c_[% src_component.comp_num %]_n_[% norm.norm_num %]_norm"
value="[% norm.norm |html %]"
size="20" maxlength="50" />
</li>
@ -401,42 +401,42 @@ function CheckRuleForm(f) {
</fieldset>
[% END %]
[% FOREACH tgt_component IN matchcheck.tgt_components %]
<fieldset class="rows" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
<fieldset class="rows" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]">
<legend>Target (database) record check field</legend>
<ol>
<li>
<label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
<input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag"
name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag"
<label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag">Tag: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag"
name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_tag"
value="[% tgt_component.tag |html %]"
size="3" maxlength="3" />
</li>
<li>
<label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
<input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields"
name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields"
<label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields">Subfields: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields"
name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_subfields"
value="[% tgt_component.subfields |html %]"
size="10" maxlength="40" />
</li>
<li>
<label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
<input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset"
name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset"
<label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset">Offset: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset"
name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_offset"
value="[% tgt_component.offset |html %]"
size="5" maxlength="5" />
</li>
<li>
<label for="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
<input type="text" id="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length"
name="mc_[% tgt_component.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length"
<label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length">Length: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length"
name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_length"
value="[% tgt_component.length |html %]"
size="5" maxlength="5" />
</li>
[% FOREACH norm IN tgt_component.norms %]
<li id="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]">
<label for="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
<input type="text" id="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm"
name="mc_[% norm.mc_num %]_tgt_c_[% norm.comp_num %]_n_[% norm.norm_num %]_norm"
<li id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]">
<label for="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm">Normalization rule: </label>
<input type="text" id="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm"
name="mc_[% matchcheck.mc_num %]_tgt_c_[% tgt_component.comp_num %]_n_[% norm.norm_num %]_norm"
value="[% norm.norm |html %]"
size="20" maxlength="50" />
</li>