upgrades core to 8.4.2

This commit is contained in:
Bachir Soussi Chiadmi
2017-11-14 16:09:54 +01:00
parent bd60eff9b3
commit c2b4e25be4
3504 changed files with 140306 additions and 38684 deletions
@@ -42,6 +42,13 @@ content:
weight: 15
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 120
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
+3 -3
View File
@@ -12,8 +12,8 @@ package: Core
# core: 8.x
configure: forum.overview
# Information added by Drupal.org packaging script on 2017-08-16
version: '8.3.7'
# Information added by Drupal.org packaging script on 2017-11-03
version: '8.4.2'
core: '8.x'
project: 'drupal'
datestamp: 1502903957
datestamp: 1509719929
+12 -9
View File
@@ -455,17 +455,20 @@ function template_preprocess_forums(&$variables) {
$variables['topics'][$id]->title_link = \Drupal::l($topic->getTitle(), $topic->urlInfo());
$variables['topics'][$id]->message = '';
}
$forum_submitted = ['#theme' => 'forum_submitted', '#topic' => (object) [
'uid' => $topic->getOwnerId(),
'name' => $topic->getOwner()->getDisplayName(),
'created' => $topic->getCreatedTime(),
]];
$variables['topics'][$id]->submitted = drupal_render($forum_submitted);
$forum_submitted = [
'#theme' => 'forum_submitted',
'#topic' => (object) [
'uid' => $topic->getOwnerId(),
'name' => $topic->getOwner()->getDisplayName(),
'created' => $topic->getCreatedTime(),
],
];
$variables['topics'][$id]->submitted = \Drupal::service('renderer')->render($forum_submitted);
$forum_submitted = [
'#theme' => 'forum_submitted',
'#topic' => isset($topic->last_reply) ? $topic->last_reply : NULL,
];
$variables['topics'][$id]->last_reply = drupal_render($forum_submitted);
$variables['topics'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
$variables['topics'][$id]->new_text = '';
$variables['topics'][$id]->new_url = '';
@@ -569,7 +572,7 @@ function template_preprocess_forum_list(&$variables) {
$variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics;
}
$forum_submitted = ['#theme' => 'forum_submitted', '#topic' => $forum->last_post];
$variables['forums'][$id]->last_reply = drupal_render($forum_submitted);
$variables['forums'][$id]->last_reply = \Drupal::service('renderer')->render($forum_submitted);
}
$variables['pager'] = [
@@ -636,7 +639,7 @@ function template_preprocess_forum_submitted(&$variables) {
$variables['author'] = '';
if (isset($variables['topic']->uid)) {
$username = ['#theme' => 'username', '#account' => User::load($variables['topic']->uid)];
$variables['author'] = drupal_render($username);
$variables['author'] = \Drupal::service('renderer')->render($username);
}
$variables['time'] = isset($variables['topic']->created) ? \Drupal::service('date.formatter')->formatTimeDiffSince($variables['topic']->created) : '';
}
@@ -11,6 +11,7 @@ source:
- forum_block_num_0
- forum_block_num_1
- forum_nav_vocabulary
source_module: forum
process:
'block/active/limit': forum_block_num_0
'block/new/limit': forum_block_num_1
@@ -11,6 +11,7 @@ source:
- forum_block_num_active
- forum_block_num_new
- forum_nav_vocabulary
source_module: forum
process:
'block/active/limit': forum_block_num_active
'block/new/limit': forum_block_num_new
@@ -20,9 +20,8 @@ class ContainerForm extends ForumForm {
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state) {
$taxonomy_term = $this->entity;
// Build the bulk of the form from the parent forum form.
$form = parent::form($form, $form_state, $taxonomy_term);
$form = parent::form($form, $form_state);
// Set the title and description of the name field.
$form['name']['#title'] = $this->t('Container name');
+2 -3
View File
@@ -29,9 +29,8 @@ class ForumForm extends TermForm {
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state) {
$taxonomy_term = $this->entity;
// Build the bulk of the form from the parent taxonomy term form.
$form = parent::form($form, $form_state, $taxonomy_term);
$form = parent::form($form, $form_state);
// Set the title and description of the name field.
$form['name']['#title'] = $this->t('Forum name');
@@ -48,7 +47,7 @@ class ForumForm extends TermForm {
// Our parent field is different to the taxonomy term.
$form['parent']['#tree'] = TRUE;
$form['parent'][0] = $this->forumParentSelect($taxonomy_term->id(), $this->t('Parent'));
$form['parent'][0] = $this->forumParentSelect($this->entity->id(), $this->t('Parent'));
$form['#theme_wrappers'] = ['form__forum'];
$this->forumFormType = $this->t('forum');
+3 -2
View File
@@ -1,6 +1,7 @@
<?php
namespace Drupal\forum;
use Drupal\comment\CommentInterface;
use Drupal\Core\Database\Connection;
use Drupal\node\NodeInterface;
@@ -103,7 +104,7 @@ class ForumIndexStorage implements ForumIndexStorageInterface {
':status' => CommentInterface::PUBLISHED,
])->fetchObject();
$this->database->update('forum_index')
->fields( [
->fields([
'comment_count' => $count,
'last_comment_timestamp' => $last_reply->created,
])
@@ -114,7 +115,7 @@ class ForumIndexStorage implements ForumIndexStorageInterface {
// Comments do not exist.
// @todo This should be actually filtering on the desired node language
$this->database->update('forum_index')
->fields( [
->fields([
'comment_count' => 0,
'last_comment_timestamp' => $node->getCreatedTime(),
])
@@ -4,7 +4,6 @@ namespace Drupal\forum;
use Drupal\node\NodeInterface;
/**
* Handles CRUD operations to {forum_index} table.
*/
@@ -8,8 +8,8 @@ dependencies:
- forum
- views
# Information added by Drupal.org packaging script on 2017-08-16
version: '8.3.7'
# Information added by Drupal.org packaging script on 2017-11-03
version: '8.4.2'
core: '8.x'
project: 'drupal'
datestamp: 1502903957
datestamp: 1509719929
@@ -170,7 +170,7 @@ class ForumBlockTest extends BrowserTestBase {
];
// Create the forum topic, preselecting the forum ID via a URL parameter.
$this->drupalPostForm('node/add/forum', $edit, t('Save and publish'), ['query' => ['forum_id' => 1]]);
$this->drupalPostForm('node/add/forum', $edit, t('Save'), ['query' => ['forum_id' => 1]]);
$topics[] = $title;
}
@@ -44,7 +44,7 @@ class ForumIndexTest extends BrowserTestBase {
$this->drupalGet("forum/$tid");
$this->clickLink(t('Add new @node_type', ['@node_type' => 'Forum topic']));
$this->assertUrl('node/add/forum', ['query' => ['forum_id' => $tid]]);
$this->drupalPostForm(NULL, $edit, t('Save and publish'));
$this->drupalPostForm(NULL, $edit, t('Save'));
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($title);
@@ -71,7 +71,8 @@ class ForumIndexTest extends BrowserTestBase {
// Unpublish the node.
$this->drupalPostForm('node/' . $node->id() . '/edit', [], t('Save and unpublish'));
$edit = ['status[value]' => FALSE];
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->drupalGet('node/' . $node->id());
$this->assertText(t('Access denied'), 'Unpublished node is no longer accessible.');
@@ -118,7 +118,7 @@ class ForumTest extends BrowserTestBase {
* Tests forum functionality through the admin and user interfaces.
*/
public function testForum() {
//Check that the basic forum install creates a default forum topic
// Check that the basic forum install creates a default forum topic
$this->drupalGet('/forum');
// Look for the "General discussion" default forum
$this->assertRaw(Link::createFromRoute(t('General discussion'), 'forum.page', ['taxonomy_term' => 1])->toString(), "Found the default forum at the /forum listing");
@@ -525,8 +525,8 @@ class ForumTest extends BrowserTestBase {
* @param bool $container
* TRUE if $forum is a container; FALSE otherwise.
*
* @return object
* The created topic node.
* @return object|null
* The created topic node or NULL if the forum is a container.
*/
public function createForumTopic($forum, $container = FALSE) {
// Generate a random subject/body.
@@ -36,7 +36,7 @@ class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
$this->assertIdentical(15, $config->get('topics.hot_threshold'));
$this->assertIdentical(25, $config->get('topics.page_limit'));
$this->assertIdentical(1, $config->get('topics.order'));
$this->assertIdentical('vocabulary_1_i_0_', $config->get('vocabulary'));
$this->assertIdentical('forums', $config->get('vocabulary'));
// This is 'forum_block_num_0' in D6, but block:active:limit' in D8.
$this->assertSame(3, $config->get('block.active.limit'));
// This is 'forum_block_num_1' in D6, but 'block:new:limit' in D8.
@@ -0,0 +1,77 @@
<?php
namespace Drupal\Tests\forum\Kernel\Migrate\d6;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\Node;
use Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase;
/**
* Tests forum migration from Drupal 6 to Drupal 8.
*
* @group migrate_drupal_6
*/
class MigrateForumTest extends MigrateNodeTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'comment',
'forum',
'menu_ui',
'taxonomy',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installEntitySchema('comment');
$this->installSchema('comment', ['comment_entity_statistics']);
$this->installSchema('forum', ['forum', 'forum_index']);
$this->installConfig(['comment', 'forum']);
$this->migrateContent();
$this->migrateTaxonomy();
$this->executeMigrations([
'd6_comment_type',
'd6_comment_field',
'd6_comment_field_instance',
'd6_comment_entity_display',
'd6_comment_entity_form_display',
'd6_comment',
'd6_term_node',
]);
}
/**
* Tests forum migration.
*/
public function testForumMigration() {
// Tests that the taxonomy_forums field storage config exists.
$field_storage_config = FieldStorageConfig::load('node.taxonomy_forums');
$this->assertInstanceOf(FieldStorageConfig::class, $field_storage_config);
// Tests that the taxonomy_forums field config exists.
$field_config = FieldConfig::load('node.forum.taxonomy_forums');
$this->assertInstanceOf(FieldConfig::class, $field_config);
// Tests that the taxonomy_forums entity view display component exists.
$entity_view_display = EntityViewDisplay::load('node.forum.default')->getComponent('taxonomy_forums');
$this->assertTrue(is_array($entity_view_display));
// Tests that the taxonomy_forums entity form display component exists.
$entity_form_display = EntityFormDisplay::load('node.forum.default')->getComponent('taxonomy_forums');
$this->assertTrue(is_array($entity_form_display));
// Test that the taxonomy_forums field has the right value.
$node = Node::load(19);
$this->assertEquals(8, $node->taxonomy_forums->target_id);
}
}