diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index 51c573b..2feeb01 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -133,7 +133,7 @@ class ForumManager implements ForumManagerInterface { * @param \Drupal\history\HistoryManagerInterface $history_manager * The history manager service. */ - public function __construct(ConfigFactory $config_factory, EntityManagerInterface $entity_manager, Connection $connection, FieldInfo $field_info, TranslationInterface $translation_manager, HistoryManagerInterface $history_manager) { + public function __construct(ConfigFactory $config_factory, EntityManagerInterface $entity_manager, Connection $connection, FieldInfo $field_info, TranslationInterface $translation_manager, HistoryManagerInterface $history_manager = NULL) { $this->configFactory = $config_factory; $this->entityManager = $entity_manager; $this->connection = $connection; diff --git a/core/modules/history/history.install b/core/modules/history/history.install index 4da063d..482ac9f 100644 --- a/core/modules/history/history.install +++ b/core/modules/history/history.install @@ -13,17 +13,17 @@ function history_schema() { 'description' => 'A record of which {users} have read which {entities}s.', 'fields' => array( 'uid' => array( - 'description' => 'The {users}.uid that read the entity.', + 'description' => 'The {users}.uid that read the {history}.entity_id entity.', 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), 'entity_type' => array( + 'description' => 'The type of the entity that was read.', 'type' => 'varchar', 'not null' => TRUE, 'default' => 'node', 'length' => 255, - 'description' => 'The entity_type of the entity that was read.', ), 'entity_id' => array( 'description' => 'The ID of the entity that was read.', diff --git a/core/modules/node/node.install b/core/modules/node/node.install index 6e69f80..be48b65 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -723,17 +723,26 @@ function node_update_8011() { * Convert {history} table to new format and enable History module. */ function node_update_8012() { + // @todo replace with proper migrate implementation. // Drop all keys to properly rename constraints. db_drop_primary_key('history'); db_drop_index('history', 'nid'); - // Add new column. + // Add new column and fill with 'node' entity type. db_add_field('history', 'entity_type', array( + 'description' => 'The type of the entity that was read.', 'type' => 'varchar', 'not null' => TRUE, 'default' => 'node', 'length' => 255, - 'description' => 'The entity_type of the entity that was read.', )); + // Remove default value. + db_add_field('history', 'entity_type', array( + 'description' => 'The type of the entity that was read.', + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => 255, + )); + // Rename the field. db_change_field('history', 'nid', 'entity_id', array( 'description' => 'The ID of the entity that was read.', 'type' => 'int', diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php index 044a121..7a3983e 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php @@ -154,7 +154,6 @@ function testTrackerNewNodes() { $this->assertNoPattern('/' . $title . '.*new/', 'Visited nodes are not flagged as new.'); $this->drupalLogin($this->other_user); - \Drupal::service('history.manager')->resetCache(); $this->drupalGet('tracker'); $this->assertPattern('/' . $title . '.*new/', 'For another user, new nodes are flagged as such in the tracker listing.');