Cannot save webhook when URL contains Twig tags

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

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
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend

Hướng nghiên cứu

Start in the Control Panel at Webhooks > New Webhook and reproduce the save failure with the Twig-templated URL shown in the issue. Trace the URL validation used by the webhook form and add or update regression coverage for templated URLs; done means creating and editing the webhook succeeds without an “Invalid URL” error.

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

Mô tả

bug repo:webhooks
Description

When creating or editing a webhook in the Control Panel with a Twig-templated URL, saving the form fails with the validation error "Invalid URL".

Steps to reproduce
  1. In the Craft Control Panel, go to Webhooks > New Webhook (or edit an existing one).
  2. Set Sender Class to craft\elements\Entry and Event Name to afterSave.
  3. Set the URL to:
    {{ siteUrl }}purge/{{ event.sender.uri }}
  4. Click Save.
Expected Result

The webhook is saved successfully.

Actual Result

Form saving fails with the error:
Invalid URL.

Additional info
  • Craft version: 5.x
  • PHP version: 8.2+
  • Database driver & version: MySQL 8.0.46
  • Plugins & versions: 3.3.0
Ngôn ngữ chính
PHP
Star
84
Fork
12
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
5

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

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 craftcms/webhooks

Tất cả issue của craftcms/webhooks

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.