Skip to content

Commit

Permalink
Merge pull request #30 from lehors/sort-licenses
Browse files Browse the repository at this point in the history
Sort the licenses in dropdown menu
  • Loading branch information
lehors authored Oct 17, 2024
2 parents 890fdfc + 6de72c5 commit e8ab4c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions web/modules/mof/src/Form/ModelForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ final protected function buildDataList(int|string $type): array {
if ($type === 'code' || (is_int($type) && $this->componentManager->getComponent($type)->contentType === 'code')) {
$licenses = array_unique([...$licenses, ...$this->licenseHandler->getOsiApproved()], SORT_REGULAR);
}
uasort($licenses, fn($a, $b) => strcasecmp($a['name'],$b['name']));

foreach ($licenses as $license) {
$datalist['licenses'][] = [
Expand Down

0 comments on commit e8ab4c0

Please sign in to comment.