Skip to content

Commit

Permalink
Update src/lib/Repository/EventSubscriber/NameSchemaSubscriber.php
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Longosz <[email protected]>
  • Loading branch information
kisztof and alongosz committed Sep 14, 2023
1 parent f80e64c commit 2ac94ed
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/lib/Repository/EventSubscriber/NameSchemaSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,17 @@ private function getValues(
continue;
}

$field = $fieldMap ? $fieldMap[$identifier][$languageCode] ?? '' : $content->getFieldValue(
$identifier,
$languageCode
);
if (!empty($fieldMap)) {
$fieldValue = $fieldMap[$identifier][$languageCode] ?? null;
} else {
$fieldValue = $content !== null ? $content->getFieldValue($identifier, $languageCode) : null;
}

$field = $field ? $persistenceFieldType->getName(
$field,
$tokenValues[$identifier] = $fieldValue !== null ? $persistenceFieldType->getName(
$fieldValue,
$fieldDefinition,
$languageCode
) : '';

$tokenValues[$identifier] = $field;
}

return $tokenValues;
Expand Down

0 comments on commit 2ac94ed

Please sign in to comment.