diff --git a/core/includes/theme.inc b/core/includes/theme.inc index c63f679..0b0330d 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2372,9 +2372,11 @@ function template_preprocess_install_page(&$variables) { * - elements: An associative array containing properties of the region. */ function template_preprocess_region(&$variables) { + $elements = $variables['elements']; + // Create the $content variable that templates expect. - $variables['content'] = $variables['elements']['#children']; - $variables['region'] = $variables['elements']['#region']; + $variables['content'] = $elements['#children']; + $variables['region'] = $elements['#region']; $variables['attributes']['class'][] = 'region'; $variables['attributes']['class'][] = drupal_html_class('region-' . $variables['region']); @@ -2415,18 +2417,22 @@ function template_preprocess_field(&$variables, $hook) { $delta++; } + if ( isset($element['#items']) ) { + if( $element['#items']->getFieldDefinition()->getCardinality() != "1"){ + $variables['multiple'] = TRUE; + } + } + // Add default CSS classes. Since there can be many fields rendered on a page, // save some overhead by calling strtr() directly instead of // drupal_html_class(). - $variables['entity_type_css'] = strtr($element['#entity_type'], '_', '-'); - $variables['field_name_css'] = strtr($element['#field_name'], '_', '-'); - $variables['field_type_css'] = strtr($element['#field_type'], '_', '-'); + $variables['entity_type'] = strtr($element['#entity_type'], '_', '-'); + $variables['field_name'] = strtr($element['#field_name'], '_', '-'); + $variables['field_type'] = strtr($element['#field_type'], '_', '-'); $variables['attributes']['class'] = array( - 'field', - 'field-' . $variables['entity_type_css'] . '--' . $variables['field_name_css'], - 'field-name-' . $variables['field_name_css'], - 'field-type-' . $variables['field_type_css'], - 'field-label-' . $element['#label_display'], + 'field-name--' . $variables['field_name'], + 'field-type--' . $variables['field_type'], + 'field-label--' . $element['#label_display'], ); // Add a "clearfix" class to the wrapper since we float the label and the // field items in field.module.css if the label is inline. diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php index dd6d13e..0bd1721 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldUITest.php @@ -340,7 +340,7 @@ function testNodeDisplay() { $output = '1'; } - $elements = $this->xpath('//div[text()="' . $output . '"]'); + $elements = $this->xpath('//div[text()=:output]', array(':output' => $output)); $this->assertEqual(count($elements), 1, 'Correct options found.'); } } diff --git a/core/modules/system/templates/field.html.twig b/core/modules/system/templates/field.html.twig index a0d527a..87bcf46 100644 --- a/core/modules/system/templates/field.html.twig +++ b/core/modules/system/templates/field.html.twig @@ -29,13 +29,41 @@ * @ingroup themeable */ #} -