Update to Drupal 8.2.3. For more information, see https://www.drupal.org/project/drupal/releases/8.2.3

This commit is contained in:
Pantheon Automation 2016-11-16 12:26:40 -08:00 committed by Greg Anderson
parent 507b45a0ed
commit 0a95b8440e
19 changed files with 300 additions and 15 deletions

View file

@ -190,6 +190,7 @@ class MachineName extends Textfield {
$element['#attached']['library'][] = 'core/drupal.machine-name';
$options = [
'replace_pattern',
'replace_token',
'replace',
'maxlength',
'target',
@ -198,6 +199,11 @@ class MachineName extends Textfield {
'field_suffix',
'suffix',
];
/** @var \Drupal\Core\Access\CsrfTokenGenerator $token_generator */
$token_generator = \Drupal::service('csrf_token');
$element['#machine_name']['replace_token'] = $token_generator->get($element['#machine_name']['replace_pattern']);
$element['#attached']['drupalSettings']['machineName']['#' . $source['#id']] = array_intersect_key($element['#machine_name'], array_flip($options));
$element['#attached']['drupalSettings']['langcode'] = $language->getId();