Cannot save webhook when URL contains Twig tags

Abierto
#105 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
PHP
Estrellas
84
Forks
12
Merge medio
1 d 1 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de craftcms/webhooks

Todos los issues de craftcms/webhooks

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.