Skip to content

Commit

Permalink
Use isset to check if variable exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
juho-lehmonen committed Mar 20, 2023
1 parent ff2fa1e commit 2fb98d7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function helfi_rekry_content_preprocess_field(&$variables) {
];

// Use span instead of div for inline fields.
if ($variables['field_name'] && in_array($variables['field_name'], $inlineFields)) {
if (isset($variables['field_name']) && in_array($variables['field_name'], $inlineFields)) {
$variables['original_language_inline'] = TRUE;
}

Expand All @@ -231,7 +231,7 @@ function helfi_rekry_content_preprocess_field(&$variables) {
'field_organization_name',
];

if ($variables['field_name'] && in_array($variables['field_name'], $wrappedFields)) {
if (isset($variables['field_name']) && in_array($variables['field_name'], $wrappedFields)) {
foreach ($variables['items'] as $item) {
$item['attributes']->setAttribute('lang', 'fi');
}
Expand Down

0 comments on commit 2fb98d7

Please sign in to comment.