craftcms / craftcms/cms

Asset field values should be explicitly assigned.

Open
#3,567 0 comments 0 reactions 1 assignee View on GitHub

@andris-sevcenko is already working on this.

Since Dec 17, 2018.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Currently, asset fields populate themselves with uploaded data if there's a matching entry in the $_FILES array when saving an element. However, field values should be explicitly assigned by setting them on the element, instead of relying on the fields to grab the data from the $_FILES array.

Having it the way it is now can lead to unexpected behavior where asset fields get populated by circumstance when that is not desired.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.