craftcms / craftcms/cms

Getting unknown property: craft\fields\Assets::siteId

Open
#18,813 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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. 😄

Image Image
Steps to reproduce

These are the steps I took

  1. Create a section with no Title field and a Default Title Format set
  2. Create an Image field
  3. Add it to the section
  4. Edit the section and upload an image
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.