From bd6e68c5ba1c9ff04d8e02b8336e3a36e35515e7 Mon Sep 17 00:00:00 2001 From: Laetitia Fesselier Date: Tue, 22 Dec 2020 12:53:35 -0500 Subject: [PATCH] [Conflict Resolver] Multiselect values (#7239) Change the display of multi select values from "value1{@}value2" to "value1, value2" in the Correct Answer frontend column of Unresolved and Resolved Conflicts. Backend values should remain unchanged. Resolves #7217 --- .../conflict_resolver/php/conflict_resolver.class.inc | 6 +++++- .../conflict_resolver/php/resolved_conflicts.class.inc | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/conflict_resolver/php/conflict_resolver.class.inc b/modules/conflict_resolver/php/conflict_resolver.class.inc index c1c04af41df..13f0997b321 100644 --- a/modules/conflict_resolver/php/conflict_resolver.class.inc +++ b/modules/conflict_resolver/php/conflict_resolver.class.inc @@ -406,8 +406,12 @@ class Conflict_Resolver extends \NDB_Menu_Filter_Form $unanonymized = parent::toArray(); $data = array(); + $value1Index = array_search('Value1', $unanonymized['Headers']); + $value2Index = array_search('Value2', $unanonymized['Headers']); foreach ($unanonymized['Data'] as &$row) { - $data[] = $row; + $row[$value1Index] = str_replace('{@}', ', ', $row[$value1Index]); + $row[$value2Index] = str_replace('{@}', ', ', $row[$value2Index]); + $data[] = $row; } return array( 'Headers' => $unanonymized['Headers'], diff --git a/modules/conflict_resolver/php/resolved_conflicts.class.inc b/modules/conflict_resolver/php/resolved_conflicts.class.inc index cfbefbcf48b..f03c812ef60 100644 --- a/modules/conflict_resolver/php/resolved_conflicts.class.inc +++ b/modules/conflict_resolver/php/resolved_conflicts.class.inc @@ -252,7 +252,16 @@ class Resolved_Conflicts extends \NDB_Menu_Filter $unanonymized = parent::toArray(); $data = array(); + $correctAnswerIndex = array_search( + 'Correct Answer', + $unanonymized['Headers'] + ); foreach ($unanonymized['Data'] as &$row) { + $row[$correctAnswerIndex] = str_replace( + '{@}', + ', ', + $row[$correctAnswerIndex] + ); $data[] = $row; } return array(