Commit 745845de authored by dpi's avatar dpi

Added missing messages counter to courier system setting form.

Removed redundant #open declaration on courier system setting form.
Removed non-existant validation function for template collection list element.
parent 005b32ee
......@@ -11,6 +11,7 @@ use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Render\Element;
use Drupal\courier\Entity\CourierContext;
use Drupal\courier\Entity\TemplateCollection;
use Drupal\courier\Service\CourierManagerInterface;
......@@ -183,7 +184,6 @@ class Settings extends ConfigFormBase {
$form['add_missing'] = [
'#type' => 'details',
'#title' => $this->t('Add missing messages'),
'#open' => TRUE, // todo change false
];
$form['add_missing']['table'] = [
'#type' => 'table',
......@@ -224,6 +224,9 @@ class Settings extends ConfigFormBase {
}
$form['add_missing']['#open'] = !count($form['list']['#items']);
if ($count = count(Element::children($form['add_missing']['table']))) {
$form['add_missing']['#title'] = $this->t('Add missing messages (@count)', ['@count' => $count]);
}
return $form;
}
......
......@@ -32,9 +32,6 @@ class TemplateCollectionList extends FormElement {
'#process' => array(
[$class, 'processTemplateCollectionList'],
),
'#element_validate' => [
[$class, 'validateTemplateCollectionList'],
],
// Items can be any non-zero key. Forms will return this key for keys of
// checkboxes in $form_element['checkboxes'].
'#items' => [],
......
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