From e9ea5fc3a5929058ec1efa4f127c80f9b45c01b1 Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Sun, 12 Jan 2014 05:54:35 +0100 Subject: [PATCH] Solve #22243 --- ACU/Defense.pm | 8 ++++---- hooks/subjects.pl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ACU/Defense.pm b/ACU/Defense.pm index d286567..b481a19 100644 --- a/ACU/Defense.pm +++ b/ACU/Defense.pm @@ -134,10 +134,10 @@ sub genIds ($;$) for my $group (@{ $self->{groups} }) { my $cur_gid; - if (! $group->{id} || grep { /^\Q$group->{id}\E$/ } @ids) + if (! $group->{id} || grep { $_ == $group->{id} } @ids) { do { - $cur_gid = "def".$def_i."g".$grp_i; + $cur_gid = "def_".$def_i."g".$grp_i; $grp_i += 1; } while (grep {$_ eq $cur_gid} @ids); $group->{id} = $cur_gid; @@ -151,7 +151,7 @@ sub genIds ($;$) for my $question (@{ $group->{questions_list} }) { my $cur_qid; - if (! $question->{id} || grep { /^\Q$question->{id}\E$/ } @ids) + if (! $question->{id} || grep { $_ == $question->{id} } @ids) { do { $cur_qid = $cur_gid."q".$qst_i; @@ -167,7 +167,7 @@ sub genIds ($;$) my $ans_i = 0; for my $answer (@{ $question->{answers} }) { - if (! $answer->{id} || grep { /^\Q$answer->{id}\E$/ } @ids) + if (! $answer->{id} || grep { $_ == $answer->{id} } @ids) { my $cur_aid; do { diff --git a/hooks/subjects.pl b/hooks/subjects.pl index 220272a..03ba63b 100755 --- a/hooks/subjects.pl +++ b/hooks/subjects.pl @@ -168,7 +168,7 @@ sub tag_defense # Generate questions and answer id my $defense = Defense->new(\$content); - $defense->genIds(); + $defense->genIds($defense_id); # Send data to intradata log INFO, "Attente d'un processus de publication...";