What happened?
Description
Unable to duplicate entry with Asset field inside Martix Block
Steps to reproduce
- Create Section with type
Structure
- Add entry on the third level of structure
- For the third-level entry add
Matrix Field with Asset Field
- Set
Asset Location to {owner.parent.parent.slug}
- Create entry on the third-level of structure
- Add asset to Matrix Block and save Entry.
- Click on the
Save as New Entry button
Expected behavior
New entry created from existing
Actual behavior
Exception: An error occurred when duplicating the element.
HTTP 500 – Internal Server Error – yii\web\ServerErrorHttpException
An error occurred when duplicating the element.
Caused by: Invalid subpath – craft\errors\InvalidSubpathException
The Asset field’s Asset Location setting has an invalid subpath (“{owner.parent.parent.slug}”).
in /craft/vendor/craftcms/cms/src/fields/Assets.php at line 1072
Caused by: Invalid subpath – craft\errors\InvalidSubpathException
Could not resolve the subpath “{owner.parent.parent.slug}”.
in /craft/vendor/craftcms/cms/src/fields/Assets.php at line 951

Craft CMS version
Craft Pro from 4.10.6 to 4.13.3
PHP version
8.1.20
Operating system and version
Docker image craftcms/php-fpm:8.1
Database type and version
PostgreSQL 15.5
Image driver and version
GD 8.1.20
Installed plugins and versions
- Amazon S3 2.2.1
- Audit 3.0.3
- CKEditor 3.8.3
- Imager X 4.4.1
- Logs 4.0.1
- Read-only Field 2.0.1
- Schedule 0.6.2
- Shortcodes 3.0.0
- Smith 2.0.1
- Super Table 3.0.14
- Translations 4.0.2
What happened?
Description
Unable to duplicate entry with Asset field inside Martix Block
Steps to reproduce
StructureMatrix FieldwithAsset FieldAsset Locationto{owner.parent.parent.slug}Save as New EntrybuttonExpected behavior
New entry created from existing
Actual behavior
Exception: An error occurred when duplicating the element.
Craft CMS version
Craft Pro from 4.10.6 to 4.13.3
PHP version
8.1.20
Operating system and version
Docker image craftcms/php-fpm:8.1
Database type and version
PostgreSQL 15.5
Image driver and version
GD 8.1.20
Installed plugins and versions