diff --git a/src/Plugin/ContextReaction/JsonldTypeAlterReaction.php b/src/Plugin/ContextReaction/JsonldTypeAlterReaction.php index b2e757ff..0314e4cd 100644 --- a/src/Plugin/ContextReaction/JsonldTypeAlterReaction.php +++ b/src/Plugin/ContextReaction/JsonldTypeAlterReaction.php @@ -89,9 +89,13 @@ class JsonldTypeAlterReaction extends NormalizerAlterReaction { $config = $this->getConfiguration(); $form['source_field'] = [ '#type' => 'select', - '#title' => $this->t('Source Field'), + '#title' => $this->t('Field containing RDF type information'), '#options' => $options, - '#description' => $this->t("Select the field containing the type predicates."), + '#description' => $this->t("Use a field to determine the rdf:type.

+ In JSON-LD representations, the @type attribute (shorthand for rdf:type) will + be populated from the value of this field, rather than the default for the bundle + as configured in the bundle's RDF mapping. If this field is an entity reference + field, the value of the referenced entity's `field_external_uri` will be used."), '#default_value' => isset($config['source_field']) ? $config['source_field'] : '', ]; return $form; diff --git a/tests/src/Functional/JsonldTypeAlterReactionTest.php b/tests/src/Functional/JsonldTypeAlterReactionTest.php index ce5aa081..d983e36d 100644 --- a/tests/src/Functional/JsonldTypeAlterReactionTest.php +++ b/tests/src/Functional/JsonldTypeAlterReactionTest.php @@ -65,7 +65,7 @@ class JsonldTypeAlterReactionTest extends JsonldSelfReferenceReactionTest { $this->drupalGet("admin/structure/context/$context_name"); $this->getSession()->getPage() - ->fillField("Source Field", "field_type_predicate"); + ->fillField("Field containing RDF type information", "field_type_predicate"); $this->getSession()->getPage()->pressButton("Save and continue"); $this->assertSession() ->pageTextContains("The context $context_name has been saved");