Skip to content

Commit

Permalink
Fixed #15857
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Oct 8, 2024
1 parent 512c2ec commit 165b8a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed errors that could occur if a custom source or field condition referenced a custom field whose type had changed. ([#15850](https://github.com/craftcms/cms/issues/15850))
- Fixed a bug where disclosure menus weren’t sticking to their trigger element as it was scrolled, if it was within a slideout or other inline-scrollable container. ([#15852](https://github.com/craftcms/cms/issues/15852))
- Fixed a bug where the default backup command for MySQL was exporting triggers twice. ([#15854](https://github.com/craftcms/cms/pull/15854))
- Fixed a bug where Multi-select fields were saving the selected options in the user-selected order rather than the field-defined order. ([#15857](https://github.com/craftcms/cms/issues/15857))
- Fixed a missing authorization vulnerability.

## 4.12.5 - 2024-09-27
Expand Down
8 changes: 5 additions & 3 deletions src/fields/BaseOptionsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,11 @@ public function serializeValue(mixed $value, ?ElementInterface $element = null):
{
if ($value instanceof MultiOptionsFieldData) {
$serialized = [];
foreach ($value as $selectedValue) {
/** @var OptionData $selectedValue */
$serialized[] = $selectedValue->value;
// Build the list out in the original option order
foreach ($value->getOptions() as $option) {
if ($option->selected) {
$serialized[] = $option->value;
}
}
return $serialized;
}
Expand Down

0 comments on commit 165b8a0

Please sign in to comment.