Issue #3514612: Added logger.
2 open threads
2 open threads
Closes #3514612
Merge request reports
Activity
109 109 * {@inheritdoc} 110 110 */ 111 111 public function offsetSet($name, $value): void { 112 // Check if the attribute name contains a space. 113 if (strpos($name, ' ') !== FALSE) { 114 \Drupal::logger('system')->warning('Invalid attribute name "@name" detected. Attribute names cannot contain spaces.', ['@name' => $name]); changed this line in version 6 of the diff
added 1 commit
- 6310adde - Tests confirm the value is being stored as an array instead of a normalized
85 protected $logger; 86 79 87 /** 80 88 * Constructs a \Drupal\Core\Template\Attribute object. 81 89 * 82 90 * @param array $attributes 83 91 * An associative array of key-value pairs to be converted to attributes. 92 * @param \Psr\Log\LoggerInterface $logger 93 * The logger. 84 94 */ 85 public function __construct($attributes = []) { 95 public function __construct($attributes = [], ?LoggerInterface $logger = NULL) { 86 96 foreach ($attributes as $name => $value) { 87 97 $this->offsetSet($name, $value); 88 98 } 99 $this->logger = $logger;
Please register or sign in to reply