Live Preview on new entries breaks tags that rely on an entry id

Đang mở
#15,734 2 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/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, full-stack

Hướng nghiên cứu

Start by tracing the Live Preview create flow introduced in #15648 and how the listed tags resolve entry context and structure; inspect the create preview route to understand why Pop out returns a 404. Reproduce with a new entry in a structured collection using the provided collection:next template, then check each listed tag and descendants()/in() behavior. Done means those tags handle unsaved entries without errors or unrelated results, and Pop out works from the create form.

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

Mô tả

live preview
Bug description

Since #15648 (6.38.0) you can open Live Preview while creating an entry.

That entry isn't saved yet, so it has no id and isn't in the structure tree. Some core tags expect both and blow up in the preview:

  • collection:next / previous / older / newer: "Call to a member function collection() on null"
  • children, and nav with from="..." on structured collections: "Call to a member function pages() on null"
  • locales:count with all="true": "Call to a member function blueprint() on null"

Also:

  • descendants() and in() on the new entry return unrelated entries, because they query for entries without an origin.
  • Pop out on the create form opens a 404, because the create preview route is POST-only.
How to reproduce
  1. Add {{ collection:next }}{{ title }}{{ /collection:next }} to a template of a structured collection.
  2. Create Entry -> Live Preview.
  3. 💥
Logs

Environment
6.38.0
Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Ngôn ngữ chính
PHP
Star
4.9k
Fork
647
Merge trung bình
1 ngày 45 phút
Pull request đã merge (30 ngày)
221

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.