Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/craftcms/cms into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Nov 27, 2024
2 parents 7279de4 + 2ad3709 commit ce672fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Fixed an error that could occur when duplicating an element with an Assets field that had a dynamic subpath. ([#16214](https://github.com/craftcms/cms/issues/16214))
- Fixed a bug where element slideouts had Save buttons even if the user didn’t have permission to save the element. ([#16205](https://github.com/craftcms/cms/pull/16205))
- Fixed a bug where pagination wasn’t working properly on the Entry Types index page when searching. ([#16204](https://github.com/craftcms/cms/issues/16204))

Expand Down
3 changes: 3 additions & 0 deletions src/fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ private function _findFolder(string $sourceKey, ?string $subpath, ?ElementInterf
if ($isDynamic) {
// Prepare the path by parsing tokens and normalizing slashes.
try {
if ($element?->duplicateOf) {
$element = $element->duplicateOf;
}
$renderedSubpath = Craft::$app->getView()->renderObjectTemplate($subpath, $element);
} catch (InvalidConfigException|RuntimeError $e) {
throw new InvalidSubpathException($subpath, null, 0, $e);
Expand Down

0 comments on commit ce672fb

Please sign in to comment.