craftcms / craftcms/webhooks

afterDelete webhook not triggering for each site

Open
#61 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
84
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Description

I have an entry on a multi site craft instance. I am using custom propagation on the section ("Let each entry choose which sites it should be saved to"). When I delete an entry, I am expecting a webhook to fire once for each site that the entry has been propagated to. Instead, it's only firing for the site I am currently viewing in the admin.

My use case is headless Craft with a unique Netlify app for each site. When I delete an entry, I want to trigger SSG on all of the Netlify apps that had been rendering that entry.

Steps to reproduce
  1. Create a webhook like this:
    image

  2. Create and save an entry that has been propagated to multiple sites
    image

  3. Delete that entry
    image

  4. Check the webhook activity. I am expecting 2 delete rows, one for each site but only one is produced.
    image

Additional info
  • Craft CMS version: 3.7.13
  • Webhooks version: 2.4.1
  • PHP version: 7.4.3
  • Database driver & version: MySQL 8.0.23
  • Plugins & versions:

Screen Shot 2021-09-29 at 8 50 08 AM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the multi-site custom-propagation scenario described in the issue and inspect webhook activity after deleting the entry. Confirm that the deletion produces one webhook event for each site where the entry was propagated, rather than only for the currently viewed site.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.