Skip to content
Snippets Groups Projects
Commit c83e6788 authored by Lily Yan's avatar Lily Yan
Browse files

Merge branch 'feature/ISTWCMS-6945-ebremner-fix-details-label' into '1.1.x'

ISTWCMS-6945 Fix details label

See merge request !134
parents 0e85fc9e 4f6d5540
No related branches found
No related tags found
1 merge request!134ISTWCMS-6945 Fix details label
...@@ -736,8 +736,36 @@ function uw_fdsu_theme_resp_preprocess_details(&$variables) { ...@@ -736,8 +736,36 @@ function uw_fdsu_theme_resp_preprocess_details(&$variables) {
} }
else { else {
// If there is an element, process it.
if (isset($variables['element'])) {
// Step through each of the indexes and ensure that we
// have an actual element, which means it will be an array.
foreach ($variables['element'] as $index => $value) {
// If this is an array, then we have an element to look at.
if (is_array($value)) {
// One more check to ensure that we have an element.
if (isset($variables['element'][$index]['#type'])) {
// Get the id based on where the id is stored, either it
// is by itself or within the attributes.
if (isset($variables['element'][$index]['#id'])) {
$variables['form_field_id'] = $variables['element'][$index]['#id'];
}
elseif (isset($variables['element'][$index]['#attributes']['id'])) {
$variables['form_field_id'] = $variables['element'][$index]['#attributes']['id'];
}
// Break out of the loop to save computational time.
break;
}
}
}
}
// If there is a data drupal selector use it for form field id. // If there is a data drupal selector use it for form field id.
if (isset($variables['element'][0]['#attributes']['data-drupal-selector'])) { elseif (isset($variables['element'][0]['#attributes']['data-drupal-selector'])) {
$variables['form_field_id'] = $variables['element'][0]['#attributes']['data-drupal-selector']; $variables['form_field_id'] = $variables['element'][0]['#attributes']['data-drupal-selector'];
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment