Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: An error occurred when duplicating the element. #16214

Closed
duxabilii opened this issue Nov 26, 2024 · 1 comment
Closed

[4.x]: An error occurred when duplicating the element. #16214

duxabilii opened this issue Nov 26, 2024 · 1 comment
Assignees

Comments

@duxabilii
Copy link

What happened?

Description

Unable to duplicate entry with Asset field inside Martix Block

Steps to reproduce

  1. Create Section with type Structure
  2. Add entry on the third level of structure
  3. For the third-level entry add Matrix Field with Asset Field
  4. Set Asset Location to {owner.parent.parent.slug}
  5. Create entry on the third-level of structure
  6. Add asset to Matrix Block and save Entry.
  7. 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

Image

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
@brandonkelly
Copy link
Member

Thanks for reporting that! Craft 5.5.4 is out with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants