Skip to content

Commit

Permalink
Respect predefined volume UUIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Oct 18, 2024
1 parent 882830a commit 24d8532
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Fixed errors that occurred when working with nested entries for a newly-added site. ([#15898](https://github.com/craftcms/cms/pull/15898))
- Fixed a bug where it wasn’t possible to scroll the section select modal when moving entries to a different section. ([#15900](https://github.com/craftcms/cms/issues/15900))
- Fixed a bug where query params in the format of `'<operator> <values>'` weren’t being parsed correctly.
- Fixed a bug there `craft\services\Entries::saveSection()` wasn’t respecting predefined UUID values on new sections.
- Fixed a bug `craft\services\Entries::saveSection()` and `craft\services\Volumes::saveVolume()` weren’t respecting predefined UUID values on new models.

## 5.4.8 - 2024-10-15

Expand Down
5 changes: 4 additions & 1 deletion src/services/Volumes.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ public function saveVolume(Volume $volume, bool $runValidation = true): bool
}

if ($isNewVolume) {
$volume->uid = StringHelper::UUID();
if (!$volume->uid) {
$volume->uid = StringHelper::UUID();
}

$volume->sortOrder = (new Query())
->from([Table::VOLUMES])
->max('[[sortOrder]]') + 1;
Expand Down

0 comments on commit 24d8532

Please sign in to comment.