Browse Source

Merge pull request #796 from rosiel/arcane-backend-process

Explain what this means.
pull/797/head
Jordan Dukart 4 years ago committed by GitHub
parent
commit
047d62a53f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/Plugin/ContextReaction/JsonldTypeAlterReaction.php
  2. 2
      tests/src/Functional/JsonldTypeAlterReactionTest.php

8
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. <br/><br/>
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;

2
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");

Loading…
Cancel
Save