Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Assets field: Discard and use existing file issue

Đang mở
#15,556 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
laravel, php
Lĩnh vực
backend

Hướng nghiên cứu

Start at the assets field's upload/update handling and trace what happens when choosing “Discard and use existing file.” Reproduce the issue with an existing file and the reported assets-field setup, then inspect the related tests. Done means the existing file is shown correctly and the entry saves without the reported error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

assets fieldtypes
Bug description

I've noticed this problem on multiple projects recently.

If I have an assets field and try to upload an existing file then a message is displayed as expected:
Image

After choosing 'Discard and use existing file' this happens (note the generic icon and strange path / usually a PDF icon is shown):
Image

Then when clicking 'Save & Publish' this happens:
Image

How to reproduce
  1. Set up an assets field
  2. Update a file that already exists.
  3. Choose discard and use existing file
  4. Save the entry.
Logs

Environment
Environment
Laravel Version: 13.33.0
PHP Version: 8.4.24
Composer Version: 2.10.2
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: Europe/Dublin
Locale: en_IE

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: database
Session: file

Storage
J:\webdev\herd\mywebsite\public\storage: NOT LINKED

Livewire
Livewire: v4.4.6

Statamic
Addons: 4
License Key: Not set
Sites: 2 (mywebsite.ie, mywebsite.co.uk)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.34.1 PRO

Statamic Addons
alt-design/alt-cookies: 1.3.1-alpha
marcorieser/statamic-livewire: 5.3.4
spatie/statamic-responsive-images: 6.2.0
stuartcusackie/statamic-cache-requester: 1.3.2
Installation

Existing Laravel app

Additional details

Based on the error message, my best guess is that the root of the filesystem is not being handled correctly by the assets field, i.e. 'root' => 'public_downloads'

Ngôn ngữ chính
PHP
Star
4.9k
Fork
647
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
108

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statamic/cms

Tất cả issue của statamic/cms

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.