From 8b5f626e4f71fbcb5dcf74f593faca5404a92498 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 12 Oct 2024 00:05:37 +0100 Subject: [PATCH] Sort pads by key when converting ATDFs to TDFs --- .../Targets/TargetDescriptionFiles/Services/AtdfService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/scripts/Targets/TargetDescriptionFiles/Services/AtdfService.php b/build/scripts/Targets/TargetDescriptionFiles/Services/AtdfService.php index 15dc6c53..55899907 100644 --- a/build/scripts/Targets/TargetDescriptionFiles/Services/AtdfService.php +++ b/build/scripts/Targets/TargetDescriptionFiles/Services/AtdfService.php @@ -188,6 +188,11 @@ class AtdfService $tdf->pads = array_values($padsByKey); + // Sort pads by key + uasort($tdf->pads, function (Pad $padA, Pad $padB): bool { + return $padA->key > $padB->key; + }); + $variantElements = $this->getElementsFromXPath( 'variants/variant', $document