Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-1209: Ensure that Link field exist. #914

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions oe_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,8 @@ function oe_theme_preprocess_paragraph__oe_text_feature_media(array &$variables)
$variables['variant'] = $variant === 'default' ? 'left_simple' : $variant;
}

// Add link field.
if (!$paragraph->get('field_oe_link')->isEmpty()) {
// Link field doesn't exist in oe_paragraphs <= 1.8.0, so ensure it exists.
if ($paragraph->hasField('field_oe_link') && !$paragraph->get('field_oe_link')->isEmpty()) {
$link_field = $paragraph->get('field_oe_link')->first();
$variables['link'] = [
'path' => $link_field->getUrl()->toString(),
Expand Down