Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -91,10 +91,15 @@ class Node extends ContentEntityBase implements NodeInterface {
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
// If no owner has been set explicitly, make the current user the owner.
if (!$this->getOwner()) {
$this->setOwnerId(\Drupal::currentUser()->id());
foreach (array_keys($this->getTranslationLanguages()) as $langcode) {
$translation = $this->getTranslation($langcode);
// If no owner has been set explicitly, make the anonymous user the owner.
if (!$translation->getOwner()) {
$translation->setOwnerId(0);
}
}
// If no revision author has been set explicitly, make the node owner the
// revision author.
if (!$this->getRevisionAuthor()) {
@ -176,30 +181,9 @@ class Node extends ContentEntityBase implements NodeInterface {
return \Drupal::entityManager()
->getAccessControlHandler($this->entityTypeId)
->access($this, $operation, $this->prepareLangcode(), $account, $return_as_object);
->access($this, $operation, $account, $return_as_object);
}
/**
* {@inheritdoc}
*/
public function prepareLangcode() {
$langcode = $this->language()->getId();
// If the Language module is enabled, try to use the language from content
// negotiation.
if (\Drupal::moduleHandler()->moduleExists('language')) {
// Load languages the node exists in.
$node_translations = $this->getTranslationLanguages();
// Load the language from content negotiation.
$content_negotiation_langcode = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();
// If there is a translation available, use it.
if (isset($node_translations[$content_negotiation_langcode])) {
$langcode = $content_negotiation_langcode;
}
}
return $langcode;
}
/**
* {@inheritdoc}
*/
@ -231,13 +215,6 @@ class Node extends ContentEntityBase implements NodeInterface {
return $this;
}
/**
* {@inheritdoc}
*/
public function getChangedTime() {
return $this->get('changed')->value;
}
/**
* {@inheritdoc}
*/
@ -404,7 +381,6 @@ class Node extends ContentEntityBase implements NodeInterface {
->setDescription(t('The username of the content author.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
@ -497,7 +473,7 @@ class Node extends ContentEntityBase implements NodeInterface {
->setLabel(t('Revision log message'))
->setDescription(t('Briefly describe the changes you have made.'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDefaultValue('')
->setDisplayOptions('form', array(
'type' => 'string_textarea',
'weight' => 25,