craftcms / craftcms/webhooks

Webhook data returns wrong siteId

Open
#65 6 comments 1 reaction 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

We use craft CMS as a headless CMS and the GraphQL api to get the content. With the Webhook plugin we send webhooks to the application to clear the cache and get the new content from Craft CMS. When a single type is saved the webhook plugins sends a request with the wrong siteId. We have different sites with the same single names.

Steps to reproduce
  1. Create multiple sites with the same single handel (Home)
  2. Save the single entry
  3. Webhook plugins sends a request with another sites id

Saved from default site
Screenshot 2022-03-04 at 15 22 49

Webhook data
Screenshot 2022-03-04 at 15 21 38

GraphQL data
Screenshot 2022-03-04 at 15 21 45

Additional info
  • Craft CMS version: 3.7.24
  • Webhooks version: 2.4.1
  • PHP version: 8.0.15
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions:
Screenshot 2022-03-04 at 15 10 38

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

No source files or tests are named. Reproduce the case with multiple sites sharing the same single handle, then compare the saved site's ID with the webhook and GraphQL data; it is done when the webhook reports the ID of the site where the single was saved.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.