Skip to content
Snippets Groups Projects
Commit 10a88f3b authored by Eric Sembrat's avatar Eric Sembrat Committed by Stefan Auditor
Browse files

Issue #3104635 by Surabhi Gokte, Webbeh: README.txt or README.md file is missing

parent 989d773f
No related branches found
No related tags found
No related merge requests found
Webhooks
INTRODUCTION
------------
This module acts as both a Webhook dispatcher and receiver. For dispatching,
you can configure any amount of Webhooks that act on various events like entity
create, update, delete and others.
For receiving, the module captures the request and provides the payload to
others with a generic webhook event.
Configuration entity Webhook implementations are easily deployable.
REQUIREMENTS
------------
This module requires the following module:
* Serialization (https://www.drupal.org/docs/8/core/modules/serialization)
INSTALLATION
------------
Install as you would normally install a contributed Drupal module.
For further information, visit:
https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules
CONFIGURATION
-------------
The module has no menu or modifiable settings. There is no configuration.
<?php
namespace Drupal\webhooks\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Provides automated tests for the webhooks module.
*/
class WebhookTest extends WebTestBase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => "webhooks Webhook's controller functionality",
'description' => 'Test Unit for module webhooks and controller Webhook.',
'group' => 'Other',
);
}
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
}
/**
* Tests webhooks functionality.
*/
public function testWebhook() {
// Check that the basic functions of module webhooks.
$this->assertEquals(TRUE, TRUE, 'Test Unit Generated via Drupal Console.');
}
}
diff --git a/src/Entity/WebhookConfig.php b/src/Entity/WebhookConfig.php
index 2e28514..659d808 100644
--- a/src/Entity/WebhookConfig.php
+++ b/src/Entity/WebhookConfig.php
@@ -243,7 +243,9 @@ class WebhookConfig extends ConfigEntityBase implements WebhookConfigInterface {
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
- $this->events = serialize($this->events);
+ $this->events = serialize(
+ array_filter($this->events)
+ );
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment