Getting unknown property: craft\fields\Assets::siteId
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
When I try to upload an image to an asset field I get the error:
Getting unknown property: craft\fields\Assets::siteId
Based on the stack trace it seems to be a draft issue, but what do I know. 😄
Steps to reproduce
These are the steps I took
- Create a section with no
Titlefield and a Default Title Format set - Create an Image field
- Add it to the section
- Edit the section and upload an image
- Save
Additional info
- Craft version: 5.8.13.1
- PHP version: 8.4.8
- Database driver & version: MariaDB 10.5.9
- Plugins & versions:
CKEditor | 4.9.0
Contact Form | 3.1.0
Contact Form Extensions | 5.0.0
Datastar | 1.0.0-RC.4
SEO | 5.0.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the upload flow described in the issue: use a section without a Title field but with a Default Title Format, add an Image field, and save an uploaded image. Review the attached stack trace and the asset-field code path to identify why siteId is accessed on craft\fields\Assets. Done means the save completes without the unknown-property error and the regression is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100