Browse Source

wrapping string in array for case where there's no rdf mapping

pull/768/head
dannylamb 6 years ago
parent
commit
907581422f
  1. 3
      src/Plugin/ContextReaction/JsonldTypeAlterReaction.php

3
src/Plugin/ContextReaction/JsonldTypeAlterReaction.php

@ -44,6 +44,9 @@ class JsonldTypeAlterReaction extends NormalizerAlterReaction {
// Search for the entity in the graph.
foreach ($normalized['@graph'] as &$elem) {
if (!is_array($elem['@type'])) {
$elem['@type'] = [$elem['@type']];
}
if ($elem['@id'] === $this->getSubjectUrl($entity)) {
foreach ($entity->get($config['source_field'])->getValue() as $type) {
// If the configured field is using an entity reference,

Loading…
Cancel
Save