Cannot save webhook when URL contains Twig tags

オープン
#105 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
PHP
スター
84
フォーク
12
平均マージ
1日 1時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

craftcms/webhooks のほかの issue

craftcms/webhooks の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。