Skip to content

[4.3.7]: Asset Location setting has an invalid subpath (“{owner.id}”) #12624

Closed
@arifje

Description

@arifje

What happened?

Updated to 4.3.7 yesterday, getting the following error when saving existing entries:

Screenshot 2023-02-05 at 15 45 51

We've been using the {owner.id} as a subfolder for a long time like this;

Screenshot 2023-02-05 at 15 39 35

Update: it only seems to happen on entries that are ENABLED. When I disable an entry, the error is gone. When it's enabled, it's there again.

Craft 4.3.7
PHP 8.1.13
MariaDB
Imagick 3.7.0 (ImageMagick 6.9.10-23)

Activity

self-assigned this
on Feb 5, 2023
added a commit that references this issue on Feb 5, 2023
4eb20f5
brandonkelly

brandonkelly commented on Feb 5, 2023

@brandonkelly
Member

Thanks for reporting! Just released Craft 3.7.64.1 and 4.3.7.1 with a fix.

It’s actually a bit of a fluke that this was ever working in the first place though. You only need that owner bit in there for Assets fields that are nested within Matrix/Super Table/Neo fields, where owner references the block’s “owner element” (the entry).

So even with the fix, you’d be better off changing that subpath setting to just /{id}/ or {id} (leading/trailing slashes are optional and meaningless).

arifje

arifje commented on Feb 6, 2023

@arifje
Author

Thanks!

arifje

arifje commented on Jun 12, 2025

@arifje
Author

Back again!

Is it possible this has changed on CraftCMS 5? I am setting up a new site in Craft 5 and getting this error when saving a Asset field (thumbnails) when saving the entry.

The Thumbnails field’s Asset Location setting has an invalid subpath (“{owner.id}”).

Asset location path:
Image

It does work on an asset field that is a child of a Matrix field, but not on the an asset field, which is a direct child of the entry.

{id} works, but this does not seem to be the real entry ID, which we need to store the related assets.

i-just

i-just commented on Jun 12, 2025

@i-just
Contributor

Hi, thanks for getting in touch!

It does work on an asset field that is a child of a Matrix field, but not on the an asset field, which is a direct child of the entry.

When using dynamic subfolder paths, you should consider using separate fields for nested and non-nested elements’ field layouts. See the warning in this section of the docs.

{id} works, but this does not seem to be the real entry ID, which we need to store the related assets.

When this field is part of, e.g. a section’s entry (root entry), the {id} will refer to that root entry’s ID. When the field is part of a matrix, it’ll refer to the nested entry’s (formerly called matrix block) ID.

arifje

arifje commented on Jun 12, 2025

@arifje
Author

Ah check, so I can use {owner.id} for fields in Matrix fields, and {id} for standalone fields in the entry.
Thanks!

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @brandonkelly@arifje@i-just

      Issue actions

        [4.3.7]: Asset Location setting has an invalid subpath (“{owner.id}”) · Issue #12624 · craftcms/cms