Commit a222ee29 authored by dpi's avatar dpi

Do not replace existing templates when adding all available channel types to a collection.

parent 35546164
......@@ -52,6 +52,7 @@ class CourierManager implements CourierManagerInterface {
*/
public function addTemplates(TemplateCollectionInterface &$template_collection) {
foreach (array_keys($this->identityChannelManager->getChannels()) as $entity_type_id) {
if (!$template_collection->getTemplate($entity_type_id)) {
/** @var $template \Drupal\courier\ChannelInterface */
$template = $this->entityManager
->getStorage($entity_type_id)
......@@ -59,6 +60,7 @@ class CourierManager implements CourierManagerInterface {
$template_collection->setTemplate($template);
}
}
}
/**
* {@inheritdoc}
......
......@@ -20,6 +20,8 @@ interface CourierManagerInterface {
/**
* Adds all available channel types to the template collection.
*
* Does not replace templates for existing channel types.
*
* @param \Drupal\courier\TemplateCollectionInterface $template_collection
* A template collection entity.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment