Skip to content

find dynamic folder by canonical of duplicateOf element#16661

Merged
brandonkelly merged 3 commits into4.xfrom
bugfix/assets-field-dynamic-subpath-and-structures
Feb 11, 2025
Merged

find dynamic folder by canonical of duplicateOf element#16661
brandonkelly merged 3 commits into4.xfrom
bugfix/assets-field-dynamic-subpath-and-structures

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Feb 10, 2025

Description

When saving an asset with dynamic location, we need to use the canonical of the duplicateOf element.

Steps to reproduce:

  • on a clean v4 installation
  • create a local filesystem and a volume that uses it
  • create an assets field with “Restrict assets to a single location” checked; “Asset Location” set to {level == 1 ? slug : parent.slug}
  • create a structure section with an entry type containing that assets field
  • create an entry in that structure (level 1); use the “Upload files” button to upload an asset - at this point, everything works as expected
  • fully save the entry and observe an “Invalid subpath” exception being thrown

Related issues

#16220

Thanks for reporting, @olivierbon!

@i-just i-just requested a review from brandonkelly February 10, 2025 09:01
@brandonkelly brandonkelly merged commit 8a6331f into 4.x Feb 11, 2025
@brandonkelly brandonkelly deleted the bugfix/assets-field-dynamic-subpath-and-structures branch February 11, 2025 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants