Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ public function __invoke(string $submission_id): array {
}
}

// Sort the fields based on weight.
// Sort the sections inside a page based on section weight.
foreach ($newPages as $pageKey => $page) {
usort($newPages[$pageKey]['sections'], fn($a, $b) => $a['weight'] > $b['weight']);
}

// Sort the fields inside the sections based on weight.
foreach ($newPages as $pageKey => $page) {
foreach ($page['sections'] as $sectionKey => $section) {
usort($newPages[$pageKey]['sections'][$sectionKey]['fields'], function ($fieldA, $fieldB) {
Expand Down
14 changes: 8 additions & 6 deletions public/modules/custom/grants_metadata/src/AtvSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,14 @@ private static function extractValuesRecursively(array $items, array $keys, arra
if (in_array($key, $keys) && !in_array($key, $values)) {
$values[$key] = $item;
}
if (is_numeric($key) &&
!AtvSchema::numericKeys($item) &&
isset($item['ID']) &&
in_array($item['ID'], $keys) &&
!in_array($item['ID'], $values)) {
$values[$item['ID']] = $item['value'];
if (
is_numeric($key) &&
!AtvSchema::numericKeys($item) &&
isset($item['ID']) &&
in_array($item['ID'], $keys) &&
!in_array($item['ID'], $values)
) {
$values[$item['ID']] = htmlspecialchars_decode($item['value']);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ protected static function getArrayElementItemValue(
$itemValue = self::processNestedArrayItem($v, $itemPropertyDefinitions);
if (array_key_exists('value', $v)) {
$meta = isset($v['meta']) ? json_decode($v['meta'], TRUE) : NULL;
$retval[$key][$v['ID']] = InputmaskHandler::convertPossibleInputmaskValue(
$itemValue ?? $v['value'],
$meta ?? []
$value = InputmaskHandler::convertPossibleInputmaskValue(
$itemValue ?? $v['value'],
$meta ?? []
);

$retval[$key][$v['ID']] = htmlspecialchars_decode($value);
}
else {
$retval[$key][$key2] = $itemValue ?? $v;
Expand Down Expand Up @@ -210,7 +212,7 @@ protected static function extractItemValue(
if ($valueExtractorConfig) {
$valueExtractorService = self::getDynamicService($valueExtractorConfig['service']);
$method = $valueExtractorConfig['method'];
return $valueExtractorService->$method($item);
return htmlspecialchars_decode($valueExtractorService->$method($item));
}
return NULL;
}
Expand Down Expand Up @@ -239,7 +241,7 @@ protected static function extractSimpleItemValue(
if ($valueExtractorConfig) {
$valueExtractorService = self::getDynamicService($valueExtractorConfig['service']);
$method = $valueExtractorConfig['method'];
return $valueExtractorService->$method($item);
return htmlspecialchars_decode($valueExtractorService->$method($item));
}
}
return NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function extractToWebformData(DataDefinitionInterface $definition, array
$value2value = 0;
}
}
$temp[$value2['ID']] = $value2value;
$temp[$value2['ID']] = htmlspecialchars_decode($value2value);
}
$returnValueArray[$key] = $temp;
}
Expand Down