Download the PHP package as-cornell/as_webhook_entities without Composer
On this page you can find all versions of the php package as-cornell/as_webhook_entities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download as-cornell/as_webhook_entities
More information about as-cornell/as_webhook_entities
Files in as-cornell/as_webhook_entities
Package as_webhook_entities
Short Description Manage Drupal entities like people records and articles via webhook notifications.
License GPL-3.0-or-later
Homepage https://communications.as.cornell.edu
Informations about the package as_webhook_entities
AS WEBHOOK ENTITIES (as_webhook_entities)
INTRODUCTION

Receives webhook notifications from remote systems and creates, updates, or deletes local Drupal entities (people, articles, taxonomy terms) accordingly. Uses a Strategy pattern with per-type handler classes for maintainability and extensibility.
REQUIREMENTS
System Requirements
- Drupal 9.5+ or Drupal 10+
- PHP 8.0+
INSTALLATION
New Installation
-
Enable the module:
-
Configure the module settings:
- Navigate to
/admin/config/as_webhook_entities/settings - Configure the authorization token and cron trigger settings
- Navigate to
-
Verify the queue worker is registered:
You should see
webhook_entities_processorin the list.
Upgrading from 1.x to 2.0
-
Pull the updated code and clear cache:
- Verify the module is functioning:
CONFIGURATION
- Settings UI:
/admin/config/as_webhook_entities/settings - Runs on cron (
webhook_entities_processorqueue, 30 seconds per cron run) - Cron can be triggered on receipt via the
crontriggersetting - Logs create/update/delete operations as
as_webhook_entities
ARCHITECTURE
Strategy Pattern (v2.0+)
Per-type field logic is handled by dedicated handler classes. WebhookCrudManager is a thin dispatcher that handles shared logic (title, status, departments/domain access, save) and delegates to the appropriate handler.
Supported Entity Types
| Payload type | Drupal entity | Handler |
|---|---|---|
person |
node:person |
PersonWebhookHandler |
article |
node:article |
ArticleWebhookHandler |
media_report_entry |
node:media_report_entry |
MediaReportEntryWebhookHandler |
media_report_person |
node:person |
MediaReportPersonWebhookHandler |
term |
taxonomy_term |
TermWebhookHandler |
Adding a New Entity Type
- Create a class in
src/WebhookHandler/extendingWebhookHandlerBase - Implement
getType(),applyCreateFields(), andapplyUpdateFields() - Register it in
WebhookCrudManager::__construct():
MAINTAINERS
Current maintainers for Drupal 10:
- Mark Wilson (markewilson)
TROUBLESHOOTING
Queue items not processing
-
Check the queue size:
-
Run the queue manually:
- Check recent logs:
Entity not created or updated
-
Verify the UUID lookup is finding the entity:
-
Push a test payload directly into the queue:
- Check for field errors — if a field in the payload doesn't exist on the destination bundle, the update will fail. Verify field existence:
CHANGELOG
2.0
- Refactored
WebhookCrudManagerusing the Strategy pattern — per-type field logic extracted into dedicated handler classes undersrc/WebhookHandler/ - Added
WebhookHandlerInterfaceandWebhookHandlerBasewith shared entity lookup helpers (lookupTermTidsByName,lookupTermTidsByProperty,lookupNodeNidsByRemoteUuid) - Added handler classes:
PersonWebhookHandler,ArticleWebhookHandler,MediaReportEntryWebhookHandler,MediaReportPersonWebhookHandler,TermWebhookHandler WebhookCrudManageris now a thin dispatcher; shared logic (departments/domain access, node creation, save) remains centralised- Simplified
WebhookUuidLookup::findEntity()to a type-keyed lookup map, eliminating duplicate if blocks - Cleaned up
WebhookEntitiesQueue: removed redundant UUID ternary, extracteddispatchCreate()helper, removed dead code - Fixed two bugs in
MediaReportEntryWebhookHandler:field_news_datewas incorrectly read fromfield_outlet_name, andfield_media_report_public_cathad a variable typo - Moved
field_portrait_image_altout of shared update logic intoArticleWebhookHandlerwhere it belongs