Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -2,6 +2,7 @@
namespace Drupal\comment;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\views\EntityViewsData;
/**
@ -35,148 +36,148 @@ class CommentViewsData extends EntityViewsData {
$data['comment_field_data']['created']['title'] = $this->t('Post date');
$data['comment_field_data']['created']['help'] = $this->t('Date and time of when the comment was created.');
$data['comment_field_data']['created_fulldata'] = array(
$data['comment_field_data']['created_fulldata'] = [
'title' => $this->t('Created date'),
'help' => $this->t('Date in the form of CCYYMMDD.'),
'argument' => array(
'argument' => [
'field' => 'created',
'id' => 'date_fulldate',
),
);
],
];
$data['comment_field_data']['created_year_month'] = array(
$data['comment_field_data']['created_year_month'] = [
'title' => $this->t('Created year + month'),
'help' => $this->t('Date in the form of YYYYMM.'),
'argument' => array(
'argument' => [
'field' => 'created',
'id' => 'date_year_month',
),
);
],
];
$data['comment_field_data']['created_year'] = array(
$data['comment_field_data']['created_year'] = [
'title' => $this->t('Created year'),
'help' => $this->t('Date in the form of YYYY.'),
'argument' => array(
'argument' => [
'field' => 'created',
'id' => 'date_year',
),
);
],
];
$data['comment_field_data']['created_month'] = array(
$data['comment_field_data']['created_month'] = [
'title' => $this->t('Created month'),
'help' => $this->t('Date in the form of MM (01 - 12).'),
'argument' => array(
'argument' => [
'field' => 'created',
'id' => 'date_month',
),
);
],
];
$data['comment_field_data']['created_day'] = array(
$data['comment_field_data']['created_day'] = [
'title' => $this->t('Created day'),
'help' => $this->t('Date in the form of DD (01 - 31).'),
'argument' => array(
'argument' => [
'field' => 'created',
'id' => 'date_day',
),
);
],
];
$data['comment_field_data']['created_week'] = array(
$data['comment_field_data']['created_week'] = [
'title' => $this->t('Created week'),
'help' => $this->t('Date in the form of WW (01 - 53).'),
'argument' => array(
'argument' => [
'field' => 'created',
'id' => 'date_week',
),
);
],
];
$data['comment_field_data']['changed']['title'] = $this->t('Updated date');
$data['comment_field_data']['changed']['help'] = $this->t('Date and time of when the comment was last updated.');
$data['comment_field_data']['changed_fulldata'] = array(
$data['comment_field_data']['changed_fulldata'] = [
'title' => $this->t('Changed date'),
'help' => $this->t('Date in the form of CCYYMMDD.'),
'argument' => array(
'argument' => [
'field' => 'changed',
'id' => 'date_fulldate',
),
);
],
];
$data['comment_field_data']['changed_year_month'] = array(
$data['comment_field_data']['changed_year_month'] = [
'title' => $this->t('Changed year + month'),
'help' => $this->t('Date in the form of YYYYMM.'),
'argument' => array(
'argument' => [
'field' => 'changed',
'id' => 'date_year_month',
),
);
],
];
$data['comment_field_data']['changed_year'] = array(
$data['comment_field_data']['changed_year'] = [
'title' => $this->t('Changed year'),
'help' => $this->t('Date in the form of YYYY.'),
'argument' => array(
'argument' => [
'field' => 'changed',
'id' => 'date_year',
),
);
],
];
$data['comment_field_data']['changed_month'] = array(
$data['comment_field_data']['changed_month'] = [
'title' => $this->t('Changed month'),
'help' => $this->t('Date in the form of MM (01 - 12).'),
'argument' => array(
'argument' => [
'field' => 'changed',
'id' => 'date_month',
),
);
],
];
$data['comment_field_data']['changed_day'] = array(
$data['comment_field_data']['changed_day'] = [
'title' => $this->t('Changed day'),
'help' => $this->t('Date in the form of DD (01 - 31).'),
'argument' => array(
'argument' => [
'field' => 'changed',
'id' => 'date_day',
),
);
],
];
$data['comment_field_data']['changed_week'] = array(
$data['comment_field_data']['changed_week'] = [
'title' => $this->t('Changed week'),
'help' => $this->t('Date in the form of WW (01 - 53).'),
'argument' => array(
'argument' => [
'field' => 'changed',
'id' => 'date_week',
),
);
],
];
$data['comment_field_data']['status']['title'] = $this->t('Approved status');
$data['comment_field_data']['status']['help'] = $this->t('Whether the comment is approved (or still in the moderation queue).');
$data['comment_field_data']['status']['filter']['label'] = $this->t('Approved comment status');
$data['comment_field_data']['status']['filter']['type'] = 'yes-no';
$data['comment']['approve_comment'] = array(
'field' => array(
$data['comment']['approve_comment'] = [
'field' => [
'title' => $this->t('Link to approve comment'),
'help' => $this->t('Provide a simple link to approve the comment.'),
'id' => 'comment_link_approve',
),
);
],
];
$data['comment']['replyto_comment'] = array(
'field' => array(
$data['comment']['replyto_comment'] = [
'field' => [
'title' => $this->t('Link to reply-to comment'),
'help' => $this->t('Provide a simple link to reply to the comment.'),
'id' => 'comment_link_reply',
),
);
],
];
$data['comment_field_data']['thread']['field'] = array(
$data['comment_field_data']['thread']['field'] = [
'title' => $this->t('Depth'),
'help' => $this->t('Display the depth of the comment if it is threaded.'),
'id' => 'comment_depth',
);
$data['comment_field_data']['thread']['sort'] = array(
];
$data['comment_field_data']['thread']['sort'] = [
'title' => $this->t('Thread'),
'help' => $this->t('Sort by the threaded order. This will keep child comments together with their parents.'),
'id' => 'comment_thread',
);
];
unset($data['comment_field_data']['thread']['filter']);
unset($data['comment_field_data']['thread']['argument']);
@ -184,28 +185,28 @@ class CommentViewsData extends EntityViewsData {
// Provide a relationship for each entity type except comment.
foreach ($entities_types as $type => $entity_type) {
if ($type == 'comment' || !$entity_type->isSubclassOf('\Drupal\Core\Entity\ContentEntityInterface') || !$entity_type->getBaseTable()) {
if ($type == 'comment' || !$entity_type->entityClassImplements(ContentEntityInterface::class) || !$entity_type->getBaseTable()) {
continue;
}
if ($fields = \Drupal::service('comment.manager')->getFields($type)) {
$data['comment_field_data'][$type] = array(
'relationship' => array(
$data['comment_field_data'][$type] = [
'relationship' => [
'title' => $entity_type->getLabel(),
'help' => $this->t('The @entity_type to which the comment is a reply to.', array('@entity_type' => $entity_type->getLabel())),
'help' => $this->t('The @entity_type to which the comment is a reply to.', ['@entity_type' => $entity_type->getLabel()]),
'base' => $entity_type->getDataTable() ?: $entity_type->getBaseTable(),
'base field' => $entity_type->getKey('id'),
'relationship field' => 'entity_id',
'id' => 'standard',
'label' => $entity_type->getLabel(),
'extra' => array(
array(
'extra' => [
[
'field' => 'entity_type',
'value' => $type,
'table' => 'comment_field_data'
),
),
),
);
],
],
],
];
}
}
@ -226,7 +227,7 @@ class CommentViewsData extends EntityViewsData {
// Provide a relationship for each entity type except comment.
foreach ($entities_types as $type => $entity_type) {
if ($type == 'comment' || !$entity_type->isSubclassOf('\Drupal\Core\Entity\ContentEntityInterface') || !$entity_type->getBaseTable()) {
if ($type == 'comment' || !$entity_type->entityClassImplements(ContentEntityInterface::class) || !$entity_type->getBaseTable()) {
continue;
}
// This relationship does not use the 'field id' column, if the entity has
@ -236,84 +237,84 @@ class CommentViewsData extends EntityViewsData {
// {comment_entity_statistics} for each field as multiple joins between
// the same two tables is not supported.
if (\Drupal::service('comment.manager')->getFields($type)) {
$data['comment_entity_statistics']['table']['join'][$entity_type->getDataTable() ?: $entity_type->getBaseTable()] = array(
$data['comment_entity_statistics']['table']['join'][$entity_type->getDataTable() ?: $entity_type->getBaseTable()] = [
'type' => 'INNER',
'left_field' => $entity_type->getKey('id'),
'field' => 'entity_id',
'extra' => array(
array(
'extra' => [
[
'field' => 'entity_type',
'value' => $type,
),
),
);
],
],
];
}
}
$data['comment_entity_statistics']['last_comment_timestamp'] = array(
$data['comment_entity_statistics']['last_comment_timestamp'] = [
'title' => $this->t('Last comment time'),
'help' => $this->t('Date and time of when the last comment was posted.'),
'field' => array(
'field' => [
'id' => 'comment_last_timestamp',
),
'sort' => array(
],
'sort' => [
'id' => 'date',
),
'filter' => array(
],
'filter' => [
'id' => 'date',
),
);
],
];
$data['comment_entity_statistics']['last_comment_name'] = array(
$data['comment_entity_statistics']['last_comment_name'] = [
'title' => $this->t("Last comment author"),
'help' => $this->t('The name of the author of the last posted comment.'),
'field' => array(
'field' => [
'id' => 'comment_ces_last_comment_name',
'no group by' => TRUE,
),
'sort' => array(
],
'sort' => [
'id' => 'comment_ces_last_comment_name',
'no group by' => TRUE,
),
);
],
];
$data['comment_entity_statistics']['comment_count'] = array(
$data['comment_entity_statistics']['comment_count'] = [
'title' => $this->t('Comment count'),
'help' => $this->t('The number of comments an entity has.'),
'field' => array(
'field' => [
'id' => 'numeric',
),
'filter' => array(
],
'filter' => [
'id' => 'numeric',
),
'sort' => array(
],
'sort' => [
'id' => 'standard',
),
'argument' => array(
],
'argument' => [
'id' => 'standard',
),
);
],
];
$data['comment_entity_statistics']['last_updated'] = array(
$data['comment_entity_statistics']['last_updated'] = [
'title' => $this->t('Updated/commented date'),
'help' => $this->t('The most recent of last comment posted or entity updated time.'),
'field' => array(
'field' => [
'id' => 'comment_ces_last_updated',
'no group by' => TRUE,
),
'sort' => array(
],
'sort' => [
'id' => 'comment_ces_last_updated',
'no group by' => TRUE,
),
'filter' => array(
],
'filter' => [
'id' => 'comment_ces_last_updated',
),
);
],
];
$data['comment_entity_statistics']['cid'] = array(
$data['comment_entity_statistics']['cid'] = [
'title' => $this->t('Last comment CID'),
'help' => $this->t('Display the last comment of an entity'),
'relationship' => array(
'relationship' => [
'title' => $this->t('Last comment'),
'help' => $this->t('The last comment of an entity.'),
'group' => $this->t('Comment'),
@ -321,62 +322,62 @@ class CommentViewsData extends EntityViewsData {
'base field' => 'cid',
'id' => 'standard',
'label' => $this->t('Last Comment'),
),
);
],
];
$data['comment_entity_statistics']['last_comment_uid'] = array(
$data['comment_entity_statistics']['last_comment_uid'] = [
'title' => $this->t('Last comment uid'),
'help' => $this->t('The User ID of the author of the last comment of an entity.'),
'relationship' => array(
'relationship' => [
'title' => $this->t('Last comment author'),
'base' => 'users',
'base field' => 'uid',
'id' => 'standard',
'label' => $this->t('Last comment author'),
),
'filter' => array(
],
'filter' => [
'id' => 'numeric',
),
'argument' => array(
],
'argument' => [
'id' => 'numeric',
),
'field' => array(
],
'field' => [
'id' => 'numeric',
),
);
],
];
$data['comment_entity_statistics']['entity_type'] = array(
$data['comment_entity_statistics']['entity_type'] = [
'title' => $this->t('Entity type'),
'help' => $this->t('The entity type to which the comment is a reply to.'),
'field' => array(
'field' => [
'id' => 'standard',
),
'filter' => array(
],
'filter' => [
'id' => 'string',
),
'argument' => array(
],
'argument' => [
'id' => 'string',
),
'sort' => array(
],
'sort' => [
'id' => 'standard',
),
);
$data['comment_entity_statistics']['field_name'] = array(
],
];
$data['comment_entity_statistics']['field_name'] = [
'title' => $this->t('Comment field name'),
'help' => $this->t('The field name from which the comment originated.'),
'field' => array(
'field' => [
'id' => 'standard',
),
'filter' => array(
],
'filter' => [
'id' => 'string',
),
'argument' => array(
],
'argument' => [
'id' => 'string',
),
'sort' => array(
],
'sort' => [
'id' => 'standard',
),
);
],
];
return $data;
}