Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
uw_fdsu_theme_resp
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_fdsu_theme_resp
Commits
4f6d5540
Commit
4f6d5540
authored
8 months ago
by
Eric Bremner
Committed by
Lily Yan
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-6945: fix logic for getting id in details/summary
parent
0e85fc9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!134
ISTWCMS-6945 Fix details label
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uw_fdsu_theme_resp.theme
+29
-1
29 additions, 1 deletion
uw_fdsu_theme_resp.theme
with
29 additions
and
1 deletion
uw_fdsu_theme_resp.theme
+
29
−
1
View file @
4f6d5540
...
...
@@ -736,8 +736,36 @@ function uw_fdsu_theme_resp_preprocess_details(&$variables) {
}
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
(
isset
(
$variables
[
'element'
][
0
][
'#attributes'
][
'data-drupal-selector'
]))
{
else
if
(
isset
(
$variables
[
'element'
][
0
][
'#attributes'
][
'data-drupal-selector'
]))
{
$variables
[
'form_field_id'
]
=
$variables
[
'element'
][
0
][
'#attributes'
][
'data-drupal-selector'
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment