Commit 01751b11 authored by greggles's avatar greggles Committed by greggles

Issue #2948022 by greggles, rocket.man, floown: Error : [] operator not...

Issue #2948022 by greggles, rocket.man, floown: Error : [] operator not supported for strings dans Drupal\comment_notify\Form\CommentNotifySettings
parent 2602dd4c
......@@ -5,7 +5,6 @@ namespace Drupal\comment_notify\Form;
use Drupal\Component\Utility\Html;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Drupal\field\Entity\FieldConfig;
use Drupal\node\Entity\NodeType;
use Drupal\user\Entity\User;
......@@ -34,13 +33,13 @@ class CommentNotifySettings extends ConfigFormBase {
// Only perform comment_notify for certain node types.
$enabled_types = $config->get('node_types');
$anonymous_problems = '';
$anonymous_problems = [];
$checkboxes = [];
foreach (NodeType::loadMultiple() as $type_id => $type) {
$checkboxes[$type_id] = Html::escape($type->label());
$default[] = $type_id;
// If they don't have the ability to leave contact info, then we make a report
// If they don't have the ability to leave contact info make a report.
$comment_field = FieldConfig::loadByName('node', $type_id, 'comment');
if (in_array($type_id, $enabled_types) && $comment_field && $comment_field->getSetting('anonymous') == COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
if (User::getAnonymousUser()->hasPermission('subscribe to comments')) {
......@@ -116,7 +115,7 @@ class CommentNotifySettings extends ConfigFormBase {
'#cols' => 80,
'#rows' => 15,
'#token_types' => [
'comment', 'node'
'comment', 'node',
],
'#element_validate' => ['token_element_validate'],
];
......@@ -133,7 +132,7 @@ class CommentNotifySettings extends ConfigFormBase {
'#cols' => 80,
'#rows' => 15,
'#token_types' => [
'comment', 'node'
'comment', 'node',
],
'#element_validate' => ['token_element_validate'],
];
......@@ -141,7 +140,7 @@ class CommentNotifySettings extends ConfigFormBase {
$form['token_help'] = [
'#theme' => 'token_tree_link',
'#token_types' => [
'comment', 'node'
'comment', 'node',
],
];
......
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