Update to Drupal 8.0.0-rc3. For more information, see https://www.drupal.org/node/2608078
This commit is contained in:
parent
6419a031d7
commit
4afb23bbd3
762 changed files with 20080 additions and 6368 deletions
|
@ -181,7 +181,7 @@ function node_entity_view_display_alter(EntityViewDisplayInterface $display, $co
|
|||
* @param $title
|
||||
* (optional) A heading for the resulting list.
|
||||
*
|
||||
* @return
|
||||
* @return array|false
|
||||
* A renderable array containing a list of linked node titles fetched from
|
||||
* $result, or FALSE if there are no rows in $result.
|
||||
*/
|
||||
|
@ -466,7 +466,7 @@ function node_revision_load($vid = NULL) {
|
|||
* @param $revision_id
|
||||
* The revision ID to delete.
|
||||
*
|
||||
* @return
|
||||
* @return bool
|
||||
* TRUE if the revision deletion was successful; otherwise, FALSE.
|
||||
*/
|
||||
function node_revision_delete($revision_id) {
|
||||
|
@ -479,7 +479,7 @@ function node_revision_delete($revision_id) {
|
|||
* @param \Drupal\node\NodeInterface $node
|
||||
* A node entity.
|
||||
*
|
||||
* @return
|
||||
* @return int|false
|
||||
* The ID of the node if this is a full page view, otherwise FALSE.
|
||||
*/
|
||||
function node_is_page(NodeInterface $node) {
|
||||
|
@ -730,7 +730,7 @@ function node_user_predelete($account) {
|
|||
* @param $number
|
||||
* (optional) The maximum number of nodes to find. Defaults to 10.
|
||||
*
|
||||
* @return
|
||||
* @return \Drupal\node\NodeInterface[]
|
||||
* An array of node entities or an empty array if there are no recent nodes
|
||||
* visible to the current user.
|
||||
*/
|
||||
|
@ -777,7 +777,7 @@ function node_get_recent($number = 10) {
|
|||
* (optional) A language code to use for rendering. Defaults to NULL which is
|
||||
* the global content language of the current request.
|
||||
*
|
||||
* @return
|
||||
* @return array
|
||||
* An array as expected by drupal_render().
|
||||
*/
|
||||
function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
|
||||
|
@ -795,7 +795,7 @@ function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
|
|||
* (optional) A language code to use for rendering. Defaults to the global
|
||||
* content language of the current request.
|
||||
*
|
||||
* @return
|
||||
* @return array
|
||||
* An array in the format expected by drupal_render().
|
||||
*/
|
||||
function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) {
|
||||
|
@ -1081,8 +1081,9 @@ function node_query_node_access_alter(AlterableInterface $query) {
|
|||
* @param $rebuild
|
||||
* (optional) The boolean value to be written.
|
||||
*
|
||||
* @return
|
||||
* The current value of the flag if no value was provided for $rebuild.
|
||||
* @return bool|null
|
||||
* The current value of the flag if no value was provided for $rebuild. If a
|
||||
* value was provided for $rebuild, nothing (NULL) is returned.
|
||||
*
|
||||
* @see node_access_rebuild()
|
||||
*/
|
||||
|
|
|
@ -108,8 +108,6 @@ class Rss extends RssPluginBase {
|
|||
return;
|
||||
}
|
||||
|
||||
$description_build = [];
|
||||
|
||||
$node->link = $node->url('canonical', array('absolute' => TRUE));
|
||||
$node->rss_namespaces = array();
|
||||
$node->rss_elements = array(
|
||||
|
@ -149,13 +147,11 @@ class Rss extends RssPluginBase {
|
|||
$this->view->style_plugin->namespaces += $xml_rdf_namespaces;
|
||||
}
|
||||
|
||||
$item = new \stdClass();
|
||||
if ($display_mode != 'title') {
|
||||
// We render node contents.
|
||||
$description_build = $build;
|
||||
$item->description = $build;
|
||||
}
|
||||
|
||||
$item = new \stdClass();
|
||||
$item->description = $description_build;
|
||||
$item->title = $node->label();
|
||||
$item->link = $node->link;
|
||||
// Provide a reference so that the render call in
|
||||
|
|
|
@ -59,7 +59,7 @@ class Node extends WizardPluginBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::rowStyleOptions().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function rowStyleOptions() {
|
||||
$options = array();
|
||||
|
@ -72,7 +72,7 @@ class Node extends WizardPluginBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function defaultDisplayOptions() {
|
||||
$display_options = parent::defaultDisplayOptions();
|
||||
|
@ -110,7 +110,7 @@ class Node extends WizardPluginBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayFiltersUser().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function defaultDisplayFiltersUser(array $form, FormStateInterface $form_state) {
|
||||
$filters = parent::defaultDisplayFiltersUser($form, $form_state);
|
||||
|
|
|
@ -56,7 +56,7 @@ class NodeRevision extends WizardPluginBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function defaultDisplayOptions() {
|
||||
$display_options = parent::defaultDisplayOptions();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains Drupal\node\ProxyClass\ParamConverter\NodePreviewConverter.
|
||||
* Contains \Drupal\node\ProxyClass\ParamConverter\NodePreviewConverter.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains Drupal\node\Tests\NodeOwnerTest.
|
||||
* Contains \Drupal\node\Tests\NodeOwnerTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\node\Tests;
|
||||
|
|
|
@ -66,7 +66,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
/**
|
||||
* Tests the basic translation UI.
|
||||
*/
|
||||
function testTranslationUI() {
|
||||
public function testTranslationUI() {
|
||||
parent::testTranslationUI();
|
||||
$this->doUninstallTest();
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
/**
|
||||
* Tests changing the published status on a node without fields.
|
||||
*/
|
||||
function testPublishedStatusNoFields() {
|
||||
public function testPublishedStatusNoFields() {
|
||||
// Test changing the published status of an article without fields.
|
||||
$this->drupalLogin($this->administrator);
|
||||
// Delete all fields.
|
||||
|
@ -108,7 +108,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslatorPermission().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getTranslatorPermissions() {
|
||||
return array_merge(parent::getTranslatorPermissions(), array('administer nodes', "edit any $this->bundle content"));
|
||||
|
@ -129,7 +129,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::getNewEntityValues().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getNewEntityValues($langcode) {
|
||||
return array('title' => array(array('value' => $this->randomMachineName()))) + parent::getNewEntityValues($langcode);
|
||||
|
@ -148,7 +148,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::assertPublishedStatus().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doTestPublishedStatus() {
|
||||
$entity = entity_load($this->entityTypeId, $this->entityId, TRUE);
|
||||
|
@ -179,7 +179,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITestBase::assertAuthoringInfo().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doTestAuthoringInfo() {
|
||||
$entity = entity_load($this->entityTypeId, $this->entityId, TRUE);
|
||||
|
@ -221,7 +221,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
/**
|
||||
* Tests that translation page inherits admin status of edit page.
|
||||
*/
|
||||
function testTranslationLinkTheme() {
|
||||
public function testTranslationLinkTheme() {
|
||||
$this->drupalLogin($this->administrator);
|
||||
$article = $this->drupalCreateNode(array('type' => 'article', 'langcode' => $this->langcodes[0]));
|
||||
|
||||
|
@ -270,7 +270,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
|
|||
/**
|
||||
* Tests that translations are rendered properly.
|
||||
*/
|
||||
function testTranslationRendering() {
|
||||
public function testTranslationRendering() {
|
||||
$default_langcode = $this->langcodes[0];
|
||||
$values[$default_langcode] = $this->getNewEntityValues($default_langcode);
|
||||
$this->entityId = $this->createEntity($values[$default_langcode], $default_langcode);
|
||||
|
|
|
@ -46,12 +46,12 @@ class BulkFormTest extends NodeTestBase {
|
|||
protected function setUp($import_test_views = TRUE) {
|
||||
parent::setUp($import_test_views);
|
||||
|
||||
ConfigurableLanguage::createFromLangcode('fr')->save();
|
||||
ConfigurableLanguage::createFromLangcode('en-gb')->save();
|
||||
ConfigurableLanguage::createFromLangcode('it')->save();
|
||||
|
||||
// Create some test nodes.
|
||||
$this->nodes = [];
|
||||
$langcodes = ['en', 'fr', 'it'];
|
||||
$langcodes = ['en', 'en-gb', 'it'];
|
||||
for ($i = 1; $i <= 5; $i++) {
|
||||
$langcode = $langcodes[($i - 1) % 3];
|
||||
$values = [
|
||||
|
@ -104,7 +104,7 @@ class BulkFormTest extends NodeTestBase {
|
|||
// Unpublish a node using the bulk form.
|
||||
$node = reset($this->nodes);
|
||||
$this->assertTrue($node->isPublished(), 'Node is initially published');
|
||||
$this->assertTrue($node->getTranslation('fr')->isPublished(), 'Node translation is published');
|
||||
$this->assertTrue($node->getTranslation('en-gb')->isPublished(), 'Node translation is published');
|
||||
$this->assertTrue($node->getTranslation('it')->isPublished(), 'Node translation is published');
|
||||
$edit = array(
|
||||
'node_bulk_form[0]' => TRUE,
|
||||
|
@ -113,7 +113,7 @@ class BulkFormTest extends NodeTestBase {
|
|||
$this->drupalPostForm(NULL, $edit, t('Apply'));
|
||||
$node = $this->loadNode($node->id());
|
||||
$this->assertFalse($node->isPublished(), 'Node has been unpublished');
|
||||
$this->assertTrue($node->getTranslation('fr')->isPublished(), 'Node translation has not been unpublished');
|
||||
$this->assertTrue($node->getTranslation('en-gb')->isPublished(), 'Node translation has not been unpublished');
|
||||
$this->assertTrue($node->getTranslation('it')->isPublished(), 'Node translation has not been unpublished');
|
||||
|
||||
// Publish action.
|
||||
|
@ -127,7 +127,7 @@ class BulkFormTest extends NodeTestBase {
|
|||
|
||||
// Make sticky action.
|
||||
$this->assertFalse($node->isSticky(), 'Node is not sticky');
|
||||
$this->assertFalse($node->getTranslation('fr')->isSticky(), 'Node translation is not sticky');
|
||||
$this->assertFalse($node->getTranslation('en-gb')->isSticky(), 'Node translation is not sticky');
|
||||
$this->assertFalse($node->getTranslation('it')->isSticky(), 'Node translation is not sticky');
|
||||
$edit = array(
|
||||
'node_bulk_form[0]' => TRUE,
|
||||
|
@ -135,8 +135,8 @@ class BulkFormTest extends NodeTestBase {
|
|||
);
|
||||
$this->drupalPostForm(NULL, $edit, t('Apply'));
|
||||
$node = $this->loadNode($node->id());
|
||||
$this->assertTrue($node->isPublished(), 'Node has been made sticky');
|
||||
$this->assertFalse($node->getTranslation('fr')->isSticky(), 'Node translation has not been made sticky');
|
||||
$this->assertTrue($node->isSticky(), 'Node has been made sticky');
|
||||
$this->assertFalse($node->getTranslation('en-gb')->isSticky(), 'Node translation has not been made sticky');
|
||||
$this->assertFalse($node->getTranslation('it')->isSticky(), 'Node translation has not been made sticky');
|
||||
|
||||
// Make unsticky action.
|
||||
|
@ -150,7 +150,7 @@ class BulkFormTest extends NodeTestBase {
|
|||
|
||||
// Promote to front page.
|
||||
$this->assertFalse($node->isPromoted(), 'Node is not promoted to the front page');
|
||||
$this->assertFalse($node->getTranslation('fr')->isPromoted(), 'Node translation is not promoted to the front page');
|
||||
$this->assertFalse($node->getTranslation('en-gb')->isPromoted(), 'Node translation is not promoted to the front page');
|
||||
$this->assertFalse($node->getTranslation('it')->isPromoted(), 'Node translation is not promoted to the front page');
|
||||
$edit = array(
|
||||
'node_bulk_form[0]' => TRUE,
|
||||
|
@ -159,7 +159,7 @@ class BulkFormTest extends NodeTestBase {
|
|||
$this->drupalPostForm(NULL, $edit, t('Apply'));
|
||||
$node = $this->loadNode($node->id());
|
||||
$this->assertTrue($node->isPromoted(), 'Node has been promoted to the front page');
|
||||
$this->assertFalse($node->getTranslation('fr')->isPromoted(), 'Node translation has not been promoted to the front page');
|
||||
$this->assertFalse($node->getTranslation('en-gb')->isPromoted(), 'Node translation has not been promoted to the front page');
|
||||
$this->assertFalse($node->getTranslation('it')->isPromoted(), 'Node translation has not been promoted to the front page');
|
||||
|
||||
// Demote from front page.
|
||||
|
@ -176,28 +176,28 @@ class BulkFormTest extends NodeTestBase {
|
|||
$edit = array(
|
||||
// Original and all translations.
|
||||
'node_bulk_form[0]' => TRUE, // Node 1, English, original.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, French.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, British English.
|
||||
'node_bulk_form[2]' => TRUE, // Node 1, Italian.
|
||||
// Original and only one translation.
|
||||
'node_bulk_form[3]' => TRUE, // Node 2, English.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, French, original.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, British English, original.
|
||||
'node_bulk_form[5]' => FALSE, // Node 2, Italian.
|
||||
// Only a single translation.
|
||||
'node_bulk_form[6]' => TRUE, // Node 3, English.
|
||||
'node_bulk_form[7]' => FALSE, // Node 3, Italian, original.
|
||||
// Only a single untranslated node.
|
||||
'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated.
|
||||
'node_bulk_form[9]' => FALSE, // Node 5, French, untranslated.
|
||||
'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated.
|
||||
'action' => 'node_unpublish_action',
|
||||
);
|
||||
$this->drupalPostForm(NULL, $edit, t('Apply'));
|
||||
$node = $this->loadNode(1);
|
||||
$this->assertFalse($node->getTranslation('en')->isPublished(), '1: English translation has been unpublished');
|
||||
$this->assertFalse($node->getTranslation('fr')->isPublished(), '1: French translation has been unpublished');
|
||||
$this->assertFalse($node->getTranslation('en-gb')->isPublished(), '1: British English translation has been unpublished');
|
||||
$this->assertFalse($node->getTranslation('it')->isPublished(), '1: Italian translation has been unpublished');
|
||||
$node = $this->loadNode(2);
|
||||
$this->assertFalse($node->getTranslation('en')->isPublished(), '2: English translation has been unpublished');
|
||||
$this->assertFalse($node->getTranslation('fr')->isPublished(), '2: French translation has been unpublished');
|
||||
$this->assertFalse($node->getTranslation('en-gb')->isPublished(), '2: British English translation has been unpublished');
|
||||
$this->assertTrue($node->getTranslation('it')->isPublished(), '2: Italian translation has not been unpublished');
|
||||
$node = $this->loadNode(3);
|
||||
$this->assertFalse($node->getTranslation('en')->isPublished(), '3: English translation has been unpublished');
|
||||
|
@ -217,18 +217,18 @@ class BulkFormTest extends NodeTestBase {
|
|||
$edit = array(
|
||||
// Original and all translations.
|
||||
'node_bulk_form[0]' => TRUE, // Node 1, English, original.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, French.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, British English.
|
||||
'node_bulk_form[2]' => TRUE, // Node 1, Italian.
|
||||
// Original and only one translation.
|
||||
'node_bulk_form[3]' => TRUE, // Node 2, English.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, French, original.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, British English, original.
|
||||
'node_bulk_form[5]' => FALSE, // Node 2, Italian.
|
||||
// Only a single translation.
|
||||
'node_bulk_form[6]' => TRUE, // Node 3, English.
|
||||
'node_bulk_form[7]' => FALSE, // Node 3, Italian, original.
|
||||
// Only a single untranslated node.
|
||||
'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated.
|
||||
'node_bulk_form[9]' => FALSE, // Node 5, French, untranslated.
|
||||
'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated.
|
||||
'action' => 'node_delete_action',
|
||||
);
|
||||
$this->drupalPostForm(NULL, $edit, t('Apply'));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\node\Tests\NodeFieldTokensTest.
|
||||
* Contains \Drupal\node\Tests\Views\NodeFieldTokensTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\node\Tests\Views;
|
||||
|
|
|
@ -4,12 +4,10 @@
|
|||
* Default theme implementation to display a node.
|
||||
*
|
||||
* Available variables:
|
||||
* - node: Full node entity.
|
||||
* - id: The node ID.
|
||||
* - bundle: The type of the node, for example, "page" or "article".
|
||||
* - authorid: The user ID of the node author.
|
||||
* - createdtime: Time the node was published formatted in Unix timestamp.
|
||||
* - changedtime: Time the node was changed formatted in Unix timestamp.
|
||||
* - node: The node entity with limited access to object properties and methods.
|
||||
Only "getter" methods (method names starting with "get", "has", or "is")
|
||||
and a few common methods such as "id" and "label" are available. Calling
|
||||
other methods (such as node.delete) will result in an exception.
|
||||
* - label: The title of the node.
|
||||
* - content: All node items. Use {{ content }} to print them all,
|
||||
* or print a subset such as {{ content.field_example }}. Use
|
||||
|
|
Reference in a new issue