Skip to content

Files/Images fields can contain unsaved temp images when output formatting is off #825

@Toutouwai

Description

@Toutouwai

Short description of the issue

Files uploaded to a Files or Images field get a temp status until the page is saved. These temp files may not ever get saved permanently to the page if Page Edit is abandoned before saving.

The issue is that these temp files can be included in the value of a Files/Images field when output formatting is off - either for the whole page or by getting the field value with getUnformatted().

In the screencast below the issue is demonstrated by dumping the count of an images field after some images are uploaded but the page is not saved.

images

Expected behavior

If temp files are not considered valid for the formatted value of a field they shouldn't be valid for the unformatted value either. If there needs to be a way to get the value of a field including temp files maybe this needs some dedicated option/argument so they are not included unintentionally.

Setup/Environment

  • ProcessWire version: 3.0.127

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions