Update to Drupal 8.1.2. For more information, see https://www.drupal.org/project/drupal/releases/8.1.2

This commit is contained in:
Pantheon Automation 2016-06-02 15:56:09 -07:00 committed by Greg Anderson
parent 9eae24d844
commit 28556d630e
1322 changed files with 6699 additions and 2064 deletions

View file

@ -113,7 +113,7 @@ function rdf_get_namespaces() {
// namespace, do not use \Drupal::moduleHandler()->invokeAll().
foreach (\Drupal::moduleHandler()->getImplementations('rdf_namespaces') as $module) {
$function = $module . '_rdf_namespaces';
foreach($function() as $prefix => $namespace) {
foreach ($function() as $prefix => $namespace) {
if (array_key_exists($prefix, $namespaces) && $namespace !== $namespaces[$prefix]) {
throw new Exception(t('Tried to map @prefix to @namespace, but @prefix is already mapped to @orig_namespace.', array('@prefix' => $prefix, '@namespace' => $namespace, '@orig_namespace' => $namespaces[$prefix])));
}
@ -233,9 +233,12 @@ function rdf_comment_storage_load($comments) {
// to optimize performance for websites that implement an entity cache.
$created_mapping = rdf_get_mapping('comment', $comment->bundle())
->getPreparedFieldMapping('created');
/** @var \Drupal\comment\CommentInterface $comment*/
$comment->rdf_data['date'] = rdf_rdfa_attributes($created_mapping, $comment->get('created')->first()->toArray());
$entity = $comment->getCommentedEntity();
$comment->rdf_data['entity_uri'] = $entity->url();
// The current function is a storage level hook, so avoid to bubble
// bubbleable metadata, because it can be outside of a render context.
$comment->rdf_data['entity_uri'] = $entity->toUrl()->toString(TRUE)->getGeneratedUrl();
if ($comment->hasParentComment()) {
$comment->rdf_data['pid_uri'] = $comment->getParentComment()->url();
}
@ -265,7 +268,7 @@ function rdf_preprocess_html(&$variables) {
if (!isset($variables['html_attributes']['prefix'])) {
$variables['html_attributes']['prefix'] = array();
}
foreach(rdf_get_namespaces() as $prefix => $uri) {
foreach (rdf_get_namespaces() as $prefix => $uri) {
$variables['html_attributes']['prefix'][] = $prefix . ': ' . $uri . " ";
}
}

View file

@ -103,4 +103,5 @@ interface RdfMappingInterface extends ConfigEntityInterface {
* The RdfMapping object.
*/
public function setFieldMapping($field_name, array $mapping = array());
}

View file

@ -26,4 +26,5 @@ class SchemaOrgDataConverter {
$interaction_type = $arguments['interaction_type'];
return "$interaction_type:$count";
}
}

View file

@ -372,4 +372,5 @@ class CommentAttributesTest extends CommentTestBase {
$comment->save();
return $comment;
}
}

View file

@ -46,4 +46,5 @@ class GetNamespacesTest extends WebTestBase {
));
$this->assertTrue(!empty($element), 'When a prefix has conflicting namespaces, the first declared one is used.');
}
}

View file

@ -40,4 +40,5 @@ class GetRdfNamespacesTest extends WebTestBase {
$this->pass('Expected exception thrown: ' . $e->getMessage());
}
}
}

View file

@ -90,4 +90,5 @@ class NodeAttributesTest extends NodeTestBase {
);
$this->assertTrue($graph->hasProperty($node_uri, 'http://purl.org/dc/terms/created', $expected_value), 'Node date found in RDF output (dc:created).');
}
}

View file

@ -533,4 +533,5 @@ class StandardProfileTest extends WebTestBase {
$parser->parse($graph, $this->drupalGet($url), 'rdfa', $this->baseUri);
return $graph;
}
}

View file

@ -77,4 +77,5 @@ class TaxonomyAttributesTest extends TaxonomyTestBase {
// @todo Add test for term description once it is a field:
// https://www.drupal.org/node/569434.
}
}

View file

@ -104,4 +104,5 @@ class UserAttributesTest extends WebTestBase {
}
}
}

View file

@ -107,4 +107,5 @@ class CrudTest extends KernelTestBase {
->getFieldMapping($field_name);
$this->assertEqual($mapping, $field_mapping, 'Field mapping updated.');
}
}

View file

@ -50,4 +50,5 @@ class DateTimeFieldRdfaTest extends FieldRdfaTestBase {
public function testDefaultFormatter() {
$this->assertFormatterRdfa(array('type' => 'datetime_default'), 'http://schema.org/dateCreated', array('value' => $this->testValue . 'Z', 'type' => 'literal', 'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime'));
}
}

View file

@ -47,4 +47,5 @@ class EmailFieldRdfaTest extends FieldRdfaTestBase {
// Test the mailto formatter.
$this->assertFormatterRdfa(array('type' => 'email_mailto'), 'http://schema.org/email', array('value' => $this->testValue));
}
}

View file

@ -200,4 +200,5 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
$this->entity = EntityTest::create(array());
$this->entity->{$this->fieldName}->value = $testValue;
}
}

View file

@ -54,4 +54,5 @@ class StringFieldRdfaTest extends FieldRdfaTestBase {
// Tests the string formatter.
$this->assertFormatterRdfa(array('type' => 'string'), 'http://schema.org/text', array('value' => $this->testValue));
}
}

View file

@ -65,4 +65,5 @@ class TelephoneFieldRdfaTest extends FieldRdfaTestBase {
// Tests the telephone link formatter with custom title.
$this->assertFormatterRdfa($formatter, 'http://schema.org/telephone', $expected_rdf_value);
}
}

View file

@ -69,4 +69,5 @@ class TextFieldRdfaTest extends FieldRdfaTestBase {
// Tests the trimmed formatter.
$this->assertFormatterRdfa(array('type' => 'text_trimmed'), 'http://schema.org/text', array('value' => $formatted_value));
}
}