diff options
author | Lee Rowlands <lee.rowlands@previousnext.com.au> | 2020-01-22 09:33:30 +1000 |
---|---|---|
committer | Lee Rowlands <lee.rowlands@previousnext.com.au> | 2020-01-22 09:33:30 +1000 |
commit | 136f05506696d196e784a376f580ab2c4e52dfcb (patch) | |
tree | fb59901442b130197a50f284a84488ca534c2a50 | |
parent | d712cec81f893566d08515a3488a66b26c5b49c5 (diff) | |
download | drupal-136f05506696d196e784a376f580ab2c4e52dfcb.tar.gz drupal-136f05506696d196e784a376f580ab2c4e52dfcb.zip |
Issue #3087644 by jibran, Berdir, alexpott, longwave, Wim Leers, amateescu, catch, larowlan, dpi, quietone: Remove Drupal 8 updates up to and including 88**
319 files changed, 123 insertions, 26482 deletions
diff --git a/core/lib/Drupal/Core/Extension/module.api.php b/core/lib/Drupal/Core/Extension/module.api.php index d2e7bcf7d56..079ad0fac9b 100644 --- a/core/lib/Drupal/Core/Extension/module.api.php +++ b/core/lib/Drupal/Core/Extension/module.api.php @@ -644,8 +644,6 @@ function hook_install_tasks_alter(&$tasks, $install_state) { * @see hook_update_last_removed() * @see update_get_update_list() * @see \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface - * @see node_update_8001 - * @see system_update_8004 * @see https://www.drupal.org/node/2535316 */ function hook_update_N(&$sandbox) { @@ -759,25 +757,10 @@ function hook_post_update_NAME(&$sandbox) { $result = t('Node %nid saved', ['%nid' => $node->id()]); - // Example of disabling blocks with missing condition contexts. Note: The - // block itself is in a state which is valid at that point. - // @see block_update_8001() - // @see block_post_update_disable_blocks_with_missing_contexts() - $block_update_8001 = \Drupal::keyValue('update_backup')->get('block_update_8001', []); - - $block_ids = array_keys($block_update_8001); - $block_storage = \Drupal::entityTypeManager()->getStorage('block'); - $blocks = $block_storage->loadMultiple($block_ids); - /** @var $blocks \Drupal\block\BlockInterface[] */ - foreach ($blocks as $block) { - // This block has had conditions removed due to an inability to resolve - // contexts in block_update_8001() so disable it. - - // Disable currently enabled blocks. - if ($block_update_8001[$block->id()]['status']) { - $block->setStatus(FALSE); - $block->save(); - } + // Example of updating some config. + if (\Drupal::moduleHandler()->moduleExists('taxonomy')) { + // Update the dependencies of all Vocabulary configuration entities. + \Drupal::classResolver(\Drupal\Core\Config\Entity\ConfigEntityUpdater::class)->update($sandbox, 'taxonomy_vocabulary'); } return $result; diff --git a/core/modules/aggregator/aggregator.install b/core/modules/aggregator/aggregator.install index 8722892093b..ee23b29850a 100644 --- a/core/modules/aggregator/aggregator.install +++ b/core/modules/aggregator/aggregator.install @@ -23,30 +23,8 @@ function aggregator_requirements($phase) { } /** - * The simple presence of this update function clears cached field definitions. + * Implements hook_update_last_removed(). */ -function aggregator_update_8001() { - // Feed ID base field is now required. -} - -/** - * Make the 'Source feed' field for aggregator items required. - */ -function aggregator_update_8200() { - // aggregator_update_8001() did not update the last installed field storage - // definition for the aggregator item's 'Source feed' field. - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $field_definition = $definition_update_manager->getFieldStorageDefinition('fid', 'aggregator_item'); - $field_definition->setRequired(TRUE); - $definition_update_manager->updateFieldStorageDefinition($field_definition); -} - -/** - * Add a default value for the 'Refresh' field for aggregator feed entities. - */ -function aggregator_update_8501() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $field_definition = $definition_update_manager->getFieldStorageDefinition('refresh', 'aggregator_feed'); - $field_definition->setDefaultValue(3600); - $definition_update_manager->updateFieldStorageDefinition($field_definition); +function aggregator_update_last_removed() { + return 8501; } diff --git a/core/modules/aggregator/tests/src/Functional/Update/AggregatorUpdateTest.php b/core/modules/aggregator/tests/src/Functional/Update/AggregatorUpdateTest.php deleted file mode 100644 index 1d0c89254d0..00000000000 --- a/core/modules/aggregator/tests/src/Functional/Update/AggregatorUpdateTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace Drupal\Tests\aggregator\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that node settings are properly updated during database updates. - * - * @group aggregator - * @group legacy - */ -class AggregatorUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - ]; - } - - /** - * Tests that the 'Source feed' field is required. - * - * @see aggregator_update_8200() - */ - public function testSourceFeedRequired() { - // Check that the 'fid' field is not required prior to the update. - $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('fid', 'aggregator_item'); - $this->assertFalse($field_definition->isRequired()); - - // Run updates. - $this->runUpdates(); - - // Check that the 'fid' field is now required. - $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('fid', 'aggregator_item'); - $this->assertTrue($field_definition->isRequired()); - } - - /** - * Tests that the 'Update interval' field has a default value. - */ - public function testUpdateIntervalDefaultValue() { - // Check that the 'refresh' field does not have a default value prior to the - // update. - $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('refresh', 'aggregator_feed'); - $this->assertSame([], $field_definition->getDefaultValueLiteral()); - - // Run updates. - $this->runUpdates(); - - // Check that the 'refresh' has a default value now. - $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('refresh', 'aggregator_feed'); - $this->assertSame([['value' => 3600]], $field_definition->getDefaultValueLiteral()); - } - -} diff --git a/core/modules/block/block.install b/core/modules/block/block.install index 50b27585f36..0a2717dabf3 100644 --- a/core/modules/block/block.install +++ b/core/modules/block/block.install @@ -18,102 +18,8 @@ function block_install() { } /** - * Update block visibility context mapping. + * Implements hook_update_last_removed(). */ -function block_update_8001() { - // This update function updates blocks for the change from - // https://www.drupal.org/node/2354889. - - // Core visibility context plugins are updated automatically; blocks with - // unknown plugins are disabled and their previous visibility settings are - // saved in key value storage; see change record - // https://www.drupal.org/node/2527840 for more explanation. - - // These are all the contexts that Drupal core provides. - $context_service_id_map = [ - 'node.node' => '@node.node_route_context:node', - 'user.current_user' => '@user.current_user_context:current_user', - ]; - - foreach (array_keys(\Drupal::languageManager()->getDefinedLanguageTypesInfo()) as $language_type_id) { - $context_service_id_map['language.' . $language_type_id] = '@language.current_language_context:' . $language_type_id; - } - - // Contributed modules should leverage hook_update_dependencies() in order to - // be executed after block_update_8001(). The blocks are then disabled if the - // contexts are still missing via - // block_post_update_disable_blocks_with_missing_contexts(). - $config_factory = \Drupal::configFactory(); - $backup_values = $update_backup = []; - - foreach ($config_factory->listAll('block.block.') as $block_config_name) { - $block = $config_factory->getEditable($block_config_name); - if ($visibility = $block->get('visibility')) { - foreach ($visibility as $condition_plugin_id => &$condition) { - foreach ($condition['context_mapping'] as $key => $context) { - if (!isset($context_service_id_map[$context])) { - // Remove the visibility condition for unknown context mapping - // entries, so the update process itself runs through and users can - // fix their block placements manually OR alternatively contributed - // modules can run their own update functions to update mappings - // that they provide. - $backup_values[$context][] = $condition_plugin_id; - unset($visibility[$condition_plugin_id]); - continue; - } - // Replace the context ID based on the defined mapping. - $condition['context_mapping'][$key] = $context_service_id_map[$context]; - } - } - $block->set('visibility', $visibility); - - if ($backup_values) { - // We not only store the missing context mappings but also the previous - // block status, in order to allow contributed and custom modules to do - // their own updates. - $update_backup[$block->get('id')] = [ - 'missing_context_ids' => $backup_values, - 'status' => $block->get('status'), - ]; - } - } - - // Mark the resulting configuration as trusted data. This avoids issues with - // future schema changes. - $block->save(TRUE); - } - - if ($update_backup) { - \Drupal::keyValue('update_backup')->set('block_update_8001', $update_backup); - } - - return t('Block context IDs updated.'); -} - -/** - * Placeholder for the previous 8002 update. - */ -function block_update_8002() { - \Drupal::state()->set('block_update_8002_placeholder', TRUE); -} - -/** - * Remove 'cache' setting. - */ -function block_update_8003() { - $config_factory = \Drupal::configFactory(); - foreach ($config_factory->listAll('block.block.') as $block_config_name) { - $block = $config_factory->getEditable($block_config_name); - - // Remove the 'cache' setting. - $settings = $block->get('settings'); - unset($settings['cache']); - $block->set('settings', $settings); - - // Mark the resulting configuration as trusted data. This avoids issues with - // future schema changes. - $block->save(TRUE); - } - - return t('Block settings updated.'); +function block_update_last_removed() { + return 8003; } diff --git a/core/modules/block/tests/fixtures/update/block.block.missing_schema.yml b/core/modules/block/tests/fixtures/update/block.block.missing_schema.yml deleted file mode 100644 index 103692aac66..00000000000 --- a/core/modules/block/tests/fixtures/update/block.block.missing_schema.yml +++ /dev/null @@ -1,28 +0,0 @@ -uuid: 1a6c0f14-78dc-4ede-bade-b8ce83881453 -langcode: en -status: true -dependencies: - module: - - block_test - - system - theme: - - bartik -id: missing_schema -theme: bartik -region: sidebar_first -weight: 0 -provider: null -plugin: system_branding_block -settings: - id: system_branding_block - label: 'Test missing schema on conditions' - provider: system - label_display: visible - use_site_logo: true - use_site_name: true - use_site_slogan: true -visibility: - missing_schema: - id: missing_schema - negate: 0 - context_mapping: { } diff --git a/core/modules/block/tests/fixtures/update/drupal-8.block-test-enabled-missing-schema.php b/core/modules/block/tests/fixtures/update/drupal-8.block-test-enabled-missing-schema.php deleted file mode 100644 index c21628a9eaf..00000000000 --- a/core/modules/block/tests/fixtures/update/drupal-8.block-test-enabled-missing-schema.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * @file - * Partial database to mimic the installation of the block_test module. - */ - -use Drupal\Core\Database\Database; -use Symfony\Component\Yaml\Yaml; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'block_test', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['block_test'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Install the block configuration. -$config = file_get_contents(__DIR__ . '/block.block.missing_schema.yml'); -$config = Yaml::parse($config); -$connection->insert('config') - ->fields(['data', 'name', 'collection']) - ->values([ - 'name' => 'block.block.missing_schema', - 'data' => serialize($config), - 'collection' => '', - ]) - ->execute(); diff --git a/core/modules/block/tests/src/Functional/Update/BlockConditionMissingSchemaUpdateTest.php b/core/modules/block/tests/src/Functional/Update/BlockConditionMissingSchemaUpdateTest.php deleted file mode 100644 index 751dd54170a..00000000000 --- a/core/modules/block/tests/src/Functional/Update/BlockConditionMissingSchemaUpdateTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\Tests\block\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for block with conditions missing context. - * - * @see https://www.drupal.org/node/2811519 - * - * @group Update - * @group legacy - */ -class BlockConditionMissingSchemaUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['block_test', 'language']; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.block-test-enabled-missing-schema.php', - ]; - } - - /** - * Tests that block context mapping is updated properly. - */ - public function testUpdateHookN() { - $this->runUpdates(); - $this->drupalGet('<front>'); - // If the block is fixed by block_post_update_fix_negate_in_conditions() - // then it will be visible. - $this->assertText('Test missing schema on conditions'); - } - -} diff --git a/core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateFilledTest.php b/core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateFilledTest.php deleted file mode 100644 index bcedfcee1c4..00000000000 --- a/core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateFilledTest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Drupal\Tests\block\Functional\Update; - -/** - * Runs BlockContextMappingUpdateTest with a dump filled with content. - * - * @group Update - * @group legacy - */ -class BlockContextMappingUpdateFilledTest extends BlockContextMappingUpdateTest { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - parent::setDatabaseDumpFiles(); - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz'; - } - -} diff --git a/core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateTest.php b/core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateTest.php deleted file mode 100644 index 427585fdac8..00000000000 --- a/core/modules/block/tests/src/Functional/Update/BlockContextMappingUpdateTest.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -namespace Drupal\Tests\block\Functional\Update; - -use Drupal\block\Entity\Block; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\node\Entity\Node; - -/** - * Tests the upgrade path for block context mapping renames. - * - * @see https://www.drupal.org/node/2354889 - * - * @group Update - * @group legacy - */ -class BlockContextMappingUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['block_test', 'language']; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.language-enabled.php', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.block-test-enabled.php', - ]; - } - - /** - * Tests that block context mapping is updated properly. - */ - public function testUpdateHookN() { - $this->runUpdates(); - $this->assertRaw('Encountered an unknown context mapping key coming probably from a contributed or custom module: One or more mappings could not be updated. Please manually review your visibility settings for the following blocks, which are disabled now:<ul><li>User login (Visibility: Baloney spam)</li></ul>'); - - // Disable maintenance mode. - \Drupal::state()->set('system.maintenance_mode', FALSE); - - // We finished updating so we can log in the user now. - $this->drupalLogin($this->rootUser); - - // The block that we are testing has the following visibility rules: - // - only visible on node pages - // - only visible to authenticated users. - $block_title = 'Test for 2354889'; - - // Create two nodes, a page and an article. - $page = Node::create([ - 'type' => 'page', - 'title' => 'Page node', - ]); - $page->save(); - - $article = Node::create([ - 'type' => 'article', - 'title' => 'Article node', - ]); - $article->save(); - - // Check that the block appears only on Page nodes for authenticated users. - $this->drupalGet('node/' . $page->id()); - $this->assertRaw($block_title, 'Test block is visible on a Page node as an authenticated user.'); - - $this->drupalGet('node/' . $article->id()); - $this->assertNoRaw($block_title, 'Test block is not visible on a Article node as an authenticated user.'); - - $this->drupalLogout(); - - // Check that the block does not appear on any page for anonymous users. - $this->drupalGet('node/' . $page->id()); - $this->assertNoRaw($block_title, 'Test block is not visible on a Page node as an anonymous user.'); - - $this->drupalGet('node/' . $article->id()); - $this->assertNoRaw($block_title, 'Test block is not visible on a Article node as an anonymous user.'); - - // Ensure that all the context mappings got updated properly. - $block = Block::load('testfor2354889'); - $visibility = $block->get('visibility'); - $this->assertEqual('@node.node_route_context:node', $visibility['node_type']['context_mapping']['node']); - $this->assertEqual('@user.current_user_context:current_user', $visibility['user_role']['context_mapping']['user']); - $this->assertEqual('@language.current_language_context:language_interface', $visibility['language']['context_mapping']['language']); - - // Check that a block with invalid context is being disabled and that it can - // still be edited afterward. - $disabled_block = Block::load('thirdtestfor2354889'); - $this->assertFalse($disabled_block->status(), 'Block with invalid context is disabled'); - - $this->assertEqual(['thirdtestfor2354889' => ['missing_context_ids' => ['baloney_spam' => ['node_type']], 'status' => TRUE]], \Drupal::keyValue('update_backup')->get('block_update_8001')); - - $disabled_block_visibility = $disabled_block->get('visibility'); - $this->assertTrue(!isset($disabled_block_visibility['node_type']), 'The problematic visibility condition has been removed.'); - - $admin_user = $this->drupalCreateUser(['administer blocks']); - $this->drupalLogin($admin_user); - - $this->drupalGet('admin/structure/block/manage/thirdtestfor2354889'); - $this->assertResponse('200'); - } - -} diff --git a/core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php b/core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php deleted file mode 100644 index 99245d2ac0d..00000000000 --- a/core/modules/block/tests/src/Functional/Update/BlockRemoveDisabledRegionUpdateTest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Drupal\Tests\block\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for removal of disabled region. - * - * @see https://www.drupal.org/node/2513534 - * - * @group Update - * @group legacy - */ -class BlockRemoveDisabledRegionUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['block_test', 'language']; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.update-test-block-disabled-2513534.php', - ]; - } - - /** - * Tests that block context mapping is updated properly. - */ - public function testUpdateHookN() { - $this->runUpdates(); - - // Disable maintenance mode. - \Drupal::state()->set('system.maintenance_mode', FALSE); - - // We finished updating so we can login the user now. - $this->drupalLogin($this->rootUser); - - // Verify that a disabled block is in the default region. - $this->drupalGet('admin/structure/block'); - $element = $this->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]", - [':block' => 'edit-blocks-pagetitle-1', ':status' => 'block-disabled', ':region' => 'header']); - $this->assertTrue(!empty($element)); - - // Verify that an enabled block is now disabled and in the default region. - $this->drupalGet('admin/structure/block'); - $element = $this->xpath("//tr[contains(@data-drupal-selector, :block) and contains(@class, :status)]//select/option[@selected and @value=:region]", - [':block' => 'edit-blocks-pagetitle-2', ':status' => 'block-disabled', ':region' => 'header']); - $this->assertTrue(!empty($element)); - - } - -} diff --git a/core/modules/block_content/block_content.install b/core/modules/block_content/block_content.install index 43c832b552a..af22b625274 100644 --- a/core/modules/block_content/block_content.install +++ b/core/modules/block_content/block_content.install @@ -5,136 +5,9 @@ * Install, update and uninstall functions for the block_content module. */ -use Drupal\Core\Field\BaseFieldDefinition; -use Drupal\Core\StringTranslation\TranslatableMarkup; - -/** - * Add 'revision_translation_affected' field to 'block_content' entities. - */ -function block_content_update_8001() { - // Install the definition that this field had in - // \Drupal\block_content\Entity\BlockContent::baseFieldDefinitions() - // at the time that this update function was written. If/when code is - // deployed that changes that definition, the corresponding module must - // implement an update function that invokes - // \Drupal::entityDefinitionUpdateManager()->updateFieldStorageDefinition() - // with the new definition. - $storage_definition = BaseFieldDefinition::create('boolean') - ->setLabel(t('Revision translation affected')) - ->setDescription(t('Indicates if the last edit of a translation belongs to current revision.')) - ->setReadOnly(TRUE) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE); - - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('revision_translation_affected', 'block_content', 'block_content', $storage_definition); -} - -/** - * Generalizes the d6_block_content_type and d6_block_content_body_field - * migrations. - */ -function block_content_update_8002() { - // Removed in issue #2569605. The Migrate and Migrate Drupal modules are - // marked experimental and do not need to support the update path until they - // are stable. - // @see https://www.drupal.org/node/2569469 -} - -/** - * Add 'revision_created' and 'revision_user' fields to 'block_content' entities. - */ -function block_content_update_8003() { - $revision_created = BaseFieldDefinition::create('created') - ->setLabel(t('Revision create time')) - ->setDescription(t('The time that the current revision was created.')) - ->setRevisionable(TRUE); - - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('revision_created', 'block_content', 'block_content', $revision_created); - - $revision_user = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Revision user')) - ->setDescription(t('The user ID of the author of the current revision.')) - ->setSetting('target_type', 'user') - ->setRevisionable(TRUE); - - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('revision_user', 'block_content', 'block_content', $revision_user); -} - -/** - * Fix the block_content entity type to specify its revision data table. - */ -function block_content_update_8300() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('block_content'); - $entity_type->set('revision_data_table', 'block_content_field_revision'); - $definition_update_manager->updateEntityType($entity_type); -} - -/** - * Add a publishing status field for block_content entities. - */ -function block_content_update_8400() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Add the published entity key to the block_content entity type. - $entity_type = $definition_update_manager->getEntityType('block_content'); - $entity_keys = $entity_type->getKeys(); - $entity_keys['published'] = 'status'; - $entity_type->set('entity_keys', $entity_keys); - $definition_update_manager->updateEntityType($entity_type); - - // Add the publishing status field to the block_content entity type. - $status = BaseFieldDefinition::create('boolean') - ->setLabel(new TranslatableMarkup('Publishing status')) - ->setDescription(new TranslatableMarkup('A boolean indicating the published state.')) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) - ->setDefaultValue(TRUE); - - $has_content_translation_status_field = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content'); - if ($has_content_translation_status_field) { - $status->setInitialValueFromField('content_translation_status', TRUE); - } - else { - $status->setInitialValue(TRUE); - } - $definition_update_manager->installFieldStorageDefinition('status', 'block_content', 'block_content', $status); - - // Uninstall the 'content_translation_status' field if needed. - $database = \Drupal::database(); - if ($has_content_translation_status_field) { - // First we have to remove the field data. - $database->update($entity_type->getDataTable()) - ->fields(['content_translation_status' => NULL]) - ->execute(); - - // A site may have disabled revisionability for this entity type. - if ($entity_type->isRevisionable()) { - $database->update($entity_type->getRevisionDataTable()) - ->fields(['content_translation_status' => NULL]) - ->execute(); - } - - $content_translation_status = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content'); - $definition_update_manager->uninstallFieldStorageDefinition($content_translation_status); - } -} - /** - * Add 'reusable' field to 'block_content' entities. + * Implements hook_update_last_removed(). */ -function block_content_update_8600() { - $reusable = BaseFieldDefinition::create('boolean') - ->setLabel(t('Reusable')) - ->setDescription(t('A boolean indicating whether this block is reusable.')) - ->setTranslatable(FALSE) - ->setRevisionable(FALSE) - ->setDefaultValue(TRUE) - ->setInitialValue(TRUE); - - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('reusable', 'block_content', 'block_content', $reusable); +function block_content_update_last_removed() { + return 8600; } diff --git a/core/modules/block_content/tests/fixtures/update/drupal-8.views_block_content-2976334.php b/core/modules/block_content/tests/fixtures/update/drupal-8.views_block_content-2976334.php deleted file mode 100644 index a917036409f..00000000000 --- a/core/modules/block_content/tests/fixtures/update/drupal-8.views_block_content-2976334.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/project/drupal/issues/2976334. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Override configuration for 'block_content' View with extra display with with -// overridden filters. -$config = Yaml::decode(file_get_contents(__DIR__ . '/views.view.block_content_2976334.yml')); -$connection->update('config') - ->fields([ - 'data' => serialize($config), - ]) - ->condition('name', 'views.view.' . $config['id']) - ->execute(); diff --git a/core/modules/block_content/tests/fixtures/update/views.view.block_content_2976334.yml b/core/modules/block_content/tests/fixtures/update/views.view.block_content_2976334.yml deleted file mode 100644 index 5853c842e83..00000000000 --- a/core/modules/block_content/tests/fixtures/update/views.view.block_content_2976334.yml +++ /dev/null @@ -1,601 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - block_content - - user -id: block_content -label: 'Custom block library' -module: views -description: 'Find and manage custom blocks.' -tag: default -base_table: block_content_field_data -base_field: id -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'administer blocks' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 50 - offset: 0 - id: 0 - total_pages: null - tags: - previous: '‹ Previous' - next: 'Next ›' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - info: info - type: type - changed: changed - operations: operations - info: - info: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - type: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - changed: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: '' - operations: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: changed - empty_table: true - row: - type: fields - fields: - info: - id: info - table: block_content_field_data - field: info - relationship: none - group_type: group - admin_label: '' - label: 'Block description' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: null - entity_field: info - plugin_id: field - type: - id: type - table: block_content_field_data - field: type - relationship: none - group_type: group - admin_label: '' - label: 'Block type' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: false - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: block_content - entity_field: type - plugin_id: field - changed: - id: changed - table: block_content_field_data - field: changed - relationship: none - group_type: group - admin_label: '' - label: Updated - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - entity_type: block_content - entity_field: changed - type: timestamp - settings: - date_format: short - custom_date_format: '' - timezone: '' - plugin_id: field - operations: - id: operations - table: block_content - field: operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - entity_type: block_content - plugin_id: entity_operations - filters: - info: - id: info - table: block_content_field_data - field: info - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: info_op - label: 'Block description' - description: '' - use_operator: false - operator: info_op - identifier: info - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: block_content - entity_field: info - plugin_id: string - type: - id: type - table: block_content_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: 'Block type' - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: block_content - entity_field: type - plugin_id: bundle - sorts: { } - title: 'Custom block library' - header: { } - footer: { } - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - empty: true - tokenize: false - content: 'There are no custom blocks available.' - plugin_id: text_custom - block_content_listing_empty: - admin_label: '' - empty: true - field: block_content_listing_empty - group_type: group - id: block_content_listing_empty - label: '' - relationship: none - table: block_content - plugin_id: block_content_listing_empty - entity_type: block_content - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - max-age: 0 - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: admin/structure/block/block-content - menu: - type: tab - title: 'Custom block library' - description: '' - parent: block.admin_display - weight: 0 - context: '0' - menu_name: admin - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - max-age: 0 - tags: { } - page_2: - display_plugin: page - id: page_2 - display_title: 'Page 2' - position: 2 - display_options: - display_extenders: { } - path: extra-view-display - filters: - type: - id: type - table: block_content_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: 'Block type' - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: block_content - entity_field: type - plugin_id: bundle - info: - id: info - table: block_content_field_data - field: info - relationship: none - group_type: group - admin_label: '' - operator: 'contains' - value: block2 - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: block_content - entity_field: info - plugin_id: string - defaults: - filters: false - filter_groups: false - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } diff --git a/core/modules/block_content/tests/src/Functional/Update/BlockContentReusableUpdateTest.php b/core/modules/block_content/tests/src/Functional/Update/BlockContentReusableUpdateTest.php deleted file mode 100644 index 64eeadde57a..00000000000 --- a/core/modules/block_content/tests/src/Functional/Update/BlockContentReusableUpdateTest.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -namespace Drupal\Tests\block_content\Functional\Update; - -use Drupal\block_content\Entity\BlockContent; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests 'reusable' field related update functions for the Block Content module. - * - * @group Update - * @group block_content - * @group legacy - */ -class BlockContentReusableUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - // Override the 'block_content' view with an extra display with overridden - // filters. This extra display should also have a filter added for - // 'reusable' field so that it does not expose non-reusable fields. This - // display also has a filter that only shows blocks that contain 'block2' - // in the 'info' field. - __DIR__ . '/../../../fixtures/update/drupal-8.views_block_content-2976334.php', - ]; - } - - /** - * Tests adding 'reusable' entity base field to the block content entity type. - * - * @see block_content_update_8600() - * @see block_content_post_update_add_views_reusable_filter() - */ - public function testReusableFieldAddition() { - $assert_session = $this->assertSession(); - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Ensure that 'reusable' field is not present before updates. - $this->assertEmpty($entity_definition_update_manager->getFieldStorageDefinition('reusable', 'block_content')); - - // Ensure that 'reusable' filter is not present before updates. - $view_config = \Drupal::configFactory()->get('views.view.block_content'); - $this->assertFalse($view_config->isNew()); - $this->assertEmpty($view_config->get('display.default.display_options.filters.reusable')); - $this->assertEmpty($view_config->get('display.page_2.display_options.filters.reusable')); - // Run updates. - $this->runUpdates(); - - // Ensure that 'reusable' filter is present after updates. - \Drupal::configFactory()->clearStaticCache(); - $view_config = \Drupal::configFactory()->get('views.view.block_content'); - $this->assertNotEmpty($view_config->get('display.default.display_options.filters.reusable')); - $this->assertNotEmpty($view_config->get('display.page_2.display_options.filters.reusable')); - - // Check that the field exists and is configured correctly. - $reusable_field = $entity_definition_update_manager->getFieldStorageDefinition('reusable', 'block_content'); - $this->assertEquals('Reusable', $reusable_field->getLabel()); - $this->assertEquals('A boolean indicating whether this block is reusable.', $reusable_field->getDescription()); - $this->assertEquals(FALSE, $reusable_field->isRevisionable()); - $this->assertEquals(FALSE, $reusable_field->isTranslatable()); - - $after_block1 = BlockContent::create([ - 'info' => 'After update block1', - 'type' => 'basic_block', - ]); - $after_block1->save(); - // Add second block that will be shown with the 'info' filter on the - // additional view display. - $after_block2 = BlockContent::create([ - 'info' => 'After update block2', - 'type' => 'basic_block', - ]); - $after_block2->save(); - - $this->assertTrue($after_block1->isReusable()); - $this->assertTrue($after_block2->isReusable()); - - $admin_user = $this->drupalCreateUser(['administer blocks']); - $this->drupalLogin($admin_user); - - $block_non_reusable = BlockContent::create([ - 'info' => 'block1 non reusable', - 'type' => 'basic_block', - 'reusable' => FALSE, - ]); - $block_non_reusable->save(); - // Add second block that would be shown with the 'info' filter on the - // additional view display if the 'reusable' filter was not added. - $block2_non_reusable = BlockContent::create([ - 'info' => 'block2 non reusable', - 'type' => 'basic_block', - 'reusable' => FALSE, - ]); - $block2_non_reusable->save(); - $this->assertFalse($block_non_reusable->isReusable()); - $this->assertFalse($block2_non_reusable->isReusable()); - - // Ensure the Custom Block view shows the reusable blocks only. - $this->drupalGet('admin/structure/block/block-content'); - $assert_session->statusCodeEquals('200'); - $assert_session->responseContains('view-id-block_content'); - $assert_session->pageTextContains($after_block1->label()); - $assert_session->pageTextContains($after_block2->label()); - $assert_session->pageTextNotContains($block_non_reusable->label()); - $assert_session->pageTextNotContains($block2_non_reusable->label()); - - // Ensure the view's other display also only shows reusable blocks and still - // filters on the 'info' field. - $this->drupalGet('extra-view-display'); - $assert_session->statusCodeEquals('200'); - $assert_session->responseContains('view-id-block_content'); - $assert_session->pageTextNotContains($after_block1->label()); - $assert_session->pageTextContains($after_block2->label()); - $assert_session->pageTextNotContains($block_non_reusable->label()); - $assert_session->pageTextNotContains($block2_non_reusable->label()); - - // Ensure the Custom Block listing without Views installed shows the only - // reusable blocks. - $this->drupalGet('admin/structure/block/block-content'); - $this->container->get('module_installer')->uninstall(['views_ui', 'views']); - $this->drupalGet('admin/structure/block/block-content'); - $assert_session->statusCodeEquals('200'); - $assert_session->responseNotContains('view-id-block_content'); - $assert_session->pageTextContains($after_block1->label()); - $assert_session->pageTextContains($after_block2->label()); - $assert_session->pageTextNotContains($block_non_reusable->label()); - $assert_session->pageTextNotContains($block2_non_reusable->label()); - - $this->drupalGet('block/' . $after_block1->id()); - $assert_session->statusCodeEquals('200'); - - // Ensure the non-reusable block is not accessible in the form. - $this->drupalGet('block/' . $block_non_reusable->id()); - $assert_session->statusCodeEquals('403'); - - $this->drupalLogout(); - - $this->drupalLogin($this->createUser([ - 'access user profiles', - 'administer blocks', - ])); - $this->drupalGet('block/' . $after_block1->id()); - $assert_session->statusCodeEquals('200'); - - $this->drupalGet('block/' . $block_non_reusable->id()); - $assert_session->statusCodeEquals('403'); - } - - /** - * Tests that the update succeeds even if Views is not installed. - */ - public function testReusableFieldAdditionWithoutViews() { - $this->container->get('module_installer')->uninstall(['views']); - $this->runUpdates(); - } - -} diff --git a/core/modules/block_content/tests/src/Functional/Update/BlockContentUpdateTest.php b/core/modules/block_content/tests/src/Functional/Update/BlockContentUpdateTest.php deleted file mode 100644 index 9f9f1d1fe7c..00000000000 --- a/core/modules/block_content/tests/src/Functional/Update/BlockContentUpdateTest.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -namespace Drupal\Tests\block_content\Functional\Update; - -use Drupal\Core\Field\BaseFieldDefinition; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests update functions for the Block Content module. - * - * @group Update - * @group legacy - */ -class BlockContentUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests the revision metadata fields and revision data table additions. - */ - public function testSimpleUpdates() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $entity_definition_update_manager->getEntityType('block_content'); - $this->assertNull($entity_type->getRevisionDataTable()); - - $this->runUpdates(); - - $post_revision_created = $entity_definition_update_manager->getFieldStorageDefinition('revision_created', 'block_content'); - $post_revision_user = $entity_definition_update_manager->getFieldStorageDefinition('revision_user', 'block_content'); - $this->assertTrue($post_revision_created instanceof BaseFieldDefinition, "Revision created field found"); - $this->assertTrue($post_revision_user instanceof BaseFieldDefinition, "Revision user field found"); - - $this->assertEqual('created', $post_revision_created->getType(), "Field is type created"); - $this->assertEqual('entity_reference', $post_revision_user->getType(), "Field is type entity_reference"); - - $entity_type = $entity_definition_update_manager->getEntityType('block_content'); - $this->assertEqual('block_content_field_revision', $entity_type->getRevisionDataTable()); - } - - /** - * Tests adding a status field to the block content entity type. - * - * @see block_content_update_8400() - */ - public function testStatusFieldAddition() { - $schema = \Drupal::database()->schema(); - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Run updates. - $this->runUpdates(); - - // Check that the field exists and has the correct label. - $updated_field = $entity_definition_update_manager->getFieldStorageDefinition('status', 'block_content'); - $this->assertEqual('Publishing status', $updated_field->getLabel()); - - $content_translation_status = $entity_definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content'); - $this->assertNull($content_translation_status); - - $this->assertFalse($schema->fieldExists('block_content_field_revision', 'content_translation_status')); - $this->assertFalse($schema->fieldExists('block_content_field_data', 'content_translation_status')); - } - -} diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index b02b432ecbe..28c6f54be37 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -5,40 +5,10 @@ * Install, update and uninstall functions for the Comment module. */ -use Drupal\comment\Entity\Comment; use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\StringTranslation\PluralTranslatableMarkup; -use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\field\Entity\FieldStorageConfig; /** - * Implements hook_requirements(). - */ -function comment_requirements($phase) { - $requirements = []; - if ($phase === 'update' && drupal_get_installed_schema_version('comment') < 8701) { - $has_empty_columns = \Drupal::entityQuery('comment', 'OR') - ->condition('entity_type', NULL, 'IS NULL') - ->condition('field_name', NULL, 'IS NULL') - ->range(0, 1) - ->accessCheck(FALSE) - ->execute(); - if ($has_empty_columns) { - $requirements['comment_update_8701'] = [ - 'title' => t('Comment required fields update'), - 'description' => t('The comment_update_8701() function requires that the %field_1 and %field_2 fields have values for all comment entities. See the <a href=":change_record">change record</a> for more information.', [ - '%field_1' => 'entity_type', - '%field_2' => 'field_name', - ':change_record' => 'https://www.drupal.org/node/3053046', - ]), - 'severity' => REQUIREMENT_ERROR, - ]; - } - } - return $requirements; -} - -/** * Implements hook_uninstall(). */ function comment_uninstall() { @@ -141,122 +111,8 @@ function comment_schema() { } /** - * Clear caches to fix Comment entity list builder and operations Views field. - */ -function comment_update_8001() { - // Empty update to cause a cache flush to rebuild comment entity handler - // information, so that comment operation links work. -} - -/** - * Clear caches to fix Comment Views context filter. - */ -function comment_update_8002() { - // Empty update to cause a cache flush. -} - -/** - * Add the 'view_mode' setting to displays having 'comment_default' formatter. - */ -function comment_update_8200() { - $config_factory = \Drupal::configFactory(); - $displays = []; - // Iterate on all entity view displays. - foreach ($config_factory->listAll('core.entity_view_display.') as $name) { - $changed = FALSE; - $display = $config_factory->getEditable($name); - $components = $display->get('content') ?: []; - foreach ($components as $field_name => $component) { - if (isset($component['type']) && ($component['type'] === 'comment_default')) { - if (empty($display->get("content.{$field_name}.settings.view_mode"))) { - $display->set("content.{$field_name}.settings.view_mode", 'default'); - $displays[] = $display->get('id'); - $changed = TRUE; - } - } - } - - if ($changed) { - $display->save(TRUE); - } - } - - if ($displays) { - return new PluralTranslatableMarkup(count($displays), '1 entity display updated: @displays.', '@count entity displays updated: @displays.', ['@displays' => implode(', ', $displays)]); - } - else { - return new TranslatableMarkup('No entity view display updated.'); - } -} - -/** - * Update status field. + * Implements hook_update_last_removed(). */ -function comment_update_8300() { - $entity_definition_update_manager = \Drupal::service('entity.definition_update_manager'); - $field_definition = $entity_definition_update_manager->getFieldStorageDefinition('status', 'comment'); - $field_definition->setDescription(new TranslatableMarkup('A boolean indicating the published state.')) - ->setRevisionable(TRUE); - $entity_definition_update_manager->updateFieldStorageDefinition($field_definition); -} - -/** - * Set the 'published' entity key. - */ -function comment_update_8301() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('comment'); - $keys = $entity_type->getKeys(); - $keys['published'] = 'status'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); -} - -/** - * Update the status field. - */ -function comment_update_8400() { - // The status field was promoted to an entity key in comment_update_8301(), - // which makes it NOT NULL in the default SQL storage, which means its storage - // definition needs to be updated as well. - $entity_definition_update_manager = \Drupal::service('entity.definition_update_manager'); - $entity_definition_update_manager->updateFieldStorageDefinition($entity_definition_update_manager->getFieldStorageDefinition('status', 'comment')); -} - -/** - * Configure the comment hostname base field to use a default value callback. - */ -function comment_update_8600() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - /** @var \Drupal\Core\Field\BaseFieldDefinition $field_storage_definition */ - $field_storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('hostname', 'comment'); - $field_storage_definition->setDefaultValueCallback(Comment::class . '::getDefaultHostname'); - $entity_definition_update_manager->updateFieldStorageDefinition($field_storage_definition); -} - -/** - * Set the 'owner' entity key and update the field. - */ -function comment_update_8700() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('comment'); - $keys = $entity_type->getKeys(); - $keys['owner'] = 'uid'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); - $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'comment')); -} - -/** - * Make the 'entity_type' and 'field_name' comment fields required. - */ -function comment_update_8701() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $field_definition = $definition_update_manager->getFieldStorageDefinition('entity_type', 'comment'); - $field_definition->setRequired(TRUE); - $definition_update_manager->updateFieldStorageDefinition($field_definition); - - $field_definition = $definition_update_manager->getFieldStorageDefinition('field_name', 'comment'); - $field_definition->setRequired(TRUE); - $definition_update_manager->updateFieldStorageDefinition($field_definition); +function comment_update_last_removed() { + return 8701; } diff --git a/core/modules/comment/tests/fixtures/update/drupal-8.empty-comment-fields.3052147.php b/core/modules/comment/tests/fixtures/update/drupal-8.empty-comment-fields.3052147.php deleted file mode 100644 index b57a784b1a2..00000000000 --- a/core/modules/comment/tests/fixtures/update/drupal-8.empty-comment-fields.3052147.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8-rc1.filled.standard.php.gz for the - * upgrade path in https://www.drupal.org/project/drupal/issues/2885809. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->insert('comment') - ->fields([ - 'cid', - 'comment_type', - 'uuid', - 'langcode', - ]) - ->values([ - 'cid' => '5', - 'comment_type' => 'comment', - 'uuid' => '2f0505ad-fdc7-49fc-9d39-571bfc3e0f88', - 'langcode' => 'en', - ]) - ->values([ - 'cid' => '6', - 'comment_type' => 'comment', - 'uuid' => '3be94e6b-4506-488a-a861-9742a18f0507', - 'langcode' => 'en', - ]) - ->execute(); - -$connection->insert('comment__comment_body') - ->fields([ - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'comment_body_value', - 'comment_body_format', - ]) - ->values([ - 'bundle' => 'comment', - 'deleted' => '0', - 'entity_id' => '5', - 'revision_id' => '5', - 'langcode' => 'en', - 'delta' => '0', - 'comment_body_value' => "<p>Comment body</p>\r\n", - 'comment_body_format' => 'basic_html', - ]) - ->values([ - 'bundle' => 'comment', - 'deleted' => '0', - 'entity_id' => '6', - 'revision_id' => '6', - 'langcode' => 'en', - 'delta' => '0', - 'comment_body_value' => "<p>Comment body</p>\r\n", - 'comment_body_format' => 'basic_html', - ]) - ->execute(); - -$connection->insert('comment_field_data') - ->fields([ - 'cid', - 'comment_type', - 'langcode', - 'pid', - 'entity_id', - 'subject', - 'uid', - 'name', - 'mail', - 'homepage', - 'hostname', - 'created', - 'changed', - 'status', - 'thread', - 'entity_type', - 'field_name', - 'default_langcode', - ]) - ->values([ - 'cid' => '5', - 'comment_type' => 'comment', - 'langcode' => 'en', - 'pid' => NULL, - 'entity_id' => '8', - 'subject' => 'Comment with no entity_type', - 'uid' => '1', - 'name' => 'drupal', - 'mail' => NULL, - 'homepage' => NULL, - 'hostname' => '127.0.0.1', - 'created' => '1557218256', - 'changed' => '1557218256', - 'status' => '1', - 'thread' => '02/', - 'entity_type' => NULL, - 'field_name' => 'field_test_2', - 'default_langcode' => '1', - ]) - ->values([ - 'cid' => '6', - 'comment_type' => 'comment', - 'langcode' => 'en', - 'pid' => NULL, - 'entity_id' => '8', - 'subject' => 'Comment with no field_name', - 'uid' => '1', - 'name' => 'drupal', - 'mail' => NULL, - 'homepage' => NULL, - 'hostname' => '127.0.0.1', - 'created' => '1557218266', - 'changed' => '1557218266', - 'status' => '1', - 'thread' => '03/', - 'entity_type' => 'node', - 'field_name' => NULL, - 'default_langcode' => '1', - ]) - ->execute(); diff --git a/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php b/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php deleted file mode 100644 index 65c36e652aa..00000000000 --- a/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\Tests\comment\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that comment admin view is enabled after update. - * - * @see comment_post_update_enable_comment_admin_view() - * - * @group Update - * @group legacy - */ -class CommentAdminViewUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['comment', 'views']; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests that comment admin view is enabled after update. - */ - public function testCommentAdminPostUpdateHook() { - $this->runUpdates(); - // Ensure we can load the view from the storage after the update and it's - // enabled. - $entity_type_manager = \Drupal::entityTypeManager(); - /** @var \Drupal\views\ViewEntityInterface $comment_admin_view */ - $comment_admin_view = $entity_type_manager->getStorage('view')->load('comment'); - $this->assertNotNull($comment_admin_view, 'Comment admin view exist in storage.'); - $this->assertTrue((bool) $comment_admin_view->enable()->get('status'), 'Comment admin view is enabled.'); - $comment_delete_action = $entity_type_manager->getStorage('action')->load('comment_delete_action'); - $this->assertNotNull($comment_delete_action, 'Comment delete action imported'); - // Verify comment admin page is working after updates. - $account = $this->drupalCreateUser(['administer comments']); - $this->drupalLogin($account); - $this->drupalGet('admin/content/comment'); - $this->assertText(t('No comments available.')); - } - -} diff --git a/core/modules/comment/tests/src/Functional/Update/CommentHostnameUpdateTest.php b/core/modules/comment/tests/src/Functional/Update/CommentHostnameUpdateTest.php deleted file mode 100644 index 6fecb1f4010..00000000000 --- a/core/modules/comment/tests/src/Functional/Update/CommentHostnameUpdateTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Drupal\Tests\comment\Functional\Update; - -use Drupal\comment\Entity\Comment; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that comment hostname settings are properly updated. - * - * @group comment - * @group legacy - */ -class CommentHostnameUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - ]; - } - - /** - * Tests comment_update_8600(). - * - * @see comment_update_8600 - */ - public function testCommentUpdate8600() { - /** @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $manager */ - $manager = $this->container->get('entity.definition_update_manager'); - - /** @var \Drupal\Core\Field\BaseFieldDefinition $definition */ - $definition = $manager->getFieldStorageDefinition('hostname', 'comment'); - // Check that 'hostname' base field doesn't have a default value callback. - $this->assertNull($definition->getDefaultValueCallback()); - - $this->runUpdates(); - - $definition = $manager->getFieldStorageDefinition('hostname', 'comment'); - // Check that 'hostname' base field default value callback was set. - $this->assertEquals(Comment::class . '::getDefaultHostname', $definition->getDefaultValueCallback()); - } - - /** - * Tests comment_post_update_add_ip_address_setting(). - * - * @see comment_post_update_add_ip_address_setting() - */ - public function testCommentPostUpdateAddIpAddressSetting() { - /** @var \Drupal\Core\Config\ConfigFactoryInterface $factory */ - $factory = $this->container->get('config.factory'); - - $settings = $factory->listAll('comment.settings'); - $this->assertEmpty($settings); - - $this->runUpdates(); - - $settings = $factory->get('comment.settings'); - // Check that settings default value was set. - $this->assertEquals(TRUE, $settings->get('log_ip_addresses')); - } - -} diff --git a/core/modules/comment/tests/src/Functional/Update/CommentUpdateTest.php b/core/modules/comment/tests/src/Functional/Update/CommentUpdateTest.php deleted file mode 100644 index b800e47f4ee..00000000000 --- a/core/modules/comment/tests/src/Functional/Update/CommentUpdateTest.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php - -namespace Drupal\Tests\comment\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that comment settings are properly updated during database updates. - * - * @group comment - * @group legacy - */ -class CommentUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz', - ]; - } - - /** - * Tests comment_update_8200(). - * - * @see comment_update_8200() - */ - public function testCommentUpdate8101() { - // Load the 'node.article.default' entity view display config, and check - // that component 'comment' does not contain the 'view_mode' setting. - $config = $this->config('core.entity_view_display.node.article.default'); - $this->assertNull($config->get('content.comment.settings.view_mode')); - - // Load the 'node.forum.default' entity view display config, and check that - // component 'comment_forum' does not contain the 'view_mode' setting. - $config = $this->config('core.entity_view_display.node.forum.default'); - $this->assertNull($config->get('content.comment_forum.settings.view_mode')); - - // Run updates. - $this->runUpdates(); - - // Check that 'node.article.default' entity view display setting 'view_mode' - // has the value 'default'. - $config = $this->config('core.entity_view_display.node.article.default'); - $this->assertIdentical($config->get('content.comment.settings.view_mode'), 'default'); - - // Check that 'node.forum.default' entity view display setting 'view_mode' - // has the value 'default'. - $config = $this->config('core.entity_view_display.node.forum.default'); - $this->assertIdentical($config->get('content.comment_forum.settings.view_mode'), 'default'); - } - - /** - * Tests that the comment entity type has a 'published' entity key. - * - * @see comment_update_8301() - */ - public function testPublishedEntityKey() { - // Check that the 'published' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('comment'); - $this->assertFalse($entity_type->getKey('published')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('comment'); - $this->assertEqual('status', $entity_type->getKey('published')); - - // Check that the {comment_field_data} table status index has been created. - $this->assertTrue(\Drupal::database()->schema()->indexExists('comment_field_data', 'comment__status_comment_type')); - } - - /** - * Tests that the comment entity type has an 'owner' entity key. - * - * @see comment_update_8700() - */ - public function testOwnerEntityKey() { - // Check that the 'owner' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('comment'); - $this->assertFalse($entity_type->getKey('owner')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('comment'); - $this->assertEquals('uid', $entity_type->getKey('owner')); - } - - /** - * Tests whether the 'entity_type' and 'field_name' columns are required. - * - * @see comment_update_8701() - */ - public function testCommentEntityTypeAndFieldNameRequired() { - $database = \Drupal::database(); - $this->assertEquals(2, $database->query('SELECT count(*) FROM {comment_field_data}')->fetchField()); - if ($database->driver() === 'mysql') { - $table_description = $database - ->query('DESCRIBE {comment_field_data}') - ->fetchAllAssoc('Field'); - $this->assertEquals('YES', $table_description['entity_type']->Null); - $this->assertEquals('YES', $table_description['field_name']->Null); - } - - $this->runUpdates(); - - $this->assertEquals(2, $database->query('SELECT count(*) FROM {comment_field_data}')->fetchField()); - if ($database->driver() === 'mysql') { - $table_description = $database - ->query('DESCRIBE {comment_field_data}') - ->fetchAllAssoc('Field'); - $this->assertEquals('NO', $table_description['entity_type']->Null); - $this->assertEquals('NO', $table_description['field_name']->Null); - } - } - - /** - * Test the update hook requirements check for 8701. - * - * @see comment_update_8701() - * @see comment_requirements() - */ - public function testCommentEntityTypeAndFieldUpdateRequirementsCheck() { - require_once __DIR__ . '/../../../fixtures/update/drupal-8.empty-comment-fields.3052147.php'; - $this->writeSettings([ - 'settings' => [ - 'update_free_access' => (object) [ - 'value' => TRUE, - 'required' => TRUE, - ], - ], - ]); - $this->drupalGet($this->updateUrl); - $this->assertSession()->pageTextContains('Errors found'); - $this->assertSession()->elementContains('css', '.system-status-report__entry--error', 'The comment_update_8701() function requires that the <em class="placeholder">entity_type</em> and <em class="placeholder">field_name</em> fields have values for all comment entities.'); - } - -} diff --git a/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php b/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php deleted file mode 100644 index 607fbfe56b4..00000000000 --- a/core/modules/contact/tests/src/Functional/Update/ContactUpdateTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Drupal\Tests\contact\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests contact update path. - * - * @group contact - * @group legacy - */ -class ContactUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests contact_form updates. - * - * @see contact_post_update_add_message_redirect_field_to_contact_form() - */ - public function testPostUpdateContactFormFields() { - // Check that contact_form does not have fields redirect and message. - $config_factory = \Drupal::configFactory(); - // Check that contact_form entities are more than zero. - $contact_forms = $config_factory->listAll('contact.form.'); - $this->assertGreaterThan(0, count($contact_forms), 'There are contact forms to update.'); - foreach ($contact_forms as $contact_config_name) { - $contact_form_data = $config_factory->get($contact_config_name)->get(); - $this->assertFalse(isset($contact_form_data['message']), 'Prior to running the update the "message" key does not exist.'); - $this->assertFalse(isset($contact_form_data['redirect']), 'Prior to running the update the "redirect" key does not exist.'); - } - - // Run updates. - $this->runUpdates(); - - // Check that the contact_form entities have been updated. - foreach ($contact_forms as $contact_config_name) { - $contact_form_data = $config_factory->get($contact_config_name)->get(); - $this->assertTrue(isset($contact_form_data['message']), 'After running the update the "message" key exists.'); - $this->assertEqual('Your message has been sent.', $contact_form_data['message']); - $this->assertTrue(isset($contact_form_data['redirect']), 'After running the update the "redirect" key exists.'); - $this->assertEqual('', $contact_form_data['redirect']); - } - } - -} diff --git a/core/modules/content_moderation/content_moderation.install b/core/modules/content_moderation/content_moderation.install index 5be700c6de4..d3e817c5671 100644 --- a/core/modules/content_moderation/content_moderation.install +++ b/core/modules/content_moderation/content_moderation.install @@ -6,24 +6,8 @@ */ /** - * Remove the 'content_revision_tracker' table. + * Implements hook_update_last_removed(). */ -function content_moderation_update_8401() { - $database_schema = \Drupal::database()->schema(); - if ($database_schema->tableExists('content_revision_tracker')) { - $database_schema->dropTable('content_revision_tracker'); - } -} - -/** - * Set the 'owner' entity key and update the field. - */ -function content_moderation_update_8700() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('content_moderation_state'); - $keys = $entity_type->getKeys(); - $keys['owner'] = 'uid'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); - $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'content_moderation_state')); +function content_moderation_update_last_removed() { + return 8700; } diff --git a/core/modules/content_moderation/tests/fixtures/update/drupal-8.4.0-content_moderation_installed.php b/core/modules/content_moderation/tests/fixtures/update/drupal-8.4.0-content_moderation_installed.php deleted file mode 100644 index 0784013c273..00000000000 --- a/core/modules/content_moderation/tests/fixtures/update/drupal-8.4.0-content_moderation_installed.php +++ /dev/null @@ -1,665 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Content moderation installed in the standard profile at 8.4.0. - * - * This file applies on top of drupal-8.4.0.bare.standard.php.gz. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->delete('config') - ->condition('name', ['core.extension'], 'IN') - ->execute(); - -$connection->insert('config') - ->fields(array( - 'collection', - 'name', - 'data', - )) - ->values(array( - 'collection' => '', - 'name' => 'core.extension', - 'data' => 'a:4:{s:6:"module";a:44:{s:14:"automated_cron";i:0;s:5:"block";i:0;s:13:"block_content";i:0;s:10:"breakpoint";i:0;s:8:"ckeditor";i:0;s:5:"color";i:0;s:7:"comment";i:0;s:6:"config";i:0;s:7:"contact";i:0;s:18:"content_moderation";i:0;s:10:"contextual";i:0;s:8:"datetime";i:0;s:5:"dblog";i:0;s:18:"dynamic_page_cache";i:0;s:6:"editor";i:0;s:5:"field";i:0;s:8:"field_ui";i:0;s:4:"file";i:0;s:6:"filter";i:0;s:4:"help";i:0;s:7:"history";i:0;s:5:"image";i:0;s:4:"link";i:0;s:7:"menu_ui";i:0;s:4:"node";i:0;s:7:"options";i:0;s:10:"page_cache";i:0;s:4:"path";i:0;s:9:"quickedit";i:0;s:3:"rdf";i:0;s:6:"search";i:0;s:8:"shortcut";i:0;s:6:"system";i:0;s:8:"taxonomy";i:0;s:4:"text";i:0;s:7:"toolbar";i:0;s:4:"tour";i:0;s:6:"update";i:0;s:4:"user";i:0;s:8:"views_ui";i:0;s:9:"workflows";i:0;s:17:"menu_link_content";i:1;s:5:"views";i:10;s:8:"standard";i:1000;}s:5:"theme";a:4:{s:6:"stable";i:0;s:6:"classy";i:0;s:6:"bartik";i:0;s:5:"seven";i:0;}s:7:"profile";s:8:"standard";s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"R4IF-ClDHXxblLcG0L7MgsLvfBIMAvi_skumNFQwkDc";}}', - )) - ->values(array( - 'collection' => '', - 'name' => 'workflows.workflow.editorial', - 'data' => 'a:9:{s:4:"uuid";s:36:"08b548c7-ff59-468b-9347-7d697680d035";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"module";a:1:{i:0;s:18:"content_moderation";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"T_JxNjYlfoRBi7Bj1zs5Xv9xv1btuBkKp5C1tNrjMhI";}s:2:"id";s:9:"editorial";s:5:"label";s:9:"Editorial";s:4:"type";s:18:"content_moderation";s:13:"type_settings";a:3:{s:6:"states";a:3:{s:8:"archived";a:4:{s:5:"label";s:8:"Archived";s:6:"weight";i:5;s:9:"published";b:0;s:16:"default_revision";b:1;}s:5:"draft";a:4:{s:5:"label";s:5:"Draft";s:9:"published";b:0;s:16:"default_revision";b:0;s:6:"weight";i:-5;}s:9:"published";a:4:{s:5:"label";s:9:"Published";s:9:"published";b:1;s:16:"default_revision";b:1;s:6:"weight";i:0;}}s:11:"transitions";a:5:{s:7:"archive";a:4:{s:5:"label";s:7:"Archive";s:4:"from";a:1:{i:0;s:9:"published";}s:2:"to";s:8:"archived";s:6:"weight";i:2;}s:14:"archived_draft";a:4:{s:5:"label";s:16:"Restore to Draft";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:5:"draft";s:6:"weight";i:3;}s:18:"archived_published";a:4:{s:5:"label";s:7:"Restore";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:9:"published";s:6:"weight";i:4;}s:16:"create_new_draft";a:4:{s:5:"label";s:16:"Create New Draft";s:2:"to";s:5:"draft";s:6:"weight";i:0;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}s:7:"publish";a:4:{s:5:"label";s:7:"Publish";s:2:"to";s:9:"published";s:6:"weight";i:1;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}}s:12:"entity_types";a:0:{}}}', - )) - ->execute(); - -$connection->schema()->createTable('content_moderation_state', array( - 'fields' => array( - 'id' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'uuid' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - ), - 'primary key' => array( - 'id', - ), - 'unique keys' => array( - 'content_moderation_state_field__uuid__value' => array( - 'uuid', - ), - 'content_moderation_state__revision_id' => array( - 'revision_id', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('content_moderation_state_field_data', array( - 'fields' => array( - 'id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - 'uid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'workflow' => array( - 'type' => 'varchar_ascii', - 'not null' => FALSE, - 'length' => '255', - ), - 'moderation_state' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - 'content_entity_type_id' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '32', - ), - 'content_entity_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'content_entity_revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'default_langcode' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - ), - 'revision_translation_affected' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'tiny', - ), - ), - 'primary key' => array( - 'id', - 'langcode', - ), - 'unique keys' => array( - 'content_moderation_state__lookup' => array( - 'content_entity_type_id', - 'content_entity_id', - 'content_entity_revision_id', - 'workflow', - 'langcode', - ), - ), - 'indexes' => array( - 'content_moderation_state__id__default_langcode__langcode' => array( - 'id', - 'default_langcode', - 'langcode', - ), - 'content_moderation_state__revision_id' => array( - 'revision_id', - ), - 'content_moderation_state_field__uid__target_id' => array( - 'uid', - ), - 'content_moderation_state__09628d8dbc' => array( - 'workflow', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('content_moderation_state_field_revision', array( - 'fields' => array( - 'id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - 'uid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'workflow' => array( - 'type' => 'varchar_ascii', - 'not null' => FALSE, - 'length' => '255', - ), - 'moderation_state' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - 'content_entity_type_id' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '32', - ), - 'content_entity_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'content_entity_revision_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'default_langcode' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - ), - 'revision_translation_affected' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'tiny', - ), - ), - 'primary key' => array( - 'revision_id', - 'langcode', - ), - 'unique keys' => array( - 'content_moderation_state__lookup' => array( - 'content_entity_type_id', - 'content_entity_id', - 'content_entity_revision_id', - 'workflow', - 'langcode', - ), - ), - 'indexes' => array( - 'content_moderation_state__id__default_langcode__langcode' => array( - 'id', - 'default_langcode', - 'langcode', - ), - 'content_moderation_state_field__uid__target_id' => array( - 'uid', - ), - 'content_moderation_state__09628d8dbc' => array( - 'workflow', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('content_moderation_state_revision', array( - 'fields' => array( - 'id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - ), - 'primary key' => array( - 'revision_id', - ), - 'indexes' => array( - 'content_moderation_state__id' => array( - 'id', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->delete('key_value') - ->condition('name', [ - 'routing.non_admin_routes', - 'system.js_cache_files', - 'system.theme.files', - ], 'IN') - ->execute(); - -$connection->insert('key_value') - ->fields(array( - 'collection', - 'name', - 'value', - )) - ->values(array( - 'collection' => 'config.entity.key_store.workflow', - 'name' => 'uuid:08b548c7-ff59-468b-9347-7d697680d035', - 'value' => 'a:1:{i:0;s:28:"workflows.workflow.editorial";}', - )) - ->values(array( - 'collection' => 'entity.definitions.installed', - 'name' => 'content_moderation_state.entity_type', - 'value' => 'O:36:"Drupal\Core\Entity\ContentEntityType":38:{s:25:" - )) - ->values(array( - 'collection' => 'entity.definitions.installed', - 'name' => 'content_moderation_state.field_storage_definitions', - 'value' => 'a:12:{s:2:"id";O:37:"Drupal\Core\Field\BaseFieldDefinition":5:{s:7:" - )) - ->values(array( - 'collection' => 'entity.definitions.installed', - 'name' => 'workflow.entity_type', - 'value' => 'O:42:"Drupal\Core\Config\Entity\ConfigEntityType":41:{s:16:" - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.entity_schema_data', - 'value' => 'a:4:{s:24:"content_moderation_state";a:2:{s:11:"primary key";a:1:{i:0;s:2:"id";}s:11:"unique keys";a:1:{s:37:"content_moderation_state__revision_id";a:1:{i:0;s:11:"revision_id";}}}s:33:"content_moderation_state_revision";a:2:{s:11:"primary key";a:1:{i:0;s:11:"revision_id";}s:7:"indexes";a:1:{s:28:"content_moderation_state__id";a:1:{i:0;s:2:"id";}}}s:35:"content_moderation_state_field_data";a:3:{s:11:"primary key";a:2:{i:0;s:2:"id";i:1;s:8:"langcode";}s:7:"indexes";a:2:{s:56:"content_moderation_state__id__default_langcode__langcode";a:3:{i:0;s:2:"id";i:1;s:16:"default_langcode";i:2;s:8:"langcode";}s:37:"content_moderation_state__revision_id";a:1:{i:0;s:11:"revision_id";}}s:11:"unique keys";a:1:{s:32:"content_moderation_state__lookup";a:5:{i:0;s:22:"content_entity_type_id";i:1;s:17:"content_entity_id";i:2;s:26:"content_entity_revision_id";i:3;s:8:"workflow";i:4;s:8:"langcode";}}}s:39:"content_moderation_state_field_revision";a:3:{s:11:"primary key";a:2:{i:0;s:11:"revision_id";i:1;s:8:"langcode";}s:7:"indexes";a:1:{s:56:"content_moderation_state__id__default_langcode__langcode";a:3:{i:0;s:2:"id";i:1;s:16:"default_langcode";i:2;s:8:"langcode";}}s:11:"unique keys";a:1:{s:32:"content_moderation_state__lookup";a:5:{i:0;s:22:"content_entity_type_id";i:1;s:17:"content_entity_id";i:2;s:26:"content_entity_revision_id";i:3;s:8:"workflow";i:4;s:8:"langcode";}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.content_entity_id', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:17:"content_entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:0;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:17:"content_entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:0;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.content_entity_revision_id', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:26:"content_entity_revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:0;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:26:"content_entity_revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:0;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.content_entity_type_id', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:22:"content_entity_type_id";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:32;s:6:"binary";b:0;s:8:"not null";b:0;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:22:"content_entity_type_id";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:32;s:6:"binary";b:0;s:8:"not null";b:0;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.default_langcode', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:16:"default_langcode";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:16:"default_langcode";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.id', - 'value' => 'a:4:{s:24:"content_moderation_state";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:33:"content_moderation_state_revision";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.langcode', - 'value' => 'a:4:{s:24:"content_moderation_state";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}s:33:"content_moderation_state_revision";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.moderation_state', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:16:"moderation_state";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:6:"binary";b:0;s:8:"not null";b:0;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:16:"moderation_state";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:6:"binary";b:0;s:8:"not null";b:0;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.revision_id', - 'value' => 'a:4:{s:24:"content_moderation_state";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:33:"content_moderation_state_revision";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.revision_translation_affected', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:1:{s:6:"fields";a:1:{s:29:"revision_translation_affected";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}}}s:39:"content_moderation_state_field_revision";a:1:{s:6:"fields";a:1:{s:29:"revision_translation_affected";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.uid', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:2:{s:6:"fields";a:1:{s:3:"uid";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;}}s:7:"indexes";a:1:{s:46:"content_moderation_state_field__uid__target_id";a:1:{i:0;s:3:"uid";}}}s:39:"content_moderation_state_field_revision";a:2:{s:6:"fields";a:1:{s:3:"uid";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;}}s:7:"indexes";a:1:{s:46:"content_moderation_state_field__uid__target_id";a:1:{i:0;s:3:"uid";}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.uuid', - 'value' => 'a:1:{s:24:"content_moderation_state";a:2:{s:6:"fields";a:1:{s:4:"uuid";a:4:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:6:"binary";b:0;s:8:"not null";b:1;}}s:11:"unique keys";a:1:{s:43:"content_moderation_state_field__uuid__value";a:1:{i:0;s:4:"uuid";}}}}', - )) - ->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'content_moderation_state.field_schema_data.workflow', - 'value' => 'a:2:{s:35:"content_moderation_state_field_data";a:2:{s:6:"fields";a:1:{s:8:"workflow";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:13:"varchar_ascii";s:6:"length";i:255;s:8:"not null";b:0;}}s:7:"indexes";a:1:{s:36:"content_moderation_state__09628d8dbc";a:1:{i:0;s:8:"workflow";}}}s:39:"content_moderation_state_field_revision";a:2:{s:6:"fields";a:1:{s:8:"workflow";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:13:"varchar_ascii";s:6:"length";i:255;s:8:"not null";b:0;}}s:7:"indexes";a:1:{s:36:"content_moderation_state__09628d8dbc";a:1:{i:0;s:8:"workflow";}}}}', - )) - ->values(array( - 'collection' => 'state', - 'name' => 'routing.non_admin_routes', - 'value' => 'a:97:{i:0;s:27:"block.category_autocomplete";i:1;s:22:"block_content.add_page";i:2;s:22:"block_content.add_form";i:3;s:30:"entity.block_content.canonical";i:4;s:30:"entity.block_content.edit_form";i:5;s:32:"entity.block_content.delete_form";i:6;s:24:"entity.comment.edit_form";i:7;s:15:"comment.approve";i:8;s:24:"entity.comment.canonical";i:9;s:26:"entity.comment.delete_form";i:10;s:13:"comment.reply";i:11;s:31:"comment.new_comments_node_links";i:12;s:21:"comment.node_redirect";i:13;s:17:"contact.site_page";i:14;s:29:"entity.contact_form.canonical";i:15;s:24:"entity.user.contact_form";i:16;s:17:"contextual.render";i:17;s:17:"editor.filter_xss";i:18;s:31:"editor.field_untransformed_text";i:19;s:19:"editor.image_dialog";i:20;s:18:"editor.link_dialog";i:21;s:18:"file.ajax_progress";i:22;s:15:"filter.tips_all";i:23;s:11:"filter.tips";i:24;s:26:"history.get_last_node_view";i:25;s:17:"history.read_node";i:26;s:18:"image.style_public";i:27;s:19:"image.style_private";i:28;s:12:"image.upload";i:29;s:10:"image.info";i:30;s:13:"node.add_page";i:31;s:8:"node.add";i:32;s:19:"entity.node.preview";i:33;s:27:"entity.node.version_history";i:34;s:20:"entity.node.revision";i:35;s:28:"node.revision_revert_confirm";i:36;s:40:"node.revision_revert_translation_confirm";i:37;s:28:"node.revision_delete_confirm";i:38;s:18:"quickedit.metadata";i:39;s:21:"quickedit.attachments";i:40;s:20:"quickedit.field_form";i:41;s:21:"quickedit.entity_save";i:42;s:11:"search.view";i:43;s:23:"search.view_node_search";i:44;s:23:"search.help_node_search";i:45;s:23:"search.view_user_search";i:46;s:23:"search.help_user_search";i:47;s:19:"shortcut.set_switch";i:48;s:10:"system.401";i:49;s:10:"system.403";i:50;s:10:"system.404";i:51;s:10:"system.4xx";i:52;s:11:"system.cron";i:53;s:33:"system.machine_name_transliterate";i:54;s:12:"system.files";i:55;s:28:"system.private_file_download";i:56;s:16:"system.temporary";i:57;s:7:"<front>";i:58;s:6:"<none>";i:59;s:8:"<nolink>";i:60;s:9:"<current>";i:61;s:15:"system.timezone";i:62;s:22:"system.batch_page.html";i:63;s:22:"system.batch_page.json";i:64;s:16:"system.db_update";i:65;s:26:"system.entity_autocomplete";i:66;s:16:"system.csrftoken";i:67;s:30:"entity.taxonomy_term.edit_form";i:68;s:32:"entity.taxonomy_term.delete_form";i:69;s:16:"toolbar.subtrees";i:70;s:13:"user.register";i:71;s:11:"user.logout";i:72;s:9:"user.pass";i:73;s:14:"user.pass.http";i:74;s:9:"user.page";i:75;s:10:"user.login";i:76;s:15:"user.login.http";i:77;s:22:"user.login_status.http";i:78;s:16:"user.logout.http";i:79;s:19:"user.cancel_confirm";i:80;s:16:"user.reset.login";i:81;s:10:"user.reset";i:82;s:15:"user.reset.form";i:83;s:21:"view.frontpage.feed_1";i:84;s:21:"view.frontpage.page_1";i:85;s:25:"view.taxonomy_term.feed_1";i:86;s:25:"view.taxonomy_term.page_1";i:87;s:10:"views.ajax";i:88;s:35:"entity.block_content.latest_version";i:89;s:21:"entity.node.canonical";i:90;s:23:"entity.node.delete_form";i:91;s:21:"entity.node.edit_form";i:92;s:26:"entity.node.latest_version";i:93;s:21:"entity.user.canonical";i:94;s:21:"entity.user.edit_form";i:95;s:23:"entity.user.cancel_form";i:96;s:30:"entity.taxonomy_term.canonical";}', - )) - ->values(array( - 'collection' => 'state', - 'name' => 'system.js_cache_files', - 'value' => 'a:10:{s:64:"ef5219d33ebedcd4b9b0ccc64f741d50bebb463122945dd3b12519b97e268ab4";s:61:"public://js/js_VtafjXmRvoUgAzqzYTA3Wrjkx9wcWhjP0G4ZnnqRamA.js";s:64:"22b57c12b5f7dfa20d16a8fb27842e2c48a55df949019086a2e14bfa9b53ed21";s:61:"public://js/js_BKcMdIbOMdbTdLn9dkUq3KCJfIKKo2SvKoQ1AnB8D-g.js";s:64:"c839df7c4fcaff2cb7890a0c2e9316f456b4c990c363fb4eb87a2a601c594055";s:61:"public://js/js_VhqXmo4azheUjYC30rijnR_Dddo0WjWkF27k5gTL8S4.js";s:64:"4290e1da549b525e5a284c0b6932deb2925f10d69b9e9df47ab9cf9be6f908c3";s:61:"public://js/js_bXOpMT4zIssDSNf-hJCfDU-GMYjogKxosCScYEEjggE.js";s:64:"ffc78e60c19e191320a1b742a777ad5b93976fce4b274faf2332dea1c3cf2393";s:61:"public://js/js_lZ_KgpFfmlx3GgVnM7BsJsa7fCjkkusU9keGexj0zRU.js";s:64:"a3979c3d25cb559722f7d2706c5d35e45bee24623da43b716fd806beea460ea4";s:61:"public://js/js_jeYE5w7CHcwrxNQJfqi7dVmAaL_TOwRxNmRmq7vLsUQ.js";s:64:"79ab52de68ab5af51160a0ef90f0c3b81977061cd1b4ec411ace995fb97ed34f";s:61:"public://js/js_PSJbtOVCvisdPwajJGvk9V8i7H6XPQfSy9LE1sAkneE.js";s:64:"07fd78d9ba4d77f63cb7a40bfaf66bb5d6232e46a5822207e8dd0d9252810971";s:61:"public://js/js_yFV18P6CACJDKa_0KFPQJwI-GGWxK6FqfSt1jdGZzDo.js";s:64:"f7a654d4d83e97e639b9855ec7593433aa08380ffd163ea2860c4d17f53f0f1b";s:61:"public://js/js_a-XEqg_PQIgAR7_4F2EScN6QKaClD_F43n2X6kQJwu4.js";s:64:"ddea937b5008530524945e74d82ce7ad1660346c4d44396941f743f3a0440973";s:61:"public://js/js_8BEUTcp1kBATjLlIGkgkfV9MI1FiKvn5V0c3C89wHSI.js";}', - )) - ->values(array( - 'collection' => 'state', - 'name' => 'system.theme.files', - 'value' => 'a:47:{s:19:"test_invalid_engine";s:81:"core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info.yml";s:34:"test_ckeditor_stylesheets_external";s:111:"core/modules/system/tests/themes/test_ckeditor_stylesheets_external/test_ckeditor_stylesheets_external.info.yml";s:43:"test_ckeditor_stylesheets_protocol_relative";s:129:"core/modules/system/tests/themes/test_ckeditor_stylesheets_protocol_relative/test_ckeditor_stylesheets_protocol_relative.info.yml";s:34:"test_ckeditor_stylesheets_relative";s:111:"core/modules/system/tests/themes/test_ckeditor_stylesheets_relative/test_ckeditor_stylesheets_relative.info.yml";s:26:"test_theme_nyan_cat_engine";s:95:"core/modules/system/tests/themes/test_theme_nyan_cat_engine/test_theme_nyan_cat_engine.info.yml";s:19:"test_theme_settings";s:81:"core/modules/system/tests/themes/test_theme_settings/test_theme_settings.info.yml";s:16:"test_theme_theme";s:75:"core/modules/system/tests/themes/test_theme_theme/test_theme_theme.info.yml";s:14:"test_wild_west";s:71:"core/modules/system/tests/themes/test_wild_west/test_wild_west.info.yml";s:5:"stark";s:32:"core/themes/stark/stark.info.yml";s:19:"big_pipe_test_theme";s:83:"core/modules/big_pipe/tests/themes/big_pipe_test_theme/big_pipe_test_theme.info.yml";s:29:"block_test_specialchars_theme";s:119:"core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml";s:16:"block_test_theme";s:93:"core/modules/block/tests/modules/block_test/themes/block_test_theme/block_test_theme.info.yml";s:21:"breakpoint_theme_test";s:89:"core/modules/breakpoint/tests/themes/breakpoint_theme_test/breakpoint_theme_test.info.yml";s:16:"color_test_theme";s:93:"core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.info.yml";s:23:"config_clash_test_theme";s:82:"core/modules/config/tests/config_clash_test_theme/config_clash_test_theme.info.yml";s:29:"config_translation_test_theme";s:113:"core/modules/config_translation/tests/themes/config_translation_test_theme/config_translation_test_theme.info.yml";s:24:"statistics_test_attached";s:95:"core/modules/statistics/tests/themes/statistics_test_attached/statistics_test_attached.info.yml";s:14:"test_basetheme";s:71:"core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml";s:22:"test_invalid_basetheme";s:87:"core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info.yml";s:26:"test_invalid_basetheme_sub";s:95:"core/modules/system/tests/themes/test_invalid_basetheme_sub/test_invalid_basetheme_sub.info.yml";s:17:"test_invalid_core";s:77:"core/modules/system/tests/themes/test_invalid_core/test_invalid_core.info.yml";s:19:"test_invalid_region";s:81:"core/modules/system/tests/themes/test_invalid_region/test_invalid_region.info.yml";s:11:"test_stable";s:65:"core/modules/system/tests/themes/test_stable/test_stable.info.yml";s:16:"test_subsubtheme";s:75:"core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.info.yml";s:10:"test_theme";s:63:"core/modules/system/tests/themes/test_theme/test_theme.info.yml";s:51:"test_theme_having_veery_long_name_which_is_too_long";s:145:"core/modules/system/tests/themes/test_theme_having_veery_long_name_which_is_too_long/test_theme_having_veery_long_name_which_is_too_long.info.yml";s:26:"test_theme_libraries_empty";s:95:"core/modules/system/tests/themes/test_theme_libraries_empty/test_theme_libraries_empty.info.yml";s:27:"test_theme_libraries_extend";s:97:"core/modules/system/tests/themes/test_theme_libraries_extend/test_theme_libraries_extend.info.yml";s:50:"test_theme_libraries_override_with_drupal_settings";s:143:"core/modules/system/tests/themes/test_theme_libraries_override_with_drupal_settings/test_theme_libraries_override_with_drupal_settings.info.yml";s:48:"test_theme_libraries_override_with_invalid_asset";s:139:"core/modules/system/tests/themes/test_theme_libraries_override_with_invalid_asset/test_theme_libraries_override_with_invalid_asset.info.yml";s:40:"test_theme_twig_registry_loader_subtheme";s:123:"core/modules/system/tests/themes/test_theme_twig_registry_loader_subtheme/test_theme_twig_registry_loader_subtheme.info.yml";s:20:"update_test_subtheme";s:83:"core/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info.yml";s:15:"user_test_theme";s:71:"core/modules/user/tests/themes/user_test_theme/user_test_theme.info.yml";s:27:"views_test_checkboxes_theme";s:96:"core/modules/views/tests/themes/views_test_checkboxes_theme/views_test_checkboxes_theme.info.yml";s:16:"views_test_theme";s:74:"core/modules/views/tests/themes/views_test_theme/views_test_theme.info.yml";s:13:"test_subtheme";s:69:"core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml";s:31:"test_theme_twig_registry_loader";s:105:"core/modules/system/tests/themes/test_theme_twig_registry_loader/test_theme_twig_registry_loader.info.yml";s:37:"test_theme_twig_registry_loader_theme";s:117:"core/modules/system/tests/themes/test_theme_twig_registry_loader_theme/test_theme_twig_registry_loader_theme.info.yml";s:21:"update_test_basetheme";s:85:"core/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info.yml";s:6:"stable";s:34:"core/themes/stable/stable.info.yml";s:5:"seven";s:32:"core/themes/seven/seven.info.yml";s:6:"bartik";s:34:"core/themes/bartik/bartik.info.yml";s:6:"classy";s:34:"core/themes/classy/classy.info.yml";s:23:"entity_print_test_theme";s:90:"modules/entity_print/tests/themes/entity_print_test_theme/entity_print_test_theme.info.yml";s:28:"webform_bootstrap_test_theme";s:121:"modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/webform_bootstrap_test_theme.info.yml";s:19:"webform_test_bartik";s:77:"modules/webform/tests/themes/webform_test_bartik/webform_test_bartik.info.yml";s:4:"mayo";s:25:"themes/mayo/mayo.info.yml";}', - )) - ->values(array( - 'collection' => 'system.schema', - 'name' => 'content_moderation', - 'value' => 's:4:"8401";', - )) - ->values(array( - 'collection' => 'system.schema', - 'name' => 'workflows', - 'value' => 'i:8000;', - )) - ->execute(); - -$connection->delete('menu_tree') - ->condition('mlid', [ - '24', - ], 'IN') - ->execute(); - -$connection->insert('menu_tree') - ->fields(array( - 'menu_name', - 'mlid', - 'id', - 'parent', - 'route_name', - 'route_param_key', - 'route_parameters', - 'url', - 'title', - 'description', - 'class', - 'options', - 'provider', - 'enabled', - 'discovered', - 'expanded', - 'weight', - 'metadata', - 'has_children', - 'depth', - 'p1', - 'p2', - 'p3', - 'p4', - 'p5', - 'p6', - 'p7', - 'p8', - 'p9', - 'form_class', - )) - ->values(array( - 'menu_name' => 'admin', - 'mlid' => '24', - 'id' => 'system.admin_config_workflow', - 'parent' => 'system.admin_config', - 'route_name' => 'system.admin_config_workflow', - 'route_param_key' => '', - 'route_parameters' => 'a:0:{}', - 'url' => '', - 'title' => 'O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" - 'description' => 'O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" - 'class' => 'Drupal\Core\Menu\MenuLinkDefault', - 'options' => 'a:0:{}', - 'provider' => 'system', - 'enabled' => '1', - 'discovered' => '1', - 'expanded' => '0', - 'weight' => '5', - 'metadata' => 'a:0:{}', - 'has_children' => '1', - 'depth' => '3', - 'p1' => '1', - 'p2' => '6', - 'p3' => '24', - 'p4' => '0', - 'p5' => '0', - 'p6' => '0', - 'p7' => '0', - 'p8' => '0', - 'p9' => '0', - 'form_class' => 'Drupal\Core\Menu\Form\MenuLinkDefaultForm', - )) - ->values(array( - 'menu_name' => 'admin', - 'mlid' => '63', - 'id' => 'entity.workflow.collection', - 'parent' => 'system.admin_config_workflow', - 'route_name' => 'entity.workflow.collection', - 'route_param_key' => '', - 'route_parameters' => 'a:0:{}', - 'url' => '', - 'title' => 'O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" - 'description' => 'O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" - 'class' => 'Drupal\Core\Menu\MenuLinkDefault', - 'options' => 'a:0:{}', - 'provider' => 'workflows', - 'enabled' => '1', - 'discovered' => '1', - 'expanded' => '0', - 'weight' => '0', - 'metadata' => 'a:0:{}', - 'has_children' => '0', - 'depth' => '4', - 'p1' => '1', - 'p2' => '6', - 'p3' => '24', - 'p4' => '63', - 'p5' => '0', - 'p6' => '0', - 'p7' => '0', - 'p8' => '0', - 'p9' => '0', - 'form_class' => 'Drupal\Core\Menu\Form\MenuLinkDefaultForm', - )) - ->execute(); - -$connection->delete('router') - ->condition('name', [ - 'entity.block_content.canonical', - 'entity.block_content.edit_form', - 'entity.node.edit_form', - ], 'IN') - ->execute(); - -$connection->insert('router') - ->fields(array( - 'name', - 'path', - 'pattern_outline', - 'fit', - 'route', - 'number_parts', - )) - ->values(array( - 'name' => 'content_moderation.workflow_type_edit_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/type/{entity_type_id}', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/type/%', - 'fit' => '250', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1871:{a:9:{s:4:"path";s:72:"/admin/config/workflow/workflows/manage/{workflow}/type/{entity_type_id}";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:5:"_form";s:73:"\Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm";s:15:"_title_callback";s:83:"\Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::getTitle";}s:12:"requirements";a:1:{s:11:"_permission";s:20:"administer workflows";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:19:"route_enhancer.form";}s:14:"_access_checks";a:1:{i:0;s:23:"access_check.permission";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":768:{a:11:{s:4:"vars";a:2:{i:0;s:8:"workflow";i:1;s:14:"entity_type_id";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:97:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/type/(?P<entity_type_id>[^/]++)$#s";s:11:"path_tokens";a:4:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:14:"entity_type_id";}i:1;a:2:{i:0;s:4:"text";i:1;s:5:"/type";}i:2;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:3;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:2:{i:0;s:8:"workflow";i:1;s:14:"entity_type_id";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:250;s:14:"patternOutline";s:48:"/admin/config/workflow/workflows/manage/%/type/%";s:8:"numParts";i:8;}}}}', - 'number_parts' => '8', - )) - ->values(array( - 'name' => 'entity.block_content.canonical', - 'path' => '/block/{block_content}', - 'pattern_outline' => '/block/%', - 'fit' => '2', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1368:{a:9:{s:4:"path";s:22:"/block/{block_content}";s:4:"host";s:0:"";s:8:"defaults";a:1:{s:12:"_entity_form";s:18:"block_content.edit";}s:12:"requirements";a:2:{s:14:"_entity_access";s:20:"block_content.update";s:13:"block_content";s:3:"\d+";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:12:"_admin_route";b:1;s:10:"parameters";a:1:{s:13:"block_content";a:2:{s:4:"type";s:20:"entity:block_content";s:9:"converter";s:30:"paramconverter.latest_revision";}}s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":466:{a:11:{s:4:"vars";a:1:{i:0;s:13:"block_content";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:34:"#^/block/(?P<block_content>\d+)$#s";s:11:"path_tokens";a:2:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:13:"block_content";}i:1;a:2:{i:0;s:4:"text";i:1;s:6:"/block";}}s:9:"path_vars";a:1:{i:0;s:13:"block_content";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:2;s:14:"patternOutline";s:8:"/block/%";s:8:"numParts";i:2;}}}}', - 'number_parts' => '2', - )) - ->values(array( - 'name' => 'entity.block_content.edit_form', - 'path' => '/block/{block_content}', - 'pattern_outline' => '/block/%', - 'fit' => '2', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1368:{a:9:{s:4:"path";s:22:"/block/{block_content}";s:4:"host";s:0:"";s:8:"defaults";a:1:{s:12:"_entity_form";s:18:"block_content.edit";}s:12:"requirements";a:2:{s:14:"_entity_access";s:20:"block_content.update";s:13:"block_content";s:3:"\d+";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:12:"_admin_route";b:1;s:10:"parameters";a:1:{s:13:"block_content";a:2:{s:4:"type";s:20:"entity:block_content";s:9:"converter";s:30:"paramconverter.latest_revision";}}s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":466:{a:11:{s:4:"vars";a:1:{i:0;s:13:"block_content";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:34:"#^/block/(?P<block_content>\d+)$#s";s:11:"path_tokens";a:2:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:13:"block_content";}i:1;a:2:{i:0;s:4:"text";i:1;s:6:"/block";}}s:9:"path_vars";a:1:{i:0;s:13:"block_content";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:2;s:14:"patternOutline";s:8:"/block/%";s:8:"numParts";i:2;}}}}', - 'number_parts' => '2', - )) - ->values(array( - 'name' => 'entity.block_content.latest_version', - 'path' => '/block/{block_content}/latest', - 'pattern_outline' => '/block/%/latest', - 'fit' => '5', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1678:{a:9:{s:4:"path";s:29:"/block/{block_content}/latest";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_view";s:18:"block_content.full";s:15:"_title_callback";s:54:"\Drupal\Core\Entity\Controller\EntityController::title";}s:12:"requirements";a:3:{s:14:"_entity_access";s:18:"block_content.view";s:34:"_content_moderation_latest_version";s:4:"TRUE";s:13:"block_content";s:3:"\d+";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:31:"_content_moderation_entity_type";s:13:"block_content";s:10:"parameters";a:1:{s:13:"block_content";a:3:{s:4:"type";s:20:"entity:block_content";s:21:"load_pending_revision";i:1;s:9:"converter";s:30:"paramconverter.latest_revision";}}s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:2:{i:0;s:19:"access_check.entity";i:1;s:28:"access_check.latest_revision";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":524:{a:11:{s:4:"vars";a:1:{i:0;s:13:"block_content";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:41:"#^/block/(?P<block_content>\d+)/latest$#s";s:11:"path_tokens";a:3:{i:0;a:2:{i:0;s:4:"text";i:1;s:7:"/latest";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:13:"block_content";}i:2;a:2:{i:0;s:4:"text";i:1;s:6:"/block";}}s:9:"path_vars";a:1:{i:0;s:13:"block_content";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:5;s:14:"patternOutline";s:15:"/block/%/latest";s:8:"numParts";i:3;}}}}', - 'number_parts' => '3', - )) - ->values(array( - 'name' => 'entity.node.edit_form', - 'path' => '/node/{node}/edit', - 'pattern_outline' => '/node/%/edit', - 'fit' => '5', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1358:{a:9:{s:4:"path";s:17:"/node/{node}/edit";s:4:"host";s:0:"";s:8:"defaults";a:1:{s:12:"_entity_form";s:9:"node.edit";}s:12:"requirements";a:2:{s:14:"_entity_access";s:11:"node.update";s:4:"node";s:3:"\d+";}s:7:"options";a:7:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:21:"_node_operation_route";b:1;s:12:"_admin_route";b:1;s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:11:"entity:node";s:9:"converter";s:30:"paramconverter.latest_revision";}}s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":476:{a:11:{s:4:"vars";a:1:{i:0;s:4:"node";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:29:"#^/node/(?P<node>\d+)/edit$#s";s:11:"path_tokens";a:3:{i:0;a:2:{i:0;s:4:"text";i:1;s:5:"/edit";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:4:"node";}i:2;a:2:{i:0;s:4:"text";i:1;s:5:"/node";}}s:9:"path_vars";a:1:{i:0;s:4:"node";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:5;s:14:"patternOutline";s:12:"/node/%/edit";s:8:"numParts";i:3;}}}}', - 'number_parts' => '3', - )) - ->values(array( - 'name' => 'entity.node.latest_version', - 'path' => '/node/{node}/latest', - 'pattern_outline' => '/node/%/latest', - 'fit' => '5', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1567:{a:9:{s:4:"path";s:19:"/node/{node}/latest";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_view";s:9:"node.full";s:15:"_title_callback";s:54:"\Drupal\Core\Entity\Controller\EntityController::title";}s:12:"requirements";a:3:{s:14:"_entity_access";s:9:"node.view";s:34:"_content_moderation_latest_version";s:4:"TRUE";s:4:"node";s:3:"\d+";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:31:"_content_moderation_entity_type";s:4:"node";s:10:"parameters";a:1:{s:4:"node";a:3:{s:4:"type";s:11:"entity:node";s:21:"load_pending_revision";i:1;s:9:"converter";s:30:"paramconverter.latest_revision";}}s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:2:{i:0;s:19:"access_check.entity";i:1;s:28:"access_check.latest_revision";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":482:{a:11:{s:4:"vars";a:1:{i:0;s:4:"node";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:31:"#^/node/(?P<node>\d+)/latest$#s";s:11:"path_tokens";a:3:{i:0;a:2:{i:0;s:4:"text";i:1;s:7:"/latest";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:4:"node";}i:2;a:2:{i:0;s:4:"text";i:1;s:5:"/node";}}s:9:"path_vars";a:1:{i:0;s:4:"node";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:5;s:14:"patternOutline";s:14:"/node/%/latest";s:8:"numParts";i:3;}}}}', - 'number_parts' => '3', - )) - ->values(array( - 'name' => 'entity.workflow.add_form', - 'path' => '/admin/config/workflow/workflows/add', - 'pattern_outline' => '/admin/config/workflow/workflows/add', - 'fit' => '31', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1264:{a:9:{s:4:"path";s:36:"/admin/config/workflow/workflows/add";s:4:"host";s:0:"";s:8:"defaults";a:3:{s:12:"_entity_form";s:12:"workflow.add";s:14:"entity_type_id";s:8:"workflow";s:15:"_title_callback";s:56:"Drupal\Core\Entity\Controller\EntityController::addTitle";}s:12:"requirements";a:1:{s:21:"_entity_create_access";s:8:"workflow";}s:7:"options";a:5:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:26:"access_check.entity_create";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":404:{a:11:{s:4:"vars";a:0:{}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:41:"#^/admin/config/workflow/workflows/add$#s";s:11:"path_tokens";a:1:{i:0;a:2:{i:0;s:4:"text";i:1;s:36:"/admin/config/workflow/workflows/add";}}s:9:"path_vars";a:0:{}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:31;s:14:"patternOutline";s:36:"/admin/config/workflow/workflows/add";s:8:"numParts";i:5;}}}}', - 'number_parts' => '5', - )) - ->values(array( - 'name' => 'entity.workflow.add_state_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/add_state', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/add_state', - 'fit' => '125', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1572:{a:9:{s:4:"path";s:60:"/admin/config/workflow/workflows/manage/{workflow}/add_state";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_form";s:18:"workflow.add-state";s:6:"_title";s:9:"Add state";}s:12:"requirements";a:1:{s:14:"_entity_access";s:13:"workflow.edit";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":619:{a:11:{s:4:"vars";a:1:{i:0;s:8:"workflow";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:75:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/add_state$#s";s:11:"path_tokens";a:3:{i:0;a:2:{i:0;s:4:"text";i:1;s:10:"/add_state";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:2;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:1:{i:0;s:8:"workflow";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:125;s:14:"patternOutline";s:51:"/admin/config/workflow/workflows/manage/%/add_state";s:8:"numParts";i:7;}}}}', - 'number_parts' => '7', - )) - ->values(array( - 'name' => 'entity.workflow.add_transition_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/add_transition', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/add_transition', - 'fit' => '125', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1603:{a:9:{s:4:"path";s:65:"/admin/config/workflow/workflows/manage/{workflow}/add_transition";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_form";s:23:"workflow.add-transition";s:6:"_title";s:14:"Add transition";}s:12:"requirements";a:1:{s:14:"_entity_access";s:13:"workflow.edit";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":634:{a:11:{s:4:"vars";a:1:{i:0;s:8:"workflow";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:80:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/add_transition$#s";s:11:"path_tokens";a:3:{i:0;a:2:{i:0;s:4:"text";i:1;s:15:"/add_transition";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:2;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:1:{i:0;s:8:"workflow";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:125;s:14:"patternOutline";s:56:"/admin/config/workflow/workflows/manage/%/add_transition";s:8:"numParts";i:7;}}}}', - 'number_parts' => '7', - )) - ->values(array( - 'name' => 'entity.workflow.collection', - 'path' => '/admin/config/workflow/workflows', - 'pattern_outline' => '/admin/config/workflow/workflows', - 'fit' => '15', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1207:{a:9:{s:4:"path";s:32:"/admin/config/workflow/workflows";s:4:"host";s:0:"";s:8:"defaults";a:4:{s:12:"_entity_list";s:8:"workflow";s:6:"_title";s:9:"Workflows";s:16:"_title_arguments";a:0:{}s:14:"_title_context";s:0:"";}s:12:"requirements";a:1:{s:11:"_permission";s:20:"administer workflows";}s:7:"options";a:5:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:23:"access_check.permission";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":392:{a:11:{s:4:"vars";a:0:{}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:37:"#^/admin/config/workflow/workflows$#s";s:11:"path_tokens";a:1:{i:0;a:2:{i:0;s:4:"text";i:1;s:32:"/admin/config/workflow/workflows";}}s:9:"path_vars";a:0:{}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:15;s:14:"patternOutline";s:32:"/admin/config/workflow/workflows";s:8:"numParts";i:4;}}}}', - 'number_parts' => '4', - )) - ->values(array( - 'name' => 'entity.workflow.delete_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/delete', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/delete', - 'fit' => '125', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1620:{a:9:{s:4:"path";s:57:"/admin/config/workflow/workflows/manage/{workflow}/delete";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_form";s:15:"workflow.delete";s:15:"_title_callback";s:60:"\Drupal\Core\Entity\Controller\EntityController::deleteTitle";}s:12:"requirements";a:1:{s:14:"_entity_access";s:15:"workflow.delete";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":609:{a:11:{s:4:"vars";a:1:{i:0;s:8:"workflow";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:72:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/delete$#s";s:11:"path_tokens";a:3:{i:0;a:2:{i:0;s:4:"text";i:1;s:7:"/delete";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:2;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:1:{i:0;s:8:"workflow";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:125;s:14:"patternOutline";s:48:"/admin/config/workflow/workflows/manage/%/delete";s:8:"numParts";i:7;}}}}', - 'number_parts' => '7', - )) - ->values(array( - 'name' => 'entity.workflow.delete_state_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/state/{workflow_state}/delete', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/state/%/delete', - 'fit' => '501', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1845:{a:9:{s:4:"path";s:80:"/admin/config/workflow/workflows/manage/{workflow}/state/{workflow_state}/delete";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:5:"_form";s:46:"\Drupal\workflows\Form\WorkflowStateDeleteForm";s:6:"_title";s:12:"Delete state";}s:12:"requirements";a:1:{s:29:"_workflow_state_delete_access";s:4:"true";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:19:"route_enhancer.form";}s:14:"_access_checks";a:1:{i:0;s:35:"workflows.access_check.delete_state";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":829:{a:11:{s:4:"vars";a:2:{i:0;s:8:"workflow";i:1;s:14:"workflow_state";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:105:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/state/(?P<workflow_state>[^/]++)/delete$#s";s:11:"path_tokens";a:5:{i:0;a:2:{i:0;s:4:"text";i:1;s:7:"/delete";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:14:"workflow_state";}i:2;a:2:{i:0;s:4:"text";i:1;s:6:"/state";}i:3;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:4;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:2:{i:0;s:8:"workflow";i:1;s:14:"workflow_state";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:501;s:14:"patternOutline";s:56:"/admin/config/workflow/workflows/manage/%/state/%/delete";s:8:"numParts";i:9;}}}}', - 'number_parts' => '9', - )) - ->values(array( - 'name' => 'entity.workflow.delete_transition_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/transition/{workflow_transition}/delete', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/transition/%/delete', - 'fit' => '501', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1880:{a:9:{s:4:"path";s:90:"/admin/config/workflow/workflows/manage/{workflow}/transition/{workflow_transition}/delete";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:5:"_form";s:51:"\Drupal\workflows\Form\WorkflowTransitionDeleteForm";s:6:"_title";s:17:"Delete transition";}s:12:"requirements";a:1:{s:14:"_entity_access";s:13:"workflow.edit";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:19:"route_enhancer.form";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":865:{a:11:{s:4:"vars";a:2:{i:0;s:8:"workflow";i:1;s:19:"workflow_transition";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:115:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/transition/(?P<workflow_transition>[^/]++)/delete$#s";s:11:"path_tokens";a:5:{i:0;a:2:{i:0;s:4:"text";i:1;s:7:"/delete";}i:1;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:19:"workflow_transition";}i:2;a:2:{i:0;s:4:"text";i:1;s:11:"/transition";}i:3;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:4;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:2:{i:0;s:8:"workflow";i:1;s:19:"workflow_transition";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:501;s:14:"patternOutline";s:61:"/admin/config/workflow/workflows/manage/%/transition/%/delete";s:8:"numParts";i:9;}}}}', - 'number_parts' => '9', - )) - ->values(array( - 'name' => 'entity.workflow.edit_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%', - 'fit' => '62', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1551:{a:9:{s:4:"path";s:50:"/admin/config/workflow/workflows/manage/{workflow}";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_form";s:13:"workflow.edit";s:15:"_title_callback";s:58:"\Drupal\Core\Entity\Controller\EntityController::editTitle";}s:12:"requirements";a:1:{s:14:"_entity_access";s:15:"workflow.update";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":551:{a:11:{s:4:"vars";a:1:{i:0;s:8:"workflow";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:65:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)$#s";s:11:"path_tokens";a:2:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:1;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:1:{i:0;s:8:"workflow";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:62;s:14:"patternOutline";s:41:"/admin/config/workflow/workflows/manage/%";s:8:"numParts";i:6;}}}}', - 'number_parts' => '6', - )) - ->values(array( - 'name' => 'entity.workflow.edit_state_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/state/{workflow_state}', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/state/%', - 'fit' => '250', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1740:{a:9:{s:4:"path";s:73:"/admin/config/workflow/workflows/manage/{workflow}/state/{workflow_state}";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_form";s:19:"workflow.edit-state";s:6:"_title";s:10:"Edit state";}s:12:"requirements";a:1:{s:14:"_entity_access";s:13:"workflow.edit";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":771:{a:11:{s:4:"vars";a:2:{i:0;s:8:"workflow";i:1;s:14:"workflow_state";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:98:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/state/(?P<workflow_state>[^/]++)$#s";s:11:"path_tokens";a:4:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:14:"workflow_state";}i:1;a:2:{i:0;s:4:"text";i:1;s:6:"/state";}i:2;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:3;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:2:{i:0;s:8:"workflow";i:1;s:14:"workflow_state";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:250;s:14:"patternOutline";s:49:"/admin/config/workflow/workflows/manage/%/state/%";s:8:"numParts";i:8;}}}}', - 'number_parts' => '8', - )) - ->values(array( - 'name' => 'entity.workflow.edit_transition_form', - 'path' => '/admin/config/workflow/workflows/manage/{workflow}/transition/{workflow_transition}', - 'pattern_outline' => '/admin/config/workflow/workflows/manage/%/transition/%', - 'fit' => '250', - 'route' => 'C:31:"Symfony\Component\Routing\Route":1797:{a:9:{s:4:"path";s:83:"/admin/config/workflow/workflows/manage/{workflow}/transition/{workflow_transition}";s:4:"host";s:0:"";s:8:"defaults";a:2:{s:12:"_entity_form";s:24:"workflow.edit-transition";s:6:"_title";s:15:"Edit transition";}s:12:"requirements";a:1:{s:14:"_entity_access";s:13:"workflow.edit";}s:7:"options";a:6:{s:14:"compiler_class";s:34:"\Drupal\Core\Routing\RouteCompiler";s:10:"parameters";a:1:{s:8:"workflow";a:2:{s:4:"type";s:15:"entity:workflow";s:9:"converter";s:63:"drupal.proxy_original_service.paramconverter.configentity_admin";}}s:12:"_admin_route";b:1;s:14:"_route_filters";a:2:{i:0;s:13:"method_filter";i:1;s:27:"content_type_header_matcher";}s:16:"_route_enhancers";a:2:{i:0;s:31:"route_enhancer.param_conversion";i:1;s:21:"route_enhancer.entity";}s:14:"_access_checks";a:1:{i:0;s:19:"access_check.entity";}}s:7:"schemes";a:0:{}s:7:"methods";a:2:{i:0;s:3:"GET";i:1;s:4:"POST";}s:9:"condition";s:0:"";s:8:"compiled";C:33:"Drupal\Core\Routing\CompiledRoute":808:{a:11:{s:4:"vars";a:2:{i:0;s:8:"workflow";i:1;s:19:"workflow_transition";}s:11:"path_prefix";s:0:"";s:10:"path_regex";s:108:"#^/admin/config/workflow/workflows/manage/(?P<workflow>[^/]++)/transition/(?P<workflow_transition>[^/]++)$#s";s:11:"path_tokens";a:4:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:19:"workflow_transition";}i:1;a:2:{i:0;s:4:"text";i:1;s:11:"/transition";}i:2;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:6:"[^/]++";i:3;s:8:"workflow";}i:3;a:2:{i:0;s:4:"text";i:1;s:39:"/admin/config/workflow/workflows/manage";}}s:9:"path_vars";a:2:{i:0;s:8:"workflow";i:1;s:19:"workflow_transition";}s:10:"host_regex";N;s:11:"host_tokens";a:0:{}s:9:"host_vars";a:0:{}s:3:"fit";i:250;s:14:"patternOutline";s:54:"/admin/config/workflow/workflows/manage/%/transition/%";s:8:"numParts";i:8;}}}}', - 'number_parts' => '8', - )) - ->execute(); diff --git a/core/modules/content_moderation/tests/fixtures/update/drupal-8.5.0-content_moderation_installed.php b/core/modules/content_moderation/tests/fixtures/update/drupal-8.5.0-content_moderation_installed.php deleted file mode 100644 index 4f0a672f831..00000000000 --- a/core/modules/content_moderation/tests/fixtures/update/drupal-8.5.0-content_moderation_installed.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Content moderation installed in the standard profile at 8.5.0. - * - * This file applies on top of drupal-8.4.0-content_moderation_installed.php. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields(array( - 'collection', - 'name', - 'data', - )) - ->values(array( - 'collection' => '', - 'name' => 'views.view.moderated_content', - 'data' => 'a:14:{s:4:"uuid";s:36:"959553ea-c90b-457b-812d-b4ccf82863f5";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:1:{i:0;s:28:"workflows.workflow.editorial";}s:6:"module";a:3:{i:0;s:18:"content_moderation";i:1;s:4:"node";i:2;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"1UIjNd6iIhogbx50cJPDN7Me8cUQx2xCP2IBgrKG6Ms";}s:2:"id";s:17:"moderated_content";s:5:"label";s:17:"Moderated content";s:6:"module";s:5:"views";s:11:"description";s:26:"Find and moderate content.";s:3:"tag";s:0:"";s:10:"base_table";s:19:"node_field_revision";s:10:"base_field";s:3:"vid";s:4:"core";s:3:"8.x";s:7:"display";a:2:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:18:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:28:"view any unpublished content";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:6:"Filter";s:12:"reset_button";b:1;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:1;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"full";s:7:"options";a:7:{s:14:"items_per_page";i:50;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:4:"tags";a:4:{s:8:"previous";s:12:"‹ Previous";s:4:"next";s:8:"Next ›";s:5:"first";s:8:"« First";s:4:"last";s:7:"Last »";}s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"5, 10, 25, 50";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:8:"quantity";i:9;}}s:5:"style";a:2:{s:4:"type";s:5:"table";s:7:"options";a:12:{s:8:"grouping";a:0:{}s:9:"row_class";s:0:"";s:17:"default_row_class";b:1;s:8:"override";b:1;s:6:"sticky";b:1;s:7:"caption";s:0:"";s:7:"summary";s:0:"";s:11:"description";s:0:"";s:7:"columns";a:5:{s:5:"title";s:5:"title";s:4:"type";s:4:"type";s:4:"name";s:4:"name";s:16:"moderation_state";s:16:"moderation_state";s:7:"changed";s:7:"changed";}s:4:"info";a:5:{s:5:"title";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:4:"type";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:4:"name";a:6:{s:8:"sortable";b:0;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:16:"moderation_state";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:7:"changed";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:4:"desc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}}s:7:"default";s:7:"changed";s:11:"empty_table";b:1;}}s:3:"row";a:1:{s:4:"type";s:6:"fields";}s:6:"fields";a:6:{s:5:"title";a:37:{s:2:"id";s:5:"title";s:5:"table";s:19:"node_field_revision";s:5:"field";s:5:"title";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:5:"Title";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:0;s:8:"ellipsis";b:0;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:6:"string";s:8:"settings";a:1:{s:14:"link_to_entity";b:1;}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:4:"node";s:12:"entity_field";s:5:"title";s:9:"plugin_id";s:5:"field";}s:4:"type";a:37:{s:2:"id";s:4:"type";s:5:"table";s:15:"node_field_data";s:5:"field";s:4:"type";s:12:"relationship";s:3:"nid";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:12:"Content type";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:22:"entity_reference_label";s:8:"settings";a:1:{s:4:"link";b:0;}s:12:"group_column";s:9:"target_id";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:4:"node";s:12:"entity_field";s:4:"type";s:9:"plugin_id";s:5:"field";}s:4:"name";a:37:{s:2:"id";s:4:"name";s:5:"table";s:16:"users_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:3:"uid";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:6:"Author";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:9:"user_name";s:8:"settings";a:1:{s:14:"link_to_entity";b:1;}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:4:"user";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:5:"field";}s:16:"moderation_state";a:36:{s:2:"id";s:16:"moderation_state";s:5:"table";s:19:"node_field_revision";s:5:"field";s:16:"moderation_state";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:16:"Moderation state";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:24:"content_moderation_state";s:8:"settings";a:0:{}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:4:"node";s:9:"plugin_id";s:5:"field";}s:7:"changed";a:37:{s:2:"id";s:7:"changed";s:5:"table";s:19:"node_field_revision";s:5:"field";s:7:"changed";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:7:"Updated";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:0;s:8:"ellipsis";b:0;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:9:"timestamp";s:8:"settings";a:3:{s:11:"date_format";s:5:"short";s:18:"custom_date_format";s:0:"";s:8:"timezone";s:0:"";}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:4:"node";s:12:"entity_field";s:7:"changed";s:9:"plugin_id";s:5:"field";}s:10:"operations";a:24:{s:2:"id";s:10:"operations";s:5:"table";s:13:"node_revision";s:5:"field";s:10:"operations";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:10:"Operations";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"destination";b:1;s:11:"entity_type";s:4:"node";s:9:"plugin_id";s:17:"entity_operations";}}s:7:"filters";a:6:{s:15:"latest_revision";a:15:{s:2:"id";s:15:"latest_revision";s:5:"table";s:13:"node_revision";s:5:"field";s:15:"latest_revision";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:10:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:4:"node";s:9:"plugin_id";s:15:"latest_revision";}s:5:"title";a:16:{s:2:"id";s:5:"title";s:5:"table";s:19:"node_field_revision";s:5:"field";s:5:"title";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:8:"title_op";s:5:"label";s:5:"Title";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:8:"title_op";s:10:"identifier";s:5:"title";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:4:"node";s:12:"entity_field";s:5:"title";s:9:"plugin_id";s:6:"string";}s:4:"type";a:16:{s:2:"id";s:4:"type";s:5:"table";s:15:"node_field_data";s:5:"field";s:4:"type";s:12:"relationship";s:3:"nid";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:7:"type_op";s:5:"label";s:12:"Content type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"type_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:4:"node";s:12:"entity_field";s:4:"type";s:9:"plugin_id";s:6:"bundle";}s:16:"moderation_state";a:15:{s:2:"id";s:16:"moderation_state";s:5:"table";s:19:"node_field_revision";s:5:"field";s:16:"moderation_state";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:2:{s:15:"editorial-draft";s:15:"editorial-draft";s:18:"editorial-archived";s:18:"editorial-archived";}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:19:"moderation_state_op";s:5:"label";s:16:"Moderation state";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:19:"moderation_state_op";s:10:"identifier";s:16:"moderation_state";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:1;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:4:"node";s:9:"plugin_id";s:23:"moderation_state_filter";}s:8:"langcode";a:16:{s:2:"id";s:8:"langcode";s:5:"table";s:19:"node_field_revision";s:5:"field";s:8:"langcode";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:11:"langcode_op";s:5:"label";s:8:"Language";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:11:"langcode_op";s:10:"identifier";s:8:"langcode";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:4:"node";s:12:"entity_field";s:8:"langcode";s:9:"plugin_id";s:8:"language";}s:18:"moderation_state_1";a:15:{s:2:"id";s:18:"moderation_state_1";s:5:"table";s:19:"node_field_revision";s:5:"field";s:16:"moderation_state";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:6:"not in";s:5:"value";a:1:{s:19:"editorial-published";s:19:"editorial-published";}s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:11:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:4:"node";s:9:"plugin_id";s:23:"moderation_state_filter";}}s:5:"sorts";a:0:{}s:5:"title";s:17:"Moderated content";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:98:"No moderated content available. Only pending versions of content, such as drafts, are listed here.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:2:{s:3:"nid";a:10:{s:2:"id";s:3:"nid";s:5:"table";s:19:"node_field_revision";s:5:"field";s:3:"nid";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:47:"Get the actual content from a content revision.";s:8:"required";b:0;s:11:"entity_type";s:4:"node";s:12:"entity_field";s:3:"nid";s:9:"plugin_id";s:8:"standard";}s:3:"uid";a:10:{s:2:"id";s:3:"uid";s:5:"table";s:19:"node_field_revision";s:5:"field";s:3:"uid";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:4:"User";s:8:"required";b:0;s:11:"entity_type";s:4:"node";s:12:"entity_field";s:3:"uid";s:9:"plugin_id";s:8:"standard";}}s:9:"arguments";a:0:{}s:17:"display_extenders";a:0:{}s:13:"filter_groups";a:2:{s:8:"operator";s:3:"AND";s:6:"groups";a:1:{i:1;s:3:"AND";}}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:6:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:21:"user.node_grants:view";i:5;s:16:"user.permissions";}s:4:"tags";a:1:{i:0;s:20:"config:workflow_list";}}}s:17:"moderated_content";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:17:"moderated_content";s:13:"display_title";s:17:"Moderated content";s:8:"position";i:1;s:15:"display_options";a:3:{s:17:"display_extenders";a:0:{}s:4:"path";s:23:"admin/content/moderated";s:19:"display_description";s:0:"";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:6:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:21:"user.node_grants:view";i:5;s:16:"user.permissions";}s:4:"tags";a:1:{i:0;s:20:"config:workflow_list";}}}}}', - )) - ->execute(); diff --git a/core/modules/content_moderation/tests/fixtures/update/drupal-8.default-cms-entity-id-2941736.php b/core/modules/content_moderation/tests/fixtures/update/drupal-8.default-cms-entity-id-2941736.php deleted file mode 100644 index 5e9d2361155..00000000000 --- a/core/modules/content_moderation/tests/fixtures/update/drupal-8.default-cms-entity-id-2941736.php +++ /dev/null @@ -1,804 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Content for the update path test in #2941736. - * - * @see \Drupal\Tests\content_moderation\Functional\DefaultContentModerationStateRevisionUpdateTest. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->insert('block_content') - ->fields(array( - 'id', - 'revision_id', - 'type', - 'uuid', - 'langcode', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '1', - 'type' => 'test_block_content', - 'uuid' => '811fac6c-8184-4de5-99eb-9e70d28709f4', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'type' => 'test_block_content', - 'uuid' => 'b89f025c-0538-4075-bd8e-96acf74211c9', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'type' => 'test_block_content', - 'uuid' => '62e428e1-88a6-478c-a8c6-a554ca2332ae', - 'langcode' => 'en', - )) - ->execute(); - -$connection->insert('block_content_field_data') - ->fields(array( - 'id', - 'revision_id', - 'type', - 'langcode', - 'info', - 'changed', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '1', - 'type' => 'test_block_content', - 'langcode' => 'en', - 'info' => 'draft pending revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'type' => 'test_block_content', - 'langcode' => 'en', - 'info' => 'published default revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'type' => 'test_block_content', - 'langcode' => 'en', - 'info' => 'archived default revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); - -$connection->insert('block_content_field_revision') - ->fields(array( - 'id', - 'revision_id', - 'langcode', - 'info', - 'changed', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'info' => 'draft pending revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - 'info' => 'draft pending revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'langcode' => 'en', - 'info' => 'published default revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '4', - 'langcode' => 'en', - 'info' => 'archived default revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'langcode' => 'en', - 'info' => 'archived default revision', - 'changed' => '1517725800', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); - -$connection->insert('block_content_revision') - ->fields(array( - 'id', - 'revision_id', - 'langcode', - 'revision_user', - 'revision_created', - 'revision_log', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'revision_user' => NULL, - 'revision_created' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - 'revision_user' => NULL, - 'revision_created' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'langcode' => 'en', - 'revision_user' => NULL, - 'revision_created' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'id' => '3', - 'revision_id' => '4', - 'langcode' => 'en', - 'revision_user' => NULL, - 'revision_created' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'langcode' => 'en', - 'revision_user' => NULL, - 'revision_created' => '1517725800', - 'revision_log' => NULL, - )) - ->execute(); - -$connection->delete('config') - ->condition('name', ['workflows.workflow.editorial'], 'IN') - ->execute(); - -$connection->insert('config') - ->fields(array( - 'collection', - 'name', - 'data', - )) - ->values(array( - 'collection' => '', - 'name' => 'block_content.type.test_block_content', - 'data' => 'a:8:{s:4:"uuid";s:36:"966baba6-525e-48fe-b8c5-a5f131b1857f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:0:{}s:2:"id";s:18:"test_block_content";s:5:"label";s:18:"Test Block Content";s:8:"revision";N;s:11:"description";N;}', - )) - ->values(array( - 'collection' => '', - 'name' => 'workflows.workflow.editorial', - 'data' => 'a:9:{s:4:"uuid";s:36:"08b548c7-ff59-468b-9347-7d697680d035";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:37:"block_content.type.test_block_content";i:1;s:17:"node.type.article";}s:6:"module";a:1:{i:0;s:18:"content_moderation";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"T_JxNjYlfoRBi7Bj1zs5Xv9xv1btuBkKp5C1tNrjMhI";}s:2:"id";s:9:"editorial";s:5:"label";s:9:"Editorial";s:4:"type";s:18:"content_moderation";s:13:"type_settings";a:3:{s:6:"states";a:3:{s:8:"archived";a:4:{s:5:"label";s:8:"Archived";s:6:"weight";i:5;s:9:"published";b:0;s:16:"default_revision";b:1;}s:5:"draft";a:4:{s:5:"label";s:5:"Draft";s:9:"published";b:0;s:16:"default_revision";b:0;s:6:"weight";i:-5;}s:9:"published";a:4:{s:5:"label";s:9:"Published";s:9:"published";b:1;s:16:"default_revision";b:1;s:6:"weight";i:0;}}s:11:"transitions";a:5:{s:7:"archive";a:4:{s:5:"label";s:7:"Archive";s:4:"from";a:1:{i:0;s:9:"published";}s:2:"to";s:8:"archived";s:6:"weight";i:2;}s:14:"archived_draft";a:4:{s:5:"label";s:16:"Restore to Draft";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:5:"draft";s:6:"weight";i:3;}s:18:"archived_published";a:4:{s:5:"label";s:7:"Restore";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:9:"published";s:6:"weight";i:4;}s:16:"create_new_draft";a:4:{s:5:"label";s:16:"Create New Draft";s:2:"to";s:5:"draft";s:6:"weight";i:0;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}s:7:"publish";a:4:{s:5:"label";s:7:"Publish";s:2:"to";s:9:"published";s:6:"weight";i:1;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}}s:12:"entity_types";a:2:{s:13:"block_content";a:1:{i:0;s:18:"test_block_content";}s:4:"node";a:1:{i:0;s:7:"article";}}}}', - )) - ->execute(); - -$connection->insert('content_moderation_state') - ->fields(array( - 'id', - 'revision_id', - 'uuid', - 'langcode', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '2', - 'uuid' => '3ce04732-f65f-4937-aa49-821f5842ae06', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'uuid' => 'a6507b55-3001-4748-8d32-f4fa47319754', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'uuid' => '112d2bd2-552b-4e2f-9a6d-526740ba1b38', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '4', - 'revision_id' => '7', - 'uuid' => 'a85d0d06-e046-4509-b9b4-75d78dcdd91e', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '5', - 'revision_id' => '8', - 'uuid' => '3797f5de-116b-4d75-b7e3-5206e6f97c41', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '6', - 'revision_id' => '10', - 'uuid' => '8d9b11c1-8ddf-4c61-bb8d-9ac724e28d9e', - 'langcode' => 'en', - )) - ->execute(); - -$connection->insert('content_moderation_state_field_data') - ->fields(array( - 'id', - 'revision_id', - 'langcode', - 'uid', - 'workflow', - 'moderation_state', - 'content_entity_type_id', - 'content_entity_id', - 'content_entity_revision_id', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'draft', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '1', - 'content_entity_revision_id' => '2', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '2', - 'content_entity_revision_id' => '3', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'archived', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '3', - 'content_entity_revision_id' => '5', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '4', - 'revision_id' => '7', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'draft', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '1', - 'content_entity_revision_id' => '2', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '5', - 'revision_id' => '8', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '2', - 'content_entity_revision_id' => '3', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '6', - 'revision_id' => '10', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'archived', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '3', - 'content_entity_revision_id' => '5', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); - -$connection->insert('content_moderation_state_field_revision') - ->fields(array( - 'id', - 'revision_id', - 'langcode', - 'uid', - 'workflow', - 'moderation_state', - 'content_entity_type_id', - 'content_entity_id', - 'content_entity_revision_id', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '1', - 'content_entity_revision_id' => '1', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'draft', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '1', - 'content_entity_revision_id' => '2', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '2', - 'content_entity_revision_id' => '3', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '4', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '3', - 'content_entity_revision_id' => '4', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'archived', - 'content_entity_type_id' => 'node', - 'content_entity_id' => '3', - 'content_entity_revision_id' => '5', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '4', - 'revision_id' => '6', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '1', - 'content_entity_revision_id' => '1', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '4', - 'revision_id' => '7', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'draft', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '1', - 'content_entity_revision_id' => '2', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '5', - 'revision_id' => '8', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '2', - 'content_entity_revision_id' => '3', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '6', - 'revision_id' => '9', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'published', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '3', - 'content_entity_revision_id' => '4', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'id' => '6', - 'revision_id' => '10', - 'langcode' => 'en', - 'uid' => '0', - 'workflow' => 'editorial', - 'moderation_state' => 'archived', - 'content_entity_type_id' => 'block_content', - 'content_entity_id' => '3', - 'content_entity_revision_id' => '5', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); - -$connection->insert('content_moderation_state_revision') - ->fields(array( - 'id', - 'revision_id', - 'langcode', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '2', - 'revision_id' => '3', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '4', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '3', - 'revision_id' => '5', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '4', - 'revision_id' => '6', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '4', - 'revision_id' => '7', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '5', - 'revision_id' => '8', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '6', - 'revision_id' => '9', - 'langcode' => 'en', - )) - ->values(array( - 'id' => '6', - 'revision_id' => '10', - 'langcode' => 'en', - )) - ->execute(); - -$connection->insert('key_value') - ->fields(array( - 'collection', - 'name', - 'value', - )) - ->values(array( - 'collection' => 'config.entity.key_store.block_content_type', - 'name' => 'uuid:966baba6-525e-48fe-b8c5-a5f131b1857f', - 'value' => 'a:1:{i:0;s:37:"block_content.type.test_block_content";}', - )) - ->execute(); - -$connection->insert('node') - ->fields(array( - 'nid', - 'vid', - 'type', - 'uuid', - 'langcode', - )) - ->values(array( - 'nid' => '1', - 'vid' => '1', - 'type' => 'article', - 'uuid' => '11143847-fe18-4808-a797-8b15966adf4c', - 'langcode' => 'en', - )) - ->values(array( - 'nid' => '2', - 'vid' => '3', - 'type' => 'article', - 'uuid' => '336e6941-9340-419e-a763-65d4c11ea031', - 'langcode' => 'en', - )) - ->values(array( - 'nid' => '3', - 'vid' => '5', - 'type' => 'article', - 'uuid' => '3eebe337-f977-4a32-94d2-4095947f125d', - 'langcode' => 'en', - )) - ->execute(); - -$connection->insert('node_field_data') - ->fields(array( - 'nid', - 'vid', - 'type', - 'langcode', - 'status', - 'title', - 'uid', - 'created', - 'changed', - 'promote', - 'sticky', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'nid' => '1', - 'vid' => '1', - 'type' => 'article', - 'langcode' => 'en', - 'status' => '1', - 'title' => 'draft pending revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'nid' => '2', - 'vid' => '3', - 'type' => 'article', - 'langcode' => 'en', - 'status' => '1', - 'title' => 'published default revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'nid' => '3', - 'vid' => '5', - 'type' => 'article', - 'langcode' => 'en', - 'status' => '0', - 'title' => 'archived default revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); - -$connection->insert('node_field_revision') - ->fields(array( - 'nid', - 'vid', - 'langcode', - 'status', - 'title', - 'uid', - 'created', - 'changed', - 'promote', - 'sticky', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'nid' => '1', - 'vid' => '1', - 'langcode' => 'en', - 'status' => '1', - 'title' => 'draft pending revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'nid' => '1', - 'vid' => '2', - 'langcode' => 'en', - 'status' => '0', - 'title' => 'draft pending revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'nid' => '2', - 'vid' => '3', - 'langcode' => 'en', - 'status' => '1', - 'title' => 'published default revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'nid' => '3', - 'vid' => '4', - 'langcode' => 'en', - 'status' => '1', - 'title' => 'archived default revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'nid' => '3', - 'vid' => '5', - 'langcode' => 'en', - 'status' => '0', - 'title' => 'archived default revision', - 'uid' => '0', - 'created' => '1517725800', - 'changed' => '1517725800', - 'promote' => '1', - 'sticky' => '0', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); - -$connection->insert('node_revision') - ->fields(array( - 'nid', - 'vid', - 'langcode', - 'revision_uid', - 'revision_timestamp', - 'revision_log', - )) - ->values(array( - 'nid' => '1', - 'vid' => '1', - 'langcode' => 'en', - 'revision_uid' => '0', - 'revision_timestamp' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'nid' => '1', - 'vid' => '2', - 'langcode' => 'en', - 'revision_uid' => '0', - 'revision_timestamp' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'nid' => '2', - 'vid' => '3', - 'langcode' => 'en', - 'revision_uid' => '0', - 'revision_timestamp' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'nid' => '3', - 'vid' => '4', - 'langcode' => 'en', - 'revision_uid' => '0', - 'revision_timestamp' => '1517725800', - 'revision_log' => NULL, - )) - ->values(array( - 'nid' => '3', - 'vid' => '5', - 'langcode' => 'en', - 'revision_uid' => '0', - 'revision_timestamp' => '1517725800', - 'revision_log' => NULL, - )) - ->execute(); diff --git a/core/modules/content_moderation/tests/fixtures/update/drupal-8.entity-form-display-dependencies-2915383.php b/core/modules/content_moderation/tests/fixtures/update/drupal-8.entity-form-display-dependencies-2915383.php deleted file mode 100644 index 3305e37e078..00000000000 --- a/core/modules/content_moderation/tests/fixtures/update/drupal-8.entity-form-display-dependencies-2915383.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Content for the update path test in #2915383. - * - * @see \Drupal\Tests\content_moderation\Functional\EntityFormDisplayDependenciesUpdateTest - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->update('config') - ->fields([ - 'data' => 'a:11:{s:4:"uuid";s:36:"16624d7d-0800-4ed7-9861-41f7e71394a8";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:24:"block_content.type.basic";i:1;s:36:"field.field.block_content.basic.body";}s:6:"module";a:2:{i:0;s:18:"content_moderation";i:1;s:4:"text";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"e1Nu5xXAuF_QplbBUhQBPLnYWvHtDX0MkZnpuCiY8uM";}s:2:"id";s:27:"block_content.basic.default";s:16:"targetEntityType";s:13:"block_content";s:6:"bundle";s:5:"basic";s:4:"mode";s:7:"default";s:7:"content";a:3:{s:4:"body";a:5:{s:4:"type";s:26:"text_textarea_with_summary";s:6:"weight";i:-4;s:6:"region";s:7:"content";s:8:"settings";a:3:{s:4:"rows";i:9;s:12:"summary_rows";i:3;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:4:"info";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:-5;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:16:"moderation_state";a:5:{s:4:"type";s:24:"moderation_state_default";s:6:"weight";i:100;s:8:"settings";a:0:{}s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:0:{}}', - ]) - ->condition('name', 'core.entity_form_display.block_content.basic.default') - ->execute(); - -$connection->update('config') - ->fields([ - 'data' => 'a:11:{s:4:"uuid";s:36:"af6ca931-0ecc-46c0-8097-ffb383db6287";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:6:{i:0;s:29:"field.field.node.article.body";i:1;s:32:"field.field.node.article.comment";i:2;s:36:"field.field.node.article.field_image";i:3;s:35:"field.field.node.article.field_tags";i:4;s:21:"image.style.thumbnail";i:5;s:17:"node.type.article";}s:6:"module";a:5:{i:0;s:7:"comment";i:1;s:18:"content_moderation";i:2;s:5:"image";i:3;s:4:"path";i:4;s:4:"text";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"buc38w3gxCqFnjINJhMiJvPpj9jWflKvlKDyBVMPVvw";}s:2:"id";s:20:"node.article.default";s:16:"targetEntityType";s:4:"node";s:6:"bundle";s:7:"article";s:4:"mode";s:7:"default";s:7:"content";a:12:{s:4:"body";a:5:{s:4:"type";s:26:"text_textarea_with_summary";s:6:"weight";i:1;s:6:"region";s:7:"content";s:8:"settings";a:3:{s:4:"rows";i:9;s:12:"summary_rows";i:3;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:7:"comment";a:5:{s:4:"type";s:15:"comment_default";s:6:"weight";i:20;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:7:"created";a:5:{s:4:"type";s:18:"datetime_timestamp";s:6:"weight";i:10;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:11:"field_image";a:5:{s:4:"type";s:11:"image_image";s:6:"weight";i:4;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:18:"progress_indicator";s:8:"throbber";s:19:"preview_image_style";s:9:"thumbnail";}s:20:"third_party_settings";a:0:{}}s:10:"field_tags";a:5:{s:4:"type";s:34:"entity_reference_autocomplete_tags";s:6:"weight";i:3;s:6:"region";s:7:"content";s:8:"settings";a:3:{s:14:"match_operator";s:8:"CONTAINS";s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:16:"moderation_state";a:5:{s:4:"type";s:24:"moderation_state_default";s:6:"weight";i:100;s:8:"settings";a:0:{}s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:4:"path";a:5:{s:4:"type";s:4:"path";s:6:"weight";i:30;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:7:"promote";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:15;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:6:"status";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:120;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:6:"sticky";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:16;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:5:"title";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:3:"uid";a:5:{s:4:"type";s:29:"entity_reference_autocomplete";s:6:"weight";i:5;s:6:"region";s:7:"content";s:8:"settings";a:3:{s:14:"match_operator";s:8:"CONTAINS";s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:0:{}}', - ]) - ->condition('name', 'core.entity_form_display.node.article.default') - ->execute(); - -$connection->update('config') - ->fields([ - 'data' => 'a:9:{s:4:"uuid";s:36:"08b548c7-ff59-468b-9347-7d697680d035";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:17:"node.type.article";i:1;s:14:"node.type.page";}s:6:"module";a:1:{i:0;s:18:"content_moderation";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"T_JxNjYlfoRBi7Bj1zs5Xv9xv1btuBkKp5C1tNrjMhI";}s:2:"id";s:9:"editorial";s:5:"label";s:9:"Editorial";s:4:"type";s:18:"content_moderation";s:13:"type_settings";a:3:{s:6:"states";a:3:{s:8:"archived";a:4:{s:5:"label";s:8:"Archived";s:6:"weight";i:5;s:9:"published";b:0;s:16:"default_revision";b:1;}s:5:"draft";a:4:{s:5:"label";s:5:"Draft";s:9:"published";b:0;s:16:"default_revision";b:0;s:6:"weight";i:-5;}s:9:"published";a:4:{s:5:"label";s:9:"Published";s:9:"published";b:1;s:16:"default_revision";b:1;s:6:"weight";i:0;}}s:11:"transitions";a:5:{s:7:"archive";a:4:{s:5:"label";s:7:"Archive";s:4:"from";a:1:{i:0;s:9:"published";}s:2:"to";s:8:"archived";s:6:"weight";i:2;}s:14:"archived_draft";a:4:{s:5:"label";s:16:"Restore to Draft";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:5:"draft";s:6:"weight";i:3;}s:18:"archived_published";a:4:{s:5:"label";s:7:"Restore";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:9:"published";s:6:"weight";i:4;}s:16:"create_new_draft";a:4:{s:5:"label";s:16:"Create New Draft";s:2:"to";s:5:"draft";s:6:"weight";i:0;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}s:7:"publish";a:4:{s:5:"label";s:7:"Publish";s:2:"to";s:9:"published";s:6:"weight";i:1;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}}s:12:"entity_types";a:1:{s:4:"node";a:2:{i:0;s:7:"article";i:1;s:4:"page";}}}}', - ]) - ->condition('name', 'workflows.workflow.editorial') - ->execute(); diff --git a/core/modules/content_moderation/tests/src/Functional/Update/ContentModerationUpdateTest.php b/core/modules/content_moderation/tests/src/Functional/Update/ContentModerationUpdateTest.php deleted file mode 100644 index 2153e4c2db0..00000000000 --- a/core/modules/content_moderation/tests/src/Functional/Update/ContentModerationUpdateTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\Tests\content_moderation\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that content moderation settings are updated during database updates. - * - * @group content_moderation - * @group legacy - */ -class ContentModerationUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php', - ]; - } - - /** - * Tests that the content moderation state entity has an 'owner' entity key. - * - * @see content_moderation_update_8700() - */ - public function testOwnerEntityKey() { - // Check that the 'owner' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('content_moderation_state'); - $this->assertFalse($entity_type->getKey('owner')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('content_moderation_state'); - $this->assertEquals('uid', $entity_type->getKey('owner')); - } - -} diff --git a/core/modules/content_moderation/tests/src/Functional/Update/DefaultContentModerationStateRevisionUpdateTest.php b/core/modules/content_moderation/tests/src/Functional/Update/DefaultContentModerationStateRevisionUpdateTest.php deleted file mode 100644 index 8be8bb74676..00000000000 --- a/core/modules/content_moderation/tests/src/Functional/Update/DefaultContentModerationStateRevisionUpdateTest.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -namespace Drupal\Tests\content_moderation\Functional\Update; - -use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Test updating the ContentModerationState entity default revisions. - * - * @group Update - * @group legacy - * @see content_moderation_post_update_update_cms_default_revisions - */ -class DefaultContentModerationStateRevisionUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php', - ]; - } - - /** - * Test updating the default revision. - */ - public function testUpdateDefaultRevision() { - // Include the database fixture required to test updating the default - // revision. This is excluded from ::setDatabaseDumpFiles so that we can - // test the same post_update hook with no test content enabled. - require __DIR__ . '/../../../fixtures/update/drupal-8.default-cms-entity-id-2941736.php'; - - $this->runUpdates(); - - foreach (['node', 'block_content'] as $entity_type_id) { - $draft_pending_revision = $this->getEntityByLabel($entity_type_id, 'draft pending revision'); - $this->assertFalse($draft_pending_revision->isLatestRevision()); - $this->assertCompositeEntityMatchesDefaultRevisionId($draft_pending_revision); - - $published_default_revision = $this->getEntityByLabel($entity_type_id, 'published default revision'); - $this->assertTrue($published_default_revision->isLatestRevision()); - $this->assertCompositeEntityMatchesDefaultRevisionId($published_default_revision); - - $archived_default_revision = $this->getEntityByLabel($entity_type_id, 'archived default revision'); - $this->assertTrue($archived_default_revision->isLatestRevision()); - $this->assertCompositeEntityMatchesDefaultRevisionId($archived_default_revision); - } - } - - /** - * Test the post_update hook when no entity types are being moderated. - */ - public function testNoEntitiesUnderModeration() { - // If any errors occur during the post_update hook, the test case will fail. - $this->runUpdates(); - } - - /** - * Assert for the given entity, the default revision ID matches. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity to use for the assertion. - */ - protected function assertCompositeEntityMatchesDefaultRevisionId(ContentEntityInterface $entity) { - $entity_type_manager = $this->container->get('entity_type.manager'); - $entity_list = $entity_type_manager->getStorage('content_moderation_state') - ->loadByProperties([ - 'content_entity_type_id' => $entity->getEntityTypeId(), - 'content_entity_id' => $entity->id(), - ]); - $content_moderation_state_entity = array_shift($entity_list); - $this->assertEquals($entity->getLoadedRevisionId(), $content_moderation_state_entity->content_entity_revision_id->value); - - // Check that the data table records were updated correctly. - /** @var \Drupal\Core\Database\Connection $database */ - $database = $this->container->get('database'); - $query = 'SELECT * FROM {content_moderation_state_field_data} WHERE id = :id'; - $records = $database->query($query, [':id' => $content_moderation_state_entity->id()]) - ->fetchAllAssoc('langcode'); - foreach ($records as $langcode => $record) { - /** @var \Drupal\Core\Entity\ContentEntityInterface $translation */ - $translation = $content_moderation_state_entity->getTranslation($langcode); - foreach ((array) $record as $field_name => $value) { - if ($translation->hasField($field_name)) { - $items = $translation->get($field_name)->getValue(); - $this->assertEquals(current($items[0]), $value); - } - } - } - } - - /** - * Load an entity by label. - * - * @param string $entity_type_id - * The entity type ID. - * @param string $label - * The label of the entity to load. - * - * @return \Drupal\Core\Entity\ContentEntityInterface - * The loaded entity. - */ - protected function getEntityByLabel($entity_type_id, $label) { - $entity_type_manager = $this->container->get('entity_type.manager'); - $label_field = $entity_type_manager->getDefinition($entity_type_id)->getKey('label'); - $entity_list = $entity_type_manager->getStorage($entity_type_id) - ->loadByProperties([$label_field => $label]); - return array_shift($entity_list); - } - -} diff --git a/core/modules/content_moderation/tests/src/Functional/Update/DefaultModerationStateUpdateTest.php b/core/modules/content_moderation/tests/src/Functional/Update/DefaultModerationStateUpdateTest.php deleted file mode 100644 index 245fef6e496..00000000000 --- a/core/modules/content_moderation/tests/src/Functional/Update/DefaultModerationStateUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\content_moderation\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\workflows\Entity\Workflow; - -/** - * Tests the upgrade path for updating the 'default_moderation_state' setting. - * - * @group Update - * @group legacy - * - * @see content_moderation_post_update_set_default_moderation_state() - */ -class DefaultModerationStateUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php', - ]; - } - - /** - * Tests updating the default moderation state setting. - */ - public function testUpdateDefaultModerationState() { - $workflow = Workflow::load('editorial'); - $this->assertArrayNotHasKey('default_moderation_state', $workflow->getTypePlugin()->getConfiguration()); - - $this->runUpdates(); - - $workflow = Workflow::load('editorial'); - $this->assertEquals('draft', $workflow->getTypePlugin()->getConfiguration()['default_moderation_state']); - } - -} diff --git a/core/modules/content_moderation/tests/src/Functional/Update/EntityFormDisplayDependenciesUpdateTest.php b/core/modules/content_moderation/tests/src/Functional/Update/EntityFormDisplayDependenciesUpdateTest.php deleted file mode 100644 index 78eab5d6906..00000000000 --- a/core/modules/content_moderation/tests/src/Functional/Update/EntityFormDisplayDependenciesUpdateTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Drupal\Tests\content_moderation\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Test updating the dependencies of entity form displays. - * - * @group Update - * @group legacy - * - * @see content_moderation_post_update_entity_display_dependencies() - */ -class EntityFormDisplayDependenciesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.entity-form-display-dependencies-2915383.php', - ]; - } - - /** - * Tests updating the dependencies of entity displays. - */ - public function testEntityDisplaysUpdated() { - $no_moderation_form_display = EntityFormDisplay::load('block_content.basic.default'); - $has_moderation_form_display = EntityFormDisplay::load('node.article.default'); - - // Assert the moderation field and content_moderation dependency exists on - // an entity type that does not have moderation enabled, these will be - // removed. - $this->assertEquals('moderation_state_default', $no_moderation_form_display->getComponent('moderation_state')['type']); - $this->assertTrue(in_array('content_moderation', $no_moderation_form_display->getDependencies()['module'])); - - // Assert the editorial config dependency doesn't exist on the entity form - // with moderation, this will be added. - $this->assertFalse(in_array('workflows.workflow.editorial', $has_moderation_form_display->getDependencies()['config'])); - - $this->runUpdates(); - - $no_moderation_form_display = EntityFormDisplay::load('block_content.basic.default'); - $has_moderation_form_display = EntityFormDisplay::load('node.article.default'); - - // The moderation_state field has been removed from the non-moderated block - // entity form display. - $this->assertEquals(NULL, $no_moderation_form_display->getComponent('moderation_state')); - $this->assertFalse(in_array('content_moderation', $no_moderation_form_display->getDependencies()['module'])); - - // The editorial workflow config dependency has been added to moderated - // form display. - $this->assertTrue(in_array('workflows.workflow.editorial', $has_moderation_form_display->getDependencies()['config'])); - } - -} diff --git a/core/modules/content_moderation/tests/src/Functional/Update/ModeratedContentViewLatestRevisionUpdateTest.php b/core/modules/content_moderation/tests/src/Functional/Update/ModeratedContentViewLatestRevisionUpdateTest.php deleted file mode 100644 index 43e0fd790c3..00000000000 --- a/core/modules/content_moderation/tests/src/Functional/Update/ModeratedContentViewLatestRevisionUpdateTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\content_moderation\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for updating the moderated content view. - * - * @group Update - * @group legacy - * - * @see content_moderation_post_update_set_views_filter_latest_translation_affected_revision() - */ -class ModeratedContentViewLatestRevisionUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.5.0-content_moderation_installed.php', - ]; - } - - /** - * Tests updating the moderated content view. - */ - public function testUpdateModeratedContentView() { - $display = View::load('moderated_content')->getDisplay('default'); - $this->assertArrayHasKey('latest_revision', $display['display_options']['filters']); - $this->assertArrayNotHasKey('latest_translation_affected_revision', $display['display_options']['filters']); - - $this->runUpdates(); - - $display = View::load('moderated_content')->getDisplay('default'); - $this->assertArrayNotHasKey('latest_revision', $display['display_options']['filters']); - $this->assertArrayHasKey('latest_translation_affected_revision', $display['display_options']['filters']); - } - -} diff --git a/core/modules/content_moderation/tests/src/Functional/Update/ModerationStateViewsFieldUpdateTest.php b/core/modules/content_moderation/tests/src/Functional/Update/ModerationStateViewsFieldUpdateTest.php deleted file mode 100644 index da961279e86..00000000000 --- a/core/modules/content_moderation/tests/src/Functional/Update/ModerationStateViewsFieldUpdateTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\Tests\content_moderation\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Test updating the views moderation state field plugin ID. - * - * @group Update - * @group legacy - * - * @see content_moderation_post_update_views_field_plugin_id() - */ -class ModerationStateViewsFieldUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.5.0-content_moderation_installed.php', - ]; - } - - /** - * Test the views field ID update. - */ - public function testViewsFieldIdUpdate() { - $views_display = View::load('moderated_content')->getDisplay('default'); - $this->assertEquals('field', $views_display['display_options']['fields']['moderation_state']['plugin_id']); - - $this->runUpdates(); - - $views_display = View::load('moderated_content')->getDisplay('default'); - $this->assertEquals('moderation_state_field', $views_display['display_options']['fields']['moderation_state']['plugin_id']); - } - - /** - * Tests that the update succeeds even if Views is not installed. - */ - public function testViewsFieldIdUpdateWithoutViews() { - $this->container->get('module_installer')->uninstall(['views']); - $this->runUpdates(); - } - -} diff --git a/core/modules/content_translation/content_translation.install b/core/modules/content_translation/content_translation.install index 96859faaebd..ba67d2141eb 100644 --- a/core/modules/content_translation/content_translation.install +++ b/core/modules/content_translation/content_translation.install @@ -5,9 +5,7 @@ * Installation functions for Content Translation module. */ -use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; use Drupal\Core\Installer\InstallerKernel; -use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Url; /** @@ -41,70 +39,8 @@ function content_translation_install() { } /** - * Rebuild the routes as the content translation routes have now new names. + * Implements hook_update_last_removed(). */ -function content_translation_update_8001() { - \Drupal::service('router.builder')->rebuild(); -} - -/** - * Clear field type plugin caches to fix image field translatability. - */ -function content_translation_update_8002() { - \Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions(); -} - -/** - * Fix the initial values for content translation metadata fields. - */ -function content_translation_update_8400() { - $database = \Drupal::database(); - /** @var \Drupal\content_translation\ContentTranslationManagerInterface $content_translation_manager */ - $content_translation_manager = \Drupal::service('content_translation.manager'); - /** @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $last_installed_schema_repository */ - $last_installed_schema_repository = \Drupal::service('entity.last_installed_schema.repository'); - $entity_type_manager = \Drupal::entityTypeManager(); - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - $entity_type_manager->clearCachedDefinitions(); - foreach ($content_translation_manager->getSupportedEntityTypes() as $entity_type_id => $entity_type_definition) { - $storage = $entity_type_manager->getStorage($entity_type_id); - if ($storage instanceof SqlEntityStorageInterface) { - $entity_type = $entity_definition_update_manager->getEntityType($entity_type_id); - $storage_definitions = $last_installed_schema_repository->getLastInstalledFieldStorageDefinitions($entity_type_id); - - // Since the entity type is managed by Content Translation, we can assume - // that it is translatable, so we use the data and revision data tables. - $tables_to_update = [$entity_type->getDataTable()]; - if ($entity_type->isRevisionable()) { - $tables_to_update += [$entity_type->getRevisionDataTable()]; - } - - foreach ($tables_to_update as $table_name) { - // Fix the values of the 'content_translation_source' field. - if (isset($storage_definitions['content_translation_source'])) { - $database->update($table_name) - ->fields(['content_translation_source' => LanguageInterface::LANGCODE_NOT_SPECIFIED]) - ->isNull('content_translation_source') - ->execute(); - } - - // Fix the values of the 'content_translation_outdated' field. - if (isset($storage_definitions['content_translation_outdated'])) { - $database->update($table_name) - ->fields(['content_translation_outdated' => 0]) - ->isNull('content_translation_outdated') - ->execute(); - } - - // Fix the values of the 'content_translation_status' field. - if (isset($storage_definitions['content_translation_status'])) { - $database->update($table_name) - ->fields(['content_translation_status' => 1]) - ->isNull('content_translation_status') - ->execute(); - } - } - } - } +function content_translation_update_last_removed() { + return 8400; } diff --git a/core/modules/content_translation/tests/src/Functional/Update/ContentTranslationUpdateTest.php b/core/modules/content_translation/tests/src/Functional/Update/ContentTranslationUpdateTest.php deleted file mode 100644 index 3df89e96fef..00000000000 --- a/core/modules/content_translation/tests/src/Functional/Update/ContentTranslationUpdateTest.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -namespace Drupal\Tests\content_translation\Functional\Update; - -use Drupal\Core\Language\LanguageInterface; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; - -/** - * Tests the upgrade path for the Content Translation module. - * - * @group Update - * @group legacy - */ -class ContentTranslationUpdateTest extends UpdatePathTestBase { - - use EntityDefinitionTestTrait; - - /** - * The database connection used. - * - * @var \Drupal\Core\Database\Connection - */ - protected $database; - - /** - * The entity definition update manager. - * - * @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface - */ - protected $entityDefinitionUpdateManager; - - /** - * The state service. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $this->database = \Drupal::database(); - $this->entityDefinitionUpdateManager = \Drupal::entityDefinitionUpdateManager(); - $this->state = \Drupal::state(); - } - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz', - ]; - } - - /** - * Tests that initial values for metadata fields are populated correctly. - */ - public function testContentTranslationUpdate8400() { - $this->updateEntityTypeToTranslatable(); - - // The test database dump contains NULL values for - // 'content_translation_source', 'content_translation_outdated' and - // 'content_translation_status' for the first 50 test entities. - // @see _entity_test_update_create_test_entities() - $first_entity_record = $this->database->select('entity_test_update_data', 'etud') - ->fields('etud') - ->condition('etud.id', 1) - ->execute() - ->fetchAllAssoc('id'); - $this->assertNull($first_entity_record[1]->content_translation_source); - $this->assertNull($first_entity_record[1]->content_translation_outdated); - $this->assertNull($first_entity_record[1]->content_translation_status); - - $this->runUpdates(); - - // After running the updates, all those fields should be populated with - // their default values. - $first_entity_record = $this->database->select('entity_test_update_data', 'etud') - ->fields('etud') - ->condition('etud.id', 1) - ->execute() - ->fetchAllAssoc('id'); - $this->assertEqual(LanguageInterface::LANGCODE_NOT_SPECIFIED, $first_entity_record[1]->content_translation_source); - $this->assertEqual(0, $first_entity_record[1]->content_translation_outdated); - $this->assertEqual(1, $first_entity_record[1]->content_translation_status); - } - -} diff --git a/core/modules/datetime_range/tests/fixtures/update/datetime_range-filter-values.php b/core/modules/datetime_range/tests/fixtures/update/datetime_range-filter-values.php deleted file mode 100644 index 952e67a16c1..00000000000 --- a/core/modules/datetime_range/tests/fixtures/update/datetime_range-filter-values.php +++ /dev/null @@ -1,332 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2786577. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Configuration for an datetime_range field storage. -$field_storage_datetime_range = Yaml::decode(file_get_contents(__DIR__ . '/field.storage.node.field_range.yml')); - -// Configuration for a datetime_range field on 'page' node bundle. -$field_datetime_range = Yaml::decode(file_get_contents(__DIR__ . '/field.field.node.page.field_range.yml')); - -// Configuration for a View using datetime_range plugins. -$views_datetime_range = Yaml::decode(file_get_contents(__DIR__ . '/views.view.test_datetime_range_filter_values.yml')); - -// Update core.entity_form_display.node.page.default -$data = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_form_display.node.page.default') - ->execute() - ->fetchField(); - -$data = unserialize($data); -$data['dependencies']['config'][] = 'field.field.' . $field_datetime_range['id']; -$data['dependencies']['module'][] = 'datetime_range'; -$data['content'][$field_datetime_range['field_name']] = array( - "weight"=> 27, - "settings" => array(), - "third_party_settings" => array(), - "type" => "daterange_default", - "region" => "content" -); -$connection->update('config') - ->fields([ - 'data' => serialize($data), - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_form_display.node.page.default') - ->execute(); - -// Update core.entity_view_display.node.page.default -$data = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.page.default') - ->execute() - ->fetchField(); - -$data = unserialize($data); -$data['dependencies']['config'][] = 'field.field.' . $field_datetime_range['id']; -$data['dependencies']['module'][] = 'datetime_range'; -$data['content'][$field_datetime_range['field_name']] = array( - "weight"=> 102, - "label"=> "above", - "settings" => array("separator"=> "-", "format_type" => "medium", "timezone_override" => ""), - "third_party_settings" => array(), - "type" => "daterange_default", - "region" => "content" -); -$connection->update('config') - ->fields([ - 'data' => serialize($data), - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.page.default') - ->execute(); - -$connection->insert('config') -->fields(array( - 'collection', - 'name', - 'data', -)) -->values(array( - 'collection' => '', - 'name' => 'field.field.' . $field_datetime_range['id'], - 'data' => serialize($field_datetime_range), -)) -->values(array( - 'collection' => '', - 'name' => 'field.storage.' . $field_storage_datetime_range['id'], - 'data' => serialize($field_storage_datetime_range), -)) -->values(array( - 'collection' => '', - 'name' => 'views.view.' . $views_datetime_range['id'], - 'data' => serialize($views_datetime_range), -)) -->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['datetime_range'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -$connection->insert('key_value') -->fields(array( - 'collection', - 'name', - 'value', -)) -->values(array( - 'collection' => 'config.entity.key_store.field_config', - 'name' => 'uuid:87dc4221-8d56-4112-8a7f-7a855ac35d08', - 'value' => 'a:1:{i:0;s:33:"field.field.' . $field_datetime_range['id'] . '";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.field_storage_config', - 'name' => 'uuid:2190ad8c-39dd-4eb1-b189-1bfc0c244a40', - 'value' => 'a:1:{i:0;s:30:"field.storage.' . $field_storage_datetime_range['id'] . '";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.view', - 'name' => 'uuid:d20760b6-7cc4-4844-ae04-96da7225a46f', - 'value' => 'a:1:{i:0;s:44:"views.view.' . $views_datetime_range['id'] . '";}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'node.field_schema_data.field_range', - 'value' => 'a:2:{s:17:"node__field_range";a:4:{s:11:"description";s:40:"Data storage for node field field_range.";s:6:"fields";a:8:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:17:"field_range_value";a:4:{s:11:"description";s:21:"The start date value.";s:4:"type";s:7:"varchar";s:6:"length";i:20;s:8:"not null";b:1;}s:21:"field_range_end_value";a:4:{s:11:"description";s:19:"The end date value.";s:4:"type";s:7:"varchar";s:6:"length";i:20;s:8:"not null";b:1;}}s:11:"primary key";a:4:{i:0;s:9:"entity_id";i:1;s:7:"deleted";i:2;s:5:"delta";i:3;s:8:"langcode";}s:7:"indexes";a:4:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}s:17:"field_range_value";a:1:{i:0;s:17:"field_range_value";}s:21:"field_range_end_value";a:1:{i:0;s:21:"field_range_end_value";}}}s:26:"node_revision__field_range";a:4:{s:11:"description";s:52:"Revision archive storage for node field field_range.";s:6:"fields";a:8:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:17:"field_range_value";a:4:{s:11:"description";s:21:"The start date value.";s:4:"type";s:7:"varchar";s:6:"length";i:20;s:8:"not null";b:1;}s:21:"field_range_end_value";a:4:{s:11:"description";s:19:"The end date value.";s:4:"type";s:7:"varchar";s:6:"length";i:20;s:8:"not null";b:1;}}s:11:"primary key";a:5:{i:0;s:9:"entity_id";i:1;s:11:"revision_id";i:2;s:7:"deleted";i:3;s:5:"delta";i:4;s:8:"langcode";}s:7:"indexes";a:4:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}s:17:"field_range_value";a:1:{i:0;s:17:"field_range_value";}s:21:"field_range_end_value";a:1:{i:0;s:21:"field_range_end_value";}}}}', -)) -->values(array( - 'collection' => 'system.schema', - 'name' => 'datetime_range', - 'value' => 'i:8000;', -)) -->execute(); - -// Update entity.definitions.bundle_field_map -$value = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'entity.definitions.bundle_field_map') - ->condition('name', 'node') - ->execute() - ->fetchField(); - -$value = unserialize($value); -$value["field_range"] = array("type" => "daterange", "bundles" => array("page" => "page")); - -$connection->update('key_value') - ->fields([ - 'value' => serialize($value), - ]) - ->condition('collection', 'entity.definitions.bundle_field_map') - ->condition('name', 'node') - ->execute(); - -// Update system.module.files -$files = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'state') - ->condition('name', 'system.module.files') - ->execute() - ->fetchField(); - -$files = unserialize($files); -$files["datetime_range"] = "core/modules/datetime_range/datetime_range.info.yml"; - -$connection->update('key_value') - ->fields([ - 'value' => serialize($files), - ]) - ->condition('collection', 'state') - ->condition('name', 'system.module.files') - ->execute(); - -$connection->schema()->createTable('node__field_range', array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_range_value' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '20', - ), - 'field_range_end_value' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '20', - ), - ), - 'primary key' => array( - 'entity_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - 'field_range_value' => array( - 'field_range_value', - ), - 'field_range_end_value' => array( - 'field_range_end_value', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('node_revision__field_range', array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_range_value' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '20', - ), - 'field_range_end_value' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '20', - ), - ), - 'primary key' => array( - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - 'field_range_value' => array( - 'field_range_value', - ), - 'field_range_end_value' => array( - 'field_range_end_value', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - diff --git a/core/modules/datetime_range/tests/fixtures/update/field.field.node.page.field_range.yml b/core/modules/datetime_range/tests/fixtures/update/field.field.node.page.field_range.yml deleted file mode 100644 index 1b984295e9f..00000000000 --- a/core/modules/datetime_range/tests/fixtures/update/field.field.node.page.field_range.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: 87dc4221-8d56-4112-8a7f-7a855ac35d08 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_range - - node.type.page - module: - - datetime_range -id: node.page.field_range -field_name: field_range -entity_type: node -bundle: page -label: range -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: daterange diff --git a/core/modules/datetime_range/tests/fixtures/update/field.storage.node.field_range.yml b/core/modules/datetime_range/tests/fixtures/update/field.storage.node.field_range.yml deleted file mode 100644 index 26d610e724f..00000000000 --- a/core/modules/datetime_range/tests/fixtures/update/field.storage.node.field_range.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 2190ad8c-39dd-4eb1-b189-1bfc0c244a40 -langcode: en -status: true -dependencies: - module: - - datetime_range - - node -id: node.field_range -field_name: field_range -entity_type: node -type: daterange -settings: - datetime_type: datetime -module: datetime_range -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/core/modules/datetime_range/tests/fixtures/update/views.view.test_datetime_range_filter_values.yml b/core/modules/datetime_range/tests/fixtures/update/views.view.test_datetime_range_filter_values.yml deleted file mode 100644 index 170b71e9454..00000000000 --- a/core/modules/datetime_range/tests/fixtures/update/views.view.test_datetime_range_filter_values.yml +++ /dev/null @@ -1,230 +0,0 @@ -uuid: d20760b6-7cc4-4844-ae04-96da7225a46f -langcode: en -status: true -dependencies: - module: - - node - - user -id: test_datetime_range_filter_values -label: test_datetime_range_filter_values -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - field_range_value: - id: field_range_value - table: node__field_range - field: field_range_value - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '2017' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - field_range_end_value: - id: field_range_end_value - table: node__field_range - field: field_range_end_value - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - sorts: - field_range_value: - id: field_range_value - table: node__field_range - field: field_range_value - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - plugin_id: standard - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/datetime_range/tests/src/Functional/Update/DatetimeRangeViewUpdateTest.php b/core/modules/datetime_range/tests/src/Functional/Update/DatetimeRangeViewUpdateTest.php deleted file mode 100644 index 9afd7aa22ba..00000000000 --- a/core/modules/datetime_range/tests/src/Functional/Update/DatetimeRangeViewUpdateTest.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - -namespace Drupal\Tests\datetime_range\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Test update of views with datetime_range filters. - * - * @see https://www.drupal.org/node/2786577 - * @see datetime_range_post_update_views_string_plugin_id() - * - * @group Update - * @group legacy - */ -class DatetimeRangeViewUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/datetime_range-filter-values.php', - ]; - } - - /** - * Tests that datetime_range filter values are updated properly. - */ - public function testViewsPostUpdateDateRangeFilterValues() { - - // Load our pre-update test view. - $view = View::load('test_datetime_range_filter_values'); - $data = $view->toArray(); - - // Check pre-update filter values. - $filter1 = $data['display']['default']['display_options']['filters']['field_range_value']; - $this->assertSame('string', $filter1['plugin_id']); - - // Check pre-update filter with operator going to be mapped. - $filter2 = $data['display']['default']['display_options']['filters']['field_range_end_value']; - $this->assertSame('string', $filter2['plugin_id']); - $this->assertSame('', $filter2['value']); - $this->assertSame('contains', $filter2['operator']); - - // Check pre-update sort values. - $sort = $data['display']['default']['display_options']['sorts']['field_range_value']; - $this->assertSame('standard', $sort['plugin_id']); - - $this->runUpdates(); - - // Reload and initialize our test view. - $view = View::load('test_datetime_range_filter_values'); - $data = $view->toArray(); - - // Check filter values. - $filter1 = $data['display']['default']['display_options']['filters']['field_range_value']; - $this->assertSame('datetime', $filter1['plugin_id']); - $this->assertSame('2017', $filter1['value']['value']); - $this->assertSame('=', $filter1['operator']); - - // Check string to datetime operator/value mapping. - $filter2 = $data['display']['default']['display_options']['filters']['field_range_end_value']; - $this->assertSame('datetime', $filter2['plugin_id']); - $this->assertSame('.*', $filter2['value']['value']); - $this->assertSame('regular_expression', $filter2['operator']); - - // Check sort values. - $sort = $data['display']['default']['display_options']['sorts']['field_range_value']; - $this->assertSame('datetime', $sort['plugin_id']); - } - -} diff --git a/core/modules/dblog/dblog.install b/core/modules/dblog/dblog.install index f180e1e3fce..b3164051b88 100644 --- a/core/modules/dblog/dblog.install +++ b/core/modules/dblog/dblog.install @@ -92,106 +92,8 @@ function dblog_schema() { } /** - * Use standard plugin for wid and uid fields. Use dblog_types for type filter. + * Implements hook_update_last_removed(). */ -function dblog_update_8400() { - $config_factory = \Drupal::configFactory(); - - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $view = $config_factory->getEditable($view_config_name); - if ($view->get('base_table') != 'watchdog') { - continue; - } - - $save = FALSE; - foreach ($view->get('display') as $display_name => $display) { - // Iterate through all the fields of watchdog views based tables. - if (isset($display['display_options']['fields'])) { - foreach ($display['display_options']['fields'] as $field_name => $field) { - // We are only interested in wid and uid fields from the watchdog - // table that still use the numeric id. - if (isset($field['table']) && - $field['table'] === 'watchdog' && - $field['plugin_id'] == 'numeric' && - in_array($field['field'], ['wid', 'uid'])) { - - $save = TRUE; - $new_value = $field; - $new_value['plugin_id'] = 'standard'; - - // Delete all the attributes related to numeric fields. - unset( - $new_value['set_precision'], - $new_value['precision'], - $new_value['decimal'], - $new_value['separator'], - $new_value['format_plural'], - $new_value['format_plural_string'], - $new_value['prefix'], - $new_value['suffix'] - ); - $view->set("display.$display_name.display_options.fields.$field_name", $new_value); - } - } - } - - // Iterate all filters looking for type filters to update. - if (isset($display['display_options']['filters'])) { - foreach ($display['display_options']['filters'] as $filter_name => $filter) { - if (isset($filter['table']) && - $filter['table'] === 'watchdog' && - $filter['plugin_id'] == 'in_operator' && - $filter['field'] == 'type') { - - $save = TRUE; - $filter['plugin_id'] = 'dblog_types'; - $view->set("display.$display_name.display_options.filters.$filter_name", $filter); - } - } - } - } - - if ($save) { - $view->save(); - } - } -} - -/** - * Change 'No logs message available.' area plugin type. - */ -function dblog_update_8600() { - $config_factory = \Drupal::configFactory(); - - $view = \Drupal::configFactory()->getEditable('views.view.watchdog'); - if (empty($view)) { - return; - } - - $empty_text = $view->get('display.default.display_options.empty'); - if (!isset($empty_text['area']['content']['value'])) { - return; - } - - // Only update the empty text if is untouched from the original version. - if ($empty_text['area']['id'] == 'area' && - $empty_text['area']['plugin_id'] == 'text' && - $empty_text['area']['field'] == 'area' && - $empty_text['area']['content']['value'] == 'No log messages available.') { - - $new_config = [ - 'id' => 'area_text_custom', - 'table' => 'views', - 'field' => 'area_text_custom', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => 'No log messages available.', - 'empty' => TRUE, - 'tokenize' => FALSE, - 'content' => 'No log messages available.', - 'plugin_id' => 'text_custom', - ]; - $view->set('display.default.display_options.empty.area', $new_config); - $view->save(); - } +function dblog_update_last_removed() { + return 8600; } diff --git a/core/modules/dblog/tests/fixtures/update/dblog-2851293.php b/core/modules/dblog/tests/fixtures/update/dblog-2851293.php deleted file mode 100644 index 0a260317486..00000000000 --- a/core/modules/dblog/tests/fixtures/update/dblog-2851293.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.dblog_2851293', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/dblog/tests/modules/dblog_test_views/test_views/views.view.dblog_2851293.yml'))), - ]) - ->execute(); diff --git a/core/modules/dblog/tests/src/Functional/Update/DblogFiltersAndFieldsUpgradeTest.php b/core/modules/dblog/tests/src/Functional/Update/DblogFiltersAndFieldsUpgradeTest.php deleted file mode 100644 index 8c33494ef41..00000000000 --- a/core/modules/dblog/tests/src/Functional/Update/DblogFiltersAndFieldsUpgradeTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Drupal\Tests\dblog\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; -use Drupal\Core\Serialization\Yaml; - -/** - * Tests the upgrade path for views field and filter handlers. - * - * @see dblog_update_8400() - * - * @group Update - * @group legacy - */ -class DblogFiltersAndFieldsUpgradeTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/dblog-2851293.php', - ]; - } - - /** - * Tests that field and filter handlers are updated properly. - */ - public function testDblogUpgradePath() { - - $this->runUpdates(); - - $view = Views::getView('dblog_2851293'); - $data = $view->storage->toArray(); - $fields = $data['display']['default']['display_options']['fields']; - - // The 'wid' and 'uid' fields should use the standard plugin now. - $this->assertEqual('standard', $fields['wid']['plugin_id']); - $this->assertEqual('standard', $fields['uid']['plugin_id']); - - $filters = $data['display']['default']['display_options']['filters']; - // The 'type' filter should use the dblog_types plugin now. - $this->assertEqual('dblog_types', $filters['type']['plugin_id']); - - // Now that the view had been converted, try the same approach but using - // dblog_view_presave() - $config_factory = \Drupal::configFactory(); - $config_view = $config_factory->getEditable('views.view.dblog_2851293'); - $config_view->setData(Yaml::decode(file_get_contents('core/modules/dblog/tests/modules/dblog_test_views/test_views/views.view.dblog_2851293.yml'))); - $config_view->save(); - - // Make sure we have a not upgraded view. - $view = Views::getView('dblog_2851293'); - $data = $view->storage->toArray(); - $fields = $data['display']['default']['display_options']['fields']; - $filters = $data['display']['default']['display_options']['filters']; - - $this->assertEqual('numeric', $fields['wid']['plugin_id']); - $this->assertEqual('numeric', $fields['uid']['plugin_id']); - $this->assertEqual('in_operator', $filters['type']['plugin_id']); - - // Now save the view. This trigger dblog_view_presave(). - $view->save(); - - // Finally check the same conversion process ran. - $data = $view->storage->toArray(); - $fields = $data['display']['default']['display_options']['fields']; - $filters = $data['display']['default']['display_options']['filters']; - - $this->assertEqual('standard', $fields['wid']['plugin_id']); - $this->assertEqual('standard', $fields['uid']['plugin_id']); - $this->assertEqual('dblog_types', $filters['type']['plugin_id']); - } - -} diff --git a/core/modules/dblog/tests/src/Functional/Update/DblogNoLogsAvailableUpgradeTest.php b/core/modules/dblog/tests/src/Functional/Update/DblogNoLogsAvailableUpgradeTest.php deleted file mode 100644 index 5002f251647..00000000000 --- a/core/modules/dblog/tests/src/Functional/Update/DblogNoLogsAvailableUpgradeTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\Tests\dblog\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Test the upgrade path of changing the empty text area for watchdog view. - * - * @see dblog_update_8600() - * - * @group Update - * @group legacy - */ -class DblogNoLogsAvailableUpgradeTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - ]; - } - - /** - * Tests that no logs available text is now using a custom area. - */ - public function testDblogUpgradePath() { - - $this->runUpdates(); - - $view = Views::getView('watchdog'); - $data = $view->storage->toArray(); - $area = $data['display']['default']['display_options']['empty']['area']; - - $this->assertEqual('text_custom', $area['plugin_id']); - $this->assertEqual('area_text_custom', $area['field']); - $this->assertEqual('No log messages available.', $area['content']); - } - -} diff --git a/core/modules/dblog/tests/src/Functional/Update/DblogRecentLogsUsingViewsUpdateTest.php b/core/modules/dblog/tests/src/Functional/Update/DblogRecentLogsUsingViewsUpdateTest.php deleted file mode 100644 index 3f54207e673..00000000000 --- a/core/modules/dblog/tests/src/Functional/Update/DblogRecentLogsUsingViewsUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\dblog\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Ensures that update hook that creates the watchdog view ran successfully. - * - * @group Update - * @group legacy - */ -class DblogRecentLogsUsingViewsUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that update hook is run for dblog module. - */ - public function testUpdate() { - // Make sure the watchdog view doesn't exist before the updates. - $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog'); - $this->assertNull($view); - - $this->runUpdates(); - - // Ensure the watchdog view is present after run updates. - $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog'); - $displays = $view->get('display'); - - $this->assertIdentical($displays['page']['display_options']['path'], 'admin/reports/dblog', 'Recent logs message view exists.'); - } - -} diff --git a/core/modules/editor/editor.install b/core/modules/editor/editor.install index a07bd805602..6e17486a870 100644 --- a/core/modules/editor/editor.install +++ b/core/modules/editor/editor.install @@ -6,17 +6,8 @@ */ /** - * Synchronizes the editor status with the paired text format status. + * Implements hook_update_last_removed(). */ -function editor_update_8001() { - $config_factory = \Drupal::configFactory(); - // Iterate on all text formats config entities. - foreach ($config_factory->listAll('filter.format.') as $name) { - list(,, $id) = explode('.', $name, 3); - $status = $config_factory->get($name)->get('status'); - $editor = $config_factory->getEditable("editor.editor.$id"); - if (!$editor->isNew() && $editor->get('status') !== $status) { - $editor->set('status', $status)->save(); - } - } +function editor_update_last_removed() { + return 8001; } diff --git a/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php b/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php deleted file mode 100644 index 5e7e5203cbb..00000000000 --- a/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -namespace Drupal\Tests\editor\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests Editor module database updates. - * - * @group editor - * @group legacy - */ -class EditorUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - // Simulate an un-synchronized environment. - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php', - ]; - } - - /** - * Tests editor_update_8001(). - * - * @see editor_update_8001() - */ - public function testEditorUpdate8001() { - /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */ - $config_factory = $this->container->get('config.factory'); - - $format_basic_html = $config_factory->get('filter.format.basic_html'); - $editor_basic_html = $config_factory->get('editor.editor.basic_html'); - $format_full_html = $config_factory->get('filter.format.full_html'); - $editor_full_html = $config_factory->get('editor.editor.full_html'); - - // Checks if the 'basic_html' format and editor statuses differ. - $this->assertTrue($format_basic_html->get('status')); - $this->assertFalse($editor_basic_html->get('status')); - $this->assertNotIdentical($format_basic_html->get('status'), $editor_basic_html->get('status')); - - // Checks if the 'full_html' format and editor statuses differ. - $this->assertFalse($format_full_html->get('status')); - $this->assertTrue($editor_full_html->get('status')); - $this->assertNotIdentical($format_full_html->get('status'), $editor_full_html->get('status')); - - // Run updates. - $this->runUpdates(); - - // Reload text formats and editors. - $format_basic_html = $config_factory->get('filter.format.basic_html'); - $editor_basic_html = $config_factory->get('editor.editor.basic_html'); - $format_full_html = $config_factory->get('filter.format.full_html'); - $editor_full_html = $config_factory->get('editor.editor.full_html'); - - // Checks if the 'basic_html' format and editor statuses are in sync. - $this->assertTrue($format_basic_html->get('status')); - $this->assertTrue($editor_basic_html->get('status')); - $this->assertIdentical($format_basic_html->get('status'), $editor_basic_html->get('status')); - - // Checks if the 'full_html' format and editor statuses are in sync. - $this->assertFalse($format_full_html->get('status')); - $this->assertFalse($editor_full_html->get('status')); - $this->assertIdentical($format_full_html->get('status'), $editor_full_html->get('status')); - } - -} diff --git a/core/modules/field/field.install b/core/modules/field/field.install index 80639a0042a..6b175e6afb3 100644 --- a/core/modules/field/field.install +++ b/core/modules/field/field.install @@ -5,131 +5,9 @@ * Install, update and uninstall functions for the field module. */ -use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; -use Drupal\field\Entity\FieldConfig; -use Drupal\field\Entity\FieldStorageConfig; - -/** - * Removes the stale 'target_bundle' storage setting on entity_reference fields. - */ -function field_update_8001() { - $config = \Drupal::configFactory(); - /** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */ - $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); - - // Iterate on all fields storage. - foreach ($config->listAll('field.storage.') as $field_id) { - $field_storage = $config->getEditable($field_id); - $class = $field_type_manager->getPluginClass($field_storage->get('type')); - - // Deal only with entity reference fields and descendants. - if ($class == EntityReferenceItem::class || is_subclass_of($class, EntityReferenceItem::class)) { - // Remove 'target_bundle' from settings. - $field_storage->clear('settings.target_bundle')->save(TRUE); - } - } -} - /** - * The 'entity_reference' field type is now provided by core. + * Implements hook_update_last_removed(). */ -function field_update_8002() { - $config_factory = \Drupal::configFactory(); - - // Iterate on all configuration entities. - foreach ($config_factory->listAll() as $id) { - $changed = FALSE; - $config = $config_factory->getEditable($id); - - // Update field storage configurations. - if (strpos($id, 'field.storage.') === 0) { - // Deal only with entity reference fields. - if ($config->get('type') == 'entity_reference') { - // Fix the type provider. - $config->set('module', 'core'); - $changed = TRUE; - } - } - - // Remove entity_reference module dependency from any configuration entity. - if ($dependencies = $config->get('dependencies.module')) { - if (($delta = array_search('entity_reference', $dependencies)) !== FALSE) { - unset($dependencies[$delta]); - if ($dependencies) { - $config->set('dependencies.module', array_values($dependencies)); - } - else { - $config->clear('dependencies.module'); - } - $changed = TRUE; - } - } - - if ($changed) { - $config->save(TRUE); - } - } -} - -/** - * Populate the new 'auto_create_bundle' setting for entity reference fields. - */ -function field_update_8003() { - $config = \Drupal::configFactory(); - /** @var \Drupal\Core\Field\FieldTypePluginManager $field_type_manager */ - $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); - - // Iterate over all fields. - foreach ($config->listAll('field.field.') as $field_id) { - $field = $config->getEditable($field_id); - $class = $field_type_manager->getPluginClass($field->get('field_type')); - - // Deal only with entity reference fields and descendants. - if ($class == EntityReferenceItem::class || is_subclass_of($class, EntityReferenceItem::class)) { - $handler_settings = $field->get('settings.handler_settings'); - - if (is_array($handler_settings) && !empty($handler_settings['auto_create'])) { - // If the field can reference multiple bundles, pick the first one - // available in order to replicate the previous behavior. - if (is_array($handler_settings['target_bundles']) && count($handler_settings['target_bundles']) > 1) { - $handler_settings['auto_create_bundle'] = reset($handler_settings['target_bundles']); - } - // Otherwise, we don't know which bundle to use for auto-creation so we - // have to disable the functionality completely. - elseif (!$handler_settings['target_bundles']) { - $handler_settings['auto_create'] = FALSE; - $handler_settings['auto_create_bundle'] = NULL; - } - } - - $field->set('settings.handler_settings', $handler_settings)->save(TRUE); - } - } -} - -/** - * Update the definition of deleted fields. - */ -function field_update_8500() { - $state = \Drupal::state(); - - // Convert the old deleted field definitions from an array to a FieldConfig - // object. - $deleted_field_definitions = $state->get('field.field.deleted', []); - foreach ($deleted_field_definitions as $key => $deleted_field_definition) { - if (is_array($deleted_field_definition)) { - $deleted_field_definitions[$key] = new FieldConfig($deleted_field_definition); - } - } - $state->set('field.field.deleted', $deleted_field_definitions); - - // Convert the old deleted field storage definitions from an array to a - // FieldStorageConfig object. - $deleted_field_storage_definitions = $state->get('field.storage.deleted', []); - foreach ($deleted_field_storage_definitions as $key => $deleted_field_storage_definition) { - if (is_array($deleted_field_storage_definition)) { - $deleted_field_storage_definitions[$key] = new FieldStorageConfig($deleted_field_storage_definition); - } - } - $state->set('field.storage.deleted', $deleted_field_storage_definitions); +function field_update_last_removed() { + return 8500; } diff --git a/core/modules/field/tests/fixtures/update/drupal-8.email_widget_size_setting-2578741.php b/core/modules/field/tests/fixtures/update/drupal-8.email_widget_size_setting-2578741.php deleted file mode 100644 index ca762bc034d..00000000000 --- a/core/modules/field/tests/fixtures/update/drupal-8.email_widget_size_setting-2578741.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * @file - * Contains SQL necessary to add a new component for an email field/widget to - * the 'node.article.default' entity form display. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$config = $connection->select('config', 'c') - ->fields('c') - ->condition('collection', '') - ->condition('name', 'core.entity_form_display.node.article.default') - ->execute() - ->fetchAssoc(); - -$data = unserialize($config['data']); - -// Manually add a new component that simulates an email field using the default -// email widget. -$data['content']['field_email_2578741'] = [ - 'weight' => 20, - 'settings' => [ - 'placeholder' => '', - ], - 'third_party_settings' => [], - 'type' => 'email_default', -]; - -$connection->update('config') - ->fields(['data' => serialize($data)]) - ->condition('collection', '') - ->condition('name', 'core.entity_form_display.node.article.default') - ->execute(); diff --git a/core/modules/field/tests/fixtures/update/drupal-8.remove_handler_submit_setting-2715589.php b/core/modules/field/tests/fixtures/update/drupal-8.remove_handler_submit_setting-2715589.php deleted file mode 100644 index 88a543fa14b..00000000000 --- a/core/modules/field/tests/fixtures/update/drupal-8.remove_handler_submit_setting-2715589.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -/** - * @file - * Provides necessary database additions for testing - * field_post_update_remove_handler_submit_setting() - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$config = unserialize($connection->select('config', 'c') - ->fields('c', ['data']) - ->condition('collection', '') - ->condition('name', 'field.field.node.article.field_tags') - ->execute() - ->fetchField()); - -$config['settings']['handler_submit'] = 'Change handler'; - -$connection->update('config') - ->fields(['data' => serialize($config)]) - ->condition('collection', '') - ->condition('name', 'field.field.node.article.field_tags') - ->execute(); diff --git a/core/modules/field/tests/fixtures/update/drupal-8.update_deleted_field_definitions-2931436.php b/core/modules/field/tests/fixtures/update/drupal-8.update_deleted_field_definitions-2931436.php deleted file mode 100644 index 9a210e0bfec..00000000000 --- a/core/modules/field/tests/fixtures/update/drupal-8.update_deleted_field_definitions-2931436.php +++ /dev/null @@ -1,203 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -/** - * @file - * Contains SQL necessary to add a deleted field to the node entity type. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Add the field schema data and the deleted field definitions. -$connection->insert('key_value') - ->fields([ - 'collection', - 'name', - 'value', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'node.field_schema_data.field_test', - 'value' => 'a:2:{s:16:"node__field_test";a:4:{s:11:"description";s:39:"Data storage for node field field_test.";s:6:"fields";a:7:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:16:"field_test_value";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:254;s:8:"not null";b:1;}}s:11:"primary key";a:4:{i:0;s:9:"entity_id";i:1;s:7:"deleted";i:2;s:5:"delta";i:3;s:8:"langcode";}s:7:"indexes";a:2:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}}}s:25:"node_revision__field_test";a:4:{s:11:"description";s:51:"Revision archive storage for node field field_test.";s:6:"fields";a:7:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:16:"field_test_value";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:254;s:8:"not null";b:1;}}s:11:"primary key";a:5:{i:0;s:9:"entity_id";i:1;s:11:"revision_id";i:2;s:7:"deleted";i:3;s:5:"delta";i:4;s:8:"langcode";}s:7:"indexes";a:2:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}}}}', - ]) - ->values([ - 'collection' => 'state', - 'name' => 'field.field.deleted', - 'value' => 'a:1:{s:36:"5d0d9870-560b-46c4-b838-0dcded0502dd";a:18:{s:4:"uuid";s:36:"5d0d9870-560b-46c4-b838-0dcded0502dd";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"config";a:2:{i:0;s:29:"field.storage.node.field_test";i:1;s:17:"node.type.article";}}s:2:"id";s:23:"node.article.field_test";s:10:"field_name";s:10:"field_test";s:11:"entity_type";s:4:"node";s:6:"bundle";s:7:"article";s:5:"label";s:4:"Test";s:11:"description";s:0:"";s:8:"required";b:0;s:12:"translatable";b:0;s:13:"default_value";a:0:{}s:22:"default_value_callback";s:0:"";s:8:"settings";a:0:{}s:10:"field_type";s:5:"email";s:7:"deleted";b:1;s:18:"field_storage_uuid";s:36:"ce93d7c2-1da7-4a2c-9e6d-b4925e3b129f";}}', - ]) - ->values([ - 'collection' => 'state', - 'name' => 'field.storage.deleted', - 'value' => 'a:1:{s:36:"ce93d7c2-1da7-4a2c-9e6d-b4925e3b129f";a:18:{s:4:"uuid";s:36:"ce93d7c2-1da7-4a2c-9e6d-b4925e3b129f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"module";a:1:{i:0;s:4:"node";}}s:2:"id";s:15:"node.field_test";s:10:"field_name";s:10:"field_test";s:11:"entity_type";s:4:"node";s:4:"type";s:5:"email";s:8:"settings";a:0:{}s:6:"module";s:4:"core";s:6:"locked";b:0;s:11:"cardinality";i:1;s:12:"translatable";b:1;s:7:"indexes";a:0:{}s:22:"persist_with_no_fields";b:0;s:14:"custom_storage";b:0;s:7:"deleted";b:1;s:7:"bundles";a:0:{}}}', - ]) - ->execute(); - -// Create and populate the deleted field tables. -// @see \Drupal\Core\Entity\Sql\DefaultTableMapping::getDedicatedDataTableName() -$deleted_field_data_table_name = "field_deleted_data_" . substr(hash('sha256', 'ce93d7c2-1da7-4a2c-9e6d-b4925e3b129f'), 0, 10); -$connection->schema()->createTable($deleted_field_data_table_name, array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_test_value' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '254', - ), - ), - 'primary key' => array( - 'entity_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - ), -)); - -$connection->insert($deleted_field_data_table_name) -->fields(array( - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'field_test_value', -)) -->values(array( - 'bundle' => 'article', - 'deleted' => '1', - 'entity_id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'delta' => '0', - 'field_test_value' => 'test@test.com', -)) -->execute(); - -// @see \Drupal\Core\Entity\Sql\DefaultTableMapping::getDedicatedDataTableName() -$deleted_field_revision_table_name = "field_deleted_revision_" . substr(hash('sha256', 'ce93d7c2-1da7-4a2c-9e6d-b4925e3b129f'), 0, 10); -$connection->schema()->createTable($deleted_field_revision_table_name, array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_test_value' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '254', - ), - ), - 'primary key' => array( - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - ), -)); - -$connection->insert($deleted_field_revision_table_name) -->fields(array( - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'field_test_value', -)) -->values(array( - 'bundle' => 'article', - 'deleted' => '1', - 'entity_id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'delta' => '0', - 'field_test_value' => 'test@test.com', -)) -->execute(); diff --git a/core/modules/field/tests/fixtures/update/drupal-8.views_entity_reference_plugins-2429191.php b/core/modules/field/tests/fixtures/update/drupal-8.views_entity_reference_plugins-2429191.php deleted file mode 100644 index 5ecacf5e33d..00000000000 --- a/core/modules/field/tests/fixtures/update/drupal-8.views_entity_reference_plugins-2429191.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2429191. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; -use Drupal\field\Entity\FieldStorageConfig; - -$connection = Database::getConnection(); - -// Configuration for a View with an "entity_reference selection" display. -$config = Yaml::decode(file_get_contents(__DIR__ . '/views.view.entity_reference_plugins_2429191.yml')); -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'views.view.' . $config['id'], - 'data' => serialize($config), - ]) - ->execute(); - -// Configuration for an entity_reference field storage using the View for -// selection. -$field_ref_views_select_2429191 = Yaml::decode(file_get_contents(__DIR__ . '/field.storage.node.field_ref_views_select_2429191.yml')); - -// Configuration for an entity_reference field storage using the auto-create -// feature. -$field_ref_autocreate_2412569 = Yaml::decode(file_get_contents(__DIR__ . '/field.storage.node.field_ref_autocreate_2412569.yml')); - -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.storage.' . $field_ref_views_select_2429191['id'], - 'data' => serialize($field_ref_views_select_2429191), - ]) - ->values([ - 'collection' => '', - 'name' => 'field.storage.' . $field_ref_autocreate_2412569['id'], - 'data' => serialize($field_ref_autocreate_2412569), - ]) - ->execute(); -// We need to Update the registry of "last installed" field definitions. -$installed = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'node.field_storage_definitions') - ->execute() - ->fetchField(); -$installed = unserialize($installed); -$installed['field_ref_views_select_2429191'] = new FieldStorageConfig($field_ref_views_select_2429191); -$installed['field_ref_autocreate_2412569'] = new FieldStorageConfig($field_ref_autocreate_2412569); -$connection->update('key_value') - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'node.field_storage_definitions') - ->fields([ - 'value' => serialize($installed), - ]) - ->execute(); - -// Configuration for an entity_reference field using the View for selection. -$field_ref_views_select_2429191 = Yaml::decode(file_get_contents(__DIR__ . '/field.field.node.article.field_ref_views_select_2429191.yml')); - -// Configuration for an entity_reference field using the auto-create feature. -$field_ref_autocreate_2412569 = Yaml::decode(file_get_contents(__DIR__ . '/field.field.node.article.field_ref_autocreate_2412569.yml')); - -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.' . $field_ref_views_select_2429191['id'], - 'data' => serialize($field_ref_views_select_2429191), - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.' . $field_ref_autocreate_2412569['id'], - 'data' => serialize($field_ref_autocreate_2412569), - ]) - ->execute(); diff --git a/core/modules/field/tests/fixtures/update/field.field.node.article.field_ref_autocreate_2412569.yml b/core/modules/field/tests/fixtures/update/field.field.node.article.field_ref_autocreate_2412569.yml deleted file mode 100644 index 2606bf6f0aa..00000000000 --- a/core/modules/field/tests/fixtures/update/field.field.node.article.field_ref_autocreate_2412569.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: d6deba8d-073a-4572-a000-ee2a2de94de2 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_ref_autocreate_2412569 - - node.type.article - - taxonomy.vocabulary.tags - - taxonomy.vocabulary.test -id: node.article.field_ref_autocreate_2412569 -field_name: field_ref_autocreate_2412569 -entity_type: node -bundle: article -label: 'Ref Autocreate 2412569' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - tags: tags - test: test - sort: - field: _none - auto_create: true -field_type: entity_reference diff --git a/core/modules/field/tests/fixtures/update/field.field.node.article.field_ref_views_select_2429191.yml b/core/modules/field/tests/fixtures/update/field.field.node.article.field_ref_views_select_2429191.yml deleted file mode 100644 index d5550684b15..00000000000 --- a/core/modules/field/tests/fixtures/update/field.field.node.article.field_ref_views_select_2429191.yml +++ /dev/null @@ -1,27 +0,0 @@ -uuid: ac77b88d-dfa0-4b07-b700-ba50cb51f72a -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_ref_views_select_2429191 - - node.type.article - module: - - entity_reference -id: node.article.field_ref_views_select_2429191 -field_name: field_ref_views_select_2429191 -entity_type: node -bundle: article -label: reference_views_select -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: views - handler_settings: - view: - view_name: entity_reference_plugins_2429191 - display_name: entity_reference_1 - arguments: { } -field_type: entity_reference diff --git a/core/modules/field/tests/fixtures/update/field.storage.node.field_ref_autocreate_2412569.yml b/core/modules/field/tests/fixtures/update/field.storage.node.field_ref_autocreate_2412569.yml deleted file mode 100644 index 1e474e833b4..00000000000 --- a/core/modules/field/tests/fixtures/update/field.storage.node.field_ref_autocreate_2412569.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 5e4095a3-8f89-4d7a-b222-34bf5240b646 -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_ref_autocreate_2412569 -field_name: field_ref_autocreate_2412569 -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: true diff --git a/core/modules/field/tests/fixtures/update/field.storage.node.field_ref_views_select_2429191.yml b/core/modules/field/tests/fixtures/update/field.storage.node.field_ref_views_select_2429191.yml deleted file mode 100644 index 950d3e024f1..00000000000 --- a/core/modules/field/tests/fixtures/update/field.storage.node.field_ref_views_select_2429191.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 7f5e9177-56b3-4b84-a936-54bfd4d4c078 -langcode: en -status: true -dependencies: - module: - - entity_reference - - node -id: node.field_ref_views_select_2429191 -field_name: field_ref_views_select_2429191 -entity_type: node -type: entity_reference -settings: - target_type: node -module: entity_reference -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: true diff --git a/core/modules/field/tests/fixtures/update/views.view.entity_reference_plugins_2429191.yml b/core/modules/field/tests/fixtures/update/views.view.entity_reference_plugins_2429191.yml deleted file mode 100644 index b36efa1afee..00000000000 --- a/core/modules/field/tests/fixtures/update/views.view.entity_reference_plugins_2429191.yml +++ /dev/null @@ -1,213 +0,0 @@ -uuid: 8b3d9ae1-c8f9-4219-af35-53f687e6081b -langcode: en -status: true -dependencies: - module: - - entity_reference - - node - - user -id: entity_reference_plugins_2429191 -label: test -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: '‹ previous' - next: 'next ›' - first: '« first' - last: 'last »' - quantity: 9 - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - value: true - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: contains - value: foo - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - multiple: false - remember: false - entity_type: node - entity_field: title - plugin_id: string - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - entity_reference_1: - display_plugin: entity_reference - id: entity_reference_1 - display_title: 'Entity Reference' - position: 1 - display_options: - display_extenders: { } - style: - type: entity_reference - options: - search_fields: - title: title - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/field/tests/src/Functional/Update/EmailWidgetSizeSettingUpdateTest.php b/core/modules/field/tests/src/Functional/Update/EmailWidgetSizeSettingUpdateTest.php deleted file mode 100644 index 0dc1b6641f0..00000000000 --- a/core/modules/field/tests/src/Functional/Update/EmailWidgetSizeSettingUpdateTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Drupal\Tests\field\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the update for the 'size' setting of the 'email_default' field widget. - * - * @group field - * @group legacy - */ -class EmailWidgetSizeSettingUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.email_widget_size_setting-2578741.php', - ]; - } - - /** - * Tests field_post_update_email_widget_size_setting(). - * - * @see field_post_update_email_widget_size_setting() - */ - public function testFieldPostUpdateEmailWidgetSizeSetting() { - $configFactory = $this->container->get('config.factory'); - - // Load the 'node.article.default' entity form display and check that the - // widget for 'field_email_2578741' does not have a 'size' setting. - /** @var \Drupal\Core\Config\Config $config */ - $config = $configFactory->get('core.entity_form_display.node.article.default'); - $settings = $config->get('content.field_email_2578741.settings'); - $this->assertTrue(!isset($settings['size']), 'The size setting does not exist prior to running the update functions.'); - - // Run updates. - $this->runUpdates(); - - // Reload the config and check that the 'size' setting has been populated. - $config = $configFactory->get('core.entity_form_display.node.article.default'); - $settings = $config->get('content.field_email_2578741.settings'); - $this->assertEqual($settings['size'], 60, 'The size setting exists and it has the correct default value.'); - } - -} diff --git a/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php b/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php deleted file mode 100644 index e90f45d78e4..00000000000 --- a/core/modules/field/tests/src/Functional/Update/EntityReferenceHandlerSettingUpdateTest.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -namespace Drupal\Tests\field\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the update for the entity reference 'handler' setting. - * - * @group field - * @group legacy - */ -class EntityReferenceHandlerSettingUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests field_post_update_entity_reference_handler_setting(). - * - * @see field_post_update_entity_reference_handler_setting() - */ - public function testFieldPostUpdateERHandlerSetting() { - $configFactory = $this->container->get('config.factory'); - - // Load the 'node.article.field_image' field config, and check that its - // 'handler' setting is wrong. - /** @var \Drupal\Core\Config\Config */ - $config = $configFactory->get('field.field.node.article.field_image'); - $settings = $config->get('settings'); - $this->assertEqual($settings['handler'], 'default:node'); - - // Run updates. - $this->runUpdates(); - - // Reload the config, and check that the 'handler' setting has been fixed. - $config = $configFactory->get('field.field.node.article.field_image'); - $settings = $config->get('settings'); - $this->assertEqual($settings['handler'], 'default:file'); - } - -} diff --git a/core/modules/field/tests/src/Functional/Update/FieldUpdateTest.php b/core/modules/field/tests/src/Functional/Update/FieldUpdateTest.php deleted file mode 100644 index bec6e96546a..00000000000 --- a/core/modules/field/tests/src/Functional/Update/FieldUpdateTest.php +++ /dev/null @@ -1,266 +0,0 @@ -<?php - -namespace Drupal\Tests\field\Functional\Update; - -use Drupal\Core\Config\Config; -use Drupal\Core\Field\FieldDefinitionInterface; -use Drupal\Core\Field\FieldStorageDefinitionInterface; -use Drupal\field\Entity\FieldConfig; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\node\Entity\Node; -use Drupal\Tests\Traits\Core\CronRunTrait; - -/** - * Tests that field settings are properly updated during database updates. - * - * @group field - * @group legacy - */ -class FieldUpdateTest extends UpdatePathTestBase { - - use CronRunTrait; - - /** - * The config factory service. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface - */ - protected $configFactory; - - /** - * The database connection. - * - * @var \Drupal\Core\Database\Connection - */ - protected $database; - - /** - * The key-value collection for tracking installed storage schema. - * - * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface - */ - protected $installedStorageSchema; - - /** - * The state service. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $this->configFactory = $this->container->get('config.factory'); - $this->database = $this->container->get('database'); - $this->installedStorageSchema = $this->container->get('keyvalue')->get('entity.storage_schema.sql'); - $this->state = $this->container->get('state'); - } - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.views_entity_reference_plugins-2429191.php', - __DIR__ . '/../../../fixtures/update/drupal-8.remove_handler_submit_setting-2715589.php', - __DIR__ . '/../../../fixtures/update/drupal-8.update_deleted_field_definitions-2931436.php', - ]; - } - - /** - * Tests field_update_8001(). - * - * @see field_update_8001() - */ - public function testFieldUpdate8001() { - // Load the 'node.field_image' field storage config, and check that is has - // a 'target_bundle' setting. - $config = $this->configFactory->get('field.storage.node.field_image'); - $settings = $config->get('settings'); - $this->assertTrue(array_key_exists('target_bundle', $settings)); - - // Run updates. - $this->runUpdates(); - - // Reload the config, and check that the 'target_bundle' setting has been - // removed. - $config = $this->configFactory->get('field.storage.node.field_image'); - $settings = $config->get('settings'); - $this->assertFalse(array_key_exists('target_bundle', $settings)); - } - - /** - * Tests field_update_8002(). - * - * @see field_update_8002() - */ - public function testFieldUpdate8002() { - // Check that 'entity_reference' is the provider and a dependency of the - // test field storage . - $field_storage = $this->configFactory->get('field.storage.node.field_ref_views_select_2429191'); - $this->assertIdentical($field_storage->get('module'), 'entity_reference'); - $this->assertEntityRefDependency($field_storage, TRUE); - - // Check that 'entity_reference' is a dependency of the test field. - $field = $this->configFactory->get('field.field.node.article.field_ref_views_select_2429191'); - $this->assertEntityRefDependency($field, TRUE); - - // Check that 'entity_reference' is a dependency of the test view. - $view = $this->configFactory->get('views.view.entity_reference_plugins_2429191'); - $this->assertEntityRefDependency($view, TRUE); - - // Run updates. - $this->runUpdates(); - - // Check that 'entity_reference' is no longer a dependency of the test field - // and view. - $field_storage = $this->configFactory->get('field.storage.node.field_ref_views_select_2429191'); - $this->assertIdentical($field_storage->get('module'), 'core'); - $this->assertEntityRefDependency($field_storage, FALSE); - $field = $this->configFactory->get('field.field.node.article.field_ref_views_select_2429191'); - $this->assertEntityRefDependency($field, FALSE); - $view = $this->configFactory->get('views.view.entity_reference_plugins_2429191'); - $this->assertEntityRefDependency($view, FALSE); - - // Check that field selection, based on the view, still works. It only - // selects nodes whose title contains 'foo'. - $node_1 = Node::create(['type' => 'article', 'title' => 'foobar']); - $node_1->save(); - $node_2 = Node::create(['type' => 'article', 'title' => 'barbaz']); - $node_2->save(); - $field = FieldConfig::load('node.article.field_ref_views_select_2429191'); - $selection = \Drupal::service('plugin.manager.entity_reference_selection')->getSelectionHandler($field); - $referencable = $selection->getReferenceableEntities(); - $this->assertEqual(array_keys($referencable['article']), [$node_1->id()]); - } - - /** - * Tests field_update_8003(). - * - * @see field_update_8003() - */ - public function testFieldUpdate8003() { - // Run updates. - $this->runUpdates(); - - // Check that the new 'auto_create_bundle' setting is populated correctly. - $field = $this->configFactory->get('field.field.node.article.field_ref_autocreate_2412569'); - $handler_settings = $field->get('settings.handler_settings'); - - $expected_target_bundles = ['tags' => 'tags', 'test' => 'test']; - $this->assertEqual($handler_settings['target_bundles'], $expected_target_bundles); - - $this->assertTrue($handler_settings['auto_create']); - $this->assertEqual($handler_settings['auto_create_bundle'], 'tags'); - } - - /** - * Tests field_update_8500(). - * - * @see field_update_8500() - */ - public function testFieldUpdate8500() { - $field_name = 'field_test'; - $field_uuid = '5d0d9870-560b-46c4-b838-0dcded0502dd'; - $field_storage_uuid = 'ce93d7c2-1da7-4a2c-9e6d-b4925e3b129f'; - - // Check that we have pre-existing entries for 'field.field.deleted' and - // 'field.storage.deleted'. - $deleted_fields = $this->state->get('field.field.deleted'); - $this->assertCount(1, $deleted_fields); - $this->assertArrayHasKey($field_uuid, $deleted_fields); - - $deleted_field_storages = $this->state->get('field.storage.deleted'); - $this->assertCount(1, $deleted_field_storages); - $this->assertArrayHasKey($field_storage_uuid, $deleted_field_storages); - - // Ensure that cron does not run automatically after running the updates. - $this->state->set('system.cron_last', REQUEST_TIME + 100); - - // Run updates. - $this->runUpdates(); - - $deleted_fields_repository = \Drupal::service('entity_field.deleted_fields_repository'); - - // Now that we can use the API, check that the "delete fields" state entries - // have been converted to proper field definition objects. - $deleted_fields = $deleted_fields_repository->getFieldDefinitions(); - - $this->assertCount(1, $deleted_fields); - $this->assertArrayHasKey($field_uuid, $deleted_fields); - $this->assertTrue($deleted_fields[$field_uuid] instanceof FieldDefinitionInterface); - $this->assertEquals($field_name, $deleted_fields[$field_uuid]->getName()); - - $deleted_field_storages = $deleted_fields_repository->getFieldStorageDefinitions(); - $this->assertCount(1, $deleted_field_storages); - $this->assertArrayHasKey($field_storage_uuid, $deleted_field_storages); - $this->assertTrue($deleted_field_storages[$field_storage_uuid] instanceof FieldStorageDefinitionInterface); - $this->assertEquals($field_name, $deleted_field_storages[$field_storage_uuid]->getName()); - - // Check that the installed storage schema still exists. - $this->assertNotNull($this->installedStorageSchema->get("node.field_schema_data.$field_name")); - - // Check that the deleted field tables exist. - /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */ - $table_mapping = \Drupal::entityTypeManager()->getStorage('node')->getTableMapping(); - - $deleted_field_data_table_name = $table_mapping->getDedicatedDataTableName($deleted_field_storages[$field_storage_uuid], TRUE); - $this->assertTrue($this->database->schema()->tableExists($deleted_field_data_table_name)); - $deleted_field_revision_table_name = $table_mapping->getDedicatedRevisionTableName($deleted_field_storages[$field_storage_uuid], TRUE); - $this->assertTrue($this->database->schema()->tableExists($deleted_field_revision_table_name)); - - // Run cron and repeat the checks above. - $this->cronRun(); - - $deleted_fields = $deleted_fields_repository->getFieldDefinitions(); - $this->assertCount(0, $deleted_fields); - - $deleted_field_storages = $deleted_fields_repository->getFieldStorageDefinitions(); - $this->assertCount(0, $deleted_field_storages); - - // Check that the installed storage schema has been deleted. - $this->assertNull($this->installedStorageSchema->get("node.field_schema_data.$field_name")); - - // Check that the deleted field tables have been deleted. - $this->assertFalse($this->database->schema()->tableExists($deleted_field_data_table_name)); - $this->assertFalse($this->database->schema()->tableExists($deleted_field_revision_table_name)); - } - - /** - * Asserts that a config depends on 'entity_reference' or not - * - * @param \Drupal\Core\Config\Config $config - * The config to test. - * @param bool $present - * TRUE to test that entity_reference is present, FALSE to test that it is - * absent. - */ - protected function assertEntityRefDependency(Config $config, $present) { - $dependencies = $config->get('dependencies'); - $dependencies += ['module' => []]; - $this->assertEqual(in_array('entity_reference', $dependencies['module']), $present); - } - - /** - * Tests field_post_update_remove_handler_submit_setting(). - * - * @see field_post_update_remove_handler_submit_setting() - */ - public function testEntityReferenceFieldConfigCleanUpdate() { - $field_config = $this->config('field.field.node.article.field_tags'); - // Check that 'handler_submit' key exists in field config settings. - $this->assertEquals('Change handler', $field_config->get('settings.handler_submit')); - - $this->runUpdates(); - - $field_config = $this->config('field.field.node.article.field_tags'); - // Check that 'handler_submit' has been removed from field config settings. - $this->assertArrayNotHasKey('handler_submit', $field_config->get('settings')); - } - -} diff --git a/core/modules/file/file.install b/core/modules/file/file.install index cd49acbabcb..a975eed34b4 100644 --- a/core/modules/file/file.install +++ b/core/modules/file/file.install @@ -5,8 +5,6 @@ * Install, update and uninstall functions for File module. */ -use Drupal\Core\Entity\Entity\EntityViewDisplay; - /** * Implements hook_schema(). */ @@ -116,60 +114,8 @@ function file_requirements($phase) { } /** - * Prevent unused files from being deleted. - */ -function file_update_8300() { - // Disable deletion of unused permanent files. - \Drupal::configFactory()->getEditable('file.settings') - ->set('make_unused_managed_files_temporary', FALSE) - ->save(); - - return t('Files that have no remaining usages are no longer deleted by default.'); -} - -/** - * Add 'use_description_as_link_text' setting to file field formatters. - */ -function file_update_8001() { - $displays = EntityViewDisplay::loadMultiple(); - foreach ($displays as $display) { - /** @var \Drupal\Core\Entity\Entity\EntityViewDisplay $display */ - $fields_settings = $display->get('content'); - $changed = FALSE; - foreach ($fields_settings as $field_name => $settings) { - if (!empty($settings['type'])) { - switch ($settings['type']) { - // The file_table formatter never displayed available descriptions - // before, so we disable this option to ensure backward compatibility. - case 'file_table': - $fields_settings[$field_name]['settings']['use_description_as_link_text'] = FALSE; - $changed = TRUE; - break; - - // The file_default formatter always displayed available descriptions - // before, so we enable this option to ensure backward compatibility. - case 'file_default': - $fields_settings[$field_name]['settings']['use_description_as_link_text'] = TRUE; - $changed = TRUE; - break; - } - } - } - if ($changed === TRUE) { - $display->set('content', $fields_settings)->save(); - } - } -} - -/** - * Set the 'owner' entity key and update the field. + * Implements hook_update_last_removed(). */ -function file_update_8700() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('file'); - $keys = $entity_type->getKeys(); - $keys['owner'] = 'uid'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); - $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'file')); +function file_update_last_removed() { + return 8700; } diff --git a/core/modules/file/tests/fixtures/update/core.entity_view_display.node.article.default_2677990.yml b/core/modules/file/tests/fixtures/update/core.entity_view_display.node.article.default_2677990.yml deleted file mode 100644 index fae6adecb6a..00000000000 --- a/core/modules/file/tests/fixtures/update/core.entity_view_display.node.article.default_2677990.yml +++ /dev/null @@ -1,71 +0,0 @@ -uuid: 9ca49b35-b49d-4014-9337-965cdf15b61e -langcode: en -status: true -dependencies: - config: - - field.field.node.article.body - - field.field.node.article.comment - - field.field.node.article.field_file_generic_2677990 - - field.field.node.article.field_file_table_2677990 - - field.field.node.article.field_image - - field.field.node.article.field_tags - - image.style.large - - node.type.article - module: - - comment - - file - - image - - text - - user -_core: - default_config_hash: JtAg_-waIt1quMtdDtHIaXJMxvTuSmxW7bWyO6Zd68E -id: node.article.default -targetEntityType: node -bundle: article -mode: default -content: - body: - type: text_default - weight: 0 - settings: { } - third_party_settings: { } - label: hidden - comment: - label: above - type: comment_default - weight: 20 - settings: - pager_id: 0 - third_party_settings: { } - field_file_generic_2677990: - weight: 101 - label: above - settings: { } - third_party_settings: { } - type: file_default - field_file_table_2677990: - weight: 102 - label: above - settings: { } - third_party_settings: { } - type: file_table - field_image: - type: image - weight: -1 - settings: - image_style: large - image_link: '' - third_party_settings: { } - label: hidden - field_tags: - type: entity_reference_label - weight: 10 - label: above - settings: - link: true - third_party_settings: { } - links: - weight: 100 - settings: { } - third_party_settings: { } -hidden: { } diff --git a/core/modules/file/tests/fixtures/update/drupal-8.file_formatters_update_2677990.php b/core/modules/file/tests/fixtures/update/drupal-8.file_formatters_update_2677990.php deleted file mode 100644 index d27fa1afdbd..00000000000 --- a/core/modules/file/tests/fixtures/update/drupal-8.file_formatters_update_2677990.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2677990. - */ - -use Drupal\Core\Database\Database; -use Drupal\Component\Serialization\Yaml; -use Drupal\field\Entity\FieldStorageConfig; - -$connection = Database::getConnection(); - -// Configuration for a file field storage for generic display. -$field_file_generic_2677990 = Yaml::decode(file_get_contents(__DIR__ . '/field.storage.node.field_file_generic_2677990.yml')); - -// Configuration for a file field storage for table display. -$field_file_table_2677990 = Yaml::decode(file_get_contents(__DIR__ . '/field.storage.node.field_file_table_2677990.yml')); - -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.storage.' . $field_file_generic_2677990['id'], - 'data' => serialize($field_file_generic_2677990), - ]) - ->values([ - 'collection' => '', - 'name' => 'field.storage.' . $field_file_table_2677990['id'], - 'data' => serialize($field_file_table_2677990), - ]) - ->execute(); -// We need to Update the registry of "last installed" field definitions. -$installed = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'node.field_storage_definitions') - ->execute() - ->fetchField(); -$installed = unserialize($installed); -$installed['field_file_generic_2677990'] = new FieldStorageConfig($field_file_generic_2677990); -$installed['field_file_table_2677990'] = new FieldStorageConfig($field_file_table_2677990); -$connection->update('key_value') - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'node.field_storage_definitions') - ->fields([ - 'value' => serialize($installed), - ]) - ->execute(); - -// Configuration for a file field storage for generic display. -$field_file_generic_2677990 = Yaml::decode(file_get_contents(__DIR__ . '/field.field.node.article.field_file_generic_2677990.yml')); - -// Configuration for a file field storage for table display. -$field_file_table_2677990 = Yaml::decode(file_get_contents(__DIR__ . '/field.field.node.article.field_file_table_2677990.yml')); - -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.' . $field_file_generic_2677990['id'], - 'data' => serialize($field_file_generic_2677990), - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.' . $field_file_table_2677990['id'], - 'data' => serialize($field_file_table_2677990), - ]) - ->execute(); - -// Configuration of the view mode to set the proper formatters. -$view_mode_2677990 = Yaml::decode(file_get_contents(__DIR__ . '/core.entity_view_display.node.article.default_2677990.yml')); - -$connection->update('config') - ->fields([ - 'data' => serialize($view_mode_2677990), - ]) - ->condition('name', 'core.entity_view_display.' . $view_mode_2677990['id']) - ->execute(); diff --git a/core/modules/file/tests/fixtures/update/field.field.node.article.field_file_generic_2677990.yml b/core/modules/file/tests/fixtures/update/field.field.node.article.field_file_generic_2677990.yml deleted file mode 100644 index 140a9f355c3..00000000000 --- a/core/modules/file/tests/fixtures/update/field.field.node.article.field_file_generic_2677990.yml +++ /dev/null @@ -1,27 +0,0 @@ -uuid: d352a831-c267-4ecc-9b4e-7ae1896b2241 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_file_generic_2677990 - - node.type.article - module: - - file -id: node.article.field_file_generic_2677990 -field_name: field_file_generic_2677990 -entity_type: node -bundle: article -label: 'File generic' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: '[date:custom:Y]-[date:custom:m]' - file_extensions: txt - max_filesize: '' - description_field: true - handler: 'default:file' - handler_settings: { } -field_type: file diff --git a/core/modules/file/tests/fixtures/update/field.field.node.article.field_file_table_2677990.yml b/core/modules/file/tests/fixtures/update/field.field.node.article.field_file_table_2677990.yml deleted file mode 100644 index ba40a9fb5d3..00000000000 --- a/core/modules/file/tests/fixtures/update/field.field.node.article.field_file_table_2677990.yml +++ /dev/null @@ -1,27 +0,0 @@ -uuid: 44c7a590-ffcc-4534-b01c-b17b8d57ed48 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_file_table_2677990 - - node.type.article - module: - - file -id: node.article.field_file_table_2677990 -field_name: field_file_table_2677990 -entity_type: node -bundle: article -label: 'File table' -description: '' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - file_directory: '[date:custom:Y]-[date:custom:m]' - file_extensions: txt - max_filesize: '' - description_field: true - handler: 'default:file' - handler_settings: { } -field_type: file diff --git a/core/modules/file/tests/fixtures/update/field.storage.node.field_file_generic_2677990.yml b/core/modules/file/tests/fixtures/update/field.storage.node.field_file_generic_2677990.yml deleted file mode 100644 index 0eda228ef43..00000000000 --- a/core/modules/file/tests/fixtures/update/field.storage.node.field_file_generic_2677990.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: a7eb470d-e538-4221-a8ac-57f989d92d8e -langcode: en -status: true -dependencies: - module: - - file - - node -id: node.field_file_generic_2677990 -field_name: field_file_generic_2677990 -entity_type: node -type: file -settings: - display_field: false - display_default: false - uri_scheme: public - target_type: file -module: file -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: true diff --git a/core/modules/file/tests/fixtures/update/field.storage.node.field_file_table_2677990.yml b/core/modules/file/tests/fixtures/update/field.storage.node.field_file_table_2677990.yml deleted file mode 100644 index 8d75eb7961d..00000000000 --- a/core/modules/file/tests/fixtures/update/field.storage.node.field_file_table_2677990.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 43113a5e-3e07-4234-b045-4aa4cd217dca -langcode: en -status: true -dependencies: - module: - - file - - node -id: node.field_file_table_2677990 -field_name: field_file_table_2677990 -entity_type: node -type: file -settings: - display_field: false - display_default: false - uri_scheme: public - target_type: file -module: file -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: true diff --git a/core/modules/file/tests/src/Functional/Update/FileUpdateTest.php b/core/modules/file/tests/src/Functional/Update/FileUpdateTest.php deleted file mode 100644 index c10e987a1c4..00000000000 --- a/core/modules/file/tests/src/Functional/Update/FileUpdateTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -namespace Drupal\Tests\file\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests File update path. - * - * @group legacy - */ -class FileUpdateTest extends UpdatePathTestBase { - - /** - * Modules to enable after the database is loaded. - */ - protected static $modules = ['file']; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.file_formatters_update_2677990.php', - ]; - } - - /** - * Tests file_update_8001(). - */ - public function testPostUpdate8001() { - $view = 'core.entity_view_display.node.article.default'; - - // Check that field_file_generic formatter has no - // use_description_as_link_text setting. - $formatter_settings = $this->config($view)->get('content.field_file_generic_2677990.settings'); - $this->assertTrue(!isset($formatter_settings['use_description_as_link_text'])); - - // Check that field_file_table formatter has no use_description_as_link_text - // setting. - $formatter_settings = $this->config($view)->get('content.field_file_table_2677990.settings'); - $this->assertTrue(!isset($formatter_settings['use_description_as_link_text'])); - - // Run updates. - $this->runUpdates(); - - // Check that field_file_generic formatter has a - // use_description_as_link_text setting which value is TRUE. - $formatter_settings = $this->config($view)->get('content.field_file_generic_2677990.settings'); - $this->assertEqual($formatter_settings, ['use_description_as_link_text' => TRUE]); - - // Check that field_file_table formatter has a use_description_as_link_text - // setting which value is FALSE. - $formatter_settings = $this->config($view)->get('content.field_file_table_2677990.settings'); - $this->assertEqual($formatter_settings, ['use_description_as_link_text' => FALSE]); - } - - /** - * Tests that the file entity type has an 'owner' entity key. - * - * @see file_update_8700() - */ - public function testOwnerEntityKey() { - // Check that the 'owner' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('file'); - $this->assertFalse($entity_type->getKey('owner')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('file'); - $this->assertEqual('uid', $entity_type->getKey('owner')); - } - -} diff --git a/core/modules/file/tests/src/Functional/Update/FileUsageTemporaryDeletionConfigurationUpdateTest.php b/core/modules/file/tests/src/Functional/Update/FileUsageTemporaryDeletionConfigurationUpdateTest.php deleted file mode 100644 index fa76cbf6d7b..00000000000 --- a/core/modules/file/tests/src/Functional/Update/FileUsageTemporaryDeletionConfigurationUpdateTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\Tests\file\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for setting the file usage deletion configuration. - * - * @see https://www.drupal.org/node/2801777 - * - * @group Update - * @group legacy - */ -class FileUsageTemporaryDeletionConfigurationUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['file']; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests that make_unused_managed_files_temporary conditions are correct. - * - * Verify that the before and after conditions for the variable are correct. - */ - public function testUpdateHookN() { - $this->assertIdentical($this->config('file.settings')->get('make_unused_managed_files_temporary'), NULL); - $this->runUpdates(); - $this->assertIdentical($this->config('file.settings')->get('make_unused_managed_files_temporary'), FALSE); - $this->assertResponse('200'); - } - -} diff --git a/core/modules/hal/hal.install b/core/modules/hal/hal.install index 87944844325..50bb0f77216 100644 --- a/core/modules/hal/hal.install +++ b/core/modules/hal/hal.install @@ -6,40 +6,8 @@ */ /** - * Move 'link_domain' from 'rest.settings' to 'hal.settings'. + * Implements hook_update_last_removed(). */ -function hal_update_8301() { - $config_factory = \Drupal::configFactory(); - - // The default value for the 'link_domain' key is `~`, which is the YAML - // equivalent of PHP's `NULL`. If the REST module is not installed, this is - // the value we will store in 'hal.settings'. - $link_domain = NULL; - - // But if the REST module was installed, we migrate its 'link_domain' setting, - // because we are actually moving that setting from 'rest.settings' to - // 'hal.settings'. - $rest_settings = $config_factory->getEditable('rest.settings'); - if ($rest_settings->getRawData() !== []) { - $link_domain = $rest_settings->get('link_domain'); - // Remove the 'link_domain' setting from 'rest.settings'. - $rest_settings->clear('link_domain') - ->save(); - } - - $hal_settings = $config_factory->getEditable('hal.settings'); - $hal_settings->set('link_domain', $link_domain); - $hal_settings->save(TRUE); -} - -/** - * Add hal.settings::bc_file_uri_as_url_normalizer configuration. - */ -function hal_update_8501() { - $config_factory = \Drupal::configFactory(); - $config_factory->getEditable('hal.settings') - ->set('bc_file_uri_as_url_normalizer', TRUE) - ->save(TRUE); - - return t('Backwards compatibility mode has been enabled for File entities\' HAL normalization of the "uri" field. Like before, it will continue to return only the absolute file URL. If you want the new behavior, which returns both the stored URI and a root-relative file URL, <a href="https://www.drupal.org/node/2925783">read the change record to learn how to opt in.</a>'); +function hal_update_last_removed() { + return 8501; } diff --git a/core/modules/hal/tests/fixtures/update/drupal-8.hal-hal_update_8301.php b/core/modules/hal/tests/fixtures/update/drupal-8.hal-hal_update_8301.php deleted file mode 100644 index ba7ac8a7d17..00000000000 --- a/core/modules/hal/tests/fixtures/update/drupal-8.hal-hal_update_8301.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of hal_update_8301(). - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'hal', - 'value' => 'i:8000;', - ]) - ->fields([ - 'collection' => 'system.schema', - 'name' => 'serialization', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['hal'] = 0; -$extensions['module']['serialization'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/hal/tests/fixtures/update/drupal-8.rest-hal_update_8301.php b/core/modules/hal/tests/fixtures/update/drupal-8.rest-hal_update_8301.php Binary files differdeleted file mode 100644 index cccd707bb83..00000000000 --- a/core/modules/hal/tests/fixtures/update/drupal-8.rest-hal_update_8301.php +++ /dev/null diff --git a/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php b/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php deleted file mode 100644 index 79882b428a8..00000000000 --- a/core/modules/hal/tests/src/Functional/Update/CreateHalSettingsForLinkDomainUpdateTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Drupal\Tests\hal\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that 'hal.settings' is created, to store 'link_domain'. - * - * @see https://www.drupal.org/node/2758897 - * - * @group hal - * @group legacy - */ -class CreateHalSettingsForLinkDomainUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.hal-hal_update_8301.php', - ]; - } - - /** - * Tests hal_update_8301(). - */ - public function testHalSettingsCreated() { - // Make sure we have the expected values before the update. - $hal_settings = $this->config('hal.settings'); - $this->assertIdentical([], $hal_settings->getRawData()); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $hal_settings = \Drupal::configFactory()->get('hal.settings'); - $this->assertTrue(array_key_exists('link_domain', $hal_settings->getRawData())); - $this->assertIdentical(NULL, $hal_settings->getRawData()['link_domain']); - } - -} diff --git a/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php b/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php deleted file mode 100644 index 34f4b88c1c3..00000000000 --- a/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Drupal\Tests\hal\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * 'link_domain' is migrated from 'rest.settings' to 'hal.settings'. - * - * @see https://www.drupal.org/node/2758897 - * - * @group hal - * @group legacy - */ -class MigrateLinkDomainSettingFromRestToHalUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.hal-hal_update_8301.php', - __DIR__ . '/../../../fixtures/update/drupal-8.rest-hal_update_8301.php', - ]; - } - - /** - * Tests hal_update_8301(). - */ - public function testLinkDomainMigratedFromRestSettingsToHalSettings() { - // Make sure we have the expected values before the update. - $hal_settings = $this->config('hal.settings'); - $this->assertIdentical([], $hal_settings->getRawData()); - $rest_settings = $this->config('rest.settings'); - $this->assertTrue(array_key_exists('link_domain', $rest_settings->getRawData())); - $this->assertIdentical('http://example.com', $rest_settings->getRawData()['link_domain']); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $hal_settings = \Drupal::configFactory()->get('hal.settings'); - $this->assertTrue(array_key_exists('link_domain', $hal_settings->getRawData())); - $this->assertIdentical('http://example.com', $hal_settings->getRawData()['link_domain']); - $rest_settings = $this->config('rest.settings'); - $this->assertFalse(array_key_exists('link_domain', $rest_settings->getRawData())); - } - -} diff --git a/core/modules/history/history.install b/core/modules/history/history.install index 85e2fdabbf1..3020d8bc24a 100644 --- a/core/modules/history/history.install +++ b/core/modules/history/history.install @@ -5,8 +5,6 @@ * Installation functions for History module. */ -use Drupal\Core\Database\Database; - /** * Implements hook_schema(). */ @@ -44,47 +42,8 @@ function history_schema() { } /** - * Change {history}.nid to an unsigned int in order to match {node}.nid. + * Implements hook_update_last_removed(). */ -function history_update_8101() { - $schema = Database::getConnection()->schema(); - $schema->dropPrimaryKey('history'); - $schema->dropIndex('history', 'nid'); - $schema->changeField('history', 'nid', 'nid', [ - 'description' => 'The {node}.nid that was read.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ]); - $schema->addPrimaryKey('history', ['uid', 'nid']); - $spec = [ - 'description' => 'A record of which {users} have read which {node}s.', - 'fields' => [ - 'uid' => [ - 'description' => 'The {users}.uid that read the {node} nid.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ], - 'nid' => [ - 'description' => 'The {node}.nid that was read.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - ], - 'timestamp' => [ - 'description' => 'The Unix timestamp at which the read occurred.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ], - ], - 'primary key' => ['uid', 'nid'], - 'indexes' => [ - 'nid' => ['nid'], - ], - ]; - $schema->addIndex('history', 'nid', ['nid'], $spec); +function history_update_last_removed() { + return 8101; } diff --git a/core/modules/image/image.install b/core/modules/image/image.install index ad29b977bb4..725bab886a7 100644 --- a/core/modules/image/image.install +++ b/core/modules/image/image.install @@ -73,12 +73,8 @@ function image_requirements($phase) { } /** - * Flush caches as we changed field formatter metadata. + * Implements hook_update_last_removed(). */ -function image_update_8201() { - // Empty update to trigger a cache flush. - - // Use hook_post_update_NAME() instead to clear the cache. The use of - // hook_update_N() to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. +function image_update_last_removed() { + return 8201; } diff --git a/core/modules/image/tests/fixtures/update/image.image_style.test_scale_and_crop_add_anchor.yml b/core/modules/image/tests/fixtures/update/image.image_style.test_scale_and_crop_add_anchor.yml deleted file mode 100644 index b8dd8db666e..00000000000 --- a/core/modules/image/tests/fixtures/update/image.image_style.test_scale_and_crop_add_anchor.yml +++ /dev/null @@ -1,28 +0,0 @@ -langcode: en -status: true -name: test_scale_and_crop_add_anchor -label: test_scale_and_crop_add_anchor -effects: - 8c7170c9-5bcc-40f9-8698-f88a8be6d434: - uuid: 8c7170c9-5bcc-40f9-8698-f88a8be6d434 - id: image_scale_and_crop - weight: 1 - data: - width: 100 - height: 100 - a8d83b12-abc6-40c8-9c2f-78a4e421cf97: - uuid: a8d83b12-abc6-40c8-9c2f-78a4e421cf97 - id: image_scale_and_crop - weight: 2 - data: - width: 100 - height: 100 - anchor: left-top - 1bffd475-19d0-439a-b6a1-7e5850ce40f9: - uuid: 1bffd475-19d0-439a-b6a1-7e5850ce40f9 - id: image_rotate - weight: 3 - data: - degrees: 180 - bgcolor: '' - random: false diff --git a/core/modules/image/tests/fixtures/update/test_scale_and_crop_add_anchor.php b/core/modules/image/tests/fixtures/update/test_scale_and_crop_add_anchor.php deleted file mode 100644 index 4fdc0335e14..00000000000 --- a/core/modules/image/tests/fixtures/update/test_scale_and_crop_add_anchor.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'image.style.test_scale_and_crop_add_anchor', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/image/tests/fixtures/update/image.image_style.test_scale_and_crop_add_anchor.yml'))), - ]) - ->execute(); diff --git a/core/modules/image/tests/src/Functional/Update/ImageUpdateTest.php b/core/modules/image/tests/src/Functional/Update/ImageUpdateTest.php deleted file mode 100644 index 272b63eb4df..00000000000 --- a/core/modules/image/tests/src/Functional/Update/ImageUpdateTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace Drupal\Tests\image\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests Image update path. - * - * @group image - * @group legacy - */ -class ImageUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - ]; - } - - /** - * Tests image_post_update_image_style_dependencies(). - * - * @see image_post_update_image_style_dependencies() - */ - public function testPostUpdateImageStylesDependencies() { - $view = 'core.entity_view_display.node.article.default'; - $form = 'core.entity_form_display.node.article.default'; - - // Check that view display 'node.article.default' doesn't depend on image - // style 'image.style.large'. - $dependencies = $this->config($view)->get('dependencies.config'); - $this->assertFalse(in_array('image.style.large', $dependencies)); - // Check that form display 'node.article.default' doesn't depend on image - // style 'image.style.thumbnail'. - $dependencies = $this->config($form)->get('dependencies.config'); - $this->assertFalse(in_array('image.style.thumbnail', $dependencies)); - - // Run updates. - $this->runUpdates(); - - // Check that view display 'node.article.default' depend on image style - // 'image.style.large'. - $dependencies = $this->config($view)->get('dependencies.config'); - $this->assertTrue(in_array('image.style.large', $dependencies)); - // Check that form display 'node.article.default' depend on image style - // 'image.style.thumbnail'. - $dependencies = $this->config($view)->get('dependencies.config'); - $this->assertTrue(in_array('image.style.large', $dependencies)); - } - -} diff --git a/core/modules/image/tests/src/Functional/Update/ScaleAndCropAddAnchorUpdateTest.php b/core/modules/image/tests/src/Functional/Update/ScaleAndCropAddAnchorUpdateTest.php deleted file mode 100644 index 6bba60457c7..00000000000 --- a/core/modules/image/tests/src/Functional/Update/ScaleAndCropAddAnchorUpdateTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Drupal\Tests\image\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests adding an 'anchor' setting to existing scale and crop image effects. - * - * @see image_post_update_scale_and_crop_effect_add_anchor() - * - * @group Update - * @group legacy - */ -class ScaleAndCropAddAnchorUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/test_scale_and_crop_add_anchor.php', - ]; - } - - /** - * Tests that 'anchor' setting is properly added. - */ - public function testImagePostUpdateScaleAndCropEffectAddAnchor() { - // Test that the first effect does not have an 'anchor' setting. - $effect_data = $this->config('image.style.test_scale_and_crop_add_anchor')->get('effects.8c7170c9-5bcc-40f9-8698-f88a8be6d434.data'); - $this->assertFalse(array_key_exists('anchor', $effect_data)); - - // Test that the second effect has an 'anchor' setting. - $effect_data = $this->config('image.style.test_scale_and_crop_add_anchor')->get('effects.a8d83b12-abc6-40c8-9c2f-78a4e421cf97.data'); - $this->assertTrue(array_key_exists('anchor', $effect_data)); - - // Test that the third effect does not have an 'anchor' setting. - $effect_data = $this->config('image.style.test_scale_and_crop_add_anchor')->get('effects.1bffd475-19d0-439a-b6a1-7e5850ce40f9.data'); - $this->assertFalse(array_key_exists('anchor', $effect_data)); - - $this->runUpdates(); - - // Test that the first effect now has an 'anchor' setting. - $effect_data = $this->config('image.style.test_scale_and_crop_add_anchor')->get('effects.8c7170c9-5bcc-40f9-8698-f88a8be6d434.data'); - $this->assertTrue(array_key_exists('anchor', $effect_data)); - $this->assertEquals('center-center', $effect_data['anchor']); - - // Test that the second effect's 'anchor' setting is unchanged. - $effect_data = $this->config('image.style.test_scale_and_crop_add_anchor')->get('effects.a8d83b12-abc6-40c8-9c2f-78a4e421cf97.data'); - $this->assertTrue(array_key_exists('anchor', $effect_data)); - $this->assertEquals('left-top', $effect_data['anchor']); - - // Test that the third effect still does not have an 'anchor' setting. - $effect_data = $this->config('image.style.test_scale_and_crop_add_anchor')->get('effects.1bffd475-19d0-439a-b6a1-7e5850ce40f9.data'); - $this->assertFalse(array_key_exists('anchor', $effect_data)); - } - -} diff --git a/core/modules/jsonapi/jsonapi.install b/core/modules/jsonapi/jsonapi.install index a1ada646df3..36bc4f02110 100644 --- a/core/modules/jsonapi/jsonapi.install +++ b/core/modules/jsonapi/jsonapi.install @@ -77,11 +77,8 @@ function jsonapi_requirements($phase) { } /** - * Enable BC: default the new read-only mode to "off" on existing sites. + * Implements hook_update_last_removed(). */ -function jsonapi_update_8701() { - $config_factory = \Drupal::configFactory(); - $jsonapi_settings = $config_factory->getEditable('jsonapi.settings'); - $jsonapi_settings->set('read_only', FALSE) - ->save(TRUE); +function jsonapi_update_last_removed() { + return 8701; } diff --git a/core/modules/jsonapi/tests/fixtures/update/drupal-8.jsonapi-jsonapi_update_8701.php b/core/modules/jsonapi/tests/fixtures/update/drupal-8.jsonapi-jsonapi_update_8701.php deleted file mode 100644 index 783c57b9c10..00000000000 --- a/core/modules/jsonapi/tests/fixtures/update/drupal-8.jsonapi-jsonapi_update_8701.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * @file - * Contains database additions for testing jsonapi_update_8701()'s update path. - * - * @depends core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection', - 'name', - 'value', - ]) - ->values([ - 'collection' => 'system.schema', - 'name' => 'serialization', - 'value' => 'i:8401;', - ]) - ->values([ - 'collection' => 'system.schema', - 'name' => 'jsonapi', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['serialization'] = 0; -$extensions['module']['jsonapi'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/jsonapi/tests/src/Functional/Update/ReadOnlyModeUpdateTest.php b/core/modules/jsonapi/tests/src/Functional/Update/ReadOnlyModeUpdateTest.php deleted file mode 100644 index dabc0df37e7..00000000000 --- a/core/modules/jsonapi/tests/src/Functional/Update/ReadOnlyModeUpdateTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\Tests\jsonapi\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that existing sites have the new read-only mode to "off". - * - * @see jsonapi_update_8701() - * @see https://www.drupal.org/project/jsonapi/issues/3039568 - * - * @group jsonapi - * @group Update - * @group legacy - */ -class ReadOnlyModeUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['jsonapi']; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.jsonapi-jsonapi_update_8701.php', - ]; - } - - /** - * Tests jsonapi_update_8701(). - */ - public function testBcReadOnlyModeSettingAdded() { - // Make sure we have the expected values before the update. - $jsonapi_settings = $this->config('jsonapi.settings'); - $this->assertFalse(array_key_exists('read_only', $jsonapi_settings->getRawData())); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $jsonapi_settings = $this->config('jsonapi.settings'); - $this->assertTrue(array_key_exists('read_only', $jsonapi_settings->getRawData())); - $this->assertFalse($jsonapi_settings->get('read_only')); - } - -} diff --git a/core/modules/language/language.install b/core/modules/language/language.install index dcec16ae619..e3ab47e2509 100644 --- a/core/modules/language/language.install +++ b/core/modules/language/language.install @@ -6,8 +6,8 @@ */ /** - * Rebuild the container as services changed. + * Implements hook_update_last_removed(). */ -function language_update_8001() { - \Drupal::service('kernel')->invalidateContainer(); +function language_update_last_removed() { + return 8001; } diff --git a/core/modules/language/tests/src/Functional/Update/LanguageSelectWidgetUpdateTest.php b/core/modules/language/tests/src/Functional/Update/LanguageSelectWidgetUpdateTest.php deleted file mode 100644 index dc3324ced93..00000000000 --- a/core/modules/language/tests/src/Functional/Update/LanguageSelectWidgetUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\language\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the update path for the language_select widget. - * - * @group Update - * @group legacy - */ -class LanguageSelectWidgetUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - ]; - } - - /** - * Tests language_post_update_language_select_widget(). - */ - public function testLanguagePostUpdateLanguageSelectWidget() { - // Tests before the update. - $content_before = EntityFormDisplay::load('node.page.default')->get('content'); - $this->assertEqual([], $content_before['langcode']['settings']); - - // Run the update. - $this->runUpdates(); - - // Tests after the update. - $content_after = EntityFormDisplay::load('node.page.default')->get('content'); - $this->assertEqual(['include_locked' => TRUE], $content_after['langcode']['settings']); - } - -} diff --git a/core/modules/layout_builder/layout_builder.install b/core/modules/layout_builder/layout_builder.install index ec16a05537c..18df64a2fbd 100644 --- a/core/modules/layout_builder/layout_builder.install +++ b/core/modules/layout_builder/layout_builder.install @@ -6,7 +6,6 @@ */ use Drupal\Core\Cache\Cache; -use Drupal\Core\Database\Database; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay; use Drupal\layout_builder\Section; @@ -42,30 +41,6 @@ function layout_builder_install() { } /** - * Enable Layout Builder for existing entity displays. - */ -function layout_builder_update_8601(&$sandbox) { - $config_factory = \Drupal::configFactory(); - - if (!isset($sandbox['count'])) { - $sandbox['ids'] = $config_factory->listAll('core.entity_view_display.'); - $sandbox['count'] = count($sandbox['ids']); - } - - $ids = array_splice($sandbox['ids'], 0, 50); - foreach ($ids as $id) { - $display = $config_factory->getEditable($id); - if ($display->get('third_party_settings.layout_builder')) { - $display - ->set('third_party_settings.layout_builder.enabled', TRUE) - ->save(); - } - } - - $sandbox['#finished'] = empty($sandbox['ids']) ? 1 : ($sandbox['count'] - count($sandbox['ids'])) / $sandbox['count']; -} - -/** * Implements hook_schema(). */ function layout_builder_schema() { @@ -102,37 +77,8 @@ function layout_builder_schema() { } /** - * Create the 'inline_block_usage' table. + * Implements hook_update_last_removed(). */ -function layout_builder_update_8602() { - $inline_block_usage = [ - 'description' => 'Track where a block_content entity is used.', - 'fields' => [ - 'block_content_id' => [ - 'description' => 'The block_content entity ID.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - 'layout_entity_type' => [ - 'description' => 'The entity type of the parent entity.', - 'type' => 'varchar_ascii', - 'length' => EntityTypeInterface::ID_MAX_LENGTH, - 'not null' => FALSE, - 'default' => '', - ], - 'layout_entity_id' => [ - 'description' => 'The ID of the parent entity.', - 'type' => 'varchar_ascii', - 'length' => 128, - 'not null' => FALSE, - 'default' => 0, - ], - ], - 'primary key' => ['block_content_id'], - 'indexes' => [ - 'type_id' => ['layout_entity_type', 'layout_entity_id'], - ], - ]; - Database::getConnection()->schema()->createTable('inline_block_usage', $inline_block_usage); +function layout_builder_update_last_removed() { + return 8602; } diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-enable.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-enable.php deleted file mode 100644 index 980a87064ef..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-enable.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Add a layout plugin to an existing entity view display without explicitly -// enabling Layout Builder for this display. -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.block_content.basic.default') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['sections'][] = [ - 'layout_id' => 'layout_onecol', - 'layout_settings' => [], - 'components' => [ - 'some-uuid' => [ - 'uuid' => 'some-uuid', - 'region' => 'content', - 'configuration' => [ - 'id' => 'system_powered_by_block', - ], - 'additional' => [], - 'weight' => 0, - ], - ], - 'third_party_settings' => [], -]; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.block_content.basic.default', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.block_content.basic.default') - ->execute(); diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-extra.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-extra.php deleted file mode 100644 index 7ec1b6954a0..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-extra.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Enable Layout Builder on an existing entity view display. -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.default') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['enabled'] = TRUE; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.node.article.default', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.default') - ->execute(); diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-field-block.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-field-block.php deleted file mode 100644 index b0f9cead47c..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-field-block.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\layout_builder\Section; - -// Create a section with a context-aware block with a layout_builder.entity -// context mapping. It is needed in array form for the defaults and string form -// for the overrides. -$section_array = [ - 'layout_id' => 'layout_onecol', - 'layout_settings' => [], - 'components' => [ - 'some-uuid' => [ - 'uuid' => 'some-uuid', - 'region' => 'content', - 'configuration' => [ - 'id' => 'field_block:node:article:body', - 'label' => 'Body', - 'provider' => 'layout_builder', - 'label_display' => 'visible', - 'formatter' => [ - 'label' => 'above', - 'type' => 'text_default', - 'settings' => [], - 'third_party_settings' => [], - ], - 'context_mapping' => [ - 'entity' => 'layout_builder.entity', - ], - ], - 'additional' => [], - 'weight' => 0, - ], - ], -]; -$section_string = serialize(Section::fromArray($section_array)); - -$connection = Database::getConnection(); - -// Add Layout Builder sections to an existing entity view display. -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.default') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['sections'][] = $section_array; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.node.article.default', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.default') - ->execute(); - -// Add the layout data to the node. -$connection->insert('node__layout_builder__layout') - ->fields([ - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'layout_builder__layout_section', - ]) - ->values([ - 'bundle' => 'article', - 'deleted' => '0', - 'entity_id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'delta' => '0', - 'layout_builder__layout_section' => $section_string, - ]) - ->execute(); -$connection->insert('node_revision__layout_builder__layout') - ->fields([ - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'layout_builder__layout_section', - ]) - ->values([ - 'bundle' => 'article', - 'deleted' => '0', - 'entity_id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'delta' => '0', - 'layout_builder__layout_section' => $section_string, - ]) - ->execute(); diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-field-schema.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-field-schema.php deleted file mode 100644 index 7824fda29e8..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-field-schema.php +++ /dev/null @@ -1,344 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Enable Layout Builder on an existing entity view display. -foreach (['article', 'page'] as $bundle) { - $display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', "core.entity_view_display.node.$bundle.default") - ->execute() - ->fetchField(); - $display = unserialize($display); - $display['third_party_settings']['layout_builder']['enabled'] = TRUE; - $display['third_party_settings']['layout_builder']['allow_custom'] = TRUE; - $connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => "core.entity_view_display.node.$bundle.default", - ]) - ->condition('collection', '') - ->condition('name', "core.entity_view_display.node.$bundle.default") - ->execute(); -} - -// Enable Layout Builder on a view display of an entity type that is not yet -// revisionable. -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', "core.entity_view_display.taxonomy_term.forums.default") - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['enabled'] = TRUE; -$display['third_party_settings']['layout_builder']['allow_custom'] = TRUE; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => "core.entity_view_display.taxonomy_term.forums.default", - ]) - ->condition('collection', '') - ->condition('name', "core.entity_view_display.taxonomy_term.forums.default") - ->execute(); - -// Add the layout builder field and field storage. -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.node.article.layout_builder__layout', - 'data' => 'a:16:{s:4:"uuid";s:36:"3a7fb64f-d1cf-4fd5-bd07-9f81d893021a";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:41:"field.storage.node.layout_builder__layout";i:1;s:17:"node.type.article";}s:6:"module";a:1:{i:0;s:14:"layout_builder";}}s:2:"id";s:35:"node.article.layout_builder__layout";s:10:"field_name";s:22:"layout_builder__layout";s:11:"entity_type";s:4:"node";s:6:"bundle";s:7:"article";s:5:"label";s:6:"Layout";s:11:"description";s:0:"";s:8:"required";b:0;s:12:"translatable";b:1;s:13:"default_value";a:0:{}s:22:"default_value_callback";s:0:"";s:8:"settings";a:0:{}s:10:"field_type";s:14:"layout_section";}', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.node.page.layout_builder__layout', - 'data' => 'a:16:{s:4:"uuid";s:36:"6439079b-0f6f-43aa-8e08-1ae42ba1333f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:41:"field.storage.node.layout_builder__layout";i:1;s:14:"node.type.page";}s:6:"module";a:1:{i:0;s:14:"layout_builder";}}s:2:"id";s:32:"node.page.layout_builder__layout";s:10:"field_name";s:22:"layout_builder__layout";s:11:"entity_type";s:4:"node";s:6:"bundle";s:4:"page";s:5:"label";s:6:"Layout";s:11:"description";s:0:"";s:8:"required";b:0;s:12:"translatable";b:1;s:13:"default_value";a:0:{}s:22:"default_value_callback";s:0:"";s:8:"settings";a:0:{}s:10:"field_type";s:14:"layout_section";}', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.storage.node.layout_builder__layout', - 'data' => 'a:16:{s:4:"uuid";s:36:"65b11331-3cd9-4c45-b7a3-6bcfbfd56c6e";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"module";a:2:{i:0;s:14:"layout_builder";i:1;s:4:"node";}}s:2:"id";s:27:"node.layout_builder__layout";s:10:"field_name";s:22:"layout_builder__layout";s:11:"entity_type";s:4:"node";s:4:"type";s:14:"layout_section";s:8:"settings";a:0:{}s:6:"module";s:14:"layout_builder";s:6:"locked";b:1;s:11:"cardinality";i:1;s:12:"translatable";b:1;s:7:"indexes";a:0:{}s:22:"persist_with_no_fields";b:0;s:14:"custom_storage";b:0;}', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.field.taxonomy_term.forums.layout_builder__layout', - 'data' => 'a:16:{s:4:"uuid";s:36:"0f385059-19dd-4bd9-b424-d3deb5aee5e9";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:50:"field.storage.taxonomy_term.layout_builder__layout";i:1;s:26:"taxonomy.vocabulary.forums";}s:6:"module";a:1:{i:0;s:14:"layout_builder";}}s:2:"id";s:43:"taxonomy_term.forums.layout_builder__layout";s:10:"field_name";s:22:"layout_builder__layout";s:11:"entity_type";s:13:"taxonomy_term";s:6:"bundle";s:6:"forums";s:5:"label";s:6:"Layout";s:11:"description";s:0:"";s:8:"required";b:0;s:12:"translatable";b:1;s:13:"default_value";a:0:{}s:22:"default_value_callback";s:0:"";s:8:"settings";a:0:{}s:10:"field_type";s:14:"layout_section";}', - ]) - ->values([ - 'collection' => '', - 'name' => 'field.storage.taxonomy_term.layout_builder__layout', - 'data' => 'a:16:{s:4:"uuid";s:36:"ca41519a-bc8a-4b04-a050-f61afc61f141";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"module";a:3:{i:0;s:14:"layout_builder";i:1;s:8:"taxonomy";i:2;s:5:"forum";}}s:2:"id";s:36:"taxonomy_term.layout_builder__layout";s:10:"field_name";s:22:"layout_builder__layout";s:11:"entity_type";s:13:"taxonomy_term";s:4:"type";s:14:"layout_section";s:8:"settings";a:0:{}s:6:"module";s:14:"layout_builder";s:6:"locked";b:1;s:11:"cardinality";i:1;s:12:"translatable";b:1;s:7:"indexes";a:0:{}s:22:"persist_with_no_fields";b:0;s:14:"custom_storage";b:0;}', - ]) - ->execute(); -$connection->insert('key_value') - ->fields([ - 'collection', - 'name', - 'value', - ]) - ->values([ - 'collection' => 'config.entity.key_store.field_config', - 'name' => 'uuid:3a7fb64f-d1cf-4fd5-bd07-9f81d893021a', - 'value' => 'a:1:{i:0;s:47:"field.field.node.article.layout_builder__layout";}', - ]) - ->values([ - 'collection' => 'config.entity.key_store.field_config', - 'name' => 'uuid:6439079b-0f6f-43aa-8e08-1ae42ba1333f', - 'value' => 'a:1:{i:0;s:44:"field.field.node.page.layout_builder__layout";}";}', - ]) - ->values([ - 'collection' => 'config.entity.key_store.field_storage_config', - 'name' => 'uuid:65b11331-3cd9-4c45-b7a3-6bcfbfd56c6e', - 'value' => 'a:1:{i:0;s:41:"field.storage.node.layout_builder__layout";}', - ]) - ->values([ - 'collection' => 'config.entity.key_store.field_config', - 'name' => 'uuid:0f385059-19dd-4bd9-b424-d3deb5aee5e9', - 'value' => 'a:1:{i:0;s:55:"field.field.taxonomy_term.forums.layout_builder__layout";}";}', - ]) - ->values([ - 'collection' => 'config.entity.key_store.field_storage_config', - 'name' => 'uuid:ca41519a-bc8a-4b04-a050-f61afc61f141', - 'value' => 'a:1:{i:0;s:50:"field.storage.taxonomy_term.layout_builder__layout";}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'node.field_schema_data.layout_builder__layout', - 'value' => 'a:2:{s:28:"node__layout_builder__layout";a:4:{s:11:"description";s:51:"Data storage for node field layout_builder__layout.";s:6:"fields";a:7:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:30:"layout_builder__layout_section";a:4:{s:4:"type";s:4:"blob";s:4:"size";s:6:"normal";s:9:"serialize";b:1;s:8:"not null";b:0;}}s:11:"primary key";a:4:{i:0;s:9:"entity_id";i:1;s:7:"deleted";i:2;s:5:"delta";i:3;s:8:"langcode";}s:7:"indexes";a:2:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}}}s:37:"node_revision__layout_builder__layout";a:4:{s:11:"description";s:63:"Revision archive storage for node field layout_builder__layout.";s:6:"fields";a:7:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:30:"layout_builder__layout_section";a:4:{s:4:"type";s:4:"blob";s:4:"size";s:6:"normal";s:9:"serialize";b:1;s:8:"not null";b:0;}}s:11:"primary key";a:5:{i:0;s:9:"entity_id";i:1;s:11:"revision_id";i:2;s:7:"deleted";i:3;s:5:"delta";i:4;s:8:"langcode";}s:7:"indexes";a:2:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'taxonomy_term.field_schema_data.layout_builder__layout', - 'value' => 'a:1:{s:37:"taxonomy_term__layout_builder__layout";a:4:{s:11:"description";s:60:"Data storage for taxonomy_term field layout_builder__layout.";s:6:"fields";a:7:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:30:"layout_builder__layout_section";a:4:{s:4:"type";s:4:"blob";s:4:"size";s:6:"normal";s:9:"serialize";b:1;s:8:"not null";b:0;}}s:11:"primary key";a:4:{i:0;s:9:"entity_id";i:1;s:7:"deleted";i:2;s:5:"delta";i:3;s:8:"langcode";}s:7:"indexes";a:2:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}}}}', - ]) - ->execute(); -$connection->update('key_value') - ->fields([ - 'collection' => 'entity.definitions.bundle_field_map', - 'name' => 'node', - 'value' => 'a:5:{s:11:"field_image";a:2:{s:4:"type";s:5:"image";s:7:"bundles";a:1:{s:7:"article";s:7:"article";}}s:7:"comment";a:2:{s:4:"type";s:7:"comment";s:7:"bundles";a:1:{s:7:"article";s:7:"article";}}s:10:"field_tags";a:2:{s:4:"type";s:16:"entity_reference";s:7:"bundles";a:1:{s:7:"article";s:7:"article";}}s:4:"body";a:2:{s:4:"type";s:17:"text_with_summary";s:7:"bundles";a:2:{s:4:"page";s:4:"page";s:7:"article";s:7:"article";}}s:22:"layout_builder__layout";a:2:{s:4:"type";s:14:"layout_section";s:7:"bundles";a:2:{s:7:"article";s:7:"article";s:4:"page";s:4:"page";}}}', - ]) - ->condition('collection', 'entity.definitions.bundle_field_map') - ->condition('name', 'node') - ->execute(); - -$taxonomy_bundle_field_map = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'entity.definitions.bundle_field_map') - ->condition('name', 'taxonomy_term') - ->execute() - ->fetchField(); -$taxonomy_bundle_field_map = unserialize($taxonomy_bundle_field_map); -$taxonomy_bundle_field_map['layout_builder__layout'] = [ - 'type' => 'layout_section', - 'bundles' => [ - 'forums' => 'forums', - ], -]; -$connection->update('key_value') - ->fields([ - 'collection' => 'entity.definitions.bundle_field_map', - 'name' => 'taxonomy_term', - 'value' => serialize($taxonomy_bundle_field_map), - ]) - ->condition('collection', 'entity.definitions.bundle_field_map') - ->condition('name', 'taxonomy_term') - ->execute(); - -// Create tables for the layout builder field. -$connection->schema()->createTable('node__layout_builder__layout', [ - 'fields' => [ - 'bundle' => [ - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ], - 'deleted' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ], - 'entity_id' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'revision_id' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'langcode' => [ - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ], - 'delta' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'layout_builder__layout_section' => [ - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'normal', - ], - ], - 'primary key' => [ - 'entity_id', - 'deleted', - 'delta', - 'langcode', - ], - 'indexes' => [ - 'bundle' => [ - 'bundle', - ], - 'revision_id' => [ - 'revision_id', - ], - ], - 'mysql_character_set' => 'utf8mb4', -]); -$connection->schema()->createTable('node_revision__layout_builder__layout', [ - 'fields' => [ - 'bundle' => [ - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ], - 'deleted' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ], - 'entity_id' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'revision_id' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'langcode' => [ - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ], - 'delta' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'layout_builder__layout_section' => [ - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'normal', - ], - ], - 'primary key' => [ - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'langcode', - ], - 'indexes' => [ - 'bundle' => [ - 'bundle', - ], - 'revision_id' => [ - 'revision_id', - ], - ], - 'mysql_character_set' => 'utf8mb4', -]); -$connection->schema()->createTable('taxonomy_term__layout_builder__layout', [ - 'fields' => [ - 'bundle' => [ - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ], - 'deleted' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ], - 'entity_id' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'revision_id' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'langcode' => [ - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ], - 'delta' => [ - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ], - 'layout_builder__layout_section' => [ - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'normal', - ], - ], - 'primary key' => [ - 'entity_id', - 'deleted', - 'delta', - 'langcode', - ], - 'indexes' => [ - 'bundle' => [ - 'bundle', - ], - 'revision_id' => [ - 'revision_id', - ], - ], - 'mysql_character_set' => 'utf8mb4', -]); diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-permissions.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-permissions.php deleted file mode 100644 index 7f0edd5cf0c..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-permissions.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/** - * @file - * Adds the 'configure any layout' permission to the authenticated user. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$role = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'user.role.authenticated') - ->execute() - ->fetchField(); -$role = unserialize($role); - -$role['permissions'][] = 'configure any layout'; - -$connection->update('config') - ->fields([ - 'data' => serialize($role), - 'collection' => '', - 'name' => 'user.role.authenticated', - ]) - ->condition('collection', '') - ->condition('name', 'user.role.authenticated') - ->execute(); diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-tempstore.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-tempstore.php Binary files differdeleted file mode 100644 index 39ef3d8e66e..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-tempstore.php +++ /dev/null diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder-translation.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder-translation.php deleted file mode 100644 index a2e5f7db86d..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder-translation.php +++ /dev/null @@ -1,170 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\layout_builder\Section; - -$section_array_default = [ - 'layout_id' => 'layout_onecol', - 'layout_settings' => [], - 'components' => [ - 'some-uuid' => [ - 'uuid' => 'some-uuid', - 'region' => 'content', - 'configuration' => [ - 'id' => 'system_powered_by_block', - 'label' => 'This is in English', - 'provider' => 'system', - 'label_display' => 'visible', - ], - 'additional' => [], - 'weight' => 0, - ], - ], -]; -$section_array_translation = $section_array_default; -$section_array_translation['components']['some-uuid']['configuration']['label'] = 'This is in Spanish'; - -$connection = Database::getConnection(); -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'language.content_settings.node.article', - 'data' => 'a:10:{s:4:"uuid";s:36:"450e592a-f451-4685-8f56-02b0f5107cb7";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:1:{i:0;s:17:"node.type.article";}s:6:"module";a:1:{i:0;s:19:"content_translation";}}s:20:"third_party_settings";a:1:{s:19:"content_translation";a:2:{s:7:"enabled";b:1;s:15:"bundle_settings";a:1:{s:26:"untranslatable_fields_hide";s:1:"0";}}}s:2:"id";s:12:"node.article";s:21:"target_entity_type_id";s:4:"node";s:13:"target_bundle";s:7:"article";s:16:"default_langcode";s:12:"site_default";s:18:"language_alterable";b:1;}', - ]) - ->values([ - 'collection' => '', - 'name' => 'language.content_settings.node.page', - 'data' => 'a:10:{s:4:"uuid";s:36:"2b8b721e-59e9-4b57-a026-c4444fd28196";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:1:{i:0;s:14:"node.type.page";}s:6:"module";a:1:{i:0;s:19:"content_translation";}}s:20:"third_party_settings";a:1:{s:19:"content_translation";a:2:{s:7:"enabled";b:1;s:15:"bundle_settings";a:1:{s:26:"untranslatable_fields_hide";s:1:"0";}}}s:2:"id";s:9:"node.page";s:21:"target_entity_type_id";s:4:"node";s:13:"target_bundle";s:4:"page";s:16:"default_langcode";s:12:"site_default";s:18:"language_alterable";b:1;}', - ]) - ->values([ - 'collection' => '', - 'name' => 'language.content_settings.taxonomy_term.forums', - 'data' => 'a:10:{s:4:"uuid";s:36:"16b8ed8f-cac8-40fd-a441-b7b91bb0012d";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:1:{i:0;s:26:"taxonomy.vocabulary.forums";}s:6:"module";a:1:{i:0;s:19:"content_translation";}}s:20:"third_party_settings";a:1:{s:19:"content_translation";a:2:{s:7:"enabled";b:1;s:15:"bundle_settings";a:1:{s:26:"untranslatable_fields_hide";s:1:"0";}}}s:2:"id";s:20:"taxonomy_term.forums";s:21:"target_entity_type_id";s:13:"taxonomy_term";s:13:"target_bundle";s:6:"forums";s:16:"default_langcode";s:12:"site_default";s:18:"language_alterable";b:1;}', - ]) - ->execute(); - -// Add Layout Builder sections to an existing entity view display. -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.default') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['sections'][] = $section_array_default; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.node.article.default', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.default') - ->execute(); - -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.page.default') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['sections'][] = $section_array_default; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.node.page.default', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.page.default') - ->execute(); - -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.taxonomy_term.forums.default') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['sections'][] = $section_array_default; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.taxonomy_term.forums.default', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.taxonomy_term.forums.default') - ->execute(); - -// Loop over test cases defined in the test class. -// @see \Drupal\Tests\layout_builder\Functional\Update\Translatability\MakeLayoutUntranslatableUpdatePathTestBase -foreach ($this->layoutBuilderTestCases as $bundle => $test_case) { - if ($test_case['has_layout']) { - $values_en = [ - 'bundle' => $bundle, - 'deleted' => '0', - 'entity_id' => $test_case['nid'], - 'revision_id' => $test_case['vid'], - 'langcode' => 'en', - 'delta' => '0', - 'layout_builder__layout_section' => serialize(Section::fromArray($section_array_default)), - ]; - - // Add the layout data to the node. - $connection->insert('node__layout_builder__layout') - ->fields(array_keys($values_en)) - ->values($values_en) - ->execute(); - $connection->insert('node_revision__layout_builder__layout') - ->fields(array_keys($values_en)) - ->values($values_en) - ->execute(); - } - - if ($test_case['has_translation']) { - $node_field_data = $connection->select('node_field_data') - ->fields('node_field_data') - ->condition('nid', $test_case['nid']) - ->condition('vid', $test_case['vid']) - ->execute() - ->fetchAssoc(); - - $node_field_data['title'] = "Test: $bundle"; - $node_field_data['langcode'] = 'es'; - $node_field_data['default_langcode'] = 0; - $node_field_data['revision_translation_affected'] = 1; - $node_field_data['content_translation_source'] = 'en'; - $connection->insert('node_field_data') - ->fields(array_keys($node_field_data)) - ->values($node_field_data) - ->execute(); - - $node_field_revision = $connection->select('node_field_revision') - ->fields('node_field_revision') - ->condition('nid', $test_case['nid']) - ->condition('vid', $test_case['vid']) - ->execute() - ->fetchAssoc(); - $node_field_revision['title'] = "Test: $bundle"; - $node_field_revision['langcode'] = 'es'; - $node_field_revision['default_langcode'] = 0; - $node_field_revision['revision_translation_affected'] = 1; - $node_field_revision['content_translation_source'] = 'en'; - $connection->insert('node_field_revision') - ->fields(array_keys($node_field_revision)) - ->values($node_field_revision) - ->execute(); - } -} diff --git a/core/modules/layout_builder/tests/fixtures/update/layout-builder.php b/core/modules/layout_builder/tests/fixtures/update/layout-builder.php deleted file mode 100644 index 3f5adb81113..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/layout-builder.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'layout_builder', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'layout_builder') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['layout_builder'] = 0; -$extensions['module']['layout_discovery'] = 0; -$extensions['module']['layout_test'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/layout_builder/tests/fixtures/update/section-dependencies.php b/core/modules/layout_builder/tests/fixtures/update/section-dependencies.php deleted file mode 100644 index bd851f32ceb..00000000000 --- a/core/modules/layout_builder/tests/fixtures/update/section-dependencies.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Add a layout plugin with a dependency to an existing entity view display. -$display = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.teaser') - ->execute() - ->fetchField(); -$display = unserialize($display); -$display['third_party_settings']['layout_builder']['sections'][] = [ - 'layout_id' => 'layout_test_dependencies_plugin', - 'layout_settings' => [], - 'components' => [], -]; -$connection->update('config') - ->fields([ - 'data' => serialize($display), - 'collection' => '', - 'name' => 'core.entity_view_display.node.article.teaser', - ]) - ->condition('collection', '') - ->condition('name', 'core.entity_view_display.node.article.teaser') - ->execute(); diff --git a/core/modules/layout_builder/tests/src/Functional/Update/ExtraFieldUpdatePathTest.php b/core/modules/layout_builder/tests/src/Functional/Update/ExtraFieldUpdatePathTest.php deleted file mode 100644 index 43474c26b15..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/ExtraFieldUpdatePathTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityViewDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for Layout Builder extra fields. - * - * @group layout_builder - * @group legacy - */ -class ExtraFieldUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../fixtures/update/layout-builder-extra.php', - ]; - } - - /** - * Tests the upgrade path for Layout Builder extra fields. - */ - public function testRunUpdates() { - // The default view mode has Layout Builder enabled. - $data = EntityViewDisplay::load('node.article.default')->toArray(); - $this->assertArrayHasKey('third_party_settings', $data); - $this->assertArrayNotHasKey('sections', $data['third_party_settings']['layout_builder']); - - // The teaser view mode does not have Layout Builder enabled. - $data = EntityViewDisplay::load('node.article.teaser')->toArray(); - $this->assertArrayNotHasKey('third_party_settings', $data); - - $this->runUpdates(); - - // The extra links have been added. - $data = EntityViewDisplay::load('node.article.default')->toArray(); - $components = $data['third_party_settings']['layout_builder']['sections'][0]->getComponents(); - $component = reset($components); - $this->assertSame('extra_field_block:node:article:links', $component->getPluginId()); - - // No extra links have been added. - $data = EntityViewDisplay::load('node.article.teaser')->toArray(); - $this->assertArrayNotHasKey('third_party_settings', $data); - } - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderContextMappingUpdatePathTest.php b/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderContextMappingUpdatePathTest.php deleted file mode 100644 index 8d820e27911..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderContextMappingUpdatePathTest.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests context-aware blocks after the context changes to section storage. - * - * @group layout_builder - * @group legacy - */ -class LayoutBuilderContextMappingUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../fixtures/update/layout-builder-field-schema.php', - __DIR__ . '/../../../fixtures/update/layout-builder-field-block.php', - ]; - } - - /** - * Tests the upgrade path for enabling Layout Builder. - */ - public function testRunUpdates() { - $assert_session = $this->assertSession(); - - $this->runUpdates(); - - $this->drupalLogin($this->rootUser); - // Ensure that defaults and overrides display the body field within the - // content region of the one column layout. - $paths = [ - // Overrides. - 'node/1', - // Defaults. - 'admin/structure/types/manage/article/display/default/layout', - ]; - foreach ($paths as $path) { - $this->drupalGet($path); - $assert_session->statusCodeEquals(200); - $assert_session->elementExists('css', '.layout--onecol .layout__region--content .field--name-body'); - } - } - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderEnableUpdatePathTest.php b/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderEnableUpdatePathTest.php deleted file mode 100644 index 3531160ced4..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderEnableUpdatePathTest.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for enabling Layout Builder. - * - * @see layout_builder_update_8601() - * - * @group layout_builder - * @group legacy - */ -class LayoutBuilderEnableUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../fixtures/update/layout-builder-enable.php', - ]; - } - - /** - * Tests the upgrade path for enabling Layout Builder. - */ - public function testRunUpdates() { - $assert_session = $this->assertSession(); - - $expected = [ - 'sections' => [ - [ - 'layout_id' => 'layout_onecol', - 'layout_settings' => [], - 'components' => [ - 'some-uuid' => [ - 'uuid' => 'some-uuid', - 'region' => 'content', - 'configuration' => [ - 'id' => 'system_powered_by_block', - ], - 'additional' => [], - 'weight' => 0, - ], - ], - 'third_party_settings' => [], - ], - ], - ]; - $this->assertLayoutBuilderSettings($expected, 'block_content', 'basic', 'default'); - $this->assertLayoutBuilderSettings(NULL, 'node', 'page', 'default'); - - $this->runUpdates(); - - // The display with existing sections is enabled while the other is not. - $expected['enabled'] = TRUE; - $expected['sections'][0]['layout_settings']['label'] = ''; - $this->assertLayoutBuilderSettings($expected, 'block_content', 'basic', 'default'); - $this->assertLayoutBuilderSettings(NULL, 'node', 'page', 'default'); - - $this->drupalLogin($this->rootUser); - $this->drupalGet('admin/structure/block/block-content/manage/basic/display'); - $assert_session->checkboxChecked('layout[enabled]'); - $this->drupalGet('admin/structure/types/manage/page/display'); - $assert_session->checkboxNotChecked('layout[enabled]'); - } - - /** - * Asserts the Layout Builder settings for a given display. - * - * @param mixed $expected - * The expected value. - * @param string $entity_type_id - * The entity type ID. - * @param string $bundle - * The bundle. - * @param string $view_mode - * The view mode. - */ - protected function assertLayoutBuilderSettings($expected, $entity_type_id, $bundle, $view_mode) { - $this->assertEquals($expected, \Drupal::config("core.entity_view_display.$entity_type_id.$bundle.$view_mode")->get('third_party_settings.layout_builder')); - } - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderPermissionsUpdatePathTest.php b/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderPermissionsUpdatePathTest.php deleted file mode 100644 index d6bcc8661f2..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/LayoutBuilderPermissionsUpdatePathTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\user\Entity\Role; - -/** - * Tests the upgrade path for Layout Builder permissions. - * - * @see layout_builder_post_update_update_permissions() - * - * @group layout_builder - * @group legacy - */ -class LayoutBuilderPermissionsUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../fixtures/update/layout-builder-permissions.php', - ]; - } - - /** - * Tests the upgrade path for Layout Builder permissions. - */ - public function testRunUpdates() { - $this->assertFalse(Role::load(Role::AUTHENTICATED_ID)->hasPermission('create and edit custom blocks')); - - $this->runUpdates(); - - $this->assertTrue(Role::load(Role::AUTHENTICATED_ID)->hasPermission('create and edit custom blocks')); - } - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/SectionDependenciesUpdatePathTest.php b/core/modules/layout_builder/tests/src/Functional/Update/SectionDependenciesUpdatePathTest.php deleted file mode 100644 index 70f5e89c8d7..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/SectionDependenciesUpdatePathTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityViewDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for Layout Builder section dependencies. - * - * @group layout_builder - * @group legacy - */ -class SectionDependenciesUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../fixtures/update/section-dependencies.php', - ]; - } - - /** - * Tests the upgrade path for Layout Builder section dependencies. - */ - public function testRunUpdates() { - $data = EntityViewDisplay::load('node.article.teaser')->toArray(); - $this->assertNotContains('system.menu.myothermenu', $data['dependencies']['config']); - $this->assertNotContains('layout_builder', $data['dependencies']['module']); - $this->assertNotContains('layout_test', $data['dependencies']['module']); - - $this->runUpdates(); - - $data = EntityViewDisplay::load('node.article.teaser')->toArray(); - $this->assertContains('system.menu.myothermenu', $data['dependencies']['config']); - $this->assertContains('layout_builder', $data['dependencies']['module']); - $this->assertContains('layout_test', $data['dependencies']['module']); - } - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/TempstoreKeyUpdatePathTest.php b/core/modules/layout_builder/tests/src/Functional/Update/TempstoreKeyUpdatePathTest.php deleted file mode 100644 index 17afb1ca82b..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/TempstoreKeyUpdatePathTest.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for Layout Builder tempstore keys. - * - * @group layout_builder - * @group legacy - */ -class TempstoreKeyUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../fixtures/update/layout-builder-field-schema.php', - __DIR__ . '/../../../fixtures/update/layout-builder-field-block.php', - __DIR__ . '/../../../fixtures/update/layout-builder-tempstore.php', - ]; - } - - /** - * Tests the upgrade path for Layout Builder extra fields. - */ - public function testRunUpdates() { - $page = $this->getSession()->getPage(); - $assert_session = $this->assertSession(); - - $this->runUpdates(); - - $this->drupalLogin($this->drupalCreateUser([ - 'configure any layout', - 'administer node display', - ])); - $this->drupalGet('node/1'); - $assert_session->elementExists('css', '.layout--onecol'); - $assert_session->elementNotExists('css', '.layout--twocol-section'); - - $page->clickLink('Layout'); - $assert_session->pageTextContains('You have unsaved changes.'); - $assert_session->elementNotExists('css', '.layout--onecol'); - $assert_session->elementExists('css', '.layout--twocol-section'); - } - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfig.php b/core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfig.php deleted file mode 100644 index 59e748a9ba0..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfig.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update\Translatability; - -/** - * A test case that updates 1 bundle's field but not both. - * - * @group layout_builder - * @group legacy - */ -class LayoutFieldTranslateUpdateConfig extends MakeLayoutUntranslatableUpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $layoutBuilderTestCases = [ - 'article' => [ - 'has_translation' => TRUE, - 'has_layout' => TRUE, - 'nid' => 1, - 'vid' => 2, - ], - 'page' => [ - 'has_translation' => FALSE, - 'has_layout' => FALSE, - 'nid' => 4, - 'vid' => 5, - ], - ]; - - /** - * {@inheritdoc} - */ - protected $expectedBundleUpdates = [ - 'article' => FALSE, - 'page' => TRUE, - ]; - - /** - * {@inheritdoc} - */ - protected $expectedFieldStorageUpdate = FALSE; - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfigAndStorage.php b/core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfigAndStorage.php deleted file mode 100644 index 63e9dfbd20c..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/Translatability/LayoutFieldTranslateUpdateConfigAndStorage.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update\Translatability; - -/** - * A test case that updates both bundles' fields. - * - * @group layout_builder - * @group legacy - */ -class LayoutFieldTranslateUpdateConfigAndStorage extends MakeLayoutUntranslatableUpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $layoutBuilderTestCases = [ - 'article' => [ - 'has_translation' => TRUE, - 'has_layout' => FALSE, - 'nid' => 1, - 'vid' => 2, - ], - 'page' => [ - 'has_translation' => FALSE, - 'has_layout' => TRUE, - 'nid' => 4, - 'vid' => 5, - ], - ]; - - /** - * {@inheritdoc} - */ - protected $expectedBundleUpdates = [ - 'article' => TRUE, - 'page' => TRUE, - ]; - - /** - * {@inheritdoc} - */ - protected $expectedFieldStorageUpdate = TRUE; - -} diff --git a/core/modules/layout_builder/tests/src/Functional/Update/Translatability/MakeLayoutUntranslatableUpdatePathTestBase.php b/core/modules/layout_builder/tests/src/Functional/Update/Translatability/MakeLayoutUntranslatableUpdatePathTestBase.php deleted file mode 100644 index 7bb91f7c353..00000000000 --- a/core/modules/layout_builder/tests/src/Functional/Update/Translatability/MakeLayoutUntranslatableUpdatePathTestBase.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_builder\Functional\Update\Translatability; - -use Drupal\field\Entity\FieldConfig; -use Drupal\field\Entity\FieldStorageConfig; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage; - -/** - * Base class for upgrade path for translatable layouts. - * - * Each class that extends this class will test 1 case for including 2 content - * types. - * - * This method of testing is used instead of a data provider method because test - * fixtures do not have access to the provide data. This allows varying fixture - * data per test case. - * - * @see layout_builder_post_update_make_layout_untranslatable() - */ -abstract class MakeLayoutUntranslatableUpdatePathTestBase extends UpdatePathTestBase { - - /** - * Layout builder test cases. - * - * Keys are bundle names. Values are test cases including keys: - * - has_translation - * - has_layout - * - vid - * - nid - * - * @var array - */ - protected $layoutBuilderTestCases; - - /** - * Expectations of field updates by bundles. - * - * @var array - */ - protected $expectedBundleUpdates; - - /** - * Whether the field storage should be updated. - * - * @var bool - */ - protected $expectedFieldStorageUpdate; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../../fixtures/update/layout-builder.php', - __DIR__ . '/../../../../fixtures/update/layout-builder-field-schema.php', - __DIR__ . '/../../../../fixtures/update/layout-builder-translation.php', - ]; - } - - /** - * Tests the upgrade path for translatable layouts. - * - * @see layout_builder_post_update_make_layout_untranslatable() - */ - public function testDisableTranslationOnLayouts() { - $this->runUpdates(); - foreach ($this->expectedBundleUpdates as $bundle => $field_update_expected) { - $this->assertEquals( - $field_update_expected, - !FieldConfig::loadByName('node', $bundle, OverridesSectionStorage::FIELD_NAME)->isTranslatable(), - $field_update_expected ? "Field on $bundle set to be non-translatable." : "Field on $bundle not set to non-translatable." - ); - } - - $this->assertEquals( - $this->expectedFieldStorageUpdate, - !FieldStorageConfig::loadByName('node', OverridesSectionStorage::FIELD_NAME)->isTranslatable() - ); - } - -} diff --git a/core/modules/layout_discovery/tests/fixtures/update/drupal-8.theme-dependencies-in-module-key-2904550.php b/core/modules/layout_discovery/tests/fixtures/update/drupal-8.theme-dependencies-in-module-key-2904550.php deleted file mode 100644 index 03084f0cf62..00000000000 --- a/core/modules/layout_discovery/tests/fixtures/update/drupal-8.theme-dependencies-in-module-key-2904550.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.4.0.bare.standard.php.gz for testing - * upgrade path of https://www.drupal.org/project/drupal/issues/2904550. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->delete('config') - ->condition('name', [ - 'core.extension', - 'core.entity_view_display.node.page.default', - 'core.entity_form_display.node.page.default', - ], 'IN') - ->execute(); - -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'core.extension', - 'data' => 'a:4:{s:6:"module";a:44:{s:14:"automated_cron";i:0;s:5:"block";i:0;s:13:"block_content";i:0;s:10:"breakpoint";i:0;s:8:"ckeditor";i:0;s:5:"color";i:0;s:7:"comment";i:0;s:6:"config";i:0;s:7:"contact";i:0;s:10:"contextual";i:0;s:8:"datetime";i:0;s:5:"dblog";i:0;s:18:"dynamic_page_cache";i:0;s:6:"editor";i:0;s:5:"field";i:0;s:12:"field_layout";i:0;s:8:"field_ui";i:0;s:4:"file";i:0;s:6:"filter";i:0;s:4:"help";i:0;s:7:"history";i:0;s:5:"image";i:0;s:16:"layout_discovery";i:0;s:4:"link";i:0;s:7:"menu_ui";i:0;s:4:"node";i:0;s:7:"options";i:0;s:10:"page_cache";i:0;s:4:"path";i:0;s:9:"quickedit";i:0;s:3:"rdf";i:0;s:6:"search";i:0;s:8:"shortcut";i:0;s:6:"system";i:0;s:8:"taxonomy";i:0;s:4:"text";i:0;s:7:"toolbar";i:0;s:4:"tour";i:0;s:6:"update";i:0;s:4:"user";i:0;s:8:"views_ui";i:0;s:17:"menu_link_content";i:1;s:5:"views";i:10;s:8:"standard";i:1000;}s:5:"theme";a:5:{s:6:"stable";i:0;s:6:"classy";i:0;s:6:"bartik";i:0;s:5:"seven";i:0;s:17:"test_layout_theme";i:0;}s:7:"profile";s:8:"standard";s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"R4IF-ClDHXxblLcG0L7MgsLvfBIMAvi_skumNFQwkDc";}}', - ]) - ->values([ - 'collection' => '', - 'name' => 'core.entity_view_display.node.page.default', - 'data' => 'a:12:{s:4:"uuid";s:36:"bf0e7e89-41b9-4031-adef-09933affbfe0";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:26:"field.field.node.page.body";i:1;s:14:"node.type.page";}s:6:"module";a:4:{i:0;s:12:"field_layout";i:1;s:17:"test_layout_theme";i:2;s:4:"text";i:3;s:4:"user";}}s:20:"third_party_settings";a:1:{s:12:"field_layout";a:2:{s:2:"id";s:17:"test_layout_theme";s:8:"settings";a:0:{}}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"g1S3_GLaxq4l3I9RIca5Mlz02MxI2KmOquZpHw59akM";}s:2:"id";s:17:"node.page.default";s:16:"targetEntityType";s:4:"node";s:6:"bundle";s:4:"page";s:4:"mode";s:7:"default";s:7:"content";a:2:{s:4:"body";a:6:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:6:"weight";i:100;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:5:"links";a:4:{s:6:"weight";i:101;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:0:{}}', - ]) - ->values([ - 'collection' => '', - 'name' => 'core.entity_form_display.node.page.default', - 'data' => 'a:12:{s:4:"uuid";s:36:"6d390c8a-e5aa-41ee-98d3-1d422e497283";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:26:"field.field.node.page.body";i:1;s:14:"node.type.page";}s:6:"module";a:4:{i:0;s:12:"field_layout";i:1;s:4:"path";i:2;s:17:"test_layout_theme";i:3;s:4:"text";}}s:20:"third_party_settings";a:1:{s:12:"field_layout";a:2:{s:2:"id";s:17:"test_layout_theme";s:8:"settings";a:0:{}}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"sb0qCkzU_8mNq29NehYAU8jCBXWPLeX0UN8sYFVGVcw";}s:2:"id";s:17:"node.page.default";s:16:"targetEntityType";s:4:"node";s:6:"bundle";s:4:"page";s:4:"mode";s:7:"default";s:7:"content";a:8:{s:4:"body";a:5:{s:4:"type";s:26:"text_textarea_with_summary";s:6:"weight";i:31;s:6:"region";s:7:"content";s:8:"settings";a:3:{s:4:"rows";i:9;s:12:"summary_rows";i:3;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:7:"created";a:5:{s:4:"type";s:18:"datetime_timestamp";s:6:"weight";i:10;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:4:"path";a:5:{s:4:"type";s:4:"path";s:6:"weight";i:30;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:7:"promote";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:15;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:6:"status";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:120;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:6:"sticky";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:16;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:5:"title";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:-5;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:3:"uid";a:5:{s:4:"type";s:29:"entity_reference_autocomplete";s:6:"weight";i:5;s:6:"region";s:7:"content";s:8:"settings";a:3:{s:14:"match_operator";s:8:"CONTAINS";s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:0:{}}', - ]) - ->execute(); diff --git a/core/modules/layout_discovery/tests/src/Functional/Update/LayoutDiscoveryDependenciesUpdateTest.php b/core/modules/layout_discovery/tests/src/Functional/Update/LayoutDiscoveryDependenciesUpdateTest.php deleted file mode 100644 index f2e8c46fa72..00000000000 --- a/core/modules/layout_discovery/tests/src/Functional/Update/LayoutDiscoveryDependenciesUpdateTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -namespace Drupal\Tests\layout_discovery\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\Core\Entity\Entity\EntityViewDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for updating the layout discovery dependencies. - * - * @see layout_discovery_post_update_recalculate_entity_form_display_dependencies() - * @see layout_discovery_post_update_recalculate_entity_view_display_dependencies() - * - * @group layout_discovery - * @group legacy - */ -class LayoutDiscoveryDependenciesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.theme-dependencies-in-module-key-2904550.php', - ]; - } - - /** - * Tests updating the dependencies for layout discovery based entity displays. - */ - public function testUpdatedLayoutDiscoveryDependencies() { - $entities = [ - EntityFormDisplay::load('node.page.default'), - EntityViewDisplay::load('node.page.default'), - ]; - foreach ($entities as $entity) { - $dependencies = $entity->getDependencies(); - $this->assertTrue(in_array('test_layout_theme', $dependencies['module'])); - $this->assertFalse(isset($dependencies['theme'])); - } - - $this->runUpdates(); - - $updated_entities = [ - EntityFormDisplay::load('node.page.default'), - EntityViewDisplay::load('node.page.default'), - ]; - foreach ($updated_entities as $updated_entity) { - $dependencies = $updated_entity->getDependencies(); - $this->assertFalse(in_array('test_layout_theme', $dependencies['module'])); - $this->assertTrue(in_array('test_layout_theme', $dependencies['theme'])); - } - } - -} diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index 649f737d8f4..420d3384d2d 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -309,29 +309,8 @@ function locale_requirements($phase) { } /** - * Delete translation status data in state. + * Implements hook_update_last_removed(). */ -function locale_update_8300() { - // Delete the old translation status data, it will be rebuilt and stored in - // the new key value collection. - \Drupal::state()->delete('locale.translation_status'); -} - -/** - * Update default server pattern value to use https. - */ -function locale_update_8500() { - $update_url = \Drupal::config('locale.settings')->get('translation.default_server_pattern'); - if ($update_url == 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po') { - \Drupal::configFactory()->getEditable('locale.settings') - ->set('translation.default_server_pattern', 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po') - ->save(); - } -} - -/** - * Clear Locale project storage to use new 'all' instead of 8.x in URLs. - */ -function locale_update_8800() { - \Drupal::service('locale.project')->deleteAll(); +function locale_update_last_removed() { + return 8800; } diff --git a/core/modules/media/media.install b/core/modules/media/media.install index 83b6a35c21c..29322aa5e58 100644 --- a/core/modules/media/media.install +++ b/core/modules/media/media.install @@ -5,14 +5,12 @@ * Install, uninstall and update hooks for Media module. */ -use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; use Drupal\Core\File\Exception\FileException; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Url; use Drupal\media\Entity\MediaType; use Drupal\media\MediaTypeInterface; use Drupal\media\Plugin\media\Source\OEmbedInterface; -use Drupal\user\Entity\Role; use Drupal\user\RoleInterface; use Drupal\image\Plugin\Field\FieldType\ImageItem; use Drupal\Core\StringTranslation\TranslatableMarkup; @@ -176,84 +174,8 @@ function media_requirements($phase) { } /** - * Introduce per-bundle permissions. + * Implements hook_update_last_removed(). */ -function media_update_8500() { - $media_types = \Drupal::entityQuery('media_type')->execute(); - - /** @var \Drupal\user\RoleInterface $role */ - foreach (Role::loadMultiple() as $role) { - if ($role->hasPermission('update media')) { - foreach ($media_types as $media_type) { - $role->grantPermission("edit own $media_type media"); - } - } - - if ($role->hasPermission('update any media')) { - foreach ($media_types as $media_type) { - $role->grantPermission("edit any $media_type media"); - } - } - - if ($role->hasPermission('delete media')) { - foreach ($media_types as $media_type) { - $role->grantPermission("delete own $media_type media"); - } - } - - if ($role->hasPermission('delete any media')) { - foreach ($media_types as $media_type) { - $role->grantPermission("delete any $media_type media"); - } - } - - if ($role->hasPermission('create media')) { - foreach ($media_types as $media_type) { - $role->grantPermission("create $media_type media"); - } - } - - $role->save(); - } -} - -/** - * Updates media.settings to support OEmbed. - */ -function media_update_8600() { - \Drupal::configFactory()->getEditable('media.settings') - ->set('iframe_domain', '') - ->set('oembed_providers_url', 'https://oembed.com/providers.json') - ->save(TRUE); -} - -/** - * Set the 'owner' entity key and update the field. - */ -function media_update_8700() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('media'); - $database = \Drupal::database(); - - if (\Drupal::entityTypeManager()->getStorage('media') instanceof SqlEntityStorageInterface) { - if ($database->schema()->tableExists($entity_type->getDataTable())) { - $database->update($entity_type->getDataTable()) - ->fields(['uid' => 0]) - ->isNull('uid') - ->execute(); - } - - if ($database->schema()->tableExists($entity_type->getRevisionDataTable())) { - $database->update($entity_type->getRevisionDataTable()) - ->fields(['uid' => 0]) - ->isNull('uid') - ->execute(); - } - } - - $keys = $entity_type->getKeys(); - $keys['owner'] = 'uid'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); - $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'media')); +function media_update_last_removed() { + return 8700; } diff --git a/core/modules/media/tests/fixtures/update/drupal-8.4.0-media_installed.php b/core/modules/media/tests/fixtures/update/drupal-8.4.0-media_installed.php deleted file mode 100644 index 0c6e14eb755..00000000000 --- a/core/modules/media/tests/fixtures/update/drupal-8.4.0-media_installed.php +++ /dev/null @@ -1,1202 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Contains database additions to drupal-8.4.0.bare.standard.php.gz for testing - * the upgrade paths of media module. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'media', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'media') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['media'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Insert Media's config objects. -$connection->insert('config') -->fields(array( - 'collection', - 'name', - 'data', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.file.default', - 'data' => 'a:11:{s:4:"uuid";s:36:"94a6eff8-01b1-49e1-80f2-2a8d0e434bf4";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:39:"field.field.media.file.field_media_file";i:1;s:15:"media.type.file";}s:6:"module";a:2:{i:0;s:4:"file";i:1;s:4:"path";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"hXrcSi0w6aTt3jtOSoec3ah6KyHcQM__VFL8eWmmkfw";}s:2:"id";s:18:"media.file.default";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:7:"default";s:7:"content";a:6:{s:7:"created";a:5:{s:4:"type";s:18:"datetime_timestamp";s:6:"weight";i:10;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:16:"field_media_file";a:5:{s:8:"settings";a:1:{s:18:"progress_indicator";s:8:"throbber";}s:20:"third_party_settings";a:0:{}s:4:"type";s:12:"file_generic";s:6:"weight";i:26;s:6:"region";s:7:"content";}s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:-5;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:4:"path";a:5:{s:4:"type";s:4:"path";s:6:"weight";i:30;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:6:"status";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:100;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:3:"uid";a:5:{s:4:"type";s:29:"entity_reference_autocomplete";s:6:"weight";i:5;s:8:"settings";a:3:{s:14:"match_operator";s:8:"CONTAINS";s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:0:{}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.image.default', - 'data' => 'a:11:{s:4:"uuid";s:36:"5d083dca-077f-4dee-a7bc-beb1cdb1bfed";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:3:{i:0;s:41:"field.field.media.image.field_media_image";i:1;s:21:"image.style.thumbnail";i:2;s:16:"media.type.image";}s:6:"module";a:2:{i:0;s:5:"image";i:1;s:4:"path";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"6Yw_Qc7BjR5JTvdpHMYqAjhoE_I2Q8fRVYCZPjfsERs";}s:2:"id";s:19:"media.image.default";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:7:"default";s:7:"content";a:6:{s:7:"created";a:5:{s:4:"type";s:18:"datetime_timestamp";s:6:"weight";i:10;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:17:"field_media_image";a:5:{s:8:"settings";a:2:{s:18:"progress_indicator";s:8:"throbber";s:19:"preview_image_style";s:9:"thumbnail";}s:20:"third_party_settings";a:0:{}s:4:"type";s:11:"image_image";s:6:"weight";i:26;s:6:"region";s:7:"content";}s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:-5;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}s:4:"path";a:5:{s:4:"type";s:4:"path";s:6:"weight";i:30;s:6:"region";s:7:"content";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}}s:6:"status";a:5:{s:4:"type";s:16:"boolean_checkbox";s:8:"settings";a:1:{s:13:"display_label";b:1;}s:6:"weight";i:100;s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}s:3:"uid";a:5:{s:4:"type";s:29:"entity_reference_autocomplete";s:6:"weight";i:5;s:8:"settings";a:3:{s:14:"match_operator";s:8:"CONTAINS";s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:6:"region";s:7:"content";s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:0:{}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.file.default', - 'data' => 'a:11:{s:4:"uuid";s:36:"4c2eab37-3139-429c-8a72-89e61b0e9d71";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:39:"field.field.media.file.field_media_file";i:1;s:15:"media.type.file";}s:6:"module";a:1:{i:0;s:4:"file";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"UT7DLCZ855GoaFZGnFwtEu42SskWbmmHvYDj4uUcuYQ";}s:2:"id";s:18:"media.file.default";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:7:"default";s:7:"content";a:1:{s:16:"field_media_file";a:6:{s:5:"label";s:15:"visually_hidden";s:8:"settings";a:0:{}s:20:"third_party_settings";a:0:{}s:4:"type";s:12:"file_default";s:6:"weight";i:0;s:6:"region";s:7:"content";}}s:6:"hidden";a:3:{s:7:"created";b:1;s:9:"thumbnail";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.image.default', - 'data' => 'a:11:{s:4:"uuid";s:36:"02272f0b-f511-4811-90c9-ea566372b668";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:3:{i:0;s:41:"field.field.media.image.field_media_image";i:1;s:18:"image.style.medium";i:2;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"Z-q-BsMo4WG234VrI7ezloYiI3MjbnKTZ_7YldIoo40";}s:2:"id";s:19:"media.image.default";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:7:"default";s:7:"content";a:1:{s:17:"field_media_image";a:6:{s:5:"label";s:15:"visually_hidden";s:8:"settings";a:2:{s:11:"image_style";s:6:"medium";s:10:"image_link";s:4:"file";}s:20:"third_party_settings";a:0:{}s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";}}s:6:"hidden";a:3:{s:7:"created";b:1;s:9:"thumbnail";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'field.field.media.file.field_media_file', - 'data' => 'a:17:{s:4:"uuid";s:36:"512ab3be-971f-4b59-b4f4-5fd1d5d50177";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:2:{i:0;s:36:"field.storage.media.field_media_file";i:1;s:15:"media.type.file";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:5:"media";}}s:6:"module";a:1:{i:0;s:4:"file";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"_C8rbTRQABc6PuyRw2LD9zdf_muwzZVumKG6HSfzqfI";}s:2:"id";s:27:"media.file.field_media_file";s:10:"field_name";s:16:"field_media_file";s:11:"entity_type";s:5:"media";s:6:"bundle";s:4:"file";s:5:"label";s:4:"File";s:11:"description";s:0:"";s:8:"required";b:1;s:12:"translatable";b:1;s:13:"default_value";a:0:{}s:22:"default_value_callback";s:0:"";s:8:"settings";a:6:{s:14:"file_directory";s:31:"[date:custom:Y]-[date:custom:m]";s:15:"file_extensions";s:96:"txt rtf doc docx ppt pptx xls xlsx pdf odf odg odp ods odt fodt fods fodp fodg key numbers pages";s:12:"max_filesize";s:0:"";s:7:"handler";s:12:"default:file";s:16:"handler_settings";a:0:{}s:17:"description_field";b:0;}s:10:"field_type";s:4:"file";}', -)) -->values(array( - 'collection' => '', - 'name' => 'field.field.media.image.field_media_image', - 'data' => 'a:17:{s:4:"uuid";s:36:"3705074a-b693-4a44-badc-48f1c71f06b5";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:2:{i:0;s:37:"field.storage.media.field_media_image";i:1;s:16:"media.type.image";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:5:"media";}}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"pzPA-2JwyxlJ3qMb4L9viAnhNhbEhl2couH8A3FO020";}s:2:"id";s:29:"media.image.field_media_image";s:10:"field_name";s:17:"field_media_image";s:11:"entity_type";s:5:"media";s:6:"bundle";s:5:"image";s:5:"label";s:5:"Image";s:11:"description";s:0:"";s:8:"required";b:1;s:12:"translatable";b:1;s:13:"default_value";a:0:{}s:22:"default_value_callback";s:0:"";s:8:"settings";a:12:{s:9:"alt_field";b:1;s:18:"alt_field_required";b:1;s:11:"title_field";b:0;s:20:"title_field_required";b:0;s:14:"max_resolution";s:0:"";s:14:"min_resolution";s:0:"";s:13:"default_image";a:5:{s:4:"uuid";N;s:3:"alt";s:0:"";s:5:"title";s:0:"";s:5:"width";N;s:6:"height";N;}s:14:"file_directory";s:31:"[date:custom:Y]-[date:custom:m]";s:15:"file_extensions";s:16:"png gif jpg jpeg";s:12:"max_filesize";s:0:"";s:7:"handler";s:12:"default:file";s:16:"handler_settings";a:0:{}}s:10:"field_type";s:5:"image";}', -)) -->values(array( - 'collection' => '', - 'name' => 'field.storage.media.field_media_file', - 'data' => 'a:17:{s:4:"uuid";s:36:"9a4345cc-dc31-47d6-8735-2ddad3e67677";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:5:"media";}}s:6:"module";a:2:{i:0;s:4:"file";i:1;s:5:"media";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"4GNilUMnj0opT050eZIkWhkfuzu69ClyEr-cHxofjQw";}s:2:"id";s:22:"media.field_media_file";s:10:"field_name";s:16:"field_media_file";s:11:"entity_type";s:5:"media";s:4:"type";s:4:"file";s:8:"settings";a:4:{s:10:"uri_scheme";s:6:"public";s:11:"target_type";s:4:"file";s:13:"display_field";b:0;s:15:"display_default";b:0;}s:6:"module";s:4:"file";s:6:"locked";b:0;s:11:"cardinality";i:1;s:12:"translatable";b:1;s:7:"indexes";a:0:{}s:22:"persist_with_no_fields";b:0;s:14:"custom_storage";b:0;}', -)) -->values(array( - 'collection' => '', - 'name' => 'field.storage.media.field_media_image', - 'data' => 'a:17:{s:4:"uuid";s:36:"d3fd56b6-fa0f-4690-9885-ccceb29a0ba3";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:5:"media";}}s:6:"module";a:3:{i:0;s:4:"file";i:1;s:5:"image";i:2;s:5:"media";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"7ZBrcl87ZXaw42v952wwcw_9cQgTBq5_5tgyUkE-VV0";}s:2:"id";s:23:"media.field_media_image";s:10:"field_name";s:17:"field_media_image";s:11:"entity_type";s:5:"media";s:4:"type";s:5:"image";s:8:"settings";a:5:{s:13:"default_image";a:5:{s:4:"uuid";N;s:3:"alt";s:0:"";s:5:"title";s:0:"";s:5:"width";N;s:6:"height";N;}s:11:"target_type";s:4:"file";s:13:"display_field";b:0;s:15:"display_default";b:0;s:10:"uri_scheme";s:6:"public";}s:6:"module";s:5:"image";s:6:"locked";b:0;s:11:"cardinality";i:1;s:12:"translatable";b:1;s:7:"indexes";a:0:{}s:22:"persist_with_no_fields";b:0;s:14:"custom_storage";b:0;}', -)) -->values(array( - 'collection' => '', - 'name' => 'media.settings', - 'data' => 'a:2:{s:13:"icon_base_uri";s:28:"public://media-icons/generic";s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"f_ouXNygByhTko09cj2hDG_CeERO4jKCV8zrIvORnd0";}}', -)) -->values(array( - 'collection' => '', - 'name' => 'media.type.file', - 'data' => 'a:13:{s:4:"uuid";s:36:"f561bea5-6743-45dc-9ddf-07a61b589a70";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:0:{}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"s6qJnINiq7zI-ZoQOXM_gtiDpIsHT3fm7RySP1F_BE0";}s:2:"id";s:4:"file";s:5:"label";s:4:"File";s:11:"description";s:35:"Use local files for reusable media.";s:6:"source";s:4:"file";s:25:"queue_thumbnail_downloads";b:0;s:12:"new_revision";b:1;s:20:"source_configuration";a:1:{s:12:"source_field";s:16:"field_media_file";}s:9:"field_map";a:0:{}}', -)) -->values(array( - 'collection' => '', - 'name' => 'media.type.image', - 'data' => 'a:13:{s:4:"uuid";s:36:"1fc52468-4606-4313-9b6a-2a7631eb8d06";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:0:{}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"u7OxrscEED35iDR3R0akmw7QNvBSMEPJXFtKP57qBh8";}s:2:"id";s:5:"image";s:5:"label";s:5:"Image";s:11:"description";s:36:"Use local images for reusable media.";s:6:"source";s:5:"image";s:25:"queue_thumbnail_downloads";b:0;s:12:"new_revision";b:1;s:20:"source_configuration";a:1:{s:12:"source_field";s:17:"field_media_image";}s:9:"field_map";a:0:{}}', -)) -->values(array( - 'collection' => '', - 'name' => 'views.view.media', - 'data' => 'a:14:{s:4:"uuid";s:36:"eedf319c-a746-4091-a8c2-a9f98722cde9";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:1:{i:0;s:21:"image.style.thumbnail";}s:6:"module";a:3:{i:0;s:5:"image";i:1;s:5:"media";i:2;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"MSzaJjMXciXBt9NEFvf84VTylGFxbhiAQUdDc572T2c";}s:2:"id";s:5:"media";s:5:"label";s:5:"Media";s:6:"module";s:5:"views";s:11:"description";s:0:"";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:2:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:17:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:6:"Filter";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:1;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"full";s:7:"options";a:7:{s:14:"items_per_page";i:50;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"5, 10, 25, 50";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:4:{s:8:"previous";s:12:"‹ Previous";s:4:"next";s:8:"Next ›";s:5:"first";s:8:"« First";s:4:"last";s:7:"Last »";}s:8:"quantity";i:9;}}s:5:"style";a:2:{s:4:"type";s:5:"table";s:7:"options";a:12:{s:8:"grouping";a:0:{}s:9:"row_class";s:0:"";s:17:"default_row_class";b:1;s:8:"override";b:1;s:6:"sticky";b:0;s:7:"caption";s:0:"";s:7:"summary";s:0:"";s:11:"description";s:0:"";s:7:"columns";a:6:{s:4:"name";s:4:"name";s:6:"bundle";s:6:"bundle";s:7:"changed";s:7:"changed";s:3:"uid";s:3:"uid";s:6:"status";s:6:"status";s:20:"thumbnail__target_id";s:20:"thumbnail__target_id";}s:4:"info";a:6:{s:4:"name";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:6:"bundle";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:7:"changed";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:4:"desc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:3:"uid";a:6:{s:8:"sortable";b:0;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:6:"status";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:20:"thumbnail__target_id";a:6:{s:8:"sortable";b:0;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}}s:7:"default";s:7:"changed";s:11:"empty_table";b:1;}}s:3:"row";a:1:{s:4:"type";s:6:"fields";}s:6:"fields";a:7:{s:20:"thumbnail__target_id";a:37:{s:2:"id";s:20:"thumbnail__target_id";s:5:"table";s:16:"media_field_data";s:5:"field";s:20:"thumbnail__target_id";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:9:"Thumbnail";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:5:"image";s:8:"settings";a:2:{s:11:"image_style";s:9:"thumbnail";s:10:"image_link";s:0:"";}s:12:"group_column";s:0:"";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:9:"thumbnail";s:9:"plugin_id";s:5:"field";}s:4:"name";a:37:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:5:"media";s:5:"alter";a:8:{s:10:"alter_text";b:0;s:9:"make_link";b:0;s:8:"absolute";b:0;s:4:"trim";b:0;s:13:"word_boundary";b:0;s:8:"ellipsis";b:0;s:10:"strip_tags";b:0;s:4:"html";b:0;}s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:8:"settings";a:1:{s:14:"link_to_entity";b:1;}s:9:"plugin_id";s:5:"field";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:10:"Media name";s:7:"exclude";b:0;s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:6:"string";s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;}s:6:"bundle";a:37:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:6:"Source";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:22:"entity_reference_label";s:8:"settings";a:1:{s:4:"link";b:0;}s:12:"group_column";s:9:"target_id";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:5:"field";}s:3:"uid";a:37:{s:2:"id";s:3:"uid";s:5:"table";s:16:"media_field_data";s:5:"field";s:3:"uid";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:6:"Author";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:22:"entity_reference_label";s:8:"settings";a:1:{s:4:"link";b:1;}s:12:"group_column";s:9:"target_id";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:3:"uid";s:9:"plugin_id";s:5:"field";}s:6:"status";a:37:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:6:"Status";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:7:"boolean";s:8:"settings";a:3:{s:6:"format";s:6:"custom";s:18:"format_custom_true";s:9:"Published";s:19:"format_custom_false";s:11:"Unpublished";}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";s:9:"plugin_id";s:5:"field";}s:7:"changed";a:37:{s:2:"id";s:7:"changed";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"changed";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:7:"Updated";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:9:"timestamp";s:8:"settings";a:3:{s:11:"date_format";s:5:"short";s:18:"custom_date_format";s:0:"";s:8:"timezone";s:0:"";}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"changed";s:9:"plugin_id";s:5:"field";}s:10:"operations";a:24:{s:2:"id";s:10:"operations";s:5:"table";s:5:"media";s:5:"field";s:10:"operations";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:10:"Operations";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"destination";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:17:"entity_operations";}}s:7:"filters";a:4:{s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:10:"Media name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:6:"Source";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:6:"source";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:0:"";s:5:"label";s:4:"True";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:16:"Published status";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:8:"langcode";a:16:{s:2:"id";s:8:"langcode";s:5:"table";s:16:"media_field_data";s:5:"field";s:8:"langcode";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:11:"langcode_op";s:5:"label";s:8:"Language";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:11:"langcode_op";s:10:"identifier";s:8:"langcode";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:8:"langcode";s:9:"plugin_id";s:8:"language";}}s:5:"sorts";a:1:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:5:"order";s:4:"DESC";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:7:"exposed";b:0;s:6:"expose";a:1:{s:5:"label";s:0:"";}s:11:"granularity";s:6:"second";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:21:"No content available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:9:"arguments";a:0:{}s:17:"display_extenders";a:0:{}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:15:"media_page_list";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:15:"media_page_list";s:13:"display_title";s:5:"Media";s:8:"position";i:1;s:15:"display_options";a:4:{s:17:"display_extenders";a:0:{}s:4:"path";s:19:"admin/content/media";s:4:"menu";a:8:{s:4:"type";s:3:"tab";s:5:"title";s:5:"Media";s:11:"description";s:0:"";s:8:"expanded";b:0;s:6:"parent";s:0:"";s:6:"weight";i:0;s:7:"context";s:1:"0";s:9:"menu_name";s:4:"main";}s:19:"display_description";s:0:"";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}}}', -)) -->execute(); - -// Insert Media's key_value entries. -$connection->insert('key_value') -->fields(array( - 'collection', - 'name', - 'value', -)) -->values(array( - 'collection' => 'entity.definitions.bundle_field_map', - 'name' => 'media', - 'value' => 'a:2:{s:16:"field_media_file";a:2:{s:4:"type";s:4:"file";s:7:"bundles";a:1:{s:4:"file";s:4:"file";}}s:17:"field_media_image";a:2:{s:4:"type";s:5:"image";s:7:"bundles";a:1:{s:5:"image";s:5:"image";}}}', -)) -->values(array( - 'collection' => 'entity.definitions.installed', - 'name' => 'media.entity_type', - 'value' => 'O:36:"Drupal\Core\Entity\ContentEntityType":38:{s:25:" -)) -->values(array( - 'collection' => 'entity.definitions.installed', - 'name' => 'media.field_storage_definitions', - 'value' => "a:18:{s:3:\"mid\";O:37:\"Drupal\\Core\\Field\\BaseFieldDefinition\":5:{s:7:\" -)) -->values(array( - 'collection' => 'entity.definitions.installed', - 'name' => 'media_type.entity_type', - 'value' => 'O:42:"Drupal\Core\Config\Entity\ConfigEntityType":41:{s:16:" -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.entity_schema_data', - 'value' => 'a:4:{s:5:"media";a:2:{s:11:"primary key";a:1:{i:0;s:3:"mid";}s:11:"unique keys";a:1:{s:10:"media__vid";a:1:{i:0;s:3:"vid";}}}s:14:"media_revision";a:2:{s:11:"primary key";a:1:{i:0;s:3:"vid";}s:7:"indexes";a:1:{s:10:"media__mid";a:1:{i:0;s:3:"mid";}}}s:16:"media_field_data";a:2:{s:11:"primary key";a:2:{i:0;s:3:"mid";i:1;s:8:"langcode";}s:7:"indexes";a:3:{s:37:"media__id__default_langcode__langcode";a:3:{i:0;s:3:"mid";i:1;s:16:"default_langcode";i:2;s:8:"langcode";}s:10:"media__vid";a:1:{i:0;s:3:"vid";}s:20:"media__status_bundle";a:3:{i:0;s:6:"status";i:1;s:6:"bundle";i:2;s:3:"mid";}}}s:20:"media_field_revision";a:2:{s:11:"primary key";a:2:{i:0;s:3:"vid";i:1;s:8:"langcode";}s:7:"indexes";a:1:{s:37:"media__id__default_langcode__langcode";a:3:{i:0;s:3:"mid";i:1;s:16:"default_langcode";i:2;s:8:"langcode";}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.bundle', - 'value' => 'a:2:{s:5:"media";a:2:{s:6:"fields";a:1:{s:6:"bundle";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;}}s:7:"indexes";a:1:{s:30:"media_field__bundle__target_id";a:1:{i:0;s:6:"bundle";}}}s:16:"media_field_data";a:2:{s:6:"fields";a:1:{s:6:"bundle";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;}}s:7:"indexes";a:1:{s:30:"media_field__bundle__target_id";a:1:{i:0;s:6:"bundle";}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.changed', - 'value' => 'a:2:{s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:7:"changed";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:7:"changed";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.created', - 'value' => 'a:2:{s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:7:"created";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:7:"created";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.default_langcode', - 'value' => 'a:2:{s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:16:"default_langcode";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:16:"default_langcode";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.field_media_file', - 'value' => 'a:2:{s:23:"media__field_media_file";a:5:{s:11:"description";s:46:"Data storage for media field field_media_file.";s:6:"fields";a:9:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:26:"field_media_file_target_id";a:4:{s:11:"description";s:26:"The ID of the file entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;}s:24:"field_media_file_display";a:6:{s:11:"description";s:75:"Flag to control whether this file should be displayed when viewing content.";s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"unsigned";b:1;s:7:"default";i:1;s:8:"not null";b:0;}s:28:"field_media_file_description";a:3:{s:11:"description";s:26:"A description of the file.";s:4:"type";s:4:"text";s:8:"not null";b:0;}}s:11:"primary key";a:4:{i:0;s:9:"entity_id";i:1;s:7:"deleted";i:2;s:5:"delta";i:3;s:8:"langcode";}s:7:"indexes";a:3:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}s:26:"field_media_file_target_id";a:1:{i:0;s:26:"field_media_file_target_id";}}s:12:"foreign keys";a:1:{s:26:"field_media_file_target_id";a:2:{s:5:"table";s:12:"file_managed";s:7:"columns";a:1:{s:26:"field_media_file_target_id";s:3:"fid";}}}}s:32:"media_revision__field_media_file";a:5:{s:11:"description";s:58:"Revision archive storage for media field field_media_file.";s:6:"fields";a:9:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:26:"field_media_file_target_id";a:4:{s:11:"description";s:26:"The ID of the file entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;}s:24:"field_media_file_display";a:6:{s:11:"description";s:75:"Flag to control whether this file should be displayed when viewing content.";s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"unsigned";b:1;s:7:"default";i:1;s:8:"not null";b:0;}s:28:"field_media_file_description";a:3:{s:11:"description";s:26:"A description of the file.";s:4:"type";s:4:"text";s:8:"not null";b:0;}}s:11:"primary key";a:5:{i:0;s:9:"entity_id";i:1;s:11:"revision_id";i:2;s:7:"deleted";i:3;s:5:"delta";i:4;s:8:"langcode";}s:7:"indexes";a:3:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}s:26:"field_media_file_target_id";a:1:{i:0;s:26:"field_media_file_target_id";}}s:12:"foreign keys";a:1:{s:26:"field_media_file_target_id";a:2:{s:5:"table";s:12:"file_managed";s:7:"columns";a:1:{s:26:"field_media_file_target_id";s:3:"fid";}}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.field_media_image', - 'value' => "a:2:{s:24:\"media__field_media_image\";a:5:{s:11:\"description\";s:47:\"Data storage for media field field_media_image.\";s:6:\"fields\";a:11:{s:6:\"bundle\";a:5:{s:4:\"type\";s:13:\"varchar_ascii\";s:6:\"length\";i:128;s:8:\"not null\";b:1;s:7:\"default\";s:0:\"\";s:11:\"description\";s:88:\"The field instance bundle to which this row belongs, used when deleting a field instance\";}s:7:\"deleted\";a:5:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"tiny\";s:8:\"not null\";b:1;s:7:\"default\";i:0;s:11:\"description\";s:60:\"A boolean indicating whether this data item has been deleted\";}s:9:\"entity_id\";a:4:{s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;s:11:\"description\";s:38:\"The entity id this data is attached to\";}s:11:\"revision_id\";a:4:{s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;s:11:\"description\";s:47:\"The entity revision id this data is attached to\";}s:8:\"langcode\";a:5:{s:4:\"type\";s:13:\"varchar_ascii\";s:6:\"length\";i:32;s:8:\"not null\";b:1;s:7:\"default\";s:0:\"\";s:11:\"description\";s:37:\"The language code for this data item.\";}s:5:\"delta\";a:4:{s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;s:11:\"description\";s:67:\"The sequence number for this data item, used for multi-value fields\";}s:27:\"field_media_image_target_id\";a:4:{s:11:\"description\";s:26:\"The ID of the file entity.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;}s:21:\"field_media_image_alt\";a:4:{s:11:\"description\";s:56:\"Alternative image text, for the image's 'alt' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:512;s:8:\"not null\";b:0;}s:23:\"field_media_image_title\";a:4:{s:11:\"description\";s:52:\"Image title text, for the image's 'title' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:1024;s:8:\"not null\";b:0;}s:23:\"field_media_image_width\";a:4:{s:11:\"description\";s:33:\"The width of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}s:24:\"field_media_image_height\";a:4:{s:11:\"description\";s:34:\"The height of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}}s:11:\"primary key\";a:4:{i:0;s:9:\"entity_id\";i:1;s:7:\"deleted\";i:2;s:5:\"delta\";i:3;s:8:\"langcode\";}s:7:\"indexes\";a:3:{s:6:\"bundle\";a:1:{i:0;s:6:\"bundle\";}s:11:\"revision_id\";a:1:{i:0;s:11:\"revision_id\";}s:27:\"field_media_image_target_id\";a:1:{i:0;s:27:\"field_media_image_target_id\";}}s:12:\"foreign keys\";a:1:{s:27:\"field_media_image_target_id\";a:2:{s:5:\"table\";s:12:\"file_managed\";s:7:\"columns\";a:1:{s:27:\"field_media_image_target_id\";s:3:\"fid\";}}}}s:33:\"media_revision__field_media_image\";a:5:{s:11:\"description\";s:59:\"Revision archive storage for media field field_media_image.\";s:6:\"fields\";a:11:{s:6:\"bundle\";a:5:{s:4:\"type\";s:13:\"varchar_ascii\";s:6:\"length\";i:128;s:8:\"not null\";b:1;s:7:\"default\";s:0:\"\";s:11:\"description\";s:88:\"The field instance bundle to which this row belongs, used when deleting a field instance\";}s:7:\"deleted\";a:5:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"tiny\";s:8:\"not null\";b:1;s:7:\"default\";i:0;s:11:\"description\";s:60:\"A boolean indicating whether this data item has been deleted\";}s:9:\"entity_id\";a:4:{s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;s:11:\"description\";s:38:\"The entity id this data is attached to\";}s:11:\"revision_id\";a:4:{s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;s:11:\"description\";s:47:\"The entity revision id this data is attached to\";}s:8:\"langcode\";a:5:{s:4:\"type\";s:13:\"varchar_ascii\";s:6:\"length\";i:32;s:8:\"not null\";b:1;s:7:\"default\";s:0:\"\";s:11:\"description\";s:37:\"The language code for this data item.\";}s:5:\"delta\";a:4:{s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;s:11:\"description\";s:67:\"The sequence number for this data item, used for multi-value fields\";}s:27:\"field_media_image_target_id\";a:4:{s:11:\"description\";s:26:\"The ID of the file entity.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:1;}s:21:\"field_media_image_alt\";a:4:{s:11:\"description\";s:56:\"Alternative image text, for the image's 'alt' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:512;s:8:\"not null\";b:0;}s:23:\"field_media_image_title\";a:4:{s:11:\"description\";s:52:\"Image title text, for the image's 'title' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:1024;s:8:\"not null\";b:0;}s:23:\"field_media_image_width\";a:4:{s:11:\"description\";s:33:\"The width of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}s:24:\"field_media_image_height\";a:4:{s:11:\"description\";s:34:\"The height of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}}s:11:\"primary key\";a:5:{i:0;s:9:\"entity_id\";i:1;s:11:\"revision_id\";i:2;s:7:\"deleted\";i:3;s:5:\"delta\";i:4;s:8:\"langcode\";}s:7:\"indexes\";a:3:{s:6:\"bundle\";a:1:{i:0;s:6:\"bundle\";}s:11:\"revision_id\";a:1:{i:0;s:11:\"revision_id\";}s:27:\"field_media_image_target_id\";a:1:{i:0;s:27:\"field_media_image_target_id\";}}s:12:\"foreign keys\";a:1:{s:27:\"field_media_image_target_id\";a:2:{s:5:\"table\";s:12:\"file_managed\";s:7:\"columns\";a:1:{s:27:\"field_media_image_target_id\";s:3:\"fid\";}}}}}", -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.langcode', - 'value' => 'a:4:{s:5:"media";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}s:14:"media_revision";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:12;s:8:"not null";b:1;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.mid', - 'value' => 'a:4:{s:5:"media";a:1:{s:6:"fields";a:1:{s:3:"mid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:3:"mid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:14:"media_revision";a:1:{s:6:"fields";a:1:{s:3:"mid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:3:"mid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.name', - 'value' => 'a:2:{s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:4:"name";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:6:"binary";b:0;s:8:"not null";b:0;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:4:"name";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:6:"binary";b:0;s:8:"not null";b:0;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.revision_created', - 'value' => 'a:1:{s:14:"media_revision";a:1:{s:6:"fields";a:1:{s:16:"revision_created";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.revision_log_message', - 'value' => 'a:1:{s:14:"media_revision";a:1:{s:6:"fields";a:1:{s:20:"revision_log_message";a:3:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:0;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.revision_translation_affected', - 'value' => 'a:2:{s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:29:"revision_translation_affected";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:29:"revision_translation_affected";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.revision_user', - 'value' => 'a:1:{s:14:"media_revision";a:2:{s:6:"fields";a:1:{s:13:"revision_user";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:0;}}s:7:"indexes";a:1:{s:37:"media_field__revision_user__target_id";a:1:{i:0;s:13:"revision_user";}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.status', - 'value' => 'a:2:{s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:6:"status";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:6:"status";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.thumbnail', - 'value' => "a:2:{s:16:\"media_field_data\";a:3:{s:6:\"fields\";a:5:{s:20:\"thumbnail__target_id\";a:4:{s:11:\"description\";s:26:\"The ID of the file entity.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}s:14:\"thumbnail__alt\";a:4:{s:11:\"description\";s:56:\"Alternative image text, for the image's 'alt' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:512;s:8:\"not null\";b:0;}s:16:\"thumbnail__title\";a:4:{s:11:\"description\";s:52:\"Image title text, for the image's 'title' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:1024;s:8:\"not null\";b:0;}s:16:\"thumbnail__width\";a:4:{s:11:\"description\";s:33:\"The width of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}s:17:\"thumbnail__height\";a:4:{s:11:\"description\";s:34:\"The height of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}}s:7:\"indexes\";a:1:{s:33:\"media_field__thumbnail__target_id\";a:1:{i:0;s:20:\"thumbnail__target_id\";}}s:12:\"foreign keys\";a:1:{s:33:\"media_field__thumbnail__target_id\";a:2:{s:5:\"table\";s:12:\"file_managed\";s:7:\"columns\";a:1:{s:20:\"thumbnail__target_id\";s:3:\"fid\";}}}}s:20:\"media_field_revision\";a:3:{s:6:\"fields\";a:5:{s:20:\"thumbnail__target_id\";a:4:{s:11:\"description\";s:26:\"The ID of the file entity.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}s:14:\"thumbnail__alt\";a:4:{s:11:\"description\";s:56:\"Alternative image text, for the image's 'alt' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:512;s:8:\"not null\";b:0;}s:16:\"thumbnail__title\";a:4:{s:11:\"description\";s:52:\"Image title text, for the image's 'title' attribute.\";s:4:\"type\";s:7:\"varchar\";s:6:\"length\";i:1024;s:8:\"not null\";b:0;}s:16:\"thumbnail__width\";a:4:{s:11:\"description\";s:33:\"The width of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}s:17:\"thumbnail__height\";a:4:{s:11:\"description\";s:34:\"The height of the image in pixels.\";s:4:\"type\";s:3:\"int\";s:8:\"unsigned\";b:1;s:8:\"not null\";b:0;}}s:7:\"indexes\";a:1:{s:33:\"media_field__thumbnail__target_id\";a:1:{i:0;s:20:\"thumbnail__target_id\";}}s:12:\"foreign keys\";a:1:{s:33:\"media_field__thumbnail__target_id\";a:2:{s:5:\"table\";s:12:\"file_managed\";s:7:\"columns\";a:1:{s:20:\"thumbnail__target_id\";s:3:\"fid\";}}}}}", -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.uid', - 'value' => 'a:2:{s:16:"media_field_data";a:2:{s:6:"fields";a:1:{s:3:"uid";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:0;}}s:7:"indexes";a:1:{s:27:"media_field__uid__target_id";a:1:{i:0;s:3:"uid";}}}s:20:"media_field_revision";a:2:{s:6:"fields";a:1:{s:3:"uid";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:0;}}s:7:"indexes";a:1:{s:27:"media_field__uid__target_id";a:1:{i:0;s:3:"uid";}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.uuid', - 'value' => 'a:1:{s:5:"media";a:2:{s:6:"fields";a:1:{s:4:"uuid";a:4:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:6:"binary";b:0;s:8:"not null";b:1;}}s:11:"unique keys";a:1:{s:24:"media_field__uuid__value";a:1:{i:0;s:4:"uuid";}}}}', -)) -->values(array( - 'collection' => 'entity.storage_schema.sql', - 'name' => 'media.field_schema_data.vid', - 'value' => 'a:4:{s:5:"media";a:1:{s:6:"fields";a:1:{s:3:"vid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}s:16:"media_field_data";a:1:{s:6:"fields";a:1:{s:3:"vid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:14:"media_revision";a:1:{s:6:"fields";a:1:{s:3:"vid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:20:"media_field_revision";a:1:{s:6:"fields";a:1:{s:3:"vid";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}}', -)) -->execute(); - -$connection->merge('key_value') -->fields([ - 'collection' => 'state', - 'name' => 'views.view_route_names', - 'value' => 'a:13:{s:13:"watchdog.page";s:14:"dblog.overview";s:24:"user_admin_people.page_1";s:22:"entity.user.collection";s:20:"taxonomy_term.page_1";s:30:"entity.taxonomy_term.canonical";s:14:"content.page_1";s:20:"system.admin_content";s:23:"comment.page_unapproved";s:22:"comment.admin_approval";s:22:"comment.page_published";s:13:"comment.admin";s:20:"block_content.page_1";s:31:"entity.block_content.collection";s:12:"files.page_1";s:17:"view.files.page_1";s:12:"files.page_2";s:17:"view.files.page_2";s:16:"frontpage.feed_1";s:21:"view.frontpage.feed_1";s:16:"frontpage.page_1";s:21:"view.frontpage.page_1";s:20:"taxonomy_term.feed_1";s:25:"view.taxonomy_term.feed_1";s:21:"media.media_page_list";s:26:"view.media.media_page_list";}', -]) -->condition('collection', 'state') -->condition('name', 'views.view_route_names') -->execute(); - -$connection->schema()->createTable('media', array( - 'fields' => array( - 'mid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'vid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - ), - 'uuid' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - ), - 'primary key' => array( - 'mid', - ), - 'unique keys' => array( - 'media_field__uuid__value' => array( - 'uuid', - ), - 'media__vid' => array( - 'vid', - ), - ), - 'indexes' => array( - 'media_field__bundle__target_id' => array( - 'bundle', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media__field_media_file', array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_file_target_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_file_display' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'tiny', - 'default' => '1', - 'unsigned' => TRUE, - ), - 'field_media_file_description' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'normal', - ), - ), - 'primary key' => array( - 'entity_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - 'field_media_file_target_id' => array( - 'field_media_file_target_id', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media__field_media_image', array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_image_target_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_image_alt' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '512', - ), - 'field_media_image_title' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '1024', - ), - 'field_media_image_width' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_image_height' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - 'field_media_image_target_id' => array( - 'field_media_image_target_id', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media_field_data', array( - 'fields' => array( - 'mid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'vid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - ), - 'name' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - 'thumbnail__target_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'thumbnail__alt' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '512', - ), - 'thumbnail__title' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '1024', - ), - 'thumbnail__width' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'thumbnail__height' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'uid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'created' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'changed' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'default_langcode' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - ), - 'revision_translation_affected' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'tiny', - ), - ), - 'primary key' => array( - 'mid', - 'langcode', - ), - 'indexes' => array( - 'media__id__default_langcode__langcode' => array( - 'mid', - 'default_langcode', - 'langcode', - ), - 'media__vid' => array( - 'vid', - ), - 'media_field__bundle__target_id' => array( - 'bundle', - ), - 'media_field__thumbnail__target_id' => array( - 'thumbnail__target_id', - ), - 'media_field__uid__target_id' => array( - 'uid', - ), - 'media__status_bundle' => array( - 'status', - 'bundle', - 'mid', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media_field_revision', array( - 'fields' => array( - 'mid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'vid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - 'status' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - ), - 'name' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - 'thumbnail__target_id' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'thumbnail__alt' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '512', - ), - 'thumbnail__title' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '1024', - ), - 'thumbnail__width' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'thumbnail__height' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'uid' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'created' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'changed' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'default_langcode' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - ), - 'revision_translation_affected' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'tiny', - ), - ), - 'primary key' => array( - 'vid', - 'langcode', - ), - 'indexes' => array( - 'media__id__default_langcode__langcode' => array( - 'mid', - 'default_langcode', - 'langcode', - ), - 'media_field__thumbnail__target_id' => array( - 'thumbnail__target_id', - ), - 'media_field__uid__target_id' => array( - 'uid', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media_revision', array( - 'fields' => array( - 'mid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'vid' => array( - 'type' => 'serial', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '12', - ), - 'revision_user' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_created' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - ), - 'revision_log_message' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'big', - ), - ), - 'primary key' => array( - 'vid', - ), - 'indexes' => array( - 'media__mid' => array( - 'mid', - ), - 'media_field__revision_user__target_id' => array( - 'revision_user', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media_revision__field_media_file', array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_file_target_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_file_display' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'tiny', - 'default' => '1', - 'unsigned' => TRUE, - ), - 'field_media_file_description' => array( - 'type' => 'text', - 'not null' => FALSE, - 'size' => 'normal', - ), - ), - 'primary key' => array( - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - 'field_media_file_target_id' => array( - 'field_media_file_target_id', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->schema()->createTable('media_revision__field_media_image', array( - 'fields' => array( - 'bundle' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '128', - 'default' => '', - ), - 'deleted' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'tiny', - 'default' => '0', - ), - 'entity_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'revision_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'langcode' => array( - 'type' => 'varchar_ascii', - 'not null' => TRUE, - 'length' => '32', - 'default' => '', - ), - 'delta' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_image_target_id' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_image_alt' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '512', - ), - 'field_media_image_title' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '1024', - ), - 'field_media_image_width' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - 'field_media_image_height' => array( - 'type' => 'int', - 'not null' => FALSE, - 'size' => 'normal', - 'unsigned' => TRUE, - ), - ), - 'primary key' => array( - 'entity_id', - 'revision_id', - 'deleted', - 'delta', - 'langcode', - ), - 'indexes' => array( - 'bundle' => array( - 'bundle', - ), - 'revision_id' => array( - 'revision_id', - ), - 'field_media_image_target_id' => array( - 'field_media_image_target_id', - ), - ), - 'mysql_character_set' => 'utf8mb4', -)); - -$connection->insert('file_managed') - ->fields(array( - 'fid', - 'uuid', - 'langcode', - 'uid', - 'filename', - 'uri', - 'filemime', - 'filesize', - 'status', - 'created', - 'changed', - )) - ->values(array( - 'fid' => '1', - 'uuid' => 'e05dcd25-04e9-459d-b0dc-8bdae902f7f7', - 'langcode' => 'en', - 'uid' => '1', - 'filename' => 'druplicon.png', - 'uri' => 'public://2019-03/druplicon.png', - 'filemime' => 'image/png', - 'filesize' => '3905', - 'status' => '1', - 'created' => '1553630615', - 'changed' => '1553630623', - )) - ->values(array( - 'fid' => '2', - 'uuid' => '565d3788-3257-416b-809f-e09e45949c3c', - 'langcode' => 'en', - 'uid' => '1', - 'filename' => 'loading.gif', - 'uri' => 'public://2019-03/loading.gif', - 'filemime' => 'image/gif', - 'filesize' => '6733', - 'status' => '1', - 'created' => '1553630962', - 'changed' => '1553630969', - )) - ->execute(); -$connection->insert('file_usage') - ->fields(array( - 'fid', - 'module', - 'type', - 'id', - 'count', - )) - ->values(array( - 'fid' => '1', - 'module' => 'file', - 'type' => 'media', - 'id' => '1', - 'count' => '2', - )) - ->values(array( - 'fid' => '2', - 'module' => 'file', - 'type' => 'media', - 'id' => '2', - 'count' => '2', - )) - ->execute(); -$connection->insert('media') - ->fields(array( - 'mid', - 'vid', - 'bundle', - 'uuid', - 'langcode', - )) - ->values(array( - 'mid' => '1', - 'vid' => '1', - 'bundle' => 'image', - 'uuid' => '8d33fdd7-12e6-4bdf-98fc-97b321ed9ef4', - 'langcode' => 'en', - )) - ->values(array( - 'mid' => '2', - 'vid' => '2', - 'bundle' => 'image', - 'uuid' => 'f714be42-14da-44ed-9fac-34daab39903e', - 'langcode' => 'en', - )) - ->execute(); -$connection->insert('media__field_media_image') - ->fields(array( - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'field_media_image_target_id', - 'field_media_image_alt', - 'field_media_image_title', - 'field_media_image_width', - 'field_media_image_height', - )) - ->values(array( - 'bundle' => 'image', - 'deleted' => '0', - 'entity_id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'delta' => '0', - 'field_media_image_target_id' => '1', - 'field_media_image_alt' => 'Druplicon', - 'field_media_image_title' => '', - 'field_media_image_width' => '88', - 'field_media_image_height' => '100', - )) - ->values(array( - 'bundle' => 'image', - 'deleted' => '0', - 'entity_id' => '2', - 'revision_id' => '2', - 'langcode' => 'en', - 'delta' => '0', - 'field_media_image_target_id' => '2', - 'field_media_image_alt' => 'Loading...', - 'field_media_image_title' => '', - 'field_media_image_width' => '48', - 'field_media_image_height' => '48', - )) - ->execute(); -$connection->insert('media_field_data') - ->fields(array( - 'mid', - 'vid', - 'bundle', - 'langcode', - 'status', - 'name', - 'thumbnail__target_id', - 'thumbnail__alt', - 'thumbnail__title', - 'thumbnail__width', - 'thumbnail__height', - 'uid', - 'created', - 'changed', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'mid' => '1', - 'vid' => '1', - 'bundle' => 'image', - 'langcode' => 'en', - 'status' => '1', - 'name' => 'druplicon.png', - 'thumbnail__target_id' => '1', - 'thumbnail__alt' => 'Thumbnail', - 'thumbnail__title' => 'druplicon.png', - 'thumbnail__width' => '88', - 'thumbnail__height' => '100', - 'uid' => NULL, - 'created' => '1553630576', - 'changed' => '1553630623', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'mid' => '2', - 'vid' => '2', - 'bundle' => 'image', - 'langcode' => 'en', - 'status' => '1', - 'name' => 'loading.gif', - 'thumbnail__target_id' => '2', - 'thumbnail__alt' => 'Thumbnail', - 'thumbnail__title' => 'loading.gif', - 'thumbnail__width' => '48', - 'thumbnail__height' => '48', - 'uid' => '1', - 'created' => '1553630952', - 'changed' => '1553630969', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); -$connection->insert('media_field_revision') - ->fields(array( - 'mid', - 'vid', - 'langcode', - 'status', - 'name', - 'thumbnail__target_id', - 'thumbnail__alt', - 'thumbnail__title', - 'thumbnail__width', - 'thumbnail__height', - 'uid', - 'created', - 'changed', - 'default_langcode', - 'revision_translation_affected', - )) - ->values(array( - 'mid' => '1', - 'vid' => '1', - 'langcode' => 'en', - 'status' => '1', - 'name' => 'druplicon.png', - 'thumbnail__target_id' => '1', - 'thumbnail__alt' => 'Thumbnail', - 'thumbnail__title' => 'druplicon.png', - 'thumbnail__width' => '88', - 'thumbnail__height' => '100', - 'uid' => NULL, - 'created' => '1553630576', - 'changed' => '1553630623', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->values(array( - 'mid' => '2', - 'vid' => '2', - 'langcode' => 'en', - 'status' => '1', - 'name' => 'loading.gif', - 'thumbnail__target_id' => '2', - 'thumbnail__alt' => 'Thumbnail', - 'thumbnail__title' => 'loading.gif', - 'thumbnail__width' => '48', - 'thumbnail__height' => '48', - 'uid' => '1', - 'created' => '1553630952', - 'changed' => '1553630969', - 'default_langcode' => '1', - 'revision_translation_affected' => '1', - )) - ->execute(); -$connection->insert('media_revision') - ->fields(array( - 'mid', - 'vid', - 'langcode', - 'revision_user', - 'revision_created', - 'revision_log_message', - )) - ->values(array( - 'mid' => '1', - 'vid' => '1', - 'langcode' => 'en', - 'revision_user' => '1', - 'revision_created' => '1553630623', - 'revision_log_message' => NULL, - )) - ->values(array( - 'mid' => '2', - 'vid' => '2', - 'langcode' => 'en', - 'revision_user' => '1', - 'revision_created' => '1553630969', - 'revision_log_message' => NULL, - )) - ->execute(); -$connection->insert('media_revision__field_media_image') - ->fields(array( - 'bundle', - 'deleted', - 'entity_id', - 'revision_id', - 'langcode', - 'delta', - 'field_media_image_target_id', - 'field_media_image_alt', - 'field_media_image_title', - 'field_media_image_width', - 'field_media_image_height', - )) - ->values(array( - 'bundle' => 'image', - 'deleted' => '0', - 'entity_id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'delta' => '0', - 'field_media_image_target_id' => '1', - 'field_media_image_alt' => 'Druplicon', - 'field_media_image_title' => '', - 'field_media_image_width' => '88', - 'field_media_image_height' => '100', - )) - ->values(array( - 'bundle' => 'image', - 'deleted' => '0', - 'entity_id' => '2', - 'revision_id' => '2', - 'langcode' => 'en', - 'delta' => '0', - 'field_media_image_target_id' => '2', - 'field_media_image_alt' => 'Loading...', - 'field_media_image_title' => '', - 'field_media_image_width' => '48', - 'field_media_image_height' => '48', - )) - ->execute(); diff --git a/core/modules/media/tests/fixtures/update/drupal-8.media-add-additional-permissions.php b/core/modules/media/tests/fixtures/update/drupal-8.media-add-additional-permissions.php deleted file mode 100644 index 6bf302f8f60..00000000000 --- a/core/modules/media/tests/fixtures/update/drupal-8.media-add-additional-permissions.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -/** - * @file - * Contains database additions to drupal-8.4.0.bare.standard.php.gz for testing - * the upgrade path of https://www.drupal.org/node/2862422. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$role = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'user.role.authenticated') - ->execute() - ->fetchField(); -$role = unserialize($role); - -$role['permissions'][] = 'update media'; -$role['permissions'][] = 'update any media'; -$role['permissions'][] = 'delete media'; -$role['permissions'][] = 'delete any media'; -$role['permissions'][] = 'create media'; - -$connection->update('config') - ->fields([ - 'data' => serialize($role), - 'collection' => '', - 'name' => 'user.role.authenticated', - ]) - ->condition('collection', '') - ->condition('name', 'user.role.authenticated') - ->execute(); diff --git a/core/modules/media/tests/src/Functional/Update/MediaUpdateTest.php b/core/modules/media/tests/src/Functional/Update/MediaUpdateTest.php deleted file mode 100644 index 7e6c925bbde..00000000000 --- a/core/modules/media/tests/src/Functional/Update/MediaUpdateTest.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php - -namespace Drupal\Tests\media\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\media\Entity\Media; -use Drupal\Tests\media\Traits\MediaTypeCreationTrait; -use Drupal\user\Entity\Role; - -/** - * Tests that media settings are properly updated during database updates. - * - * @group media - * @group legacy - */ -class MediaUpdateTest extends UpdatePathTestBase { - - use MediaTypeCreationTrait; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.media-add-additional-permissions.php', - ]; - } - - /** - * Tests that media permissions are correctly migrated. - * - * @see media_update_8500() - */ - public function testBundlePermission() { - $this->runUpdates(); - - /** @var \Drupal\user\RoleInterface $role */ - $role = Role::load(Role::AUTHENTICATED_ID); - - $media_types = \Drupal::entityQuery('media_type')->execute(); - foreach ($media_types as $media_type) { - $this->assertTrue($role->hasPermission("create $media_type media")); - $this->assertTrue($role->hasPermission("edit own $media_type media")); - $this->assertTrue($role->hasPermission("edit any $media_type media")); - $this->assertTrue($role->hasPermission("delete own $media_type media")); - $this->assertTrue($role->hasPermission("delete any $media_type media")); - } - } - - /** - * Tests that media.settings config is updated with oEmbed configuration. - * - * @see media_update_8600() - */ - public function testOEmbedConfig() { - $config = $this->config('media.settings'); - $this->assertNull($config->get('oembed_providers_url')); - $this->assertNull($config->get('iframe_domain')); - - $this->runUpdates(); - - $config = $this->config('media.settings'); - $this->assertSame('https://oembed.com/providers.json', $config->get('oembed_providers_url')); - $this->assertSame('', $config->get('iframe_domain')); - } - - /** - * Tests that the media entity type has an 'owner' entity key. - * - * @see media_update_8700() - */ - public function testOwnerEntityKey() { - // Check that the 'owner' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('media'); - $this->assertFalse($entity_type->getKey('owner')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('media'); - $this->assertEquals('uid', $entity_type->getKey('owner')); - } - - /** - * Tests that the standalone URL is still accessible. - * - * @see media_post_update_enable_standalone_url() - */ - public function testEnableStandaloneUrl() { - $this->container->get('module_installer')->install(['media_test_source']); - - // Create a media type. - $media_type = $this->createMediaType('test'); - - // Run updates. - $this->runUpdates(); - - // Create a media item. - $media = Media::create([ - 'bundle' => $media_type->id(), - 'name' => 'Unnamed', - ]); - $media->save(); - - $user = $this->drupalCreateUser([ - 'administer media', - ]); - $this->drupalLogin($user); - - $this->drupalGet('media/' . $media->id()); - $this->assertSession()->statusCodeEquals(200); - } - - /** - * Tests that the status extra filter is added to the media view. - * - * @see media_post_update_add_status_extra_filter() - */ - public function testMediaViewStatusExtraFilter() { - $config = $this->config('views.view.media'); - $this->assertNull($config->get('display.default.display_options.filters.status_extra')); - - $this->runUpdates(); - - $config = $this->config('views.view.media'); - $filter = $config->get('display.default.display_options.filters.status_extra'); - $this->assertInternalType('array', $filter); - $this->assertSame('status_extra', $filter['field']); - $this->assertSame('media', $filter['entity_type']); - $this->assertSame('media_status', $filter['plugin_id']); - $this->assertSame('status_extra', $filter['id']); - $this->assertFalse($filter['exposed']); - } - -} diff --git a/core/modules/media_library/media_library.install b/core/modules/media_library/media_library.install index dd83c4a8846..c03aa041ef4 100644 --- a/core/modules/media_library/media_library.install +++ b/core/modules/media_library/media_library.install @@ -20,185 +20,8 @@ function media_library_install($is_syncing) { } /** - * Create the 'media_library' image style. + * Implements hook_update_last_removed(). */ -function media_library_update_8701() { - // This update function has been moved to - // media_library_post_update_add_media_library_image_style(). -} - -/** - * Updates the media library view widget display (contextual) filters. - */ -function media_library_update_8702() { - $view = \Drupal::configFactory()->getEditable('views.view.media_library'); - if ($view && $view->get('display.widget')) { - $view->set('display.widget.display_options.defaults.filters', FALSE); - $view->set('display.widget.display_options.defaults.filter_groups', FALSE); - $view->set('display.widget.display_options.defaults.arguments', FALSE); - $view->set('display.widget.display_options.filters', [ - 'status' => [ - 'id' => 'status', - 'table' => 'media_field_data', - 'field' => 'status', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'operator' => '=', - 'value' => '1', - 'group' => 1, - 'exposed' => FALSE, - 'expose' => [ - 'operator_id' => '', - 'label' => '', - 'description' => '', - 'use_operator' => FALSE, - 'operator' => '', - 'identifier' => '', - 'required' => FALSE, - 'remember' => FALSE, - 'multiple' => FALSE, - 'remember_roles' => [ - 'authenticated' => 'authenticated', - ], - ], - 'is_grouped' => FALSE, - 'group_info' => [ - 'label' => '', - 'description' => '', - 'identifier' => '', - 'optional' => TRUE, - 'widget' => 'select', - 'multiple' => FALSE, - 'remember' => FALSE, - 'default_group' => 'All', - 'default_group_multiple' => [], - 'group_items' => [], - ], - 'entity_type' => 'media', - 'entity_field' => 'status', - 'plugin_id' => 'boolean', - ], - 'name' => [ - 'id' => 'name', - 'table' => 'media_field_data', - 'field' => 'name', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'operator' => 'contains', - 'value' => '', - 'group' => 1, - 'exposed' => TRUE, - 'expose' => [ - 'operator_id' => 'name_op', - 'label' => 'Name', - 'description' => '', - 'use_operator' => FALSE, - 'operator' => 'name_op', - 'identifier' => 'name', - 'required' => FALSE, - 'remember' => FALSE, - 'multiple' => FALSE, - 'remember_roles' => [ - 'authenticated' => 'authenticated', - 'anonymous' => '0', - 'administrator' => '0', - ], - ], - 'is_grouped' => FALSE, - 'group_info' => [ - 'label' => '', - 'description' => '', - 'identifier' => '', - 'optional' => TRUE, - 'widget' => 'select', - 'multiple' => FALSE, - 'remember' => FALSE, - 'default_group' => 'All', - 'default_group_multiple' => [], - 'group_items' => [], - ], - 'entity_type' => 'media', - 'entity_field' => 'name', - 'plugin_id' => 'string', - ], - ]); - $view->set('display.widget.display_options.filter_groups', [ - 'operator' => 'AND', - 'groups' => [ - 1 => 'AND', - ], - ]); - $view->set('display.widget.display_options.arguments', [ - 'bundle' => [ - 'id' => 'bundle', - 'table' => 'media_field_data', - 'field' => 'bundle', - 'relationship' => 'none', - 'group_type' => 'group', - 'admin_label' => '', - 'default_action' => 'ignore', - 'exception' => [ - 'value' => 'all', - 'title_enable' => FALSE, - 'title' => 'All', - ], - 'title_enable' => FALSE, - 'title' => '', - 'default_argument_type' => 'fixed', - 'default_argument_options' => [ - 'argument' => '', - ], - 'default_argument_skip_url' => FALSE, - 'summary_options' => [ - 'base_path' => '', - 'count' => TRUE, - 'items_per_page' => 25, - 'override' => FALSE, - ], - 'summary' => [ - 'sort_order' => 'asc', - 'number_of_records' => 0, - 'format' => 'default_summary', - ], - 'specify_validation' => FALSE, - 'validate' => [ - 'type' => 'none', - 'fail' => 'not found', - ], - 'validate_options' => [], - 'glossary' => FALSE, - 'limit' => 0, - 'case' => 'none', - 'path_case' => 'none', - 'transform_dash' => FALSE, - 'break_phrase' => FALSE, - 'entity_type' => 'media', - 'entity_field' => 'bundle', - 'plugin_id' => 'string', - ], - ]); - $view->save(TRUE); - } -} - -/** - * This update has been removed and will not run. - */ -function media_library_update_8703() { - // This update function previously added 'edit' and 'delete' buttons to media - // items in the 'media' view. It has been converted to a post-update hook. - // @see media_library_post_update_add_buttons_to_page_view() -} - -/** - * Creates the media_library.settings config object. - */ -function media_library_update_8704() { - \Drupal::configFactory() - ->getEditable('media_library.settings') - // Enable the advanced UI by default, to preserve existing behavior. - ->set('advanced_ui', TRUE) - ->save(); +function media_library_update_last_removed() { + return 8704; } diff --git a/core/modules/media_library/tests/fixtures/update/drupal-8.7.2-media_library_installed.php b/core/modules/media_library/tests/fixtures/update/drupal-8.7.2-media_library_installed.php deleted file mode 100644 index f4db99ea727..00000000000 --- a/core/modules/media_library/tests/fixtures/update/drupal-8.7.2-media_library_installed.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Contains database additions to drupal-8.4.0-media_installed.php for testing - * the upgrade paths of the media library module from Drupal 8.7.2. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'media_library', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'media_library') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['media_library'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Insert media library config objects. -$connection->insert('config') -->fields(array( - 'collection', - 'name', - 'data', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.file.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"86ab9619-c970-4416-971d-e5c8614b3368";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"config";a:3:{i:0;s:41:"core.entity_form_mode.media.media_library";i:1;s:39:"field.field.media.file.field_media_file";i:2;s:15:"media.type.file";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"RFmywOcuem167havmD4VLgBTO1Swq9hyA-_f5aYTi8c";}s:2:"id";s:24:"media.file.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:5:{s:7:"created";b:1;s:16:"field_media_file";b:1;s:4:"path";b:1;s:6:"status";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.image.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"2bbea060-3cd8-4881-a3aa-c898d6619b16";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_form_mode.media.media_library";i:1;s:41:"field.field.media.image.field_media_image";i:2;s:21:"image.style.thumbnail";i:3;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"PlyfyVZfALLkP7nbxLpaVKIDUWRioZghWpFDv0_rJ68";}s:2:"id";s:25:"media.image.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:13:"media_library";s:7:"content";a:2:{s:17:"field_media_image";a:5:{s:4:"type";s:11:"image_image";s:6:"weight";i:1;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:18:"progress_indicator";s:8:"throbber";s:19:"preview_image_style";s:9:"thumbnail";}s:20:"third_party_settings";a:0:{}}s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:4:"path";b:1;s:6:"status";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.file.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"67e6d857-8ecb-49f5-95e1-6b1c4306c31f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:39:"field.field.media.file.field_media_file";i:2;s:21:"image.style.thumbnail";i:3;s:15:"media.type.file";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"vhAK2lCOWK2paUpJawj7yiSLFO9wwsx6WE8_oDmvbwU";}s:2:"id";s:24:"media.file.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:9:"thumbnail";a:6:{s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";s:5:"label";s:6:"hidden";s:8:"settings";a:2:{s:11:"image_style";s:9:"thumbnail";s:10:"image_link";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:16:"field_media_file";b:1;s:4:"name";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.image.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"277ca98b-2ada-4251-ad69-aa73e72d60fe";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:41:"field.field.media.image.field_media_image";i:2;s:18:"image.style.medium";i:3;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"PaGXvzRcL9eII--JV4eCVfObjrNo0l-u1dB_WJtB9ig";}s:2:"id";s:25:"media.image.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:9:"thumbnail";a:6:{s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";s:5:"label";s:6:"hidden";s:8:"settings";a:2:{s:11:"image_style";s:6:"medium";s:10:"image_link";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:17:"field_media_image";b:1;s:4:"name";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_mode.media.media_library', - 'data' => 'a:9:{s:4:"uuid";s:36:"20b2f1f7-a864-4d41-a15f-32f66789f73d";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:1:{i:0;s:5:"media";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"pkq0uj-IoqEQRBOP_ddUDV0ZJ-dKQ_fLcppsEDF2UO8";}s:2:"id";s:19:"media.media_library";s:5:"label";s:13:"Media library";s:16:"targetEntityType";s:5:"media";s:5:"cache";b:1;}', -)) -->values(array( - 'collection' => '', - 'name' => 'views.view.media_library', - 'data' => 'a:14:{s:4:"uuid";s:36:"e42c9697-889f-41f8-a752-4d91aa8997a7";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:2:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:25:"image.style.media_library";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:4:{i:0;s:5:"image";i:1;s:5:"media";i:2;s:13:"media_library";i:3;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"WM0EWBXTR1beBFa860NA1kUdffL9bM1548gUS9DS5fg";}s:2:"id";s:13:"media_library";s:5:"label";s:13:"Media library";s:6:"module";s:5:"views";s:11:"description";s:0:"";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:4:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:18:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:13:"Apply filters";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:0;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"mini";s:7:"options";a:6:{s:14:"items_per_page";i:24;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"6, 12, 24, 48";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:2:{s:8:"previous";s:6:"‹‹";s:4:"next";s:6:"››";}}}s:5:"style";a:2:{s:4:"type";s:7:"default";s:7:"options";a:3:{s:8:"grouping";a:0:{}s:9:"row_class";s:84:"media-library-item media-library-item--grid js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:3:"row";a:2:{s:4:"type";s:6:"fields";s:7:"options";a:4:{s:22:"default_field_elements";b:1;s:6:"inline";a:0:{}s:9:"separator";s:0:"";s:10:"hide_empty";b:0;}}s:6:"fields";a:2:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"js-click-to-select-checkbox";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}}s:7:"filters";a:3:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:17:"Publishing status";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:9:"Published";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:13:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:10:"Media type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:10:"Media type";s:11:"description";N;s:10:"identifier";s:6:"bundle";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:3:{i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}}s:5:"sorts";a:3:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:12:"Newest first";}s:11:"granularity";s:6:"second";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";}s:4:"name";a:12:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:3:"ASC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (A-Z)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}s:6:"name_1";a:12:{s:2:"id";s:6:"name_1";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (Z-A)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:19:"No media available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:17:"display_extenders";a:0:{}s:8:"use_ajax";b:1;s:9:"css_class";s:40:"media-library-view js-media-library-view";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:4:"page";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:4:"page";s:13:"display_title";s:4:"Page";s:8:"position";i:1;s:15:"display_options";a:3:{s:17:"display_extenders";a:0:{}s:4:"path";s:19:"admin/content/media";s:4:"menu";a:8:{s:4:"type";s:3:"tab";s:5:"title";s:5:"Media";s:11:"description";s:49:"Allows users to browse and administer media items";s:8:"expanded";b:0;s:6:"parent";s:20:"system.admin_content";s:6:"weight";i:5;s:7:"context";s:1:"0";s:9:"menu_name";s:5:"admin";}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:6:"widget";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:6:"widget";s:13:"display_title";s:6:"Widget";s:8:"position";i:2;s:15:"display_options";a:11:{s:17:"display_extenders";a:0:{}s:4:"path";s:26:"admin/content/media-widget";s:6:"fields";a:2:{s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}s:25:"media_library_select_form";a:23:{s:2:"id";s:25:"media_library_select_form";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";}}s:8:"defaults";a:7:{s:6:"fields";b:0;s:6:"access";b:0;s:7:"filters";b:0;s:13:"filter_groups";b:0;s:9:"arguments";b:0;s:6:"header";b:0;s:9:"css_class";b:0;}s:19:"display_description";s:0:"";s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}s:7:"filters";a:2:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";s:9:"plugin_id";s:7:"boolean";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}}s:13:"filter_groups";a:2:{s:8:"operator";s:3:"AND";s:6:"groups";a:1:{i:1;s:3:"AND";}}s:9:"arguments";a:1:{s:6:"bundle";a:27:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:14:"default_action";s:6:"ignore";s:9:"exception";a:3:{s:5:"value";s:3:"all";s:12:"title_enable";b:0;s:5:"title";s:3:"All";}s:12:"title_enable";b:0;s:5:"title";s:0:"";s:21:"default_argument_type";s:5:"fixed";s:24:"default_argument_options";a:1:{s:8:"argument";s:0:"";}s:25:"default_argument_skip_url";b:0;s:15:"summary_options";a:4:{s:9:"base_path";s:0:"";s:5:"count";b:1;s:14:"items_per_page";i:24;s:8:"override";b:0;}s:7:"summary";a:3:{s:10:"sort_order";s:3:"asc";s:17:"number_of_records";i:0;s:6:"format";s:15:"default_summary";}s:18:"specify_validation";b:0;s:8:"validate";a:2:{s:4:"type";s:4:"none";s:4:"fail";s:9:"not found";}s:16:"validate_options";a:0:{}s:8:"glossary";b:0;s:5:"limit";i:0;s:4:"case";s:4:"none";s:9:"path_case";s:4:"none";s:14:"transform_dash";b:0;s:12:"break_phrase";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"string";}}s:6:"header";a:2:{s:17:"display_link_grid";a:7:{s:2:"id";s:17:"display_link_grid";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:6:"widget";s:5:"label";s:4:"Grid";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}s:18:"display_link_table";a:7:{s:2:"id";s:18:"display_link_table";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:12:"widget_table";s:5:"label";s:5:"Table";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}}s:9:"css_class";s:67:"media-library-view js-media-library-view media-library-view--widget";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:12:"widget_table";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:12:"widget_table";s:13:"display_title";s:14:"Widget (table)";s:8:"position";i:3;s:15:"display_options";a:12:{s:17:"display_extenders";a:0:{}s:4:"path";s:32:"admin/content/media-widget-table";s:5:"style";a:2:{s:4:"type";s:5:"table";s:7:"options";a:2:{s:9:"row_class";s:85:"media-library-item media-library-item--table js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:8:"defaults";a:9:{s:5:"style";b:0;s:3:"row";b:0;s:6:"fields";b:0;s:6:"access";b:0;s:7:"filters";b:0;s:13:"filter_groups";b:0;s:9:"arguments";b:0;s:6:"header";b:0;s:9:"css_class";b:0;}s:3:"row";a:1:{s:4:"type";s:6:"fields";}s:6:"fields";a:5:{s:25:"media_library_select_form";a:9:{s:2:"id";s:25:"media_library_select_form";s:5:"label";s:0:"";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:13:"element_class";s:0:"";}s:20:"thumbnail__target_id";a:10:{s:2:"id";s:20:"thumbnail__target_id";s:5:"label";s:9:"Thumbnail";s:5:"table";s:16:"media_field_data";s:5:"field";s:20:"thumbnail__target_id";s:12:"relationship";s:4:"none";s:4:"type";s:5:"image";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:9:"thumbnail";s:9:"plugin_id";s:5:"field";s:8:"settings";a:2:{s:11:"image_style";s:13:"media_library";s:10:"image_link";s:0:"";}}s:4:"name";a:10:{s:2:"id";s:4:"name";s:5:"label";s:4:"Name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:4:"type";s:6:"string";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:5:"field";s:8:"settings";a:1:{s:14:"link_to_entity";b:0;}}s:3:"uid";a:10:{s:2:"id";s:3:"uid";s:5:"label";s:6:"Author";s:5:"table";s:20:"media_field_revision";s:5:"field";s:3:"uid";s:12:"relationship";s:4:"none";s:4:"type";s:22:"entity_reference_label";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:3:"uid";s:9:"plugin_id";s:5:"field";s:8:"settings";a:1:{s:4:"link";b:1;}}s:7:"changed";a:10:{s:2:"id";s:7:"changed";s:5:"label";s:7:"Updated";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"changed";s:12:"relationship";s:4:"none";s:4:"type";s:9:"timestamp";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"changed";s:9:"plugin_id";s:5:"field";s:8:"settings";a:3:{s:11:"date_format";s:5:"short";s:18:"custom_date_format";s:0:"";s:8:"timezone";s:0:"";}}}s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}s:7:"filters";a:2:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";s:9:"plugin_id";s:7:"boolean";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}}s:13:"filter_groups";a:2:{s:8:"operator";s:3:"AND";s:6:"groups";a:1:{i:1;s:3:"AND";}}s:9:"arguments";a:1:{s:6:"bundle";a:27:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:14:"default_action";s:6:"ignore";s:9:"exception";a:3:{s:5:"value";s:3:"all";s:12:"title_enable";b:0;s:5:"title";s:3:"All";}s:12:"title_enable";b:0;s:5:"title";s:0:"";s:21:"default_argument_type";s:5:"fixed";s:24:"default_argument_options";a:1:{s:8:"argument";s:0:"";}s:25:"default_argument_skip_url";b:0;s:15:"summary_options";a:4:{s:9:"base_path";s:0:"";s:5:"count";b:1;s:14:"items_per_page";i:24;s:8:"override";b:0;}s:7:"summary";a:3:{s:10:"sort_order";s:3:"asc";s:17:"number_of_records";i:0;s:6:"format";s:15:"default_summary";}s:18:"specify_validation";b:0;s:8:"validate";a:2:{s:4:"type";s:4:"none";s:4:"fail";s:9:"not found";}s:16:"validate_options";a:0:{}s:8:"glossary";b:0;s:5:"limit";i:0;s:4:"case";s:4:"none";s:9:"path_case";s:4:"none";s:14:"transform_dash";b:0;s:12:"break_phrase";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"string";}}s:6:"header";a:2:{s:17:"display_link_grid";a:7:{s:2:"id";s:17:"display_link_grid";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:6:"widget";s:5:"label";s:4:"Grid";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}s:18:"display_link_table";a:7:{s:2:"id";s:18:"display_link_table";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:12:"widget_table";s:5:"label";s:5:"Table";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}}s:9:"css_class";s:67:"media-library-view js-media-library-view media-library-view--widget";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:6:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:22:"url.query_args:sort_by";i:5;s:16:"user.permissions";}s:4:"tags";a:0:{}}}}}', -)) -->execute(); - -// Insert 'media' view, as modified by media_library_install(). -$connection->merge('config') - ->fields([ - 'data' => 'a:14:{s:4:"uuid";s:36:"668e914f-4d0b-4712-957c-8f3e9459caf5";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:1:{i:0;s:21:"image.style.thumbnail";}s:6:"module";a:3:{i:0;s:5:"image";i:1;s:5:"media";i:2;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"rRzAWaXpJGYA2gPG6BmGxy8gfFd4srCc-LQY3JB6tR8";}s:2:"id";s:5:"media";s:5:"label";s:5:"Media";s:6:"module";s:5:"views";s:11:"description";s:0:"";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:2:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:17:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:6:"Filter";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:1;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"full";s:7:"options";a:7:{s:14:"items_per_page";i:50;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"5, 10, 25, 50";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:4:{s:8:"previous";s:12:"‹ Previous";s:4:"next";s:8:"Next ›";s:5:"first";s:8:"« First";s:4:"last";s:7:"Last »";}s:8:"quantity";i:9;}}s:5:"style";a:2:{s:4:"type";s:5:"table";s:7:"options";a:12:{s:8:"grouping";a:0:{}s:9:"row_class";s:0:"";s:17:"default_row_class";b:1;s:8:"override";b:1;s:6:"sticky";b:0;s:7:"caption";s:0:"";s:7:"summary";s:0:"";s:11:"description";s:0:"";s:7:"columns";a:6:{s:4:"name";s:4:"name";s:6:"bundle";s:6:"bundle";s:7:"changed";s:7:"changed";s:3:"uid";s:3:"uid";s:6:"status";s:6:"status";s:20:"thumbnail__target_id";s:20:"thumbnail__target_id";}s:4:"info";a:6:{s:4:"name";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:6:"bundle";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:7:"changed";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:4:"desc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:3:"uid";a:6:{s:8:"sortable";b:0;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:6:"status";a:6:{s:8:"sortable";b:1;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}s:20:"thumbnail__target_id";a:6:{s:8:"sortable";b:0;s:18:"default_sort_order";s:3:"asc";s:5:"align";s:0:"";s:9:"separator";s:0:"";s:12:"empty_column";b:0;s:10:"responsive";s:0:"";}}s:7:"default";s:7:"changed";s:11:"empty_table";b:1;}}s:3:"row";a:1:{s:4:"type";s:6:"fields";}s:6:"fields";a:8:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:20:"thumbnail__target_id";a:37:{s:2:"id";s:20:"thumbnail__target_id";s:5:"table";s:16:"media_field_data";s:5:"field";s:20:"thumbnail__target_id";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:9:"Thumbnail";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:5:"image";s:8:"settings";a:2:{s:11:"image_style";s:9:"thumbnail";s:10:"image_link";s:0:"";}s:12:"group_column";s:0:"";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:9:"thumbnail";s:9:"plugin_id";s:5:"field";}s:4:"name";a:37:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:5:"media";s:5:"alter";a:8:{s:10:"alter_text";b:0;s:9:"make_link";b:0;s:8:"absolute";b:0;s:4:"trim";b:0;s:13:"word_boundary";b:0;s:8:"ellipsis";b:0;s:10:"strip_tags";b:0;s:4:"html";b:0;}s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:8:"settings";a:1:{s:14:"link_to_entity";b:1;}s:9:"plugin_id";s:5:"field";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:10:"Media name";s:7:"exclude";b:0;s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:6:"string";s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;}s:6:"bundle";a:37:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:4:"Type";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:22:"entity_reference_label";s:8:"settings";a:1:{s:4:"link";b:0;}s:12:"group_column";s:9:"target_id";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:5:"field";}s:3:"uid";a:37:{s:2:"id";s:3:"uid";s:5:"table";s:16:"media_field_data";s:5:"field";s:3:"uid";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:6:"Author";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:9:"target_id";s:4:"type";s:22:"entity_reference_label";s:8:"settings";a:1:{s:4:"link";b:1;}s:12:"group_column";s:9:"target_id";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:3:"uid";s:9:"plugin_id";s:5:"field";}s:6:"status";a:37:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:6:"Status";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:7:"boolean";s:8:"settings";a:3:{s:6:"format";s:6:"custom";s:18:"format_custom_true";s:9:"Published";s:19:"format_custom_false";s:11:"Unpublished";}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";s:9:"plugin_id";s:5:"field";}s:7:"changed";a:37:{s:2:"id";s:7:"changed";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"changed";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:7:"Updated";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:9:"timestamp";s:8:"settings";a:3:{s:11:"date_format";s:5:"short";s:18:"custom_date_format";s:0:"";s:8:"timezone";s:0:"";}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"changed";s:9:"plugin_id";s:5:"field";}s:10:"operations";a:24:{s:2:"id";s:10:"operations";s:5:"table";s:5:"media";s:5:"field";s:10:"operations";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:10:"Operations";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:1;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"destination";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:17:"entity_operations";}}s:7:"filters";a:4:{s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:10:"Media name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:4:"Type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:0:"";s:5:"label";s:4:"True";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:16:"Published status";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:8:"langcode";a:16:{s:2:"id";s:8:"langcode";s:5:"table";s:16:"media_field_data";s:5:"field";s:8:"langcode";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:11:"langcode_op";s:5:"label";s:8:"Language";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:11:"langcode_op";s:10:"identifier";s:8:"langcode";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:8:"langcode";s:9:"plugin_id";s:8:"language";}}s:5:"sorts";a:1:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:5:"order";s:4:"DESC";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:7:"exposed";b:0;s:6:"expose";a:1:{s:5:"label";s:0:"";}s:11:"granularity";s:6:"second";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:19:"No media available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:9:"arguments";a:0:{}s:17:"display_extenders";a:0:{}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:15:"media_page_list";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:15:"media_page_list";s:13:"display_title";s:5:"Media";s:8:"position";i:1;s:15:"display_options";a:3:{s:17:"display_extenders";a:0:{}s:4:"path";s:25:"admin/content/media-table";s:19:"display_description";s:0:"";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}}}', - 'name' => 'views.view.media', - 'collection' => '', - ]) - ->condition('collection', '') - ->condition('name', 'views.view.media') - ->execute(); - -// Insert media library key_value entries. -$connection->insert('key_value') -->fields(array( - 'collection', - 'name', - 'value', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_display', - 'name' => 'uuid:67e6d857-8ecb-49f5-95e1-6b1c4306c31f', - 'value' => 'a:1:{i:0;s:49:"core.entity_view_display.media.file.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_display', - 'name' => 'uuid:277ca98b-2ada-4251-ad69-aa73e72d60fe', - 'value' => 'a:1:{i:0;s:50:"core.entity_view_display.media.image.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_mode', - 'name' => 'uuid:20b2f1f7-a864-4d41-a15f-32f66789f73d', - 'value' => 'a:1:{i:0;s:41:"core.entity_view_mode.media.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.view', - 'name' => 'uuid:3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932', - 'value' => 'a:1:{i:0;s:24:"views.view.media_library";}', -)) -->execute(); diff --git a/core/modules/media_library/tests/fixtures/update/drupal-8.8.x-media_library-update-views-classnames-3049943.php b/core/modules/media_library/tests/fixtures/update/drupal-8.8.x-media_library-update-views-classnames-3049943.php deleted file mode 100644 index c91f8010fd2..00000000000 --- a/core/modules/media_library/tests/fixtures/update/drupal-8.8.x-media_library-update-views-classnames-3049943.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Contains database additions to drupal-8.4.0-media_installed.php for testing - * the the addition of BEM classes to the media library views config. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'media_library', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'media_library') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['media_library'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -$connection->insert('config') - ->fields(array( - 'collection', - 'name', - 'data', - )) - ->values(array( - 'collection' => '', - 'name' => 'views.view.media_library', - 'data' => 'a:14:{s:4:"uuid";s:36:"f57329d9-bc3a-43c4-90a8-ace75fcc2e22";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:2:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:25:"image.style.media_library";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:4:{i:0;s:5:"image";i:1;s:5:"media";i:2;s:13:"media_library";i:3;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"AWji7uYzNsxcFVzYkTki4iTCAT2cn2s7FLMu64brtQo";}s:2:"id";s:13:"media_library";s:5:"label";s:13:"Media library";s:6:"module";s:5:"views";s:11:"description";s:22:"Find and manage media.";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:4:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:18:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:13:"Apply filters";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:0;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"mini";s:7:"options";a:6:{s:14:"items_per_page";i:24;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"6, 12, 24, 48";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:2:{s:8:"previous";s:6:"‹‹";s:4:"next";s:6:"››";}}}s:5:"style";a:2:{s:4:"type";s:7:"default";s:7:"options";a:3:{s:8:"grouping";a:0:{}s:9:"row_class";s:84:"media-library-item media-library-item--grid js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:3:"row";a:2:{s:4:"type";s:6:"fields";s:7:"options";a:4:{s:22:"default_field_elements";b:1;s:6:"inline";a:0:{}s:9:"separator";s:0:"";s:10:"hide_empty";b:0;}}s:6:"fields";a:2:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"js-click-to-select-checkbox";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}}s:7:"filters";a:4:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:17:"Publishing status";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:9:"Published";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:13:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:10:"Media type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:10:"Media type";s:11:"description";N;s:10:"identifier";s:6:"bundle";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:3:{i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}s:12:"status_extra";a:15:{s:2:"id";s:12:"status_extra";s:5:"table";s:16:"media_field_data";s:5:"field";s:12:"status_extra";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:12:"media_status";}}s:5:"sorts";a:3:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:12:"Newest first";}s:11:"granularity";s:6:"second";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";}s:4:"name";a:12:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:3:"ASC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (A-Z)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}s:6:"name_1";a:12:{s:2:"id";s:6:"name_1";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (Z-A)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:19:"No media available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:17:"display_extenders";a:0:{}s:8:"use_ajax";b:1;s:9:"css_class";s:40:"media-library-view js-media-library-view";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:6:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:4:"user";i:5;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:4:"page";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:4:"page";s:13:"display_title";s:4:"Page";s:8:"position";i:1;s:15:"display_options";a:5:{s:17:"display_extenders";a:0:{}s:4:"path";s:19:"admin/content/media";s:4:"menu";a:8:{s:4:"type";s:3:"tab";s:5:"title";s:5:"Media";s:11:"description";s:49:"Allows users to browse and administer media items";s:8:"expanded";b:0;s:6:"parent";s:20:"system.admin_content";s:6:"weight";i:5;s:7:"context";s:1:"0";s:9:"menu_name";s:5:"admin";}s:6:"fields";a:5:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"js-click-to-select-checkbox";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:4:"name";a:37:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:1;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:17:"click_sort_column";s:5:"value";s:4:"type";s:6:"string";s:8:"settings";a:1:{s:14:"link_to_entity";b:0;}s:12:"group_column";s:5:"value";s:13:"group_columns";a:0:{}s:10:"group_rows";b:1;s:11:"delta_limit";i:0;s:12:"delta_offset";i:0;s:14:"delta_reversed";b:0;s:16:"delta_first_last";b:0;s:10:"multi_type";s:9:"separator";s:9:"separator";s:2:", ";s:17:"field_api_classes";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:5:"field";}s:10:"edit_media";a:26:{s:2:"id";s:10:"edit_media";s:5:"table";s:5:"media";s:5:"field";s:10:"edit_media";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:1;s:4:"text";s:15:"Edit {{ name }}";s:9:"make_link";b:1;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:15:"Edit {{ name }}";s:3:"rel";s:0:"";s:10:"link_class";s:24:"media-library-item__edit";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:1:"0";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:0;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:4:"text";s:4:"Edit";s:18:"output_url_as_text";b:0;s:8:"absolute";b:0;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:16:"entity_link_edit";}s:12:"delete_media";a:26:{s:2:"id";s:12:"delete_media";s:5:"table";s:5:"media";s:5:"field";s:12:"delete_media";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:1;s:4:"text";s:17:"Delete {{ name }}";s:9:"make_link";b:1;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:17:"Delete {{ name }}";s:3:"rel";s:0:"";s:10:"link_class";s:26:"media-library-item__remove";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:1:"0";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:0;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:4:"text";s:6:"Delete";s:18:"output_url_as_text";b:0;s:8:"absolute";b:0;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:18:"entity_link_delete";}s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}}s:8:"defaults";a:1:{s:6:"fields";b:0;}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:7:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:22:"url.query_args:sort_by";i:5;s:4:"user";i:6;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:6:"widget";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:6:"widget";s:13:"display_title";s:6:"Widget";s:8:"position";i:2;s:15:"display_options";a:11:{s:17:"display_extenders";a:0:{}s:4:"path";s:26:"admin/content/media-widget";s:6:"fields";a:2:{s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}s:25:"media_library_select_form";a:23:{s:2:"id";s:25:"media_library_select_form";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";}}s:8:"defaults";a:7:{s:6:"fields";b:0;s:6:"access";b:0;s:7:"filters";b:0;s:13:"filter_groups";b:0;s:9:"arguments";b:0;s:6:"header";b:0;s:9:"css_class";b:0;}s:19:"display_description";s:0:"";s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}s:7:"filters";a:2:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";s:9:"plugin_id";s:7:"boolean";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}}s:13:"filter_groups";a:2:{s:8:"operator";s:3:"AND";s:6:"groups";a:1:{i:1;s:3:"AND";}}s:9:"arguments";a:1:{s:6:"bundle";a:27:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:14:"default_action";s:6:"ignore";s:9:"exception";a:3:{s:5:"value";s:3:"all";s:12:"title_enable";b:0;s:5:"title";s:3:"All";}s:12:"title_enable";b:0;s:5:"title";s:0:"";s:21:"default_argument_type";s:5:"fixed";s:24:"default_argument_options";a:1:{s:8:"argument";s:0:"";}s:25:"default_argument_skip_url";b:0;s:15:"summary_options";a:4:{s:9:"base_path";s:0:"";s:5:"count";b:1;s:14:"items_per_page";i:24;s:8:"override";b:0;}s:7:"summary";a:3:{s:10:"sort_order";s:3:"asc";s:17:"number_of_records";i:0;s:6:"format";s:15:"default_summary";}s:18:"specify_validation";b:0;s:8:"validate";a:2:{s:4:"type";s:4:"none";s:4:"fail";s:9:"not found";}s:16:"validate_options";a:0:{}s:8:"glossary";b:0;s:5:"limit";i:0;s:4:"case";s:4:"none";s:9:"path_case";s:4:"none";s:14:"transform_dash";b:0;s:12:"break_phrase";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"string";}}s:6:"header";a:2:{s:17:"display_link_grid";a:7:{s:2:"id";s:17:"display_link_grid";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:6:"widget";s:5:"label";s:4:"Grid";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}s:18:"display_link_table";a:7:{s:2:"id";s:18:"display_link_table";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:12:"widget_table";s:5:"label";s:5:"Table";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}}s:9:"css_class";s:67:"media-library-view js-media-library-view media-library-view--widget";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:0:{}}}s:12:"widget_table";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:12:"widget_table";s:13:"display_title";s:14:"Widget (table)";s:8:"position";i:3;s:15:"display_options";a:12:{s:17:"display_extenders";a:0:{}s:4:"path";s:32:"admin/content/media-widget-table";s:5:"style";a:2:{s:4:"type";s:5:"table";s:7:"options";a:2:{s:9:"row_class";s:85:"media-library-item media-library-item--table js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:8:"defaults";a:9:{s:5:"style";b:0;s:3:"row";b:0;s:6:"fields";b:0;s:6:"access";b:0;s:7:"filters";b:0;s:13:"filter_groups";b:0;s:9:"arguments";b:0;s:6:"header";b:0;s:9:"css_class";b:0;}s:3:"row";a:1:{s:4:"type";s:6:"fields";}s:6:"fields";a:5:{s:25:"media_library_select_form";a:9:{s:2:"id";s:25:"media_library_select_form";s:5:"label";s:0:"";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:13:"element_class";s:0:"";}s:20:"thumbnail__target_id";a:10:{s:2:"id";s:20:"thumbnail__target_id";s:5:"label";s:9:"Thumbnail";s:5:"table";s:16:"media_field_data";s:5:"field";s:20:"thumbnail__target_id";s:12:"relationship";s:4:"none";s:4:"type";s:5:"image";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:9:"thumbnail";s:9:"plugin_id";s:5:"field";s:8:"settings";a:2:{s:11:"image_style";s:13:"media_library";s:10:"image_link";s:0:"";}}s:4:"name";a:10:{s:2:"id";s:4:"name";s:5:"label";s:4:"Name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:4:"type";s:6:"string";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:5:"field";s:8:"settings";a:1:{s:14:"link_to_entity";b:0;}}s:3:"uid";a:10:{s:2:"id";s:3:"uid";s:5:"label";s:6:"Author";s:5:"table";s:20:"media_field_revision";s:5:"field";s:3:"uid";s:12:"relationship";s:4:"none";s:4:"type";s:22:"entity_reference_label";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:3:"uid";s:9:"plugin_id";s:5:"field";s:8:"settings";a:1:{s:4:"link";b:1;}}s:7:"changed";a:10:{s:2:"id";s:7:"changed";s:5:"label";s:7:"Updated";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"changed";s:12:"relationship";s:4:"none";s:4:"type";s:9:"timestamp";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"changed";s:9:"plugin_id";s:5:"field";s:8:"settings";a:3:{s:11:"date_format";s:5:"short";s:18:"custom_date_format";s:0:"";s:8:"timezone";s:0:"";}}}s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}s:7:"filters";a:2:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:0;s:6:"expose";a:12:{s:11:"operator_id";s:0:"";s:5:"label";s:0:"";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:0:"";s:10:"identifier";s:0:"";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";s:9:"plugin_id";s:7:"boolean";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:12:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:24:"operator_limit_selection";b:0;s:13:"operator_list";a:0:{}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}}s:13:"filter_groups";a:2:{s:8:"operator";s:3:"AND";s:6:"groups";a:1:{i:1;s:3:"AND";}}s:9:"arguments";a:1:{s:6:"bundle";a:27:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:14:"default_action";s:6:"ignore";s:9:"exception";a:3:{s:5:"value";s:3:"all";s:12:"title_enable";b:0;s:5:"title";s:3:"All";}s:12:"title_enable";b:0;s:5:"title";s:0:"";s:21:"default_argument_type";s:5:"fixed";s:24:"default_argument_options";a:1:{s:8:"argument";s:0:"";}s:25:"default_argument_skip_url";b:0;s:15:"summary_options";a:4:{s:9:"base_path";s:0:"";s:5:"count";b:1;s:14:"items_per_page";i:24;s:8:"override";b:0;}s:7:"summary";a:3:{s:10:"sort_order";s:3:"asc";s:17:"number_of_records";i:0;s:6:"format";s:15:"default_summary";}s:18:"specify_validation";b:0;s:8:"validate";a:2:{s:4:"type";s:4:"none";s:4:"fail";s:9:"not found";}s:16:"validate_options";a:0:{}s:8:"glossary";b:0;s:5:"limit";i:0;s:4:"case";s:4:"none";s:9:"path_case";s:4:"none";s:14:"transform_dash";b:0;s:12:"break_phrase";b:0;s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"string";}}s:6:"header";a:2:{s:17:"display_link_grid";a:7:{s:2:"id";s:17:"display_link_grid";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:6:"widget";s:5:"label";s:4:"Grid";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}s:18:"display_link_table";a:7:{s:2:"id";s:18:"display_link_table";s:5:"table";s:5:"views";s:5:"field";s:12:"display_link";s:10:"display_id";s:12:"widget_table";s:5:"label";s:5:"Table";s:9:"plugin_id";s:12:"display_link";s:5:"empty";b:1;}}s:9:"css_class";s:67:"media-library-view js-media-library-view media-library-view--widget";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:6:{i:0;s:26:"languages:language_content";i:1;s:28:"languages:language_interface";i:2;s:3:"url";i:3;s:14:"url.query_args";i:4;s:22:"url.query_args:sort_by";i:5;s:16:"user.permissions";}s:4:"tags";a:0:{}}}}}', - )) - ->execute(); diff --git a/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-form-view-displays-2988433.php b/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-form-view-displays-2988433.php deleted file mode 100644 index 7bbe130fcba..00000000000 --- a/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-form-view-displays-2988433.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing - * the upgrade paths of the media library module form and view displays. - * - * @see https://www.drupal.org/project/drupal/issues/2988433 - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->condition('collection', 'system.schema') - ->condition('name', 'media_library') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'media_library', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['media_library'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Add config. -$connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values(array( - 'collection' => '', - 'name' => 'views.view.media_library', - 'data' => 'a:14:{s:4:"uuid";s:36:"3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:1:{i:0;s:41:"core.entity_view_mode.media.media_library";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:3:{i:0;s:5:"media";i:1;s:13:"media_library";i:2;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"1F1cSZ5MlvxdwjdyrwnH2I8CWngOp8Pu2SXDzix2QUc";}s:2:"id";s:13:"media_library";s:5:"label";s:13:"Media library";s:6:"module";s:5:"views";s:11:"description";s:0:"";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:3:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:18:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:13:"Apply Filters";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:0;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"mini";s:7:"options";a:6:{s:14:"items_per_page";i:25;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"5, 10, 25, 50";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:2:{s:8:"previous";s:6:"‹‹";s:4:"next";s:6:"››";}}}s:5:"style";a:2:{s:4:"type";s:7:"default";s:7:"options";a:3:{s:8:"grouping";a:0:{}s:9:"row_class";s:59:"media-library-item js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:3:"row";a:2:{s:4:"type";s:6:"fields";s:7:"options";a:4:{s:22:"default_field_elements";b:1;s:6:"inline";a:0:{}s:9:"separator";s:0:"";s:10:"hide_empty";b:0;}}s:6:"fields";a:2:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"js-click-to-select-checkbox";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}}s:7:"filters";a:3:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:0:"";s:5:"label";s:17:"Publishing status";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:9:"Published";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:10:"Media type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:10:"Media type";s:11:"description";N;s:10:"identifier";s:6:"bundle";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:3:{i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}}s:5:"sorts";a:3:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:12:"Newest first";}s:11:"granularity";s:6:"second";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";}s:4:"name";a:12:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:3:"ASC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (A-Z)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}s:6:"name_1";a:12:{s:2:"id";s:6:"name_1";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (Z-A)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:19:"No media available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:17:"display_extenders";a:0:{}s:8:"use_ajax";b:1;s:9:"css_class";s:40:"media-library-view js-media-library-view";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}s:4:"page";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:4:"page";s:13:"display_title";s:4:"Page";s:8:"position";i:1;s:15:"display_options";a:3:{s:17:"display_extenders";a:0:{}s:4:"path";s:19:"admin/content/media";s:4:"menu";a:8:{s:4:"type";s:3:"tab";s:5:"title";s:5:"Media";s:11:"description";s:49:"Allows users to browse and administer media items";s:8:"expanded";b:0;s:6:"parent";s:20:"system.admin_content";s:6:"weight";i:5;s:7:"context";s:1:"0";s:9:"menu_name";s:5:"admin";}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}s:6:"widget";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:6:"widget";s:13:"display_title";s:6:"Widget";s:8:"position";i:2;s:15:"display_options";a:6:{s:17:"display_extenders";a:0:{}s:4:"path";s:26:"admin/content/media-widget";s:6:"fields";a:2:{s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}s:25:"media_library_select_form";a:23:{s:2:"id";s:25:"media_library_select_form";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";}}s:8:"defaults";a:2:{s:6:"fields";b:0;s:6:"access";b:0;}s:19:"display_description";s:0:"";s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}}}', - )) - ->execute(); - - -// Insert media library key_value entries. -$connection->insert('key_value') - ->fields(array( - 'collection', - 'name', - 'value', - )) - ->values(array( - 'collection' => 'config.entity.key_store.view', - 'name' => 'uuid:3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932', - 'value' => 'a:1:{i:0;s:24:"views.view.media_library";}', - )) - ->execute(); diff --git a/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-view-table-display-2981044.php b/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-view-table-display-2981044.php deleted file mode 100644 index c1154497550..00000000000 --- a/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-view-table-display-2981044.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing - * the upgrade paths of the media library module view. - * - * @see https://www.drupal.org/project/drupal/issues/2981044 - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'media_library', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'media_library') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['media_library'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Insert media library config objects. -$connection->insert('config') -->fields(array( - 'collection', - 'name', - 'data', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.file.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"86ab9619-c970-4416-971d-e5c8614b3368";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"config";a:3:{i:0;s:41:"core.entity_form_mode.media.media_library";i:1;s:39:"field.field.media.file.field_media_file";i:2;s:15:"media.type.file";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"RFmywOcuem167havmD4VLgBTO1Swq9hyA-_f5aYTi8c";}s:2:"id";s:24:"media.file.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:5:{s:7:"created";b:1;s:16:"field_media_file";b:1;s:4:"path";b:1;s:6:"status";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.image.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"2bbea060-3cd8-4881-a3aa-c898d6619b16";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_form_mode.media.media_library";i:1;s:41:"field.field.media.image.field_media_image";i:2;s:21:"image.style.thumbnail";i:3;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"PlyfyVZfALLkP7nbxLpaVKIDUWRioZghWpFDv0_rJ68";}s:2:"id";s:25:"media.image.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:13:"media_library";s:7:"content";a:2:{s:17:"field_media_image";a:5:{s:4:"type";s:11:"image_image";s:6:"weight";i:1;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:18:"progress_indicator";s:8:"throbber";s:19:"preview_image_style";s:9:"thumbnail";}s:20:"third_party_settings";a:0:{}}s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:4:"path";b:1;s:6:"status";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.file.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"67e6d857-8ecb-49f5-95e1-6b1c4306c31f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:39:"field.field.media.file.field_media_file";i:2;s:21:"image.style.thumbnail";i:3;s:15:"media.type.file";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"vhAK2lCOWK2paUpJawj7yiSLFO9wwsx6WE8_oDmvbwU";}s:2:"id";s:24:"media.file.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:9:"thumbnail";a:6:{s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";s:5:"label";s:6:"hidden";s:8:"settings";a:2:{s:11:"image_style";s:9:"thumbnail";s:10:"image_link";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:16:"field_media_file";b:1;s:4:"name";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.image.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"277ca98b-2ada-4251-ad69-aa73e72d60fe";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:41:"field.field.media.image.field_media_image";i:2;s:18:"image.style.medium";i:3;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"PaGXvzRcL9eII--JV4eCVfObjrNo0l-u1dB_WJtB9ig";}s:2:"id";s:25:"media.image.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:9:"thumbnail";a:6:{s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";s:5:"label";s:6:"hidden";s:8:"settings";a:2:{s:11:"image_style";s:6:"medium";s:10:"image_link";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:17:"field_media_image";b:1;s:4:"name";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_mode.media.media_library', - 'data' => 'a:9:{s:4:"uuid";s:36:"20b2f1f7-a864-4d41-a15f-32f66789f73d";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:1:{i:0;s:5:"media";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"pkq0uj-IoqEQRBOP_ddUDV0ZJ-dKQ_fLcppsEDF2UO8";}s:2:"id";s:19:"media.media_library";s:5:"label";s:13:"Media library";s:16:"targetEntityType";s:5:"media";s:5:"cache";b:1;}', -)) -->values(array( - 'collection' => '', - 'name' => 'views.view.media_library', - 'data' => 'a:14:{s:4:"uuid";s:36:"3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:1:{i:0;s:41:"core.entity_view_mode.media.media_library";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:3:{i:0;s:5:"media";i:1;s:13:"media_library";i:2;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"1F1cSZ5MlvxdwjdyrwnH2I8CWngOp8Pu2SXDzix2QUc";}s:2:"id";s:13:"media_library";s:5:"label";s:13:"Media library";s:6:"module";s:5:"views";s:11:"description";s:0:"";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:3:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:18:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:13:"Apply Filters";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:0;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"mini";s:7:"options";a:6:{s:14:"items_per_page";i:25;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"5, 10, 25, 50";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:2:{s:8:"previous";s:6:"‹‹";s:4:"next";s:6:"››";}}}s:5:"style";a:2:{s:4:"type";s:7:"default";s:7:"options";a:3:{s:8:"grouping";a:0:{}s:9:"row_class";s:59:"media-library-item js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:3:"row";a:2:{s:4:"type";s:6:"fields";s:7:"options";a:4:{s:22:"default_field_elements";b:1;s:6:"inline";a:0:{}s:9:"separator";s:0:"";s:10:"hide_empty";b:0;}}s:6:"fields";a:2:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"js-click-to-select-checkbox";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}}s:7:"filters";a:3:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:0:"";s:5:"label";s:17:"Publishing status";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:9:"Published";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:10:"Media type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:10:"Media type";s:11:"description";N;s:10:"identifier";s:6:"bundle";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:3:{i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}}s:5:"sorts";a:3:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:12:"Newest first";}s:11:"granularity";s:6:"second";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";}s:4:"name";a:12:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:3:"ASC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (A-Z)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}s:6:"name_1";a:12:{s:2:"id";s:6:"name_1";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (Z-A)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:19:"No media available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:17:"display_extenders";a:0:{}s:8:"use_ajax";b:1;s:9:"css_class";s:40:"media-library-view js-media-library-view";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}s:4:"page";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:4:"page";s:13:"display_title";s:4:"Page";s:8:"position";i:1;s:15:"display_options";a:3:{s:17:"display_extenders";a:0:{}s:4:"path";s:19:"admin/content/media";s:4:"menu";a:8:{s:4:"type";s:3:"tab";s:5:"title";s:5:"Media";s:11:"description";s:49:"Allows users to browse and administer media items";s:8:"expanded";b:0;s:6:"parent";s:20:"system.admin_content";s:6:"weight";i:5;s:7:"context";s:1:"0";s:9:"menu_name";s:5:"admin";}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}s:6:"widget";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:6:"widget";s:13:"display_title";s:6:"Widget";s:8:"position";i:2;s:15:"display_options";a:6:{s:17:"display_extenders";a:0:{}s:4:"path";s:26:"admin/content/media-widget";s:6:"fields";a:2:{s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}s:25:"media_library_select_form";a:23:{s:2:"id";s:25:"media_library_select_form";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";}}s:8:"defaults";a:2:{s:6:"fields";b:0;s:6:"access";b:0;}s:19:"display_description";s:0:"";s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}}}', -)) -->execute(); - -// Insert media library key_value entries. -$connection->insert('key_value') -->fields(array( - 'collection', - 'name', - 'value', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_display', - 'name' => 'uuid:67e6d857-8ecb-49f5-95e1-6b1c4306c31f', - 'value' => 'a:1:{i:0;s:49:"core.entity_view_display.media.file.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_display', - 'name' => 'uuid:277ca98b-2ada-4251-ad69-aa73e72d60fe', - 'value' => 'a:1:{i:0;s:50:"core.entity_view_display.media.image.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_mode', - 'name' => 'uuid:20b2f1f7-a864-4d41-a15f-32f66789f73d', - 'value' => 'a:1:{i:0;s:41:"core.entity_view_mode.media.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.view', - 'name' => 'uuid:3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932', - 'value' => 'a:1:{i:0;s:24:"views.view.media_library";}', -)) -->execute(); diff --git a/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-widget-view-3020716.php b/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-widget-view-3020716.php deleted file mode 100644 index a07a69003ec..00000000000 --- a/core/modules/media_library/tests/fixtures/update/drupal-8.media_library-update-widget-view-3020716.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -// @codingStandardsIgnoreFile -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing - * the upgrade paths of the media library module widget view. - * - * @see https://www.drupal.org/project/drupal/issues/3020716 - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'media_library', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'media_library') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['media_library'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Insert media library config objects. -$connection->insert('config') -->fields(array( - 'collection', - 'name', - 'data', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.file.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"86ab9619-c970-4416-971d-e5c8614b3368";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"config";a:3:{i:0;s:41:"core.entity_form_mode.media.media_library";i:1;s:39:"field.field.media.file.field_media_file";i:2;s:15:"media.type.file";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"RFmywOcuem167havmD4VLgBTO1Swq9hyA-_f5aYTi8c";}s:2:"id";s:24:"media.file.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:5:{s:7:"created";b:1;s:16:"field_media_file";b:1;s:4:"path";b:1;s:6:"status";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_form_display.media.image.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"2bbea060-3cd8-4881-a3aa-c898d6619b16";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_form_mode.media.media_library";i:1;s:41:"field.field.media.image.field_media_image";i:2;s:21:"image.style.thumbnail";i:3;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"PlyfyVZfALLkP7nbxLpaVKIDUWRioZghWpFDv0_rJ68";}s:2:"id";s:25:"media.image.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:13:"media_library";s:7:"content";a:2:{s:17:"field_media_image";a:5:{s:4:"type";s:11:"image_image";s:6:"weight";i:1;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:18:"progress_indicator";s:8:"throbber";s:19:"preview_image_style";s:9:"thumbnail";}s:20:"third_party_settings";a:0:{}}s:4:"name";a:5:{s:4:"type";s:16:"string_textfield";s:6:"weight";i:0;s:6:"region";s:7:"content";s:8:"settings";a:2:{s:4:"size";i:60;s:11:"placeholder";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:4:"path";b:1;s:6:"status";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.file.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"67e6d857-8ecb-49f5-95e1-6b1c4306c31f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:39:"field.field.media.file.field_media_file";i:2;s:21:"image.style.thumbnail";i:3;s:15:"media.type.file";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"vhAK2lCOWK2paUpJawj7yiSLFO9wwsx6WE8_oDmvbwU";}s:2:"id";s:24:"media.file.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:4:"file";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:9:"thumbnail";a:6:{s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";s:5:"label";s:6:"hidden";s:8:"settings";a:2:{s:11:"image_style";s:9:"thumbnail";s:10:"image_link";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:16:"field_media_file";b:1;s:4:"name";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_display.media.image.media_library', - 'data' => 'a:11:{s:4:"uuid";s:36:"277ca98b-2ada-4251-ad69-aa73e72d60fe";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:4:{i:0;s:41:"core.entity_view_mode.media.media_library";i:1;s:41:"field.field.media.image.field_media_image";i:2;s:18:"image.style.medium";i:3;s:16:"media.type.image";}s:6:"module";a:1:{i:0;s:5:"image";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"PaGXvzRcL9eII--JV4eCVfObjrNo0l-u1dB_WJtB9ig";}s:2:"id";s:25:"media.image.media_library";s:16:"targetEntityType";s:5:"media";s:6:"bundle";s:5:"image";s:4:"mode";s:13:"media_library";s:7:"content";a:1:{s:9:"thumbnail";a:6:{s:4:"type";s:5:"image";s:6:"weight";i:0;s:6:"region";s:7:"content";s:5:"label";s:6:"hidden";s:8:"settings";a:2:{s:11:"image_style";s:6:"medium";s:10:"image_link";s:0:"";}s:20:"third_party_settings";a:0:{}}}s:6:"hidden";a:4:{s:7:"created";b:1;s:17:"field_media_image";b:1;s:4:"name";b:1;s:3:"uid";b:1;}}', -)) -->values(array( - 'collection' => '', - 'name' => 'core.entity_view_mode.media.media_library', - 'data' => 'a:9:{s:4:"uuid";s:36:"20b2f1f7-a864-4d41-a15f-32f66789f73d";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:1:{i:0;s:5:"media";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"pkq0uj-IoqEQRBOP_ddUDV0ZJ-dKQ_fLcppsEDF2UO8";}s:2:"id";s:19:"media.media_library";s:5:"label";s:13:"Media library";s:16:"targetEntityType";s:5:"media";s:5:"cache";b:1;}', -)) -->values(array( - 'collection' => '', - 'name' => 'views.view.media_library', - 'data' => 'a:14:{s:4:"uuid";s:36:"3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:3:{s:6:"config";a:1:{i:0;s:41:"core.entity_view_mode.media.media_library";}s:8:"enforced";a:1:{s:6:"module";a:1:{i:0;s:13:"media_library";}}s:6:"module";a:3:{i:0;s:5:"media";i:1;s:13:"media_library";i:2;s:4:"user";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"1F1cSZ5MlvxdwjdyrwnH2I8CWngOp8Pu2SXDzix2QUc";}s:2:"id";s:13:"media_library";s:5:"label";s:13:"Media library";s:6:"module";s:5:"views";s:11:"description";s:0:"";s:3:"tag";s:0:"";s:10:"base_table";s:16:"media_field_data";s:10:"base_field";s:3:"mid";s:4:"core";s:3:"8.x";s:7:"display";a:3:{s:7:"default";a:6:{s:14:"display_plugin";s:7:"default";s:2:"id";s:7:"default";s:13:"display_title";s:6:"Master";s:8:"position";i:0;s:15:"display_options";a:18:{s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:21:"access media overview";}}s:5:"cache";a:2:{s:4:"type";s:3:"tag";s:7:"options";a:0:{}}s:5:"query";a:2:{s:4:"type";s:11:"views_query";s:7:"options";a:5:{s:19:"disable_sql_rewrite";b:0;s:8:"distinct";b:0;s:7:"replica";b:0;s:13:"query_comment";s:0:"";s:10:"query_tags";a:0:{}}}s:12:"exposed_form";a:2:{s:4:"type";s:5:"basic";s:7:"options";a:7:{s:13:"submit_button";s:13:"Apply Filters";s:12:"reset_button";b:0;s:18:"reset_button_label";s:5:"Reset";s:19:"exposed_sorts_label";s:7:"Sort by";s:17:"expose_sort_order";b:0;s:14:"sort_asc_label";s:3:"Asc";s:15:"sort_desc_label";s:4:"Desc";}}s:5:"pager";a:2:{s:4:"type";s:4:"mini";s:7:"options";a:6:{s:14:"items_per_page";i:25;s:6:"offset";i:0;s:2:"id";i:0;s:11:"total_pages";N;s:6:"expose";a:7:{s:14:"items_per_page";b:0;s:20:"items_per_page_label";s:14:"Items per page";s:22:"items_per_page_options";s:13:"5, 10, 25, 50";s:26:"items_per_page_options_all";b:0;s:32:"items_per_page_options_all_label";s:7:"- All -";s:6:"offset";b:0;s:12:"offset_label";s:6:"Offset";}s:4:"tags";a:2:{s:8:"previous";s:6:"‹‹";s:4:"next";s:6:"››";}}}s:5:"style";a:2:{s:4:"type";s:7:"default";s:7:"options";a:3:{s:8:"grouping";a:0:{}s:9:"row_class";s:59:"media-library-item js-media-library-item js-click-to-select";s:17:"default_row_class";b:1;}}s:3:"row";a:2:{s:4:"type";s:6:"fields";s:7:"options";a:4:{s:22:"default_field_elements";b:1;s:6:"inline";a:0:{}s:9:"separator";s:0:"";s:10:"hide_empty";b:0;}}s:6:"fields";a:2:{s:15:"media_bulk_form";a:26:{s:2:"id";s:15:"media_bulk_form";s:5:"table";s:5:"media";s:5:"field";s:15:"media_bulk_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"js-click-to-select-checkbox";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:12:"action_title";s:6:"Action";s:15:"include_exclude";s:7:"exclude";s:16:"selected_actions";a:0:{}s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:9:"bulk_form";}s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}}s:7:"filters";a:3:{s:6:"status";a:16:{s:2:"id";s:6:"status";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"status";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:0:"";s:5:"label";s:17:"Publishing status";s:11:"description";N;s:12:"use_operator";b:0;s:8:"operator";s:9:"status_op";s:10:"identifier";s:6:"status";s:8:"required";b:1;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:1:{s:13:"authenticated";s:13:"authenticated";}}s:10:"is_grouped";b:1;s:10:"group_info";a:10:{s:5:"label";s:9:"Published";s:11:"description";s:0:"";s:10:"identifier";s:6:"status";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:2:{i:1;a:3:{s:5:"title";s:9:"Published";s:8:"operator";s:1:"=";s:5:"value";s:1:"1";}i:2;a:3:{s:5:"title";s:11:"Unpublished";s:8:"operator";s:1:"=";s:5:"value";s:1:"0";}}}s:9:"plugin_id";s:7:"boolean";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"status";}s:4:"name";a:16:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:8:"contains";s:5:"value";s:0:"";s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:10:{s:11:"operator_id";s:7:"name_op";s:5:"label";s:4:"Name";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:7:"name_op";s:10:"identifier";s:4:"name";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:0:"";s:11:"description";s:0:"";s:10:"identifier";s:0:"";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:0:{}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:6:"string";}s:6:"bundle";a:16:{s:2:"id";s:6:"bundle";s:5:"table";s:16:"media_field_data";s:5:"field";s:6:"bundle";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:8:"operator";s:2:"in";s:5:"value";a:0:{}s:5:"group";i:1;s:7:"exposed";b:1;s:6:"expose";a:11:{s:11:"operator_id";s:9:"bundle_op";s:5:"label";s:10:"Media type";s:11:"description";s:0:"";s:12:"use_operator";b:0;s:8:"operator";s:9:"bundle_op";s:10:"identifier";s:4:"type";s:8:"required";b:0;s:8:"remember";b:0;s:8:"multiple";b:0;s:14:"remember_roles";a:3:{s:13:"authenticated";s:13:"authenticated";s:9:"anonymous";s:1:"0";s:13:"administrator";s:1:"0";}s:6:"reduce";b:0;}s:10:"is_grouped";b:0;s:10:"group_info";a:10:{s:5:"label";s:10:"Media type";s:11:"description";N;s:10:"identifier";s:6:"bundle";s:8:"optional";b:1;s:6:"widget";s:6:"select";s:8:"multiple";b:0;s:8:"remember";b:0;s:13:"default_group";s:3:"All";s:22:"default_group_multiple";a:0:{}s:11:"group_items";a:3:{i:1;a:0:{}i:2;a:0:{}i:3;a:0:{}}}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:6:"bundle";s:9:"plugin_id";s:6:"bundle";}}s:5:"sorts";a:3:{s:7:"created";a:13:{s:2:"id";s:7:"created";s:5:"table";s:16:"media_field_data";s:5:"field";s:7:"created";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:12:"Newest first";}s:11:"granularity";s:6:"second";s:11:"entity_type";s:5:"media";s:12:"entity_field";s:7:"created";s:9:"plugin_id";s:4:"date";}s:4:"name";a:12:{s:2:"id";s:4:"name";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:3:"ASC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (A-Z)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}s:6:"name_1";a:12:{s:2:"id";s:6:"name_1";s:5:"table";s:16:"media_field_data";s:5:"field";s:4:"name";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"order";s:4:"DESC";s:7:"exposed";b:1;s:6:"expose";a:1:{s:5:"label";s:10:"Name (Z-A)";}s:11:"entity_type";s:5:"media";s:12:"entity_field";s:4:"name";s:9:"plugin_id";s:8:"standard";}}s:5:"title";s:5:"Media";s:6:"header";a:0:{}s:6:"footer";a:0:{}s:5:"empty";a:1:{s:16:"area_text_custom";a:10:{s:2:"id";s:16:"area_text_custom";s:5:"table";s:5:"views";s:5:"field";s:16:"area_text_custom";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"empty";b:1;s:8:"tokenize";b:0;s:7:"content";s:19:"No media available.";s:9:"plugin_id";s:11:"text_custom";}}s:13:"relationships";a:0:{}s:17:"display_extenders";a:0:{}s:8:"use_ajax";b:1;s:9:"css_class";s:40:"media-library-view js-media-library-view";}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}s:4:"page";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:4:"page";s:13:"display_title";s:4:"Page";s:8:"position";i:1;s:15:"display_options";a:3:{s:17:"display_extenders";a:0:{}s:4:"path";s:19:"admin/content/media";s:4:"menu";a:8:{s:4:"type";s:3:"tab";s:5:"title";s:5:"Media";s:11:"description";s:49:"Allows users to browse and administer media items";s:8:"expanded";b:0;s:6:"parent";s:20:"system.admin_content";s:6:"weight";i:5;s:7:"context";s:1:"0";s:9:"menu_name";s:5:"admin";}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:0;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}s:6:"widget";a:6:{s:14:"display_plugin";s:4:"page";s:2:"id";s:6:"widget";s:13:"display_title";s:6:"Widget";s:8:"position";i:2;s:15:"display_options";a:6:{s:17:"display_extenders";a:0:{}s:4:"path";s:26:"admin/content/media-widget";s:6:"fields";a:2:{s:15:"rendered_entity";a:24:{s:2:"id";s:15:"rendered_entity";s:5:"table";s:5:"media";s:5:"field";s:15:"rendered_entity";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:27:"media-library-item__content";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:0:"";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:9:"view_mode";s:13:"media_library";s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:15:"rendered_entity";}s:25:"media_library_select_form";a:23:{s:2:"id";s:25:"media_library_select_form";s:5:"table";s:5:"media";s:5:"field";s:25:"media_library_select_form";s:12:"relationship";s:4:"none";s:10:"group_type";s:5:"group";s:11:"admin_label";s:0:"";s:5:"label";s:0:"";s:7:"exclude";b:0;s:5:"alter";a:26:{s:10:"alter_text";b:0;s:4:"text";s:0:"";s:9:"make_link";b:0;s:4:"path";s:0:"";s:8:"absolute";b:0;s:8:"external";b:0;s:14:"replace_spaces";b:0;s:9:"path_case";s:4:"none";s:15:"trim_whitespace";b:0;s:3:"alt";s:0:"";s:3:"rel";s:0:"";s:10:"link_class";s:0:"";s:6:"prefix";s:0:"";s:6:"suffix";s:0:"";s:6:"target";s:0:"";s:5:"nl2br";b:0;s:10:"max_length";i:0;s:13:"word_boundary";b:1;s:8:"ellipsis";b:1;s:9:"more_link";b:0;s:14:"more_link_text";s:0:"";s:14:"more_link_path";s:0:"";s:10:"strip_tags";b:0;s:4:"trim";b:0;s:13:"preserve_tags";s:0:"";s:4:"html";b:0;}s:12:"element_type";s:0:"";s:13:"element_class";s:0:"";s:18:"element_label_type";s:0:"";s:19:"element_label_class";s:0:"";s:19:"element_label_colon";b:0;s:20:"element_wrapper_type";s:0:"";s:21:"element_wrapper_class";s:27:"js-click-to-select-checkbox";s:23:"element_default_classes";b:1;s:5:"empty";s:0:"";s:10:"hide_empty";b:0;s:10:"empty_zero";b:0;s:16:"hide_alter_empty";b:1;s:11:"entity_type";s:5:"media";s:9:"plugin_id";s:25:"media_library_select_form";}}s:8:"defaults";a:2:{s:6:"fields";b:0;s:6:"access";b:0;}s:19:"display_description";s:0:"";s:6:"access";a:2:{s:4:"type";s:4:"perm";s:7:"options";a:1:{s:4:"perm";s:10:"view media";}}}s:14:"cache_metadata";a:3:{s:7:"max-age";i:-1;s:8:"contexts";a:5:{i:0;s:28:"languages:language_interface";i:1;s:3:"url";i:2;s:14:"url.query_args";i:3;s:22:"url.query_args:sort_by";i:4;s:16:"user.permissions";}s:4:"tags";a:5:{i:0;s:51:"config:core.entity_view_display.media.audio.default";i:1;s:50:"config:core.entity_view_display.media.file.default";i:2;s:51:"config:core.entity_view_display.media.image.default";i:3;s:58:"config:core.entity_view_display.media.remote_video.default";i:4;s:51:"config:core.entity_view_display.media.video.default";}}}}}', -)) -->execute(); - -// Insert media library key_value entries. -$connection->insert('key_value') -->fields(array( - 'collection', - 'name', - 'value', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_display', - 'name' => 'uuid:67e6d857-8ecb-49f5-95e1-6b1c4306c31f', - 'value' => 'a:1:{i:0;s:49:"core.entity_view_display.media.file.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_display', - 'name' => 'uuid:277ca98b-2ada-4251-ad69-aa73e72d60fe', - 'value' => 'a:1:{i:0;s:50:"core.entity_view_display.media.image.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.entity_view_mode', - 'name' => 'uuid:20b2f1f7-a864-4d41-a15f-32f66789f73d', - 'value' => 'a:1:{i:0;s:41:"core.entity_view_mode.media.media_library";}', -)) -->values(array( - 'collection' => 'config.entity.key_store.view', - 'name' => 'uuid:3bc9cf0f-cb66-4dbe-8d7e-862cb85e5932', - 'value' => 'a:1:{i:0;s:24:"views.view.media_library";}', -)) -->execute(); diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibrarySetAdministrativePageToTableDisplayTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibrarySetAdministrativePageToTableDisplayTest.php deleted file mode 100644 index 23ba0018e9c..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibrarySetAdministrativePageToTableDisplayTest.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests update to set 'media' view's table display as the administrative page. - * - * @group media_library - * @group legacy - */ -class MediaLibrarySetAdministrativePageToTableDisplayTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.7.2-media_library_installed.php', - ]; - } - - /** - * Tests that the update alters uncustomized path and menu settings. - */ - public function testUpdateWithoutCustomizations() { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = View::load('media'); - $display = $view->getDisplay('media_page_list'); - $this->assertSame('admin/content/media-table', $display['display_options']['path']); - $this->assertArrayNotHasKey('menu', $display['display_options']); - - $view = View::load('media_library'); - $display = $view->getDisplay('page'); - $this->assertSame('admin/content/media', $display['display_options']['path']); - $this->assertSame('tab', $display['display_options']['menu']['type']); - $this->assertSame('Media', $display['display_options']['menu']['title']); - - $this->runUpdates(); - - $view = View::load('media'); - $display = $view->getDisplay('media_page_list'); - $this->assertSame('admin/content/media', $display['display_options']['path']); - $this->assertArrayNotHasKey('menu', $display['display_options']); - - $view = View::load('media_library'); - $display = $view->getDisplay('page'); - $this->assertSame('admin/content/media-grid', $display['display_options']['path']); - $this->assertArrayNotHasKey('menu', $display['display_options']); - } - - /** - * Tests that the update does not alter a custom 'media' view path. - */ - public function testUpdateWithCustomizedMediaViewPath() { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = View::load('media'); - $display = &$view->getDisplay('media_page_list'); - $display['display_options']['path'] = 'admin/content/all-media'; - $view->save(); - - $this->runUpdates(); - - // The update should not have modified the path. - $view = View::load('media'); - $display = $view->getDisplay('media_page_list'); - $this->assertSame('admin/content/all-media', $display['display_options']['path']); - - $view = View::load('media_library'); - $display = $view->getDisplay('page'); - $this->assertSame('admin/content/media-grid', $display['display_options']['path']); - $this->assertArrayNotHasKey('menu', $display['display_options']); - } - - /** - * Tests that the update does not alter custom 'media' view menu settings. - */ - public function testUpdateWithCustomizedMediaViewMenuSettings() { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = View::load('media'); - $display = &$view->getDisplay('media_page_list'); - $display['display_options']['menu'] = [ - 'type' => 'normal', - 'title' => 'All media', - 'parent' => 'system.admin_structure', - ]; - $view->save(); - - $this->runUpdates(); - - // The update should not have modified the path. - $view = View::load('media'); - $display = $view->getDisplay('media_page_list'); - $this->assertSame('admin/content/media', $display['display_options']['path']); - $this->assertSame('normal', $display['display_options']['menu']['type']); - $this->assertSame('All media', $display['display_options']['menu']['title']); - $this->assertSame('system.admin_structure', $display['display_options']['menu']['parent']); - - $view = View::load('media_library'); - $display = $view->getDisplay('page'); - $this->assertSame('admin/content/media-grid', $display['display_options']['path']); - $this->assertArrayNotHasKey('menu', $display['display_options']); - } - - /** - * Tests that the update does not alter custom 'media' path and menu settings. - */ - public function testUpdateWithCustomizedMediaLibraryViewPath() { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = View::load('media_library'); - $display = &$view->getDisplay('page'); - $display['display_options']['path'] = 'admin/content/media-pretty'; - $view->save(); - - $this->runUpdates(); - - // The update should not have modified the path or menu settings. - $view = View::load('media_library'); - $display = $view->getDisplay('page'); - $this->assertSame('admin/content/media-pretty', $display['display_options']['path']); - $this->assertSame('tab', $display['display_options']['menu']['type']); - $this->assertSame('Media', $display['display_options']['menu']['title']); - } - - /** - * Tests that the update preserves custom 'media_library' menu settings. - */ - public function testUpdateWithCustomizedMediaLibraryMenuSettings() { - /** @var \Drupal\views\ViewEntityInterface $view */ - $view = View::load('media_library'); - $display = &$view->getDisplay('page'); - $display['display_options']['menu'] = [ - 'type' => 'normal', - 'title' => 'A treasure trove of interesting pictures', - 'parent' => 'system.admin_structure', - ]; - $view->save(); - - $this->runUpdates(); - - // The update should have changed the path but preserved the menu settings. - $view = View::load('media_library'); - $display = $view->getDisplay('page'); - $this->assertSame('admin/content/media-grid', $display['display_options']['path']); - $this->assertSame('normal', $display['display_options']['menu']['type']); - $this->assertSame('A treasure trove of interesting pictures', $display['display_options']['menu']['title']); - $this->assertSame('system.admin_structure', $display['display_options']['menu']['parent']); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdate8704Test.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdate8704Test.php deleted file mode 100644 index 819f39cf1dc..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdate8704Test.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests update path to create the media_library.settings config object. - * - * @group media_library - * @group legacy - * - * @covers media_library_update_8704 - */ -class MediaLibraryUpdate8704Test extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.7.2-media_library_installed.php', - ]; - } - - /** - * Tests that the update creates the media_library.settings config object. - */ - public function testUpdate() { - $this->assertNull($this->config('media_library.settings')->get('advanced_ui')); - $this->runUpdates(); - $this->assertTrue($this->config('media_library.settings')->get('advanced_ui')); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateCheckboxClassesTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateCheckboxClassesTest.php deleted file mode 100644 index 6642e29609a..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateCheckboxClassesTest.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Tests the media library module updates views checkbox classes. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateCheckboxClassesTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.8.x-media_library-update-views-classnames-3049943.php', - ]; - } - - /** - * Tests that non js prefixes are added to checkboxes in the media view. - * - * @see media_library_post_update_update_8001_checkbox_classes() - */ - public function testAddNonPrefixedClasses() { - $view = Views::getView('media_library'); - - $display_items = [ - [ - 'display_id' => 'default', - 'option' => 'element_class', - 'field' => 'media_bulk_form', - ], - [ - 'display_id' => 'page', - 'option' => 'element_class', - 'field' => 'media_bulk_form', - ], - [ - 'display_id' => 'widget', - 'option' => 'element_wrapper_class', - 'field' => 'media_library_select_form', - ], - [ - 'display_id' => 'widget_table', - 'option' => 'element_wrapper_class', - 'field' => 'media_library_select_form', - ], - ]; - foreach ($display_items as $item) { - $display_id = $item['display_id']; - $option = $item['option']; - $field = $item['field']; - $display = $view->storage->getDisplay($display_id); - $classes_string = $display['display_options']['fields'][$field][$option]; - $classes = preg_split('/\s+/', $classes_string); - $this->assertContains('js-click-to-select-checkbox', $classes); - $this->assertNotContains('media-library-item__click-to-select-checkbox', $classes); - } - - $this->runUpdates(); - $view = Views::getView('media_library'); - - foreach ($display_items as $item) { - $display_id = $item['display_id']; - $option = $item['option']; - $field = $item['field']; - $display = $view->storage->getDisplay($display_id); - $classes_string = $display['display_options']['fields'][$field][$option]; - $classes = preg_split('/\s+/', $classes_string); - $this->assertContains('js-click-to-select-checkbox', $classes); - $this->assertContains('media-library-item__click-to-select-checkbox', $classes, "Class 'media-library-item__click-to-select-checkbox' not found in display: $display_id"); - } - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateFormAndViewDisplaysTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateFormAndViewDisplaysTest.php deleted file mode 100644 index 0d1790f0ef2..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateFormAndViewDisplaysTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\Core\Entity\Entity\EntityViewDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\image\Entity\ImageStyle; - -/** - * Tests the media library module updates for form and view displays. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateFormAndViewDisplaysTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.media_library-update-form-view-displays-2988433.php', - ]; - } - - /** - * Tests the media library module updates for form and view displays. - * - * @see media_library_update_8701() - * @see media_library_post_update_display_modes() - */ - public function testPostUpdateDisplayModes() { - $this->assertNull(ImageStyle::load('media_library')); - $this->assertNull(EntityFormDisplay::load('media.file.media_library')); - $this->assertNull(EntityViewDisplay::load('media.file.media_library')); - $this->assertNull(EntityFormDisplay::load('media.image.media_library')); - $this->assertNull(EntityViewDisplay::load('media.image.media_library')); - $this->runUpdates(); - $this->assertInstanceOf(ImageStyle::class, ImageStyle::load('media_library')); - $this->assertInstanceOf(EntityFormDisplay::class, EntityFormDisplay::load('media.file.media_library')); - $this->assertInstanceOf(EntityViewDisplay::class, EntityViewDisplay::load('media.file.media_library')); - $this->assertInstanceOf(EntityFormDisplay::class, EntityFormDisplay::load('media.image.media_library')); - $this->assertInstanceOf(EntityViewDisplay::class, EntityViewDisplay::load('media.image.media_library')); - $this->assertSession()->pageTextContains('Media Library form and view displays have been created for the following media types: File, Image.'); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewLangcodeFiltersTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewLangcodeFiltersTest.php deleted file mode 100644 index bec98b28f16..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewLangcodeFiltersTest.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the media library module updates for the langcode filters. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateViewLangcodeFiltersTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.7.2-media_library_installed.php', - ]; - } - - /** - * Tests that the langcode filters are added to the media library view. - * - * @see media_library_post_update_add_langcode_filters() - */ - public function testMediaLibraryViewStatusExtraFilter() { - $config = $this->config('views.view.media_library'); - // We don't have any language filters yet for all displays. - $this->assertNull($config->get('display.default.display_options.filters.langcode')); - $this->assertNull($config->get('display.default.display_options.filters.default_langcode')); - $this->assertNull($config->get('display.widget.display_options.filters.langcode')); - $this->assertNull($config->get('display.widget.display_options.filters.default_langcode')); - $this->assertNull($config->get('display.widget_table.display_options.filters.langcode')); - $this->assertNull($config->get('display.widget_table.display_options.filters.default_langcode')); - // The rendering language should not be set for the displays. - $this->assertNull($config->get('display.default.display_options.rendering_language')); - $this->assertNull($config->get('display.widget.display_options.rendering_language')); - $this->assertNull($config->get('display.widget_table.display_options.rendering_language')); - - $this->runUpdates(); - - $config = $this->config('views.view.media_library'); - - // The update should add the langcode filter to the default display only. - $this->assertNull($config->get('display.widget.display_options.filters.langcode')); - $this->assertNull($config->get('display.widget_table.display_options.filters.langcode')); - $default_langcode_filter = $config->get('display.default.display_options.filters.langcode'); - $this->assertInternalType('array', $default_langcode_filter); - $this->assertSame('langcode', $default_langcode_filter['field']); - $this->assertSame('media', $default_langcode_filter['entity_type']); - $this->assertSame('language', $default_langcode_filter['plugin_id']); - $this->assertSame('langcode', $default_langcode_filter['id']); - $this->assertTrue($default_langcode_filter['exposed']); - - // The update should add the default_langcode filter to the widget displays - // only. - $this->assertNull($config->get('display.default.display_options.filters.default_langcode')); - foreach (['widget', 'widget_table'] as $display_id) { - $filter = $config->get('display.' . $display_id . '.display_options.filters.default_langcode'); - $this->assertInternalType('array', $filter); - $this->assertSame('default_langcode', $filter['field']); - $this->assertSame('media', $filter['entity_type']); - $this->assertSame('boolean', $filter['plugin_id']); - $this->assertSame('default_langcode', $filter['id']); - $this->assertFalse($filter['exposed']); - } - - // The default display should use the default rendering language, which is - // the language of the content. - $this->assertNull($config->get('display.default.display_options.rendering_language')); - // The rendering language of the row should be set to the interface - // language. - $this->assertSame('***LANGUAGE_language_interface***', $config->get('display.widget.display_options.rendering_language')); - $this->assertSame('***LANGUAGE_language_interface***', $config->get('display.widget_table.display_options.rendering_language')); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest.php deleted file mode 100644 index 38a30a8b6a5..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the media library module updates for the view page display links. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateViewPageDisplayEditDeleteLinkTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.7.2-media_library_installed.php', - ]; - } - - /** - * Tests that the media library view config is updated. - * - * @see media_library_update_8703() - */ - public function testMediaLibraryViewsConfig() { - $config = $this->config('views.view.media_library'); - $this->assertNull($config->get('display.page.display_options.defaults.fields')); - $this->assertNull($config->get('display.page.display_options.fields.name')); - $this->assertNull($config->get('display.page.display_options.fields.edit_media')); - $this->assertNull($config->get('display.page.display_options.fields.delete_media')); - - $this->runUpdates(); - - $config = $this->config('views.view.media_library'); - $this->assertFalse($config->get('display.page.display_options.defaults.fields')); - $this->assertSame('field', $config->get('display.page.display_options.fields.name.plugin_id')); - $this->assertSame('name', $config->get('display.page.display_options.fields.name.entity_field')); - $this->assertSame('entity_link_edit', $config->get('display.page.display_options.fields.edit_media.plugin_id')); - $this->assertSame('entity_link_delete', $config->get('display.page.display_options.fields.delete_media.plugin_id')); - // Check if the rendered entity is last in the field. - $fields = $config->get('display.page.display_options.fields'); - end($fields); - $this->assertSame('rendered_entity', key($fields)); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewStatusExtraFilterTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewStatusExtraFilterTest.php deleted file mode 100644 index 29c42b8b91b..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewStatusExtraFilterTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the media library module updates for the view page display links. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateViewStatusExtraFilterTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.7.2-media_library_installed.php', - ]; - } - - /** - * Tests that the status extra filter is added to the media library view. - * - * @see media_library_post_update_add_status_extra_filter() - */ - public function testMediaLibraryViewStatusExtraFilter() { - $config = $this->config('views.view.media_library'); - $this->assertNull($config->get('display.default.display_options.filters.status_extra')); - - $this->runUpdates(); - - $config = $this->config('views.view.media_library'); - $filter = $config->get('display.default.display_options.filters.status_extra'); - $this->assertInternalType('array', $filter); - $this->assertSame('status_extra', $filter['field']); - $this->assertSame('media', $filter['entity_type']); - $this->assertSame('media_status', $filter['plugin_id']); - $this->assertSame('status_extra', $filter['id']); - $this->assertFalse($filter['exposed']); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewTableDisplayTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewTableDisplayTest.php deleted file mode 100644 index 861b610a7f5..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateViewTableDisplayTest.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Tests the media library module updates for the view table display. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateViewTableDisplayTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.media_library-update-view-table-display-2981044.php', - ]; - } - - /** - * Tests the widget_table display is added to the views config. - * - * @see media_library_post_update_table_display() - */ - public function testMediaLibraryViewTableDisplay() { - $grid_prefix = 'display.widget'; - $table_prefix = 'display.widget_table'; - - $config = $this->config('views.view.media_library'); - $this->assertNull($config->get("$grid_prefix.display_options.defaults.css_class")); - $this->assertNull($config->get("$grid_prefix.display_options.css_class")); - $this->assertNull($config->get($table_prefix)); - - $this->runUpdates(); - - $config = $this->config('views.view.media_library'); - - // Assert the CSS classes are updated for the widget display. - $this->assertFalse($config->get("$grid_prefix.display_options.defaults.css_class")); - $this->assertSame('media-library-view js-media-library-view media-library-view--widget', $config->get("$grid_prefix.display_options.css_class")); - $this->assertSame('media-library-item media-library-item--grid js-media-library-item js-click-to-select', $config->get('display.default.display_options.style.options.row_class')); - - // Assert the widget_table display was added correctly. - $this->assertSame('table', $config->get("$table_prefix.display_options.style.type")); - $this->assertSame('media-library-item media-library-item--table js-media-library-item js-click-to-select', $config->get("$table_prefix.display_options.style.options.row_class")); - $this->assertSame('fields', $config->get("$table_prefix.display_options.row.type")); - $this->assertSame(['media_library_select_form', 'thumbnail__target_id', 'name', 'uid', 'changed'], array_keys($config->get("$table_prefix.display_options.fields"))); - - // Assert the CSS classes are added to the widget_table display. - $this->assertFalse($config->get("$table_prefix.display_options.defaults.css_class")); - $this->assertSame('media-library-view js-media-library-view media-library-view--widget', $config->get("$table_prefix.display_options.css_class")); - - // Assert all display options are set correctly on the widget_table display. - $this->assertSame($config->get("$grid_prefix.display_options.filters"), $config->get("$table_prefix.display_options.filters")); - $this->assertSame($config->get("$grid_prefix.display_options.access"), $config->get("$table_prefix.display_options.access")); - $this->assertSame($config->get("$grid_prefix.display_options.sorts"), $config->get("$table_prefix.display_options.sorts")); - $this->assertSame($config->get("$grid_prefix.display_options.pager"), $config->get("$table_prefix.display_options.pager")); - $this->assertSame($config->get("$grid_prefix.display_options.arguments"), $config->get("$table_prefix.display_options.arguments")); - - // Assert the display links are added to the widget and widget_table - // displays. - $this->assertSame('display_link', $config->get("$grid_prefix.display_options.header.display_link_grid.plugin_id")); - $this->assertSame('display_link', $config->get("$grid_prefix.display_options.header.display_link_table.plugin_id")); - $this->assertSame('display_link', $config->get("$table_prefix.display_options.header.display_link_grid.plugin_id")); - $this->assertSame('display_link', $config->get("$table_prefix.display_options.header.display_link_table.plugin_id")); - $this->assertSame('widget', $config->get("$grid_prefix.display_options.header.display_link_grid.display_id")); - $this->assertSame('widget_table', $config->get("$grid_prefix.display_options.header.display_link_table.display_id")); - $this->assertSame('widget', $config->get("$table_prefix.display_options.header.display_link_grid.display_id")); - $this->assertSame('widget_table', $config->get("$table_prefix.display_options.header.display_link_table.display_id")); - } - - /** - * Tests the views config update when the widget display is overridden. - * - * @see media_library_post_update_table_display() - */ - public function testMediaLibraryChangedViewTableDisplay() { - $grid_prefix = 'display.widget'; - $table_prefix = 'display.widget_table'; - - $view = Views::getView('media_library'); - - // The existing 'widget' display could have been overridden. The 'widget' - // and 'widget_table' displays need to have the same display options, so we - // need to verify the overridden settings are correctly set when creating - // the 'widget_table' display. - $view->setDisplay('widget'); - $grid_display = $view->getDisplay('widget'); - - // Change the filters, sorts and pager for the widget display. - $grid_display->overrideOption('filters', [ - 'uid' => [ - 'id' => 'uid', - 'table' => 'media_field_data', - 'field' => 'uid', - 'relationship' => 'none', - 'operator' => '=', - 'exposed' => TRUE, - ], - ]); - $grid_display->overrideOption('sorts', [ - 'name' => [ - 'id' => 'name', - 'table' => 'media_field_data', - 'field' => 'name', - 'relationship' => 'none', - 'order' => 'ASC', - ], - ]); - $grid_display->overrideOption('pager', [ - 'type' => 'full', - 'options' => ['items_per_page' => 10], - ]); - $view->save(); - - $this->runUpdates(); - - $config = $this->config('views.view.media_library'); - - // Assert the CSS classes are updated for the widget display. - $this->assertFalse($config->get("$grid_prefix.display_options.defaults.css_class")); - $this->assertSame('media-library-view js-media-library-view media-library-view--widget', $config->get("$grid_prefix.display_options.css_class")); - $this->assertSame('media-library-item media-library-item--grid js-media-library-item js-click-to-select', $config->get('display.default.display_options.style.options.row_class')); - - // Assert the widget_table display was added correctly. - $this->assertSame('table', $config->get("$table_prefix.display_options.style.type")); - $this->assertSame('media-library-item media-library-item--table js-media-library-item js-click-to-select', $config->get("$table_prefix.display_options.style.options.row_class")); - $this->assertSame('fields', $config->get("$table_prefix.display_options.row.type")); - $this->assertSame(['media_library_select_form', 'thumbnail__target_id', 'name', 'uid', 'changed'], array_keys($config->get("$table_prefix.display_options.fields"))); - - // Assert the CSS classes are added to the widget_table display. - $this->assertFalse($config->get("$table_prefix.display_options.defaults.css_class")); - $this->assertSame('media-library-view js-media-library-view media-library-view--widget', $config->get("$table_prefix.display_options.css_class")); - - // Assert all display options are set correctly on the widget_table display. - $this->assertSame($config->get("$grid_prefix.display_options.filters"), $config->get("$table_prefix.display_options.filters")); - $this->assertSame($config->get("$grid_prefix.display_options.access"), $config->get("$table_prefix.display_options.access")); - $this->assertSame($config->get("$grid_prefix.display_options.sorts"), $config->get("$table_prefix.display_options.sorts")); - $this->assertSame($config->get("$grid_prefix.display_options.pager"), $config->get("$table_prefix.display_options.pager")); - $this->assertSame($config->get("$grid_prefix.display_options.arguments"), $config->get("$table_prefix.display_options.arguments")); - - // Assert the display links are added to the widget and widget_table - // displays. - $this->assertSame('display_link', $config->get("$grid_prefix.display_options.header.display_link_grid.plugin_id")); - $this->assertSame('display_link', $config->get("$grid_prefix.display_options.header.display_link_table.plugin_id")); - $this->assertSame('display_link', $config->get("$table_prefix.display_options.header.display_link_grid.plugin_id")); - $this->assertSame('display_link', $config->get("$table_prefix.display_options.header.display_link_table.plugin_id")); - $this->assertSame('widget', $config->get("$grid_prefix.display_options.header.display_link_grid.display_id")); - $this->assertSame('widget_table', $config->get("$grid_prefix.display_options.header.display_link_table.display_id")); - $this->assertSame('widget', $config->get("$table_prefix.display_options.header.display_link_grid.display_id")); - $this->assertSame('widget_table', $config->get("$table_prefix.display_options.header.display_link_table.display_id")); - } - -} diff --git a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateWidgetViewTest.php b/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateWidgetViewTest.php deleted file mode 100644 index 0e51aea4dca..00000000000 --- a/core/modules/media_library/tests/src/Functional/Update/MediaLibraryUpdateWidgetViewTest.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Drupal\Tests\media_library\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the media library module updates for the widget view. - * - * @group media_library - * @group legacy - */ -class MediaLibraryUpdateWidgetViewTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../../media/tests/fixtures/update/drupal-8.4.0-media_installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.media_library-update-widget-view-3020716.php', - ]; - } - - /** - * Tests that the media library view config is updated. - * - * @see media_library_update_8702() - */ - public function testMediaLibraryViewsConfig() { - $config = $this->config('views.view.media_library'); - $this->assertNull($config->get('display.widget.display_options.defaults.filters')); - $this->assertNull($config->get('display.widget.display_options.defaults.arguments')); - $this->assertArrayNotHasKey('filters', $config->get('display.widget.display_options')); - $this->assertArrayNotHasKey('arguments', $config->get('display.widget.display_options')); - - $this->runUpdates(); - - $config = $this->config('views.view.media_library'); - $this->assertFalse($config->get('display.widget.display_options.defaults.filters')); - $this->assertFalse($config->get('display.widget.display_options.defaults.arguments')); - $this->assertArrayHasKey('filters', $config->get('display.widget.display_options')); - $this->assertArrayHasKey('arguments', $config->get('display.widget.display_options')); - $this->assertSame('1', $config->get('display.widget.display_options.filters.status.value')); - $this->assertTrue($config->get('display.widget.display_options.filters.name.exposed')); - $this->assertSame('ignore', $config->get('display.widget.display_options.arguments.bundle.default_action')); - } - -} diff --git a/core/modules/menu_link_content/menu_link_content.install b/core/modules/menu_link_content/menu_link_content.install index fb9608e9605..6086ac08f59 100644 --- a/core/modules/menu_link_content/menu_link_content.install +++ b/core/modules/menu_link_content/menu_link_content.install @@ -6,27 +6,8 @@ */ /** - * Add the publishing status entity key to custom menu links. + * Implements hook_update_last_removed(). */ -function menu_link_content_update_8601() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('menu_link_content'); - - // Add the published entity key to the menu_link_content entity type. - $entity_keys = $entity_type->getKeys(); - $entity_keys['published'] = 'enabled'; - $entity_type->set('entity_keys', $entity_keys); - $definition_update_manager->updateEntityType($entity_type); - - // @todo The above should be enough, since that is the only definition that - // changed. But \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema varies - // field schema by whether a field is an entity key, so invoke - // EntityDefinitionUpdateManagerInterface::updateFieldStorageDefinition() - // with an unmodified field storage definition to trigger the necessary - // changes. SqlContentEntityStorageSchema::onEntityTypeUpdate() should be - // fixed to automatically handle this. - // @see https://www.drupal.org/node/2554245 - $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('enabled', 'menu_link_content')); - - return t('The publishing status entity key has been added to custom menu links.'); +function menu_link_content_update_last_removed() { + return 8601; } diff --git a/core/modules/menu_link_content/tests/src/Functional/Update/MenuLinkContentUpdateTest.php b/core/modules/menu_link_content/tests/src/Functional/Update/MenuLinkContentUpdateTest.php deleted file mode 100644 index 29df303f6a7..00000000000 --- a/core/modules/menu_link_content/tests/src/Functional/Update/MenuLinkContentUpdateTest.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -namespace Drupal\Tests\menu_link_content\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\user\Entity\User; - -/** - * Tests the upgrade path for custom menu links. - * - * @group menu_link_content - * @group Update - * @group legacy - */ -class MenuLinkContentUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - ]; - } - - /** - * Tests the addition of the publishing status entity key. - * - * @see menu_link_content_update_8601() - */ - public function testPublishedEntityKeyAddition() { - $this->runUpdates(); - - // Log in as user 1. - $account = User::load(1); - $account->passRaw = 'drupal'; - $this->drupalLogin($account); - - // Make sure our custom menu link exists. - $assert_session = $this->assertSession(); - $this->drupalGet('admin/structure/menu/item/1/edit'); - $assert_session->checkboxChecked('edit-enabled-value'); - - // Check that custom menu links can be created, saved and then loaded. - $storage = \Drupal::entityTypeManager()->getStorage('menu_link_content'); - /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $menu_link */ - $menu_link = $storage->create([ - 'menu_name' => 'main', - 'link' => 'route:user.page', - 'title' => 'Pineapple', - ]); - $menu_link->save(); - - $menu_link = $storage->loadUnchanged($menu_link->id()); - - $this->assertEquals('main', $menu_link->getMenuName()); - $this->assertEquals('Pineapple', $menu_link->label()); - $this->assertEquals('route:user.page', $menu_link->link->uri); - $this->assertTrue($menu_link->isPublished()); - } - - /** - * Tests the conversion of custom menu links to be revisionable. - * - * @see menu_link_content_post_update_make_menu_link_content_revisionable() - */ - public function testConversionToRevisionable() { - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('menu_link_content'); - $this->assertFalse($entity_type->isRevisionable()); - - $this->runUpdates(); - - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('menu_link_content'); - $this->assertTrue($entity_type->isRevisionable()); - - // Log in as user 1. - $account = User::load(1); - $account->passRaw = 'drupal'; - $this->drupalLogin($account); - - // Make sure our custom menu link exists. - $assert_session = $this->assertSession(); - $this->drupalGet('admin/structure/menu/item/1/edit'); - $assert_session->checkboxChecked('edit-enabled-value'); - - // Check that custom menu links can be created, saved and then loaded. - $storage = \Drupal::entityTypeManager()->getStorage('menu_link_content'); - /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $menu_link */ - $menu_link = $storage->create([ - 'menu_name' => 'main', - 'link' => 'route:user.page', - 'title' => 'Pineapple', - ]); - $menu_link->save(); - - $storage->resetCache(); - $menu_link = $storage->loadRevision($menu_link->getRevisionId()); - - $this->assertEquals('main', $menu_link->getMenuName()); - $this->assertEquals('Pineapple', $menu_link->label()); - $this->assertEquals('route:user.page', $menu_link->link->uri); - $this->assertTrue($menu_link->isPublished()); - } - - /** - * {@inheritdoc} - */ - protected function replaceUser1() { - // Do not replace the user from our dump. - } - -} diff --git a/core/modules/migrate/migrate.install b/core/modules/migrate/migrate.install index 064b95adc84..c701034c81c 100644 --- a/core/modules/migrate/migrate.install +++ b/core/modules/migrate/migrate.install @@ -6,13 +6,8 @@ */ /** - * Remove load plugin references from existing migrations. + * Implements hook_update_last_removed(). */ -function migrate_update_8001() { - $config_factory = \Drupal::configFactory(); - foreach ($config_factory->listAll('migrate.migration.') as $migration_config_name) { - $migration = $config_factory->getEditable($migration_config_name); - $migration->clear('load'); - $migration->save(TRUE); - } +function migrate_update_last_removed() { + return 8001; } diff --git a/core/modules/migrate_drupal/migrate_drupal.install b/core/modules/migrate_drupal/migrate_drupal.install index 820bcdc8706..5d83624f415 100644 --- a/core/modules/migrate_drupal/migrate_drupal.install +++ b/core/modules/migrate_drupal/migrate_drupal.install @@ -6,28 +6,8 @@ */ /** - * Creates migrate_drupal.settings config object. + * Implements hook_update_last_removed(). */ -function migrate_drupal_update_8501() { - \Drupal::configFactory() - ->getEditable('migrate_drupal.settings') - ->set('enforce_source_module_tags', ['Drupal 6', 'Drupal 7']) - ->save(); -} - -/** - * Sets the follow-up migration tags. - */ -function migrate_drupal_update_8502() { - \Drupal::configFactory() - ->getEditable('migrate_drupal.settings') - ->set('follow_up_migration_tags', ['Follow-up migration']) - ->save(); -} - -/** - * Install migrate_drupal_multilingual since migrate_drupal is installed. - */ -function migrate_drupal_update_8601() { - \Drupal::service('module_installer')->install(['migrate_drupal_multilingual']); +function migrate_drupal_update_last_removed() { + return 8601; } diff --git a/core/modules/node/node.install b/core/modules/node/node.install index e05c841128f..676e05e2b6c 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -7,7 +7,6 @@ use Drupal\Core\Url; use Drupal\Core\Database\Database; -use Drupal\Core\Field\BaseFieldDefinition; use Drupal\user\RoleInterface; /** @@ -156,128 +155,8 @@ function node_uninstall() { } /** - * Add 'revision_translation_affected' field to 'node' entities. + * Implements hook_update_last_removed(). */ -function node_update_8001() { - // Install the definition that this field had in - // \Drupal\node\Entity\Node::baseFieldDefinitions() - // at the time that this update function was written. If/when code is - // deployed that changes that definition, the corresponding module must - // implement an update function that invokes - // \Drupal::entityDefinitionUpdateManager()->updateFieldStorageDefinition() - // with the new definition. - $storage_definition = BaseFieldDefinition::create('boolean') - ->setLabel(t('Revision translation affected')) - ->setDescription(t('Indicates if the last edit of a translation belongs to current revision.')) - ->setReadOnly(TRUE) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE); - - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('revision_translation_affected', 'node', 'node', $storage_definition); -} - -/** - * Remove obsolete indexes from the node schema. - */ -function node_update_8002() { - // The "node__default_langcode" and "node_field__langcode" indexes were - // removed from \Drupal\node\NodeStorageSchema in - // https://www.drupal.org/node/2261669, but this update function wasn't - // added until https://www.drupal.org/node/2542748. Regenerate the related - // schemas to ensure they match the currently expected status. - $manager = \Drupal::entityDefinitionUpdateManager(); - // Regenerate entity type indexes, this should drop "node__default_langcode". - $manager->updateEntityType($manager->getEntityType('node')); - // Regenerate "langcode" indexes, this should drop "node_field__langcode". - $manager->updateFieldStorageDefinition($manager->getFieldStorageDefinition('langcode', 'node')); -} - -/** - * Promote 'status' and 'uid' fields to entity keys. - */ -function node_update_8003() { - // The 'status' and 'uid' fields were added to the 'entity_keys' annotation - // of \Drupal\node\Entity\Node in https://www.drupal.org/node/2498919, but - // this update function wasn't added until - // https://www.drupal.org/node/2542748. - $manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $manager->getEntityType('node'); - $entity_keys = $entity_type->getKeys(); - $entity_keys['status'] = 'status'; - $entity_keys['uid'] = 'uid'; - $entity_type->set('entity_keys', $entity_keys); - $manager->updateEntityType($entity_type); - - // @todo The above should be enough, since that is the only definition that - // changed. But \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema varies - // field schema by whether a field is an entity key, so invoke - // EntityDefinitionUpdateManagerInterface::updateFieldStorageDefinition() - // with an unmodified field storage definition to trigger the necessary - // changes. SqlContentEntityStorageSchema::onEntityTypeUpdate() should be - // fixed to automatically handle this. - // See https://www.drupal.org/node/2554245. - foreach (['status', 'uid'] as $field_name) { - $manager->updateFieldStorageDefinition($manager->getFieldStorageDefinition($field_name, 'node')); - } -} - -/** - * Change {node_access}.fallback from an int to a tinyint as it is a boolean. - */ -function node_update_8300() { - Database::getConnection()->schema()->changeField('node_access', 'fallback', 'fallback', [ - 'description' => 'Boolean indicating whether this record should be used as a fallback if a language condition is not provided.', - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 1, - 'size' => 'tiny', - ]); -} - -/** - * Set the 'published' entity key. - */ -function node_update_8301() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('node'); - $keys = $entity_type->getKeys(); - $keys['published'] = 'status'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); -} - -/** - * Fix realm column description on the node_access table. - */ -function node_update_8400() { - $schema = drupal_get_module_schema('node', 'node_access'); - $schema['fields']['realm']['description'] = 'The realm in which the user must possess the grant ID. Modules can define one or more realms by implementing hook_node_grants().'; - Database::getConnection()->schema()->changeField('node_access', 'realm', 'realm', $schema['fields']['realm']); -} - -/** - * Run a node access rebuild, if required. - */ -function node_update_8401() { - // Get the list of node access modules. - $modules = \Drupal::moduleHandler()->getImplementations('node_grants'); - // If multilingual usage, then rebuild node access. - if (count($modules) > 0 && \Drupal::languageManager()->isMultilingual()) { - node_access_needs_rebuild(TRUE); - } -} - -/** - * Set the 'owner' entity key and update the field. - */ -function node_update_8700() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('node'); - $keys = $entity_type->getKeys(); - $keys['owner'] = 'uid'; - $entity_type->set('entity_keys', $keys); - $definition_update_manager->updateEntityType($entity_type); - $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'node')); +function node_update_last_removed() { + return 8700; } diff --git a/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php b/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php deleted file mode 100644 index 00c7e8c07a2..00000000000 --- a/core/modules/node/tests/src/Functional/Update/NodeUpdateTest.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php - -namespace Drupal\Tests\node\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that node settings are properly updated during database updates. - * - * @group node - * @group legacy - */ -class NodeUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - ]; - } - - /** - * Tests that the node entity type has a 'published' entity key. - * - * @see node_update_8301() - */ - public function testPublishedEntityKey() { - // Check that the 'published' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('node'); - $this->assertFalse($entity_type->getKey('published')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('node'); - $this->assertEqual('status', $entity_type->getKey('published')); - } - - /** - * Tests that the node entity form has the status checkbox. - * - * @see node_post_update_configure_status_field_widget() - */ - public function testStatusCheckbox() { - // Run updates. - $this->runUpdates(); - - $query = \Drupal::entityQuery('entity_form_display') - ->condition('targetEntityType', 'node'); - $ids = $query->execute(); - $form_displays = EntityFormDisplay::loadMultiple($ids); - - /** - * @var string $id - * @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display - */ - foreach ($form_displays as $id => $form_display) { - $component = $form_display->getComponent('status'); - $this->assertEqual('boolean_checkbox', $component['type']); - $this->assertEqual(['display_label' => TRUE], $component['settings']); - } - } - - /** - * Tests that the node entity type has an 'owner' entity key. - * - * @see node_update_8700() - */ - public function testOwnerEntityKey() { - // Check that the 'owner' entity key does not exist prior to the update. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('node'); - $this->assertFalse($entity_type->getKey('owner')); - - // Run updates. - $this->runUpdates(); - - // Check that the entity key exists and it has the correct value. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('node'); - $this->assertEquals('uid', $entity_type->getKey('owner')); - } - -} diff --git a/core/modules/path/path.install b/core/modules/path/path.install index fba049eac91..78efdc997d0 100644 --- a/core/modules/path/path.install +++ b/core/modules/path/path.install @@ -6,18 +6,8 @@ */ /** - * Change the path field to computed for node and taxonomy_term. + * Implements hook_update_last_removed(). */ -function path_update_8200() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - foreach (['node', 'taxonomy_term'] as $entity_type_id) { - if ($entity_definition_update_manager->getEntityType($entity_type_id)) { - // Computed field definitions are not tracked by the entity definition - // update manager, so remove them. - $storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('path', $entity_type_id); - if ($storage_definition) { - $entity_definition_update_manager->uninstallFieldStorageDefinition($storage_definition); - } - } - } +function path_update_last_removed() { + return 8200; } diff --git a/core/modules/responsive_image/tests/fixtures/update/drupal-8.responsive_image-enabled.php b/core/modules/responsive_image/tests/fixtures/update/drupal-8.responsive_image-enabled.php deleted file mode 100644 index a23eea79139..00000000000 --- a/core/modules/responsive_image/tests/fixtures/update/drupal-8.responsive_image-enabled.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'responsive_image', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'responsive_image') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['responsive_image'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -$connection->merge('key_value') - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'responsive_image_style.entity_type') - ->fields([ - 'value' => 'O:42:"Drupal\Core\Config\Entity\ConfigEntityType":44:{s:16:" * config_prefix";s:6:"styles";s:15:" * static_cache";b:0;s:14:" * lookup_keys";a:1:{i:0;s:4:"uuid";}s:16:" * config_export";a:5:{i:0;s:2:"id";i:1;s:5:"label";i:2;s:20:"image_style_mappings";i:3;s:16:"breakpoint_group";i:4;s:20:"fallback_image_style";}s:21:" * mergedConfigExport";a:0:{}s:15:" * render_cache";b:1;s:19:" * persistent_cache";b:1;s:14:" * entity_keys";a:8:{s:2:"id";s:2:"id";s:5:"label";s:5:"label";s:8:"revision";s:0:"";s:6:"bundle";s:0:"";s:8:"langcode";s:8:"langcode";s:16:"default_langcode";s:16:"default_langcode";s:29:"revision_translation_affected";s:29:"revision_translation_affected";s:4:"uuid";s:4:"uuid";}s:5:" * id";s:22:"responsive_image_style";s:16:" * originalClass";s:51:"Drupal\responsive_image\Entity\ResponsiveImageStyle";s:11:" * handlers";a:4:{s:12:"list_builder";s:55:"Drupal\responsive_image\ResponsiveImageStyleListBuilder";s:4:"form";a:4:{s:4:"edit";s:48:"Drupal\responsive_image\ResponsiveImageStyleForm";s:3:"add";s:48:"Drupal\responsive_image\ResponsiveImageStyleForm";s:6:"delete";s:35:"Drupal\Core\Entity\EntityDeleteForm";s:9:"duplicate";s:48:"Drupal\responsive_image\ResponsiveImageStyleForm";}s:6:"access";s:45:"Drupal\Core\Entity\EntityAccessControlHandler";s:7:"storage";s:45:"Drupal\Core\Config\Entity\ConfigEntityStorage";}s:19:" * admin_permission";s:28:"administer responsive images";s:25:" * permission_granularity";s:11:"entity_type";s:8:" * links";a:4:{s:9:"edit-form";s:67:"/admin/config/media/responsive-image-style/{responsive_image_style}";s:14:"duplicate-form";s:77:"/admin/config/media/responsive-image-style/{responsive_image_style}/duplicate";s:11:"delete-form";s:74:"/admin/config/media/responsive-image-style/{responsive_image_style}/delete";s:10:"collection";s:42:"/admin/config/media/responsive-image-style";}s:17:" * label_callback";N;s:21:" * bundle_entity_type";N;s:12:" * bundle_of";N;s:15:" * bundle_label";N;s:13:" * base_table";N;s:22:" * revision_data_table";N;s:17:" * revision_table";N;s:13:" * data_table";N;s:11:" * internal";b:0;s:15:" * translatable";b:0;s:19:" * show_revision_ui";b:0;s:8:" * label";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:22:"Responsive image style";s:12:" * arguments";a:0:{}s:10:" * options";a:0:{}}s:19:" * label_collection";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:23:"Responsive image styles";s:12:" * arguments";a:0:{}s:10:" * options";a:0:{}}s:17:" * label_singular";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:22:"responsive image style";s:12:" * arguments";a:0:{}s:10:" * options";a:0:{}}s:15:" * label_plural";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:23:"responsive image styles";s:12:" * arguments";a:0:{}s:10:" * options";a:0:{}}s:14:" * label_count";a:3:{s:8:"singular";s:29:"@count responsive image style";s:6:"plural";s:30:"@count responsive image styles";s:7:"context";N;}s:15:" * uri_callback";N;s:8:" * group";s:13:"configuration";s:14:" * group_label";O:48:"Drupal\Core\StringTranslation\TranslatableMarkup":3:{s:9:" * string";s:13:"Configuration";s:12:" * arguments";a:0:{}s:10:" * options";a:1:{s:7:"context";s:17:"Entity type group";}}s:22:" * field_ui_base_route";N;s:26:" * common_reference_target";b:0;s:22:" * list_cache_contexts";a:0:{}s:18:" * list_cache_tags";a:1:{i:0;s:34:"config:responsive_image_style_list";}s:14:" * constraints";a:0:{}s:13:" * additional";a:0:{}s:8:" * class";s:51:"Drupal\responsive_image\Entity\ResponsiveImageStyle";s:11:" * provider";s:16:"responsive_image";s:14:" * _serviceIds";a:0:{}s:18:" * _entityStorages";a:0:{}s:20:" * stringTranslation";N;}', - 'name' => 'responsive_image_style.entity_type', - 'collection' => 'entity.definitions.installed', - ]) - ->execute(); diff --git a/core/modules/responsive_image/tests/src/Functional/Update/ResponsiveImageUpdateTest.php b/core/modules/responsive_image/tests/src/Functional/Update/ResponsiveImageUpdateTest.php deleted file mode 100644 index e14f58d696a..00000000000 --- a/core/modules/responsive_image/tests/src/Functional/Update/ResponsiveImageUpdateTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Drupal\Tests\responsive_image\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityViewDisplay; -use Drupal\Core\Serialization\Yaml; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests responsive image module updates. - * - * @group responsive_image - * @group legacy - */ -class ResponsiveImageUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.responsive_image-enabled.php', - ]; - } - - /** - * Tests post-update responsive_image_post_update_dependency(). - * - * @see responsive_image_post_update_dependency() - */ - public function testPostUpdateDependency() { - // Installing the 'wide' responsive image style. - $wide_image_style = Yaml::decode(file_get_contents(__DIR__ . '/../../../../../../profiles/standard/config/optional/responsive_image.styles.wide.yml')); - $this->config('responsive_image.styles.wide')->setData($wide_image_style)->save(TRUE); - - // Change 'field_image' formatter to a responsive image formatter. - $options = [ - 'type' => 'responsive_image', - 'label' => 'hidden', - 'settings' => ['responsive_image_style' => 'wide', 'image_link' => ''], - 'third_party_settings' => [], - ]; - $display = $this->config('core.entity_view_display.node.article.default'); - $display->set('content.field_image', $options)->save(TRUE); - - // Check that there's no dependency to 'responsive_image.styles.wide'. - $dependencies = $display->get('dependencies.config') ?: []; - $this->assertFalse(in_array('responsive_image.styles.wide', $dependencies)); - - // Run updates. - $this->runUpdates(); - - /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $view_display */ - $view_display = EntityViewDisplay::load('node.article.default'); - $dependencies = $view_display->getDependencies() + ['config' => []]; - // Check that post-update added a 'responsive_image.styles.wide' dependency. - $this->assertTrue(in_array('responsive_image.styles.wide', $dependencies['config'])); - } - -} diff --git a/core/modules/rest/rest.install b/core/modules/rest/rest.install index 5fdb5cc9e28..776f4591098 100644 --- a/core/modules/rest/rest.install +++ b/core/modules/rest/rest.install @@ -5,101 +5,9 @@ * Install, update and uninstall functions for the rest module. */ -use Drupal\Core\Config\Entity\ConfigEntityType; -use Drupal\Core\StringTranslation\TranslatableMarkup; - -/** - * Install the REST config entity type and fix old settings-based config. - * - * @see rest_post_update_create_rest_resource_config_entities() - */ -function rest_update_8201() { - \Drupal::entityDefinitionUpdateManager()->installEntityType(new ConfigEntityType([ - 'id' => 'rest_resource_config', - 'label' => new TranslatableMarkup('REST resource configuration'), - 'config_prefix' => 'resource', - 'admin_permission' => 'administer rest resources', - 'label_callback' => 'getLabelFromPlugin', - 'entity_keys' => ['id' => 'id'], - 'config_export' => [ - 'id', - 'plugin_id', - 'granularity', - 'configuration', - ], - ])); - \Drupal::state()->set('rest_update_8201_resources', \Drupal::config('rest.settings')->get('resources')); - \Drupal::configFactory()->getEditable('rest.settings') - ->clear('resources') - ->save(); -} - /** - * Re-save all views with a REST display to add new auth defaults. + * Implements hook_update_last_removed(). */ -function rest_update_8202() { - $config_factory = \Drupal::configFactory(); - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $save = FALSE; - $view = $config_factory->getEditable($view_config_name); - $displays = $view->get('display'); - foreach ($displays as $display_name => &$display) { - if ($display['display_plugin'] == 'rest_export') { - if (!isset($display['display_options']['auth'])) { - $display['display_options']['auth'] = []; - $save = TRUE; - } - } - } - if ($save) { - $view->set('display', $displays); - $view->save(TRUE); - } - } -} - -/** - * Enable BC for EntityResource: continue to use permissions. - */ -function rest_update_8203() { - $config_factory = \Drupal::configFactory(); - $rest_settings = $config_factory->getEditable('rest.settings'); - $rest_settings->set('bc_entity_resource_permissions', TRUE) - ->save(TRUE); -} - -/** - * Ensure the right REST authentication method is used. - * - * This fixes the bug in https://www.drupal.org/node/2825204. - */ -function rest_update_8401() { - $config_factory = \Drupal::configFactory(); - $auth_providers = \Drupal::service('authentication_collector')->getSortedProviders(); - $process_auth = function ($auth_option) use ($auth_providers) { - foreach ($auth_providers as $provider_id => $provider_data) { - // The provider belongs to the module that declares it as a service. - if (strtok($provider_data->_serviceId, '.') === $auth_option) { - return $provider_id; - } - } - - return $auth_option; - }; - - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $save = FALSE; - $view = $config_factory->getEditable($view_config_name); - $displays = $view->get('display'); - foreach ($displays as $display_name => $display) { - if ('rest_export' === $display['display_plugin'] && !empty($display['display_options']['auth'])) { - $displays[$display_name]['display_options']['auth'] = array_map($process_auth, $display['display_options']['auth']); - $save = TRUE; - } - } - if ($save) { - $view->set('display', $displays); - $view->save(TRUE); - } - } +function rest_update_last_removed() { + return 8401; } diff --git a/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_post_update_resource_granularity.php b/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_post_update_resource_granularity.php Binary files differdeleted file mode 100644 index aa94c63e555..00000000000 --- a/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_post_update_resource_granularity.php +++ /dev/null diff --git a/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_update_8201.php b/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_update_8201.php deleted file mode 100644 index ac9b19119ca..00000000000 --- a/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_update_8201.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of rest_update_8201(). - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'rest', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['basic_auth'] = 0; -$extensions['module']['rest'] = 0; -$extensions['module']['serialization'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Install the rest configuration. -$config = [ - 'resources' => [ - 'entity:node' => [ - 'GET' => [ - 'supported_formats' => ['json'], - 'supported_auth' => ['basic_auth'], - ], - ], - ], - 'link_domain' => NULL, -]; -$data = $connection->insert('config') - ->fields([ - 'name' => 'rest.settings', - 'data' => serialize($config), - 'collection' => '', - ]) - ->execute(); diff --git a/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_update_8203.php b/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_update_8203.php deleted file mode 100644 index c20ba9531d4..00000000000 --- a/core/modules/rest/tests/fixtures/update/drupal-8.rest-rest_update_8203.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of rest_update_8203(). - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'rest', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['rest'] = 0; -$extensions['module']['serialization'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Install the rest configuration. -$config = [ - 'resources' => [ - 'entity:node' => [ - 'GET' => [ - 'supported_formats' => ['json'], - 'supported_auth' => ['basic_auth'], - ], - ], - ], - 'link_domain' => NULL, -]; -$data = $connection->insert('config') - ->fields([ - 'name' => 'rest.settings', - 'data' => serialize($config), - 'collection' => '', - ]) - ->execute(); diff --git a/core/modules/rest/tests/fixtures/update/rest-export-with-authentication-correction.php b/core/modules/rest/tests/fixtures/update/rest-export-with-authentication-correction.php deleted file mode 100644 index 59d93e0ecac..00000000000 --- a/core/modules/rest/tests/fixtures/update/rest-export-with-authentication-correction.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/** - * @file - * Test fixture for \Drupal\Tests\rest\Functional\Update\RestExportAuthCorrectionUpdateTest. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'rest', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['rest'] = 0; -$extensions['module']['serialization'] = 0; -$extensions['module']['basic_auth'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -$connection->insert('config') - ->fields([ - 'name' => 'rest.settings', - 'data' => serialize([ - 'link_domain' => '~', - ]), - 'collection' => '', - ]) - ->execute(); - -$connection->insert('config') - ->fields([ - 'name' => 'views.view.rest_export_with_authorization_correction', - ]) - ->execute(); - -$connection->merge('config') - ->condition('name', 'views.view.rest_export_with_authorization_correction') - ->condition('collection', '') - ->fields([ - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/modules/views_test_config/test_views/views.view.rest_export_with_authorization_correction.yml'))), - ]) - ->execute(); diff --git a/core/modules/rest/tests/fixtures/update/rest-export-with-authentication.php b/core/modules/rest/tests/fixtures/update/rest-export-with-authentication.php deleted file mode 100644 index 7d72d492767..00000000000 --- a/core/modules/rest/tests/fixtures/update/rest-export-with-authentication.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/** - * @file - * Test fixture for \Drupal\rest\Tests\Update\RestExportAuthUpdateTest. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); -$config = $connection; - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'rest', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['rest'] = 0; -$extensions['module']['serialization'] = 0; -$extensions['module']['basic_auth'] = 0; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -$config = [ - 'link_domain' => '~', -]; -$data = $connection->insert('config') - ->fields([ - 'name' => 'rest.settings', - 'data' => serialize($config), - 'collection' => '', - ]) - ->execute(); - -$connection->insert('config') - ->fields([ - 'name' => 'views.view.rest_export_with_authorization', - ]) - ->execute(); - -$connection->merge('config') - ->condition('name', 'views.view.rest_export_with_authorization') - ->condition('collection', '') - ->fields([ - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/modules/views_test_config/test_views/views.view.rest_export_with_authorization.yml'))), - ]) - ->execute(); diff --git a/core/modules/rest/tests/fixtures/update/rest.resource.entity.comment_2721595.yml b/core/modules/rest/tests/fixtures/update/rest.resource.entity.comment_2721595.yml deleted file mode 100644 index 7e86bab477f..00000000000 --- a/core/modules/rest/tests/fixtures/update/rest.resource.entity.comment_2721595.yml +++ /dev/null @@ -1,32 +0,0 @@ -id: entity.comment -plugin_id: 'entity:comment' -granularity: method -configuration: - GET: - supported_formats: - - hal_json - # This resource has a method-specific format. - # @see \Drupal\rest\Tests\Update\ResourceGranularityUpdateTest - - xml - supported_auth: - - basic_auth - POST: - supported_formats: - - hal_json - supported_auth: - - basic_auth - PATCH: - supported_formats: - - hal_json - supported_auth: - - basic_auth - DELETE: - supported_formats: - - hal_json - supported_auth: - - basic_auth -dependencies: - module: - - node - - basic_auth - - hal diff --git a/core/modules/rest/tests/fixtures/update/rest.resource.entity.node_2721595.yml b/core/modules/rest/tests/fixtures/update/rest.resource.entity.node_2721595.yml deleted file mode 100644 index 0cf4d789894..00000000000 --- a/core/modules/rest/tests/fixtures/update/rest.resource.entity.node_2721595.yml +++ /dev/null @@ -1,29 +0,0 @@ -id: entity.node -plugin_id: 'entity:node' -granularity: method -configuration: - GET: - supported_formats: - - hal_json - supported_auth: - - basic_auth - POST: - supported_formats: - - hal_json - supported_auth: - - basic_auth - PATCH: - supported_formats: - - hal_json - supported_auth: - - basic_auth - DELETE: - supported_formats: - - hal_json - supported_auth: - - basic_auth -dependencies: - module: - - node - - basic_auth - - hal diff --git a/core/modules/rest/tests/fixtures/update/rest.resource.entity.user_2721595.yml b/core/modules/rest/tests/fixtures/update/rest.resource.entity.user_2721595.yml deleted file mode 100644 index 593a260b681..00000000000 --- a/core/modules/rest/tests/fixtures/update/rest.resource.entity.user_2721595.yml +++ /dev/null @@ -1,32 +0,0 @@ -id: entity.user -plugin_id: 'entity:user' -granularity: method -configuration: - GET: - supported_formats: - - hal_json - supported_auth: - - basic_auth - # This resource has a method-specific authentication. - # @see \Drupal\rest\Tests\Update\ResourceGranularityUpdateTest - - oauth - POST: - supported_formats: - - hal_json - supported_auth: - - basic_auth - PATCH: - supported_formats: - - hal_json - supported_auth: - - basic_auth - DELETE: - supported_formats: - - hal_json - supported_auth: - - basic_auth -dependencies: - module: - - node - - basic_auth - - hal diff --git a/core/modules/rest/tests/src/Functional/Update/EntityResourcePermissionsUpdateTest.php b/core/modules/rest/tests/src/Functional/Update/EntityResourcePermissionsUpdateTest.php deleted file mode 100644 index e2b322ac5de..00000000000 --- a/core/modules/rest/tests/src/Functional/Update/EntityResourcePermissionsUpdateTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Drupal\Tests\rest\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\rest\RestPermissions; - -/** - * Tests that existing sites continue to use permissions for EntityResource. - * - * @see https://www.drupal.org/node/2664780 - * - * @group rest - * @group legacy - */ -class EntityResourcePermissionsUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['rest', 'serialization']; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.rest-rest_update_8203.php', - ]; - } - - /** - * Tests rest_update_8203(). - */ - public function testBcEntityResourcePermissionSettingAdded() { - // Make sure we have the expected values before the update. - $rest_settings = $this->config('rest.settings'); - $this->assertFalse(array_key_exists('bc_entity_resource_permissions', $rest_settings->getRawData())); - - // We can not use the 'user.permissions' service here because some - // permissions include generated URLs inside their description, thus - // requiring the path alias system, which is not guaranteed to be working - // before running the database updates. - $rest_permissions_callback = \Drupal::service('controller_resolver')->getControllerFromDefinition(RestPermissions::class . '::permissions'); - $rest_permissions = array_keys(call_user_func($rest_permissions_callback)); - $this->assertEquals([], $rest_permissions); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $rest_settings = $this->config('rest.settings'); - $this->assertTrue(array_key_exists('bc_entity_resource_permissions', $rest_settings->getRawData())); - $this->assertTrue($rest_settings->get('bc_entity_resource_permissions')); - - $rest_permissions_callback = \Drupal::service('controller_resolver')->getControllerFromDefinition(RestPermissions::class . '::permissions'); - $rest_permissions = array_keys(call_user_func($rest_permissions_callback)); - $this->assertEquals(['restful get entity:node', 'restful post entity:node', 'restful delete entity:node', 'restful patch entity:node'], $rest_permissions); - } - -} diff --git a/core/modules/rest/tests/src/Functional/Update/ResourceGranularityUpdateTest.php b/core/modules/rest/tests/src/Functional/Update/ResourceGranularityUpdateTest.php deleted file mode 100644 index 57d9c1dc27e..00000000000 --- a/core/modules/rest/tests/src/Functional/Update/ResourceGranularityUpdateTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -namespace Drupal\Tests\rest\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests method-granularity REST config is simplified to resource-granularity. - * - * @see https://www.drupal.org/node/2721595 - * @see rest_post_update_resource_granularity() - * - * @group rest - * @group legacy - */ -class ResourceGranularityUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['rest', 'serialization']; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.rest-rest_post_update_resource_granularity.php', - ]; - } - - /** - * Tests rest_post_update_simplify_resource_granularity(). - */ - public function testMethodGranularityConvertedToResourceGranularity() { - /** @var \Drupal\Core\Entity\EntityStorageInterface $resource_config_storage */ - $resource_config_storage = $this->container->get('entity_type.manager')->getStorage('rest_resource_config'); - - // Make sure we have the expected values before the update. - $resource_config_entities = $resource_config_storage->loadMultiple(); - $this->assertIdentical(['entity.comment', 'entity.node', 'entity.user'], array_keys($resource_config_entities)); - $this->assertIdentical('method', $resource_config_entities['entity.node']->get('granularity')); - $this->assertIdentical('method', $resource_config_entities['entity.comment']->get('granularity')); - $this->assertIdentical('method', $resource_config_entities['entity.user']->get('granularity')); - - // Read the existing 'entity:comment' and 'entity:user' resource - // configuration so we can verify it after the update. - $comment_resource_configuration = $resource_config_entities['entity.comment']->get('configuration'); - $user_resource_configuration = $resource_config_entities['entity.user']->get('configuration'); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $resource_config_entities = $resource_config_storage->loadMultiple(); - $this->assertIdentical(['entity.comment', 'entity.node', 'entity.user'], array_keys($resource_config_entities)); - // 'entity:node' should be updated. - $this->assertIdentical('resource', $resource_config_entities['entity.node']->get('granularity')); - $this->assertidentical($resource_config_entities['entity.node']->get('configuration'), [ - 'methods' => ['GET', 'POST', 'PATCH', 'DELETE'], - 'formats' => ['hal_json'], - 'authentication' => ['basic_auth'], - ]); - // 'entity:comment' should be unchanged. - $this->assertIdentical('method', $resource_config_entities['entity.comment']->get('granularity')); - $this->assertIdentical($comment_resource_configuration, $resource_config_entities['entity.comment']->get('configuration')); - // 'entity:user' should be unchanged. - $this->assertIdentical('method', $resource_config_entities['entity.user']->get('granularity')); - $this->assertIdentical($user_resource_configuration, $resource_config_entities['entity.user']->get('configuration')); - } - -} diff --git a/core/modules/rest/tests/src/Functional/Update/RestConfigurationEntitiesUpdateTest.php b/core/modules/rest/tests/src/Functional/Update/RestConfigurationEntitiesUpdateTest.php deleted file mode 100644 index a0937dbfda5..00000000000 --- a/core/modules/rest/tests/src/Functional/Update/RestConfigurationEntitiesUpdateTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Drupal\Tests\rest\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\rest\RestResourceConfigInterface; - -/** - * Tests that rest.settings is converted to rest_resource_config entities. - * - * @see https://www.drupal.org/node/2308745 - * @see rest_update_8201() - * @see rest_post_update_create_rest_resource_config_entities() - * - * @group rest - * @group legacy - */ -class RestConfigurationEntitiesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['rest', 'serialization']; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.rest-rest_update_8201.php', - ]; - } - - /** - * Tests rest_update_8201(). - */ - public function testResourcesConvertedToConfigEntities() { - /** @var \Drupal\Core\Entity\EntityStorageInterface $resource_config_storage */ - $resource_config_storage = $this->container->get('entity_type.manager')->getStorage('rest_resource_config'); - - // Make sure we have the expected values before the update. - $rest_settings = $this->config('rest.settings'); - $this->assertTrue(array_key_exists('resources', $rest_settings->getRawData())); - $this->assertTrue(array_key_exists('entity:node', $rest_settings->getRawData()['resources'])); - $resource_config_entities = $resource_config_storage->loadMultiple(); - $this->assertIdentical([], array_keys($resource_config_entities)); - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $rest_settings = $this->config('rest.settings'); - $this->assertFalse(array_key_exists('resources', $rest_settings->getRawData())); - $resource_config_entities = $resource_config_storage->loadMultiple(); - $this->assertIdentical(['entity.node'], array_keys($resource_config_entities)); - $node_resource_config_entity = $resource_config_entities['entity.node']; - $this->assertIdentical(RestResourceConfigInterface::RESOURCE_GRANULARITY, $node_resource_config_entity->get('granularity')); - $this->assertIdentical([ - 'methods' => ['GET'], - 'formats' => ['json'], - 'authentication' => ['basic_auth'], - ], $node_resource_config_entity->get('configuration')); - $this->assertIdentical(['module' => ['basic_auth', 'node', 'serialization']], $node_resource_config_entity->getDependencies()); - } - -} diff --git a/core/modules/rest/tests/src/Functional/Update/RestExportAuthCorrectionUpdateTest.php b/core/modules/rest/tests/src/Functional/Update/RestExportAuthCorrectionUpdateTest.php deleted file mode 100644 index 161414c9560..00000000000 --- a/core/modules/rest/tests/src/Functional/Update/RestExportAuthCorrectionUpdateTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Drupal\Tests\rest\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Ensures that update hook is run properly for REST Export config. - * - * @group legacy - */ -class RestExportAuthCorrectionUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/rest-export-with-authentication-correction.php', - ]; - } - - /** - * Ensures that update hook is run for "rest" module. - */ - public function testUpdate() { - $this->runUpdates(); - - // Get particular view. - $view = \Drupal::entityTypeManager()->getStorage('view')->load('rest_export_with_authorization_correction'); - $displays = $view->get('display'); - $this->assertIdentical($displays['rest_export_1']['display_options']['auth'], ['cookie'], 'Cookie is used for authentication'); - } - -} diff --git a/core/modules/rest/tests/src/Functional/Update/RestExportAuthUpdateTest.php b/core/modules/rest/tests/src/Functional/Update/RestExportAuthUpdateTest.php deleted file mode 100644 index 6b4dad17d2d..00000000000 --- a/core/modules/rest/tests/src/Functional/Update/RestExportAuthUpdateTest.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Drupal\Tests\rest\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Ensures that update hook is run properly for REST Export config. - * - * @group Update - * @group legacy - */ -class RestExportAuthUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/rest-export-with-authentication.php', - ]; - } - - /** - * Ensures that update hook is run for rest module. - */ - public function testUpdate() { - $this->runUpdates(); - - // Get particular view. - $view = \Drupal::entityTypeManager()->getStorage('view')->load('rest_export_with_authorization'); - $displays = $view->get('display'); - $this->assertIdentical($displays['rest_export_1']['display_options']['auth']['basic_auth'], 'basic_auth', 'Basic authentication is set as authentication method.'); - } - -} diff --git a/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php b/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php deleted file mode 100644 index d11ef0bdefd..00000000000 --- a/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\Tests\search\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests search blocks upgrade to default page setting. - * - * @group Update - * @group legacy - */ -class BlockPageSettingTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests existing search block settings upgrade. - * - * @see search_post_update_block_page() - */ - public function testUpdateActionPlugins() { - $config = \Drupal::configFactory()->get('block.block.bartik_search'); - $this->assertArrayNotHasKey('page_id', $config->get('settings')); - - $this->runUpdates(); - - $config = \Drupal::configFactory()->get('block.block.bartik_search'); - $this->assertSame('', $config->get('settings')['page_id']); - } - -} diff --git a/core/modules/serialization/serialization.install b/core/modules/serialization/serialization.install index f5a11b88052..0b56ba85b62 100644 --- a/core/modules/serialization/serialization.install +++ b/core/modules/serialization/serialization.install @@ -31,28 +31,8 @@ function serialization_requirements($phase) { } /** - * @see hal_update_8301() + * Implements hook_update_last_removed(). */ -function serialization_update_8301() { -} - -/** - * Add serialization.settings::bc_primitives_as_strings configuration. - */ -function serialization_update_8302() { - $config_factory = \Drupal::configFactory(); - $config_factory->getEditable('serialization.settings') - ->set('bc_primitives_as_strings', FALSE) - ->save(TRUE); - - return t('The REST API will no longer output all values as strings. Integers/booleans will be used where appropriate. If your site depends on these value being strings, <a href="https://www.drupal.org/node/2837696">read the change record to learn how to enable the BC mode.</a>'); -} - -/** - * Enable BC for timestamp formatting: continue to return UNIX timestamps. - */ -function serialization_update_8401() { - $config_factory = \Drupal::configFactory(); - $serialization_settings = $config_factory->getEditable('serialization.settings'); - $serialization_settings->set('bc_timestamp_normalizer_unix', TRUE)->save(TRUE); +function serialization_update_last_removed() { + return 8401; } diff --git a/core/modules/statistics/statistics.install b/core/modules/statistics/statistics.install index deac9010a4a..f5c8a82fce2 100644 --- a/core/modules/statistics/statistics.install +++ b/core/modules/statistics/statistics.install @@ -59,30 +59,8 @@ function statistics_schema() { } /** - * Disable the Statistics module if the node module is not enabled. + * Implements hook_update_last_removed(). */ -function statistics_update_8001() { - if (!\Drupal::moduleHandler()->moduleExists('node')) { - if (\Drupal::service('module_installer')->uninstall(['statistics'], TRUE)) { - return 'The statistics module depends on the node module and has therefore been uninstalled.'; - } - else { - return 'There was an error uninstalling the statistcs module.'; - } - } -} - -/** - * Disable the Statistics module if the node module is not enabled. - */ -function statistics_update_8002() { - // Set the new configuration setting for max age to the initial value. - \Drupal::configFactory()->getEditable('statistics.settings')->set('display_max_age', 3600)->save(); -} - -/** - * Remove access_log settings. - */ -function statistics_update_8300() { - \Drupal::configFactory()->getEditable('statistics.settings')->clear('access_log')->save(); +function statistics_update_last_removed() { + return 8300; } diff --git a/core/modules/syslog/syslog.install b/core/modules/syslog/syslog.install index f0ce5cc68a3..2219bd507f2 100644 --- a/core/modules/syslog/syslog.install +++ b/core/modules/syslog/syslog.install @@ -15,10 +15,8 @@ function syslog_install() { } /** - * Convert syslog.settings.facility to an integer. + * Implements hook_update_last_removed(). */ -function syslog_update_8400() { - $config = \Drupal::configFactory()->getEditable('syslog.settings'); - $facility = (int) $config->get('facility'); - $config->set('facility', $facility)->save(TRUE); +function syslog_update_last_removed() { + return 8400; } diff --git a/core/modules/syslog/tests/src/Functional/Update/SyslogUpdateTest.php b/core/modules/syslog/tests/src/Functional/Update/SyslogUpdateTest.php deleted file mode 100644 index 39ac01e82a3..00000000000 --- a/core/modules/syslog/tests/src/Functional/Update/SyslogUpdateTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Drupal\Tests\syslog\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that syslog settings are properly updated during database updates. - * - * @group syslog - * @group legacy - */ -class SyslogUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - ]; - } - - /** - * Tests that syslog.settings.facility has been converted from string to int. - * - * @see syslog_update_8400() - */ - public function testSyslogSettingsFacilityDataType() { - $config = $this->config('syslog.settings'); - $this->assertIdentical('128', $config->get('facility')); - - // Run updates. - $this->runUpdates(); - - $config = $this->config('syslog.settings'); - $this->assertIdentical(128, $config->get('facility')); - } - -} diff --git a/core/modules/system/system.install b/core/modules/system/system.install index e5f7df06fb1..fb3d5eac829 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -10,17 +10,9 @@ use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Environment; use Drupal\Component\Utility\OpCodeCache; use Drupal\Component\Utility\Unicode; -use Drupal\Core\Cache\Cache; use Drupal\Core\Database\Database; use Drupal\Core\DrupalKernel; -use Drupal\Core\Entity\ContentEntityTypeInterface; -use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\Entity\FieldableEntityInterface; -use Drupal\Core\Extension\Extension; -use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\File\FileSystemInterface; -use Drupal\path_alias\Entity\PathAlias; -use Drupal\path_alias\PathAliasStorage; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PrivateStream; use Drupal\Core\StreamWrapper\PublicStream; @@ -1240,1258 +1232,16 @@ function system_schema() { } /** - * Change two fields on the default menu link storage to be serialized data. + * Implements hook_update_last_removed(). */ -function system_update_8001(&$sandbox = NULL) { - $database = \Drupal::database(); - $schema = $database->schema(); - if ($schema->tableExists('menu_tree')) { - - if (!isset($sandbox['current'])) { - // Converting directly to blob can cause problems with reading out and - // serializing the string data later on postgres, so rename the existing - // columns and create replacement ones to hold the serialized objects. - $old_fields = [ - 'title' => [ - 'description' => 'The text displayed for the link.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - ], - 'description' => [ - 'description' => 'The description of this link - used for admin pages and title attribute.', - 'type' => 'text', - 'not null' => FALSE, - ], - ]; - foreach ($old_fields as $name => $spec) { - $schema->changeField('menu_tree', $name, 'system_update_8001_' . $name, $spec); - } - $spec = [ - 'description' => 'The title for the link. May be a serialized TranslatableMarkup.', - 'type' => 'blob', - 'size' => 'big', - 'not null' => FALSE, - 'serialize' => TRUE, - ]; - $schema->addField('menu_tree', 'title', $spec); - $spec = [ - 'description' => 'The description of this link - used for admin pages and title attribute.', - 'type' => 'blob', - 'size' => 'big', - 'not null' => FALSE, - 'serialize' => TRUE, - ]; - $schema->addField('menu_tree', 'description', $spec); - - $sandbox['current'] = 0; - $sandbox['max'] = $database->query('SELECT COUNT(mlid) FROM {menu_tree}') - ->fetchField(); - } - - $menu_links = $database->queryRange('SELECT mlid, system_update_8001_title AS title, system_update_8001_description AS description FROM {menu_tree} ORDER BY mlid ASC', $sandbox['current'], $sandbox['current'] + 50) - ->fetchAllAssoc('mlid'); - - foreach ($menu_links as $menu_link) { - $menu_link = (array) $menu_link; - // Convert title and description to serialized strings. - $menu_link['title'] = serialize($menu_link['title']); - $menu_link['description'] = serialize($menu_link['description']); - - $database->update('menu_tree') - ->fields($menu_link) - ->condition('mlid', $menu_link['mlid']) - ->execute(); - - $sandbox['current']++; - } - - $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['current'] / $sandbox['max']); - - if ($sandbox['#finished'] >= 1) { - // Drop unnecessary fields from {menu_tree}. - $schema->dropField('menu_tree', 'system_update_8001_title'); - $schema->dropField('menu_tree', 'title_arguments'); - $schema->dropField('menu_tree', 'title_context'); - $schema->dropField('menu_tree', 'system_update_8001_description'); - } - return t('Menu links converted'); - } - else { - return t('Menu link conversion skipped, because the {menu_tree} table did not exist yet.'); - } -} - -/** - * Removes the system.filter configuration. - */ -function system_update_8002() { - \Drupal::configFactory()->getEditable('system.filter')->delete(); - return t('The system.filter configuration has been moved to a container parameter, see default.services.yml for more information.'); -} - -/** - * Change the index on the {router} table. - */ -function system_update_8003() { - $database = \Drupal::database(); - $database->schema()->dropIndex('router', 'pattern_outline_fit'); - $database->schema()->addIndex( - 'router', - 'pattern_outline_parts', - ['pattern_outline', 'number_parts'], - [ - 'fields' => [ - 'pattern_outline' => [ - 'description' => 'The pattern', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - ], - 'number_parts' => [ - 'description' => 'Number of parts in this router path.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - 'size' => 'small', - ], - ], - ] - ); -} - -/** - * Add a (id, default_langcode, langcode) composite index to entities. - */ -function system_update_8004() { - // \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema was changed in - // https://www.drupal.org/node/2261669 to include a (id, default_langcode, - // langcode) compound index, but this update function wasn't added until - // https://www.drupal.org/node/2542748. Regenerate the related schemas to - // ensure they match the currently expected status. - $manager = \Drupal::entityDefinitionUpdateManager(); - foreach (array_keys(\Drupal::entityTypeManager() - ->getDefinitions()) as $entity_type_id) { - // Only update the entity type if it already exists. This condition is - // needed in case new entity types are introduced after this update. - if ($entity_type = $manager->getEntityType($entity_type_id)) { - $manager->updateEntityType($entity_type); - } - } -} - -/** - * Place local actions and tasks blocks in every theme. - */ -function system_update_8005() { - // When block module is not installed, there is nothing that could be done - // except showing a warning. - if (!\Drupal::moduleHandler()->moduleExists('block')) { - return t('Block module is not enabled so local actions and tasks which have been converted to blocks, are not visible anymore.'); - } - $config_factory = \Drupal::configFactory(); - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $custom_themes_installed = FALSE; - $message = NULL; - $langcode = \Drupal::service('language_manager')->getCurrentLanguage()->getId(); - - $local_actions_default_settings = [ - 'plugin' => 'local_actions_block', - 'region' => 'content', - 'settings.label' => 'Primary admin actions', - 'settings.label_display' => 0, - 'settings.cache.max_age' => 0, - 'visibility' => [], - 'weight' => 0, - 'langcode' => $langcode, - ]; - $tabs_default_settings = [ - 'plugin' => 'local_tasks_block', - 'region' => 'content', - 'settings.label' => 'Tabs', - 'settings.label_display' => 0, - 'settings.cache.max_age' => 0, - 'visibility' => [], - 'weight' => 0, - 'langcode' => $langcode, - ]; - foreach ($theme_handler->listInfo() as $theme) { - $theme_name = $theme->getName(); - switch ($theme_name) { - case 'bartik': - $name = 'block.block.bartik_local_actions'; - $values = [ - 'id' => 'bartik_local_actions', - 'weight' => -1, - ] + $local_actions_default_settings; - _system_update_create_block($name, $theme_name, $values); - - $name = 'block.block.bartik_local_tasks'; - $values = [ - 'id' => 'bartik_local_tasks', - 'weight' => -7, - ] + $tabs_default_settings; - _system_update_create_block($name, $theme_name, $values); - - // Help region has been removed so all the blocks inside has to be moved - // to content region. - $weight = -6; - $blocks = []; - foreach ($config_factory->listAll('block.block.') as $block_config) { - $block = $config_factory->getEditable($block_config); - if ($block->get('theme') == 'bartik' && $block->get('region') == 'help') { - $blocks[] = $block; - } - } - // Sort blocks by block weight. - uasort($blocks, function ($a, $b) { - return $a->get('weight') - $b->get('weight'); - }); - // Move blocks to content region and set them in right order by their - // weight. - foreach ($blocks as $block) { - $block->set('region', 'content'); - $block->set('weight', $weight++); - $block->save(); - } - break; - - case 'seven': - $name = 'block.block.seven_local_actions'; - $values = [ - 'id' => 'seven_local_actions', - 'weight' => -10, - ] + $local_actions_default_settings; - _system_update_create_block($name, $theme_name, $values); - - $name = 'block.block.seven_primary_local_tasks'; - $values = [ - 'region' => 'header', - 'id' => 'seven_primary_local_tasks', - 'settings.label' => 'Primary tabs', - 'settings.primary' => TRUE, - 'settings.secondary' => FALSE, - ] + $tabs_default_settings; - _system_update_create_block($name, $theme_name, $values); - - $name = 'block.block.seven_secondary_local_tasks'; - $values = [ - 'region' => 'pre_content', - 'id' => 'seven_secondary_local_tasks', - 'settings.label' => 'Secondary tabs', - 'settings.primary' => FALSE, - 'settings.secondary' => TRUE, - ] + $tabs_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'stark': - $name = 'block.block.stark_local_actions'; - $values = [ - 'id' => 'stark_local_actions', - ] + $local_actions_default_settings; - _system_update_create_block($name, $theme_name, $values); - - $name = 'block.block.stark_local_tasks'; - $values = [ - 'id' => 'stark_local_tasks', - ] + $tabs_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'classy': - case 'stable': - // Don't place any blocks or trigger custom themes installed warning. - break; - - default: - $custom_themes_installed = TRUE; - $name = 'block.block.' . $theme_name . '_local_actions'; - $values = [ - 'id' => $theme_name . '_local_actions', - 'weight' => -10, - ] + $local_actions_default_settings; - _system_update_create_block($name, $theme_name, $values); - - $name = sprintf('block.block.%s_local_tasks', $theme_name); - $values = [ - 'id' => $theme_name . '_local_tasks', - 'weight' => -20, - ] + $tabs_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - } - } - - if ($custom_themes_installed) { - $message = t('Because your site has custom theme(s) installed, we had to set local actions and tasks blocks into the content region. Please manually review the block configurations and remove the removed variables from your templates.'); - } - - return $message; -} - -/** - * Place branding blocks in every theme. - */ -function system_update_8006() { - // When block module is not installed, there is nothing that could be done - // except showing a warning. - if (!\Drupal::moduleHandler()->moduleExists('block')) { - return t('Block module is not enabled so site branding elements, which have been converted to a block, are not visible anymore.'); - } - - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $custom_themes_installed = FALSE; - $message = NULL; - $langcode = \Drupal::service('language_manager')->getCurrentLanguage()->getId(); - - $site_branding_default_settings = [ - 'plugin' => 'system_branding_block', - 'region' => 'content', - 'settings.label' => 'Site branding', - 'settings.label_display' => 0, - 'visibility' => [], - 'weight' => 0, - 'langcode' => $langcode, - ]; - foreach ($theme_handler->listInfo() as $theme) { - $theme_name = $theme->getName(); - switch ($theme_name) { - case 'bartik': - $name = 'block.block.bartik_branding'; - $values = [ - 'id' => 'bartik_branding', - 'region' => 'header', - ] + $site_branding_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'stark': - $name = 'block.block.stark_branding'; - $values = [ - 'id' => 'stark_branding', - 'region' => 'header', - ] + $site_branding_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'seven': - case 'classy': - case 'stable': - // Don't place any blocks or trigger custom themes installed warning. - break; - default: - $custom_themes_installed = TRUE; - $name = sprintf('block.block.%s_branding', $theme_name); - $values = [ - 'id' => sprintf('%s_branding', $theme_name), - 'region' => 'content', - 'weight' => '-50', - ] + $site_branding_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - } - } - - if ($custom_themes_installed) { - $message = t('Because your site has custom theme(s) installed, we had to set the branding block into the content region. Please manually review the block configuration and remove the site name, slogan, and logo variables from your templates.'); - } - - return $message; -} - -/** - * Helper function to create block configuration objects for an update. - * - * @param string $name - * The name of the config object. - * @param string $theme_name - * The name of the theme the block is associated with. - * @param array $values - * The block config values. - */ -function _system_update_create_block($name, $theme_name, array $values) { - if (!\Drupal::service('config.storage')->exists($name)) { - $block = \Drupal::configFactory()->getEditable($name); - $values['uuid'] = \Drupal::service('uuid')->generate(); - $values['theme'] = $theme_name; - $values['dependencies.theme'] = [$theme_name]; - foreach ($values as $key => $value) { - $block->set($key, $value); - } - $block->save(); - } -} - -/** - * Set langcode fields to be ASCII-only. - */ -function system_update_8007() { - $database = \Drupal::database(); - $database_schema = $database->schema(); - $entity_types = \Drupal::entityTypeManager()->getDefinitions(); - - $schema = \Drupal::keyValue('entity.storage_schema.sql')->getAll(); - $schema_copy = $schema; - foreach ($schema as $item_name => $item) { - list($entity_type_id, ,) = explode('.', $item_name); - if (!isset($entity_types[$entity_type_id])) { - continue; - } - foreach ($item as $table_name => $table_schema) { - foreach ($table_schema as $schema_key => $schema_data) { - if ($schema_key == 'fields') { - foreach ($schema_data as $field_name => $field_data) { - foreach ($field_data as $field_data_property => $field_data_value) { - // Langcode fields have the property 'is_ascii' set, instead - // they should have set the type to 'varchar_ascii'. - if ($field_data_property == 'is_ascii') { - unset($schema_copy[$item_name][$table_name]['fields'][$field_name]['is_ascii']); - $schema_copy[$item_name][$table_name]['fields'][$field_name]['type'] = 'varchar_ascii'; - if ($database->driver() == 'mysql') { - $database_schema->changeField($table_name, $field_name, $field_name, $schema_copy[$item_name][$table_name]['fields'][$field_name]); - } - } - } - } - } - } - } - } - \Drupal::keyValue('entity.storage_schema.sql')->setMultiple($schema_copy); - - $definitions = \Drupal::keyValue('entity.definitions.installed')->getAll(); - $definitions_copy = $definitions; - foreach ($definitions as $item_name => $item_value) { - $suffix = '.field_storage_definitions'; - if (substr($item_name, -strlen($suffix)) == $suffix) { - foreach ($item_value as $field_name => $field_definition) { - $reflection = new \ReflectionObject($field_definition); - $schema_property = $reflection->getProperty('schema'); - $schema_property->setAccessible(TRUE); - $schema = $schema_property->getValue($field_definition); - if (isset($schema['columns']['value']['is_ascii'])) { - $schema['columns']['value']['type'] = 'varchar_ascii'; - unset($schema['columns']['value']['is_ascii']); - } - $schema_property->setValue($field_definition, $schema); - $schema_property->setAccessible(FALSE); - $definitions_copy[$item_name][$field_name] = $field_definition; - } - } - } - \Drupal::keyValue('entity.definitions.installed')->setMultiple($definitions_copy); -} - -/** - * Purge field schema data for uninstalled entity types. - */ -function system_update_8008() { - $entity_types = \Drupal::entityTypeManager()->getDefinitions(); - /** @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface $schema */ - $schema = \Drupal::keyValue('entity.storage_schema.sql'); - foreach ($schema->getAll() as $key => $item) { - list($entity_type_id, ,) = explode('.', $key); - if (!isset($entity_types[$entity_type_id])) { - $schema->delete($key); - } - } -} - -/** - * Add allowed attributes to existing html filters. - */ -function system_update_8009() { - $default_mapping = [ - '<a>' => '<a href hreflang>', - '<blockquote>' => '<blockquote cite>', - '<ol>' => '<ol start type>', - '<ul>' => '<ul type>', - '<img>' => '<img src alt height width>', - '<h2>' => '<h2 id>', - '<h3>' => '<h3 id>', - '<h4>' => '<h4 id>', - '<h5>' => '<h5 id>', - '<h6>' => '<h6 id>', - ]; - $config_factory = \Drupal::configFactory(); - foreach ($config_factory->listAll('filter.format') as $name) { - $allowed_html_mapping = $default_mapping; - $config = $config_factory->getEditable($name); - // The image alignment filter needs the data-align attribute. - $align_enabled = $config->get('filters.filter_align.status'); - if ($align_enabled) { - $allowed_html_mapping['<img>'] = str_replace('>', ' data-align>', $allowed_html_mapping['<img>']); - } - // The image caption filter needs the data-caption attribute. - $caption_enabled = $config->get('filters.filter_caption.status'); - if ($caption_enabled) { - $allowed_html_mapping['<img>'] = str_replace('>', ' data-caption>', $allowed_html_mapping['<img>']); - } - $allowed_html = $config->get('filters.filter_html.settings.allowed_html'); - if (!empty($allowed_html)) { - $allowed_html = strtr($allowed_html, $allowed_html_mapping); - $config->set('filters.filter_html.settings.allowed_html', $allowed_html); - $config->save(); - } - } -} - -/** - * Place page title blocks in every theme. - */ -function system_update_8010() { - // When block module is not installed, there is nothing that could be done - // except showing a warning. - if (!\Drupal::moduleHandler()->moduleExists('block')) { - return t('Block module is not enabled. The page title has been converted to a block, but default page title markup will still display at the top of the main content area.'); - } - - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $custom_themes_installed = FALSE; - $message = NULL; - $langcode = \Drupal::service('language_manager')->getCurrentLanguage()->getId(); - - $page_title_default_settings = [ - 'plugin' => 'page_title_block', - 'region' => 'content', - 'settings.label' => 'Page title', - 'settings.label_display' => 0, - 'visibility' => [], - 'weight' => -50, - 'langcode' => $langcode, - ]; - foreach ($theme_handler->listInfo() as $theme) { - $theme_name = $theme->getName(); - switch ($theme_name) { - case 'bartik': - $name = 'block.block.bartik_page_title'; - $values = [ - 'id' => 'bartik_page_title', - ] + $page_title_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'stark': - $name = 'block.block.stark_page_title'; - $values = [ - 'id' => 'stark_page_title', - 'region' => 'content', - ] + $page_title_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'seven': - $name = 'block.block.seven_page_title'; - $values = [ - 'id' => 'seven_page_title', - 'region' => 'header', - ] + $page_title_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - case 'classy': - $name = 'block.block.classy_page_title'; - $values = [ - 'id' => 'classy_page_title', - 'region' => 'content', - ] + $page_title_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - - default: - $custom_themes_installed = TRUE; - $name = sprintf('block.block.%s_page_title', $theme_name); - $values = [ - 'id' => sprintf('%s_page_title', $theme_name), - 'region' => 'content', - 'weight' => '-50', - ] + $page_title_default_settings; - _system_update_create_block($name, $theme_name, $values); - break; - } - } - - if ($custom_themes_installed) { - $message = t('Because your site has custom theme(s) installed, we have placed the page title block in the content region. Please manually review the block configuration and remove the page title variables from your page templates.'); - } - - return $message; -} - -/** - * Add secondary local tasks block to Seven (fixes system_update_8005). - */ -function system_update_8011() { - $langcode = \Drupal::service('language_manager')->getCurrentLanguage()->getId(); - $theme_name = 'seven'; - $name = 'block.block.seven_secondary_local_tasks'; - $values = [ - 'plugin' => 'local_tasks_block', - 'region' => 'pre_content', - 'id' => 'seven_secondary_local_tasks', - 'settings.label' => 'Secondary tabs', - 'settings.label_display' => 0, - 'settings.primary' => FALSE, - 'settings.secondary' => TRUE, - 'visibility' => [], - 'weight' => 0, - 'langcode' => $langcode, - ]; - _system_update_create_block($name, $theme_name, $values); -} - -/** - * Enable automated cron module and move the config into it. - */ -function system_update_8013() { - $autorun = \Drupal::configFactory()->getEditable('system.cron')->get('threshold.autorun'); - if ($autorun) { - // Install 'automated_cron' module. - \Drupal::service('module_installer')->install(['automated_cron'], FALSE); - - // Copy 'autorun' value into the new module's 'interval' setting. - \Drupal::configFactory()->getEditable('automated_cron.settings') - ->set('interval', $autorun) - ->save(TRUE); - } - - // Remove the 'autorun' key in system module config. - \Drupal::configFactory() - ->getEditable('system.cron') - ->clear('threshold.autorun') - ->save(TRUE); -} - -/** - * Install the Stable base theme if needed. - */ -function system_update_8014() { - $theme_handler = \Drupal::service('theme_handler'); - if ($theme_handler->themeExists('stable')) { - return; - } - $theme_handler->refreshInfo(); - $theme_installer = \Drupal::service('theme_installer'); - foreach ($theme_handler->listInfo() as $theme) { - // We first check that a base theme is set because if it's set to false then - // it's unset in - // \Drupal\Core\Extension\ThemeExtensionList::createExtensionInfo(). - if (isset($theme->info['base theme']) && $theme->info['base theme'] == 'stable') { - $theme_installer->install(['stable']); - return; - } - } -} - -/** - * Fix configuration overrides to not override non existing keys. - */ -function system_update_8200(&$sandbox) { - $config_factory = \Drupal::configFactory(); - if (!array_key_exists('config_names', $sandbox)) { - $sandbox['config_names'] = $config_factory->listAll(); - $sandbox['max'] = count($sandbox['config_names']); - } - - // Get a list of 50 to work on at a time. - $config_names_to_process = array_slice($sandbox['config_names'], 0, 50); - // Preload in a single query. - $config_factory->loadMultiple($config_names_to_process); - foreach ($config_names_to_process as $config_name) { - $config_factory->getEditable($config_name)->save(); - } - - // Update the list of names to process. - $sandbox['config_names'] = array_diff($sandbox['config_names'], $config_names_to_process); - $sandbox['#finished'] = empty($sandbox['config_names']) ? 1 : ($sandbox['max'] - count($sandbox['config_names'])) / $sandbox['max']; +function system_update_last_removed() { + return 8805; } /** - * Clear caches due to behavior change in DefaultPluginManager. + * Ensures that Drupal is updated from a supported version. */ -function system_update_8201() { - // Empty update to cause a cache rebuild. - - // Use hook_post_update_NAME() instead to clear the cache. - // The use of hook_update_N() to clear the cache has been deprecated - // see https://www.drupal.org/node/2960601 for more details. -} - -/** - * Clear caches due to behavior change in MachineName element. - */ -function system_update_8202() { - // Empty update to cause a cache rebuild. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Add detailed cron logging configuration. - */ -function system_update_8300() { - \Drupal::configFactory()->getEditable('system.cron') - ->set('logging', 1) - ->save(TRUE); -} - -/** - * Add install profile to core.extension configuration. - */ -function system_update_8301() { - \Drupal::configFactory()->getEditable('core.extension') - ->set('profile', \Drupal::installProfile()) - ->save(); -} - -/** - * Move revision metadata fields to the revision table. - */ -function system_update_8400(&$sandbox) { - // Due to the fields from RevisionLogEntityTrait not being explicitly - // mentioned in the storage they might have been installed wrongly in the base - // table for revisionable untranslatable entities and in the data and revision - // data tables for revisionable and translatable entities. - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $database = \Drupal::database(); - $database_schema = $database->schema(); - - if (!isset($sandbox['current'])) { - // This must be the first run. Initialize the sandbox. - $sandbox['current'] = 0; - - $definitions = array_filter(\Drupal::entityTypeManager()->getDefinitions(), function (EntityTypeInterface $entity_type) use ($entity_definition_update_manager) { - if ($entity_type = $entity_definition_update_manager->getEntityType($entity_type->id())) { - return is_subclass_of($entity_type->getClass(), FieldableEntityInterface::class) && ($entity_type instanceof ContentEntityTypeInterface) && $entity_type->isRevisionable(); - } - return FALSE; - }); - $sandbox['entity_type_ids'] = array_keys($definitions); - $sandbox['max'] = count($sandbox['entity_type_ids']); - } - - $current_entity_type_key = $sandbox['current']; - for ($i = $current_entity_type_key; ($i < $current_entity_type_key + 1) && ($i < $sandbox['max']); $i++) { - $entity_type_id = $sandbox['entity_type_ids'][$i]; - /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */ - $entity_type = $entity_definition_update_manager->getEntityType($entity_type_id); - - $base_fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions($entity_type_id); - $revision_metadata_fields = $entity_type->getRevisionMetadataKeys(); - $fields_to_update = array_intersect_key($base_fields, array_flip($revision_metadata_fields)); - - if (!empty($fields_to_update)) { - // Initialize the entity table names. - // @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage::initTableLayout() - $base_table = $entity_type->getBaseTable() ?: $entity_type_id; - $data_table = $entity_type->getDataTable() ?: $entity_type_id . '_field_data'; - $revision_table = $entity_type->getRevisionTable() ?: $entity_type_id . '_revision'; - $revision_data_table = $entity_type->getRevisionDataTable() ?: $entity_type_id . '_field_revision'; - $revision_field = $entity_type->getKey('revision'); - - // No data needs to be migrated if the entity type is not translatable. - if ($entity_type->isTranslatable()) { - if (!isset($sandbox[$entity_type_id])) { - // This must be the first run for this entity type. Initialize the - // sub-sandbox for it. - - // Calculate the number of revisions to process. - $count = \Drupal::entityQuery($entity_type_id) - ->allRevisions() - ->count() - ->accessCheck(FALSE) - ->execute(); - - $sandbox[$entity_type_id]['current'] = 0; - $sandbox[$entity_type_id]['max'] = $count; - } - // Define the step size. - $steps = Settings::get('entity_update_batch_size', 50); - - // Collect the revision IDs to process. - $revisions = \Drupal::entityQuery($entity_type_id) - ->allRevisions() - ->range($sandbox[$entity_type_id]['current'], $sandbox[$entity_type_id]['current'] + $steps) - ->sort($revision_field, 'ASC') - ->accessCheck(FALSE) - ->execute(); - $revisions = array_keys($revisions); - - foreach ($fields_to_update as $revision_metadata_field_name => $definition) { - // If the revision metadata field is present in the data and the - // revision data table, install its definition again with the updated - // storage code in order for the field to be installed in the - // revision table. Afterwards, copy over the field values and remove - // the field from the data and the revision data tables. - if ($database_schema->fieldExists($data_table, $revision_metadata_field_name) && $database_schema->fieldExists($revision_data_table, $revision_metadata_field_name)) { - // Install the field in the revision table. - if (!isset($sandbox[$entity_type_id]['storage_definition_installed'][$revision_metadata_field_name])) { - $entity_definition_update_manager->installFieldStorageDefinition($revision_metadata_field_name, $entity_type_id, $entity_type->getProvider(), $definition); - $sandbox[$entity_type_id]['storage_definition_installed'][$revision_metadata_field_name] = TRUE; - } - - // Apply the field value from the revision data table to the - // revision table. - foreach ($revisions as $rev_id) { - $field_value = $database->select($revision_data_table, 't') - ->fields('t', [$revision_metadata_field_name]) - ->condition($revision_field, $rev_id) - ->execute() - ->fetchField(); - $database->update($revision_table) - ->condition($revision_field, $rev_id) - ->fields([$revision_metadata_field_name => $field_value]) - ->execute(); - } - } - } - - $sandbox[$entity_type_id]['current'] += count($revisions); - $sandbox[$entity_type_id]['finished'] = ($sandbox[$entity_type_id]['current'] == $sandbox[$entity_type_id]['max']) || empty($revisions); - - if ($sandbox[$entity_type_id]['finished']) { - foreach ($fields_to_update as $revision_metadata_field_name => $definition) { - // Drop the field from the data and revision data tables. - $database_schema->dropField($data_table, $revision_metadata_field_name); - $database_schema->dropField($revision_data_table, $revision_metadata_field_name); - } - $sandbox['current']++; - } - } - else { - foreach ($fields_to_update as $revision_metadata_field_name => $definition) { - if ($database_schema->fieldExists($base_table, $revision_metadata_field_name)) { - // Install the field in the revision table. - $entity_definition_update_manager->installFieldStorageDefinition($revision_metadata_field_name, $entity_type_id, $entity_type->getProvider(), $definition); - // Drop the field from the base table. - $database_schema->dropField($base_table, $revision_metadata_field_name); - } - } - $sandbox['current']++; - } - } - else { - $sandbox['current']++; - } - - } - - $sandbox['#finished'] = $sandbox['current'] == $sandbox['max']; -} - -/** - * Remove response.gzip (and response) from system module configuration. - */ -function system_update_8401() { - \Drupal::configFactory()->getEditable('system.performance') - ->clear('response.gzip') - ->clear('response') - ->save(); -} - -/** - * Add the 'revision_translation_affected' field to all entity types. - */ -function system_update_8402() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Clear the cached entity type definitions so we get the new - // 'revision_translation_affected' entity key. - \Drupal::entityTypeManager()->clearCachedDefinitions(); - - // Get a list of revisionable and translatable entity types. - /** @var \Drupal\Core\Entity\ContentEntityTypeInterface[] $definitions */ - $definitions = array_filter(\Drupal::entityTypeManager()->getDefinitions(), function (EntityTypeInterface $entity_type) use ($definition_update_manager) { - if ($entity_type = $definition_update_manager->getEntityType($entity_type->id())) { - return $entity_type->isRevisionable() && $entity_type->isTranslatable(); - } - return FALSE; - }); - - foreach ($definitions as $entity_type_id => $entity_type) { - $field_name = $entity_type->getKey('revision_translation_affected'); - // Install the 'revision_translation_affected' field if needed. - if (!$definition_update_manager->getFieldStorageDefinition($field_name, $entity_type_id)) { - $storage_definition = BaseFieldDefinition::create('boolean') - ->setLabel(t('Revision translation affected')) - ->setDescription(t('Indicates if the last edit of a translation belongs to current revision.')) - ->setReadOnly(TRUE) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) - // Mark all pre-existing revisions as affected in order to be consistent - // with the previous API return value: if the field was not defined the - // value returned was always TRUE. - ->setInitialValue(TRUE); - - $definition_update_manager - ->installFieldStorageDefinition($field_name, $entity_type_id, $entity_type_id, $storage_definition); - } - } -} - -/** - * Delete all cache_* tables. They are recreated on demand with the new schema. - */ -function system_update_8403() { - foreach (Cache::getBins() as $bin => $cache_backend) { - // Try to delete the table regardless of which cache backend is handling it. - // This is to ensure the new schema is used if the configuration for the - // backend class is changed after the update hook runs. - $table_name = "cache_$bin"; - $schema = Database::getConnection()->schema(); - if ($schema->tableExists($table_name)) { - $schema->dropTable($table_name); - } - } -} - -/** - * Add the 'revision_default' field to all relevant entity types. - */ -function system_update_8501() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Clear the cached entity type definitions so we get the new - // 'revision_default' revision metadata key. - \Drupal::entityTypeManager()->clearCachedDefinitions(); - - // Get a list of revisionable entity types. - /** @var \Drupal\Core\Entity\ContentEntityTypeInterface[] $definitions */ - $definitions = array_filter(\Drupal::entityTypeManager()->getDefinitions(), function (EntityTypeInterface $entity_type) use ($definition_update_manager) { - if ($entity_type = $definition_update_manager->getEntityType($entity_type->id())) { - return $entity_type->isRevisionable(); - } - return FALSE; - }); - - // Install the 'revision_default' field. - foreach ($definitions as $entity_type_id => $entity_type) { - $field_name = $entity_type->getRevisionMetadataKey('revision_default'); - // Install the 'revision_default' field if needed. - if (!$definition_update_manager->getFieldStorageDefinition($field_name, $entity_type_id)) { - // Make sure the new "revision_default" revision metadata key is available - // also to code using the latest installed definition. - $installed_entity_type = $definition_update_manager->getEntityType($entity_type_id); - $revision_metadata_keys = $installed_entity_type->get('revision_metadata_keys'); - - if (!isset($revision_metadata_keys['revision_default'])) { - // Update the property holding the required revision metadata keys, - // which is used by the BC layer for retrieving the revision metadata - // keys. - // @see \Drupal\Core\Entity\ContentEntityType::getRevisionMetadataKeys(). - $required_revision_metadata_keys = $installed_entity_type->get('requiredRevisionMetadataKeys'); - $required_revision_metadata_keys['revision_default'] = $field_name; - $installed_entity_type->set('requiredRevisionMetadataKeys', $required_revision_metadata_keys); - - // Update the revision metadata keys to add the new required revision - // metadata key "revision_default". - $revision_metadata_keys['revision_default'] = $required_revision_metadata_keys['revision_default']; - $installed_entity_type->set('revision_metadata_keys', $revision_metadata_keys); - - $definition_update_manager->updateEntityType($installed_entity_type); - } - - $storage_definition = BaseFieldDefinition::create('boolean') - ->setLabel(t('Default revision')) - ->setDescription(t('A flag indicating whether this was a default revision when it was saved.')) - ->setStorageRequired(TRUE) - ->setTranslatable(FALSE) - ->setRevisionable(TRUE) - // We cannot tell whether existing revisions were default or not when - // they were created, but since we did not support creating non-default - // revisions in any core stable UI so far, we default to TRUE. - ->setInitialValue(TRUE); - - $definition_update_manager - ->installFieldStorageDefinition($field_name, $entity_type_id, $entity_type_id, $storage_definition); - } - else { - $variables = ['@entity_type_label' => $entity_type->getLabel()]; - if ($field_name === 'revision_default') { - \Drupal::logger('system')->error('An existing "Default revision" field was found for the @entity_type_label entity type, but no "revision_default" revision metadata key was found in its definition.', $variables); - } - else { - \Drupal::logger('system')->error('An existing "Default revision" field was found for the @entity_type_label entity type.', $variables); - } - } - } -} - -/** -* Fix missing install profile after updating to Drupal 8.6.9 with Drush 8. -*/ -function system_update_8601() { - $extension_config = \Drupal::configFactory()->getEditable('core.extension'); - $install_profile = $extension_config->get('profile'); - if (!$install_profile) { - // There's no install profile configured. - return; - } - $modules = $extension_config->get('module'); - if (isset($modules[$install_profile])) { - // The install profile is already in the installed module list. - return; - } - - // Ensure the install profile is available. - if (!\Drupal::service('extension.list.module')->exists($install_profile)) { - return t('The %install_profile install profile configured in core.extension is not available.', ['%install_profile' => $install_profile]); - } - - // Add the install profile to the list of enabled modules. - $modules[$install_profile] = 1000; - $modules = module_config_sort($modules); - $extension_config - ->set('module', $modules) - ->save(TRUE); - - // Build a module list from the updated extension configuration. - $current_module_filenames = \Drupal::moduleHandler()->getModuleList(); - $current_modules = array_fill_keys(array_keys($current_module_filenames), 0); - $current_modules = module_config_sort(array_merge($current_modules, $extension_config->get('module'))); - $module_filenames = []; - foreach ($current_modules as $name => $weight) { - if (isset($current_module_filenames[$name])) { - $module_filenames[$name] = $current_module_filenames[$name]; - } - else { - $module_path = \Drupal::service('extension.list.module')->getPath($name); - $pathname = "$module_path/$name.info.yml"; - $filename = file_exists($module_path . "/$name.module") ? "$name.module" : NULL; - $module_filenames[$name] = new Extension(\Drupal::root(), 'module', $pathname, $filename); - } - } - - // Update the module handler list to contain the missing install profile. - \Drupal::moduleHandler()->setModuleList($module_filenames); - \Drupal::moduleHandler()->load($install_profile); - - // Clear the static cache of the "extension.list.module" service to pick - // up the new install profile correctly. - \Drupal::service('extension.list.profile')->reset(); - - // Clear the static cache of the "extension.list.module" service to pick - // up the new module, since it merges the installation status of modules - // into its statically cached list. - \Drupal::service('extension.list.module')->reset(); - - // Update the kernel to include the missing profile. - \Drupal::service('kernel')->updateModules($module_filenames, $module_filenames); - - return t('The %install_profile install profile has been added to the installed module list.', ['%install_profile' => $install_profile]); -} - -/** - * Remove the unused 'system.theme.data' from state. - */ -function system_update_8701() { - // The system.theme.data key is no longer used in Drupal 8.7.x. - \Drupal::state()->delete('system.theme.data'); -} - -/** - * Add the 'revision_translation_affected' entity key. - */ -function system_update_8702() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Get a list of revisionable and translatable entity types. - /** @var \Drupal\Core\Entity\EntityTypeInterface[] $last_installed_definitions */ - $last_installed_definitions = array_filter($entity_definition_update_manager->getEntityTypes(), function (EntityTypeInterface $entity_type) { - return $entity_type->isRevisionable() && $entity_type->isTranslatable(); - }); - - // Ensure that we don't use the cached in-code definitions to support sites - // that might be updating from 8.3.x straight to 8.7.x. - \Drupal::entityTypeManager()->useCaches(FALSE); - $live_definitions = \Drupal::entityTypeManager()->getDefinitions(); - - // Update the 'revision_translation_affected' entity key of the last installed - // definitions to use the value of the live (in-code) entity type definitions - // in cases when the key has not been populated yet. - foreach ($last_installed_definitions as $entity_type_id => $entity_type) { - // The live (in-code) entity type definition might not exist anymore, while - // an update function that would remove its last installed definition didn't - // run yet. We don't need to update it in that case. - if (!isset($live_definitions[$entity_type_id])) { - continue; - } - - $revision_translation_affected_key = $live_definitions[$entity_type_id]->getKey('revision_translation_affected'); - if (!$entity_type->hasKey('revision_translation_affected') && !empty($revision_translation_affected_key) && $entity_definition_update_manager->getFieldStorageDefinition($revision_translation_affected_key, $entity_type_id)) { - $entity_keys = $entity_type->getKeys(); - $entity_keys['revision_translation_affected'] = $revision_translation_affected_key; - $entity_type->set('entity_keys', $entity_keys); - $entity_definition_update_manager->updateEntityType($entity_type); - } - } - \Drupal::entityTypeManager()->useCaches(TRUE); -} - -/** - * Remove 'path.temporary' config if redundant. - */ -function system_update_8801() { - // If settings is already being used, or the config is set to the OS default, - // clear the config value. - $config = Drupal::configFactory()->getEditable('system.file'); - if (Settings::get('file_temp_path') || $config->get('path.temporary') === FileSystemComponent::getOsTemporaryDirectory()) { - $config->clear('path.temporary') - ->save(TRUE); - } -} - -/** - * Fix system.theme:admin when the default theme is used as the admin theme. - */ -function system_update_8802() { - $config = Drupal::configFactory()->getEditable('system.theme'); - // Replace '0' with an empty string as '0' is not a valid value. - if ($config->get('admin') == '0') { - $config - ->set('admin', '') - ->save(TRUE); - } -} - -/** - * Install the 'path_alias' entity type. - */ -function system_update_8803() { - // Enable the Path Alias module if needed. - if (!\Drupal::moduleHandler()->moduleExists('path_alias')) { - \Drupal::service('module_installer')->install(['path_alias'], FALSE); - return t('The "path_alias" entity type has been installed.'); - } -} - -/** - * Convert path aliases to entities. - */ -function system_update_8804(&$sandbox = NULL) { - // Bail out early if the entity type is not using the default storage class. - $storage = \Drupal::entityTypeManager()->getStorage('path_alias'); - if (!$storage instanceof PathAliasStorage) { - return; - } - - if (!isset($sandbox['current_id'])) { - // This must be the first run. Initialize the sandbox. - $sandbox['progress'] = 0; - $sandbox['current_id'] = 0; - } - - $database = \Drupal::database(); - $step_size = 200; - $url_aliases = $database->select('url_alias', 't') - ->condition('t.pid', $sandbox['current_id'], '>') - ->fields('t') - ->orderBy('pid', 'ASC') - ->range(0, $step_size) - ->execute() - ->fetchAll(); - - if ($url_aliases) { - /** @var \Drupal\Component\Uuid\UuidInterface $uuid */ - $uuid = \Drupal::service('uuid'); - - $base_table_insert = $database->insert('path_alias'); - $base_table_insert->fields(['id', 'revision_id', 'uuid', 'path', 'alias', 'langcode', 'status']); - $revision_table_insert = $database->insert('path_alias_revision'); - $revision_table_insert->fields(['id', 'revision_id', 'path', 'alias', 'langcode', 'status', 'revision_default']); - foreach ($url_aliases as $url_alias) { - $values = [ - 'id' => $url_alias->pid, - 'revision_id' => $url_alias->pid, - 'uuid' => $uuid->generate(), - 'path' => $url_alias->source, - 'alias' => $url_alias->alias, - 'langcode' => $url_alias->langcode, - 'status' => 1, - ]; - $base_table_insert->values($values); - - unset($values['uuid']); - $values['revision_default'] = 1; - $revision_table_insert->values($values); - } - $base_table_insert->execute(); - $revision_table_insert->execute(); - - $sandbox['progress'] += count($url_aliases); - $last_url_alias = end($url_aliases); - $sandbox['current_id'] = $last_url_alias->pid; - - // If we're not in maintenance mode, the number of path aliases could change - // at any time so make sure that we always use the latest record count. - $missing = $database->select('url_alias', 't') - ->condition('t.pid', $sandbox['current_id'], '>') - ->orderBy('pid', 'ASC') - ->countQuery() - ->execute() - ->fetchField(); - $sandbox['#finished'] = $missing ? $sandbox['progress'] / ($sandbox['progress'] + (int) $missing) : 1; - } - else { - $sandbox['#finished'] = 1; - } - - if ($sandbox['#finished'] >= 1) { - // Keep a backup of the old 'url_alias' table if requested. - if (Settings::get('entity_update_backup', TRUE)) { - $old_table_name = 'old_' . substr(uniqid(), 0, 6) . '_url_alias'; - if (!$database->schema()->tableExists($old_table_name)) { - $database->schema()->renameTable('url_alias', $old_table_name); - } - } - else { - $database->schema()->dropTable('url_alias'); - } - - return t('Path aliases have been converted to entities.'); - } -} - -/** - * Change the provider of the 'path_alias' entity type and its base fields. - */ -function system_update_8805() { - // If the path alias module is not installed, it means that - // system_update_8803() ran as part of Drupal 8.8.0-alpha1, in which case we - // need to enable the module and change the provider of the 'path_alias' - // entity type. - if (!\Drupal::moduleHandler()->moduleExists('path_alias')) { - \Drupal::service('module_installer')->install(['path_alias'], FALSE); - - /** @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $last_installed_schema_repository */ - $last_installed_schema_repository = \Drupal::service('entity.last_installed_schema.repository'); - $entity_type = $last_installed_schema_repository->getLastInstalledDefinition('path_alias'); - - // Set the new class for the entity type. - $entity_type->setClass(PathAlias::class); - - // Set the new provider for the entity type. - $reflection = new ReflectionClass($entity_type); - $property = $reflection->getProperty('provider'); - $property->setAccessible(TRUE); - $property->setValue($entity_type, 'path_alias'); - - $last_installed_schema_repository->setLastInstalledDefinition($entity_type); - - $field_storage_definitions = $last_installed_schema_repository->getLastInstalledFieldStorageDefinitions('path_alias'); - foreach ($field_storage_definitions as $field_storage_definition) { - if ($field_storage_definition->isBaseField()) { - $field_storage_definition->setProvider('path_alias'); - $last_installed_schema_repository->setLastInstalledFieldStorageDefinition($field_storage_definition); - } - } - } +function system_update_9000() { + // See update_get_update_list(), there needs to be at least one update + // function to check for the last removed schema version. } diff --git a/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml b/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml deleted file mode 100644 index e7ee5eda13f..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml +++ /dev/null @@ -1,24 +0,0 @@ -uuid: C499B41D-035E-432E-9462-36410C43C49F -langcode: en -status: true -dependencies: - module: - - search - theme: - - bartik -id: secondtestfor2354889 -theme: bartik -region: sidebar_first -weight: -6 -provider: null -plugin: search_form_block -settings: - id: search_form_block - label: Search - provider: search - label_display: visible - page_id: node_search - cache: - max_age: -1 - status: true -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.secondtestfor2513534.yml b/core/modules/system/tests/fixtures/update/block.block.secondtestfor2513534.yml deleted file mode 100644 index 2999cab9efb..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.secondtestfor2513534.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 3c4e92c3-5fb1-408d-993c-6066559230be -langcode: en -status: true -dependencies: - theme: - - bartik -id: pagetitle_2 -theme: bartik -region: '-1' -weight: null -provider: null -plugin: page_title_block -settings: - id: page_title_block - label: 'Page title' - provider: core - label_display: '0' -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.testfor2005546.yml b/core/modules/system/tests/fixtures/update/block.block.testfor2005546.yml deleted file mode 100644 index c1359934f9f..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.testfor2005546.yml +++ /dev/null @@ -1,25 +0,0 @@ -uuid: b299258f-6fb5-47f8-b42f-473787d02e22 -langcode: en -status: true -dependencies: - module: - - system - theme: - - bartik -id: bartik_branding -theme: bartik -region: header -weight: 0 -provider: null -plugin: system_branding_block -settings: - id: system_branding_block - label: 'Site branding' - provider: system - label_display: '0' - cache: - max_age: -1 - use_site_logo: true - use_site_name: true - use_site_slogan: true -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.testfor2354889.yml b/core/modules/system/tests/fixtures/update/block.block.testfor2354889.yml deleted file mode 100644 index d2ac964da81..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.testfor2354889.yml +++ /dev/null @@ -1,51 +0,0 @@ -uuid: 9d204071-a923-4707-8200-c298a540fb0c -langcode: en -status: true -dependencies: - content: - - 'block_content:basic:c1895145-893e-460b-a24e-78cd2cefbb1f' - module: - - block_content - - node - - user - theme: - - bartik -id: testfor2354889 -theme: bartik -region: content -weight: -6 -provider: null -plugin: 'block_content:c1895145-893e-460b-a24e-78cd2cefbb1f' -settings: - id: 'block_content:c1895145-893e-460b-a24e-78cd2cefbb1f' - label: 'Test for 2354889' - provider: block_content - label_display: visible - cache: - max_age: -1 - status: true - info: '' - view_mode: full -visibility: - node_type: - id: node_type - bundles: - page: page - negate: false - context_mapping: - node: node.node - user_role: - id: user_role - roles: - authenticated: authenticated - negate: false - context_mapping: - user: user.current_user - language: - id: language - langcodes: - en: en - de: de - negate: false - context_mapping: - language: language.language_interface diff --git a/core/modules/system/tests/fixtures/update/block.block.testfor2476947.yml b/core/modules/system/tests/fixtures/update/block.block.testfor2476947.yml deleted file mode 100644 index 21cfb2f0e9a..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.testfor2476947.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - bartik -id: bartik_page_title -theme: bartik -region: content -weight: -50 -provider: null -plugin: page_title_block -settings: - id: page_title_block - label: 'Page title' - provider: core - label_display: '0' -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.testfor2513534.yml b/core/modules/system/tests/fixtures/update/block.block.testfor2513534.yml deleted file mode 100644 index b8a55fadfdc..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.testfor2513534.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 87097da9-29d1-441f-8b00-b93852c760d6 -langcode: en -status: false -dependencies: - theme: - - bartik -id: pagetitle_1 -theme: bartik -region: '-1' -weight: -8 -provider: null -plugin: page_title_block -settings: - id: page_title_block - label: 'Page title' - provider: core - label_display: '0' -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.testfor2569529.yml b/core/modules/system/tests/fixtures/update/block.block.testfor2569529.yml deleted file mode 100644 index 33391991c7d..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.testfor2569529.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - seven -id: seven_secondary_local_tasks -theme: seven -region: pre_content -weight: 0 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: 'Secondary tabs' - provider: core - label_display: '0' - primary: false - secondary: true -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.testfor507488.yml b/core/modules/system/tests/fixtures/update/block.block.testfor507488.yml deleted file mode 100644 index a8b79fd832c..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.testfor507488.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: ee7c230c-337b-4e8f-8600-d65bfd34f171 -langcode: en -status: true -dependencies: - theme: - - seven -id: seven_local_actions -theme: seven -region: content -weight: -10 -provider: null -plugin: local_actions_block -settings: - id: local_actions_block - label: 'Primary admin actions' - label_display: '0' - cache: - max_age: 0 - status: true -visibility: { } diff --git a/core/modules/system/tests/fixtures/update/block.block.thirdtestfor2354889.yml b/core/modules/system/tests/fixtures/update/block.block.thirdtestfor2354889.yml deleted file mode 100644 index 03498b83e95..00000000000 --- a/core/modules/system/tests/fixtures/update/block.block.thirdtestfor2354889.yml +++ /dev/null @@ -1,30 +0,0 @@ -uuid: 4558907D-2918-48FE-B56F-8A007B5FBDD5 -langcode: en -status: true -dependencies: - module: - - user - theme: - - bartik -id: thirdtestfor2354889 -theme: bartik -region: sidebar_first -weight: -6 -provider: null -plugin: user_login_block -settings: - id: user_login_block - label: 'User login' - provider: user - label_display: visible - cache: - max_age: -1 - status: true -visibility: - node_type: - id: node_type - bundles: - page: page - negate: false - context_mapping: - baloney: baloney_spam diff --git a/core/modules/system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz b/core/modules/system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz Binary files differdeleted file mode 100644 index db046bea947..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz b/core/modules/system/tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz Binary files differdeleted file mode 100644 index d7f880d07a3..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz Binary files differdeleted file mode 100644 index a7ecfdce225..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz Binary files differdeleted file mode 100644 index 0252db84ed0..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul_rev.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul_rev.php.gz Binary files differdeleted file mode 100644 index d7a8ba13ea6..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul_rev.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.2.0.bare.standard_with_entity_test_revlog_enabled.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.2.0.bare.standard_with_entity_test_revlog_enabled.php.gz Binary files differdeleted file mode 100644 index 19772649a9c..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.2.0.bare.standard_with_entity_test_revlog_enabled.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz Binary files differdeleted file mode 100644 index b45aeca7383..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.6.0-minimal-with-warm-caches.sql.gz b/core/modules/system/tests/fixtures/update/drupal-8.6.0-minimal-with-warm-caches.sql.gz Binary files differdeleted file mode 100644 index 7fe17c87447..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.6.0-minimal-with-warm-caches.sql.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz Binary files differdeleted file mode 100644 index 31bb51305cf..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.actions-2815379.php b/core/modules/system/tests/fixtures/update/drupal-8.actions-2815379.php deleted file mode 100644 index c76a840fcb3..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.actions-2815379.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to for testing upgrade path for action plugins. - * - * @see https://www.drupal.org/node/2815379 - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of configured email, goto, and message actions. -$actions[] = Yaml::decode(file_get_contents(__DIR__ . '/system.action.goto_2815379.yml')); -$actions[] = Yaml::decode(file_get_contents(__DIR__ . '/system.action.message_2815379.yml')); -$actions[] = Yaml::decode(file_get_contents(__DIR__ . '/system.action.send_email_2815379.yml')); - -foreach ($actions as $action) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'system.action.' . $action['id'], - 'data' => serialize($action), - ]) - ->execute(); -} - -// Enable action module. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$connection->update('config') - ->fields([ - 'data' => serialize(array_merge_recursive($extensions, ['module' => ['action' => 0]])), - ]) - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.admin_theme_0.php b/core/modules/system/tests/fixtures/update/drupal-8.admin_theme_0.php deleted file mode 100644 index fb04d316dc7..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.admin_theme_0.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$config = unserialize($connection->query("SELECT data FROM {config} where name = :name", [':name' => 'system.theme'])->fetchField()); -$config['admin'] = '0'; -$connection->update('config') - ->fields(['data' => serialize($config)]) - ->condition('name', 'system.theme') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz Binary files differdeleted file mode 100644 index 6bb7e00630c..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.block-content-uninstall.php b/core/modules/system/tests/fixtures/update/drupal-8.block-content-uninstall.php deleted file mode 100644 index 7c2ca9470dd..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.block-content-uninstall.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php - -/** - * @file - * Partial database to mimic the uninstallation of the block_content module. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->schema()->dropTable('block_content'); -$connection->schema()->dropTable('block_content__body'); -$connection->schema()->dropTable('block_content_field_data'); -$connection->schema()->dropTable('block_content_field_revision'); -$connection->schema()->dropTable('block_content_revision'); -$connection->schema()->dropTable('block_content_revision__body'); - -$connection->update('config') - ->condition('collection', '') - ->condition('name', 'core.extension') - ->fields(['data' => 'a:2:{s:6:"module";a:39:{s:5:"block";i:0;s:10:"breakpoint";i:0;s:8:"ckeditor";i:0;s:5:"color";i:0;s:7:"comment";i:0;s:6:"config";i:0;s:7:"contact";i:0;s:10:"contextual";i:0;s:8:"datetime";i:0;s:5:"dblog";i:0;s:6:"editor";i:0;s:16:"entity_reference";i:0;s:5:"field";i:0;s:8:"field_ui";i:0;s:4:"file";i:0;s:6:"filter";i:0;s:4:"help";i:0;s:7:"history";i:0;s:5:"image";i:0;s:4:"link";i:0;s:7:"menu_ui";i:0;s:4:"node";i:0;s:7:"options";i:0;s:10:"page_cache";i:0;s:4:"path";i:0;s:9:"quickedit";i:0;s:3:"rdf";i:0;s:6:"search";i:0;s:8:"shortcut";i:0;s:6:"system";i:0;s:8:"taxonomy";i:0;s:4:"text";i:0;s:7:"toolbar";i:0;s:4:"tour";i:0;s:4:"user";i:0;s:8:"views_ui";i:0;s:17:"menu_link_content";i:1;s:5:"views";i:10;s:8:"standard";i:1000;}s:5:"theme";a:3:{s:6:"classy";i:0;s:6:"bartik";i:0;s:5:"seven";i:0;}}']) - ->execute(); - -$connection->delete('config') - ->condition('name', 'block_content.type.basic') - ->execute(); -$connection->delete('config') - ->condition('name', 'core.entity_form_display.block_content.basic.default') - ->execute(); -$connection->delete('config') - ->condition('name', 'core.entity_view_display.block_content.basic.default') - ->execute(); -$connection->delete('config') - ->condition('name', 'core.entity_view_mode.block_content.full') - ->execute(); -$connection->delete('config') - ->condition('name', 'field.field.block_content.basic.body') - ->execute(); -$connection->delete('config') - ->condition('name', 'field.storage.block_content.body') - ->execute(); -$connection->delete('config') - ->condition('name', 'views.view.block_content') - ->execute(); - -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.block_content_type') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.entity_form_display') - ->condition('value', '%.block_content.%', 'LIKE') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.entity_view_display') - ->condition('value', '%.block_content.%', 'LIKE') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.entity_view_mode') - ->condition('value', '%.block_content.%', 'LIKE') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.field_config') - ->condition('value', '%.block_content.%', 'LIKE') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.field_storage_config') - ->condition('value', '%.block_content.%', 'LIKE') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'config.entity.key_store.view') - ->condition('value', '%.block_content"%', 'LIKE') - ->execute(); - -$connection->update('key_value') - ->condition('collection', 'entity.definitions.bundle_field_map') - ->condition('name', 'block_content') - ->fields(['value' => 'a:0:{}']) - ->execute(); - -$connection->delete('key_value') - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'block_content.entity_type') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'block_content.field_storage_definitions') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'entity.definitions.installed') - ->condition('name', 'block_content_type.entity_type') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'entity.storage_schema.sql') - ->condition('name', 'block_content.entity_schema_data') - ->execute(); -$connection->delete('key_value') - ->condition('collection', 'entity.storage_schema.sql') - ->condition('name', 'block_content.field_schema_data.%', 'LIKE') - ->execute(); - -$connection->update('key_value') - ->condition('collection', 'state') - ->condition('name', 'router.path_roots') - ->fields(['value' => 'a:27:{i:0;s:5:"admin";i:1;s:14:"block-category";i:2;s:7:"comment";i:3;s:8:"comments";i:4;s:7:"contact";i:5;s:4:"user";i:6;s:10:"contextual";i:7;s:6:"editor";i:8;s:4:"file";i:9;s:6:"filter";i:10;s:7:"history";i:11;s:5:"sites";i:12;s:6:"system";i:13;s:4:"node";i:14;s:9:"quickedit";i:15;s:6:"search";i:16;s:4:"cron";i:17;s:12:"machine_name";i:18;s:0:"";i:19;s:9:"<current>";i:20;s:5:"batch";i:21;s:10:"update.php";i:22;s:29:"entity_reference_autocomplete";i:23;s:8:"taxonomy";i:24;s:7:"toolbar";i:25;s:7:"rss.xml";i:26;s:5:"views";}']) - ->execute(); -$connection->update('key_value') - ->condition('collection', 'state') - ->condition('name', 'routing.non_admin_routes') - ->fields(['value' => 'a:79:{i:0;s:27:"block.category_autocomplete";i:1;s:24:"entity.comment.edit_form";i:2;s:15:"comment.approve";i:3;s:24:"entity.comment.canonical";i:4;s:26:"entity.comment.delete_form";i:5;s:13:"comment.reply";i:6;s:31:"comment.new_comments_node_links";i:7;s:21:"comment.node_redirect";i:8;s:17:"contact.site_page";i:9;s:22:"contact.site_page_form";i:10;s:24:"entity.user.contact_form";i:11;s:17:"contextual.render";i:12;s:17:"editor.filter_xss";i:13;s:31:"editor.field_untransformed_text";i:14;s:19:"editor.image_dialog";i:15;s:18:"editor.link_dialog";i:16;s:18:"file.ajax_progress";i:17;s:15:"filter.tips_all";i:18;s:11:"filter.tips";i:19;s:26:"history.get_last_node_view";i:20;s:17:"history.read_node";i:21;s:18:"image.style_public";i:22;s:19:"image.style_private";i:23;s:13:"node.add_page";i:24;s:8:"node.add";i:25;s:19:"entity.node.preview";i:26;s:27:"entity.node.version_history";i:27;s:20:"entity.node.revision";i:28;s:28:"node.revision_revert_confirm";i:29;s:28:"node.revision_delete_confirm";i:30;s:18:"quickedit.metadata";i:31;s:21:"quickedit.attachments";i:32;s:20:"quickedit.field_form";i:33;s:21:"quickedit.entity_save";i:34;s:11:"search.view";i:35;s:23:"search.view_node_search";i:36;s:23:"search.help_node_search";i:37;s:23:"search.view_user_search";i:38;s:23:"search.help_user_search";i:39;s:19:"shortcut.set_switch";i:40;s:11:"system.ajax";i:41;s:10:"system.401";i:42;s:10:"system.403";i:43;s:10:"system.404";i:44;s:11:"system.cron";i:45;s:33:"system.machine_name_transliterate";i:46;s:12:"system.files";i:47;s:28:"system.private_file_download";i:48;s:16:"system.temporary";i:49;s:7:"<front>";i:50;s:6:"<none>";i:51;s:9:"<current>";i:52;s:15:"system.timezone";i:53;s:22:"system.batch_page.html";i:54;s:22:"system.batch_page.json";i:55;s:16:"system.db_update";i:56;s:26:"system.entity_autocomplete";i:57;s:30:"entity.taxonomy_term.edit_form";i:58;s:32:"entity.taxonomy_term.delete_form";i:59;s:16:"toolbar.subtrees";i:60;s:13:"user.register";i:61;s:11:"user.logout";i:62;s:9:"user.pass";i:63;s:9:"user.page";i:64;s:10:"user.login";i:65;s:19:"user.cancel_confirm";i:66;s:10:"user.reset";i:67;s:21:"view.frontpage.feed_1";i:68;s:21:"view.frontpage.page_1";i:69;s:25:"view.taxonomy_term.feed_1";i:70;s:25:"view.taxonomy_term.page_1";i:71;s:10:"views.ajax";i:72;s:21:"entity.node.canonical";i:73;s:23:"entity.node.delete_form";i:74;s:21:"entity.node.edit_form";i:75;s:21:"entity.user.canonical";i:76;s:21:"entity.user.edit_form";i:77;s:23:"entity.user.cancel_form";i:78;s:30:"entity.taxonomy_term.canonical";}']) - ->execute(); -$connection->update('key_value') - ->condition('collection', 'state') - ->condition('name', 'views.view_route_names') - ->fields(['value' => 'a:8:{s:24:"user_admin_people.page_1";s:22:"entity.user.collection";s:20:"taxonomy_term.page_1";s:30:"entity.taxonomy_term.canonical";s:14:"content.page_1";s:20:"system.admin_content";s:12:"files.page_1";s:17:"view.files.page_1";s:12:"files.page_2";s:17:"view.files.page_2";s:16:"frontpage.feed_1";s:21:"view.frontpage.feed_1";s:16:"frontpage.page_1";s:21:"view.frontpage.page_1";s:20:"taxonomy_term.feed_1";s:25:"view.taxonomy_term.feed_1";}']) - ->execute(); - -$connection->delete('key_value') - ->condition('collection', 'system.schema') - ->condition('name', 'block_content') - ->execute(); - -$connection->delete('router') - ->condition('name', 'block_content.%', 'LIKE') - ->execute(); -$connection->delete('router') - ->condition('name', 'entity.block_content.%', 'LIKE') - ->execute(); -$connection->delete('router') - ->condition('name', 'entity.entity_form_display.block_content.%', 'LIKE') - ->execute(); -$connection->delete('router') - ->condition('name', 'entity.entity_view_display.block_content.%', 'LIKE') - ->execute(); -$connection->delete('router') - ->condition('name', 'entity.field_config.block_content_%', 'LIKE') - ->execute(); -$connection->delete('router') - ->condition('name', 'field_ui.field_storage_config_add_block_content') - ->execute(); -$connection->delete('router') - ->condition('name', 'view.block_content.page_1') - ->execute(); -$connection->delete('router') - ->condition('name', 'entity.block_content_type.collection') - ->execute(); -$connection->delete('router') - ->condition('name', 'entity.block_content_type.%', 'LIKE') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php b/core/modules/system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php deleted file mode 100644 index c19c6bb6646..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.block-context-manager-2354889.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2354889. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// A custom block with visibility settings. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testfor2354889.yml')); - -// A custom block without any visibility settings. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.secondtestfor2354889.yml')); - -// A custom block with visibility settings that contain a non-existing context -// mapping. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.thirdtestfor2354889.yml')); - -foreach ($block_configs as $block_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'block.block.' . $block_config['id'], - 'data' => serialize($block_config), - ]) - ->execute(); -} - -// Update the config entity query "index". -$existing_blocks = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute() - ->fetchField(); -$existing_blocks = unserialize($existing_blocks); - -$connection->update('key_value') - ->fields([ - 'value' => serialize(array_merge($existing_blocks, ['block.block.testfor2354889', 'block.block.secondtestfor2354889', 'block.block.thirdtestfor2354889'])), - ]) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.block-test-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.block-test-enabled.php deleted file mode 100644 index f3edf280bc0..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.block-test-enabled.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/** - * @file - * Partial database to mimic the installation of the block_test module. - */ - -use Drupal\Core\Database\Database; -use Symfony\Component\Yaml\Yaml; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->insert('key_value') - ->fields([ - 'collection' => 'system.schema', - 'name' => 'block_test', - 'value' => 'i:8000;', - ]) - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['block_test'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -// Install the block configuration. -$config = file_get_contents(__DIR__ . '/../../../../block/tests/modules/block_test/config/install/block.block.test_block.yml'); -$config = Yaml::parse($config); -$connection->insert('config') - ->fields(['data', 'name', 'collection']) - ->values([ - 'name' => 'block.block.test_block', - 'data' => serialize($config), - 'collection' => '', - ]) - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.broken_routing.php b/core/modules/system/tests/fixtures/update/drupal-8.broken_routing.php deleted file mode 100644 index e06cd1c5816..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.broken_routing.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$config = unserialize($connection->query("SELECT data FROM {config} where name = :name", [':name' => 'core.extension'])->fetchField()); -$config['module']['update_script_test'] = 0; -$connection->update('config') - ->fields(['data' => serialize($config)]) - ->condition('name', 'core.extension') - ->execute(); - -$connection->insert('key_value') - ->fields(['collection' => 'system.schema', 'name' => 'update_script_test', 'value' => serialize(8000)]) - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.config-override-fix.php b/core/modules/system/tests/fixtures/update/drupal-8.config-override-fix.php deleted file mode 100644 index f631bf9b92b..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.config-override-fix.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * @file - * Partial database to create broken config overrides. - * - * @see \Drupal\system\Tests\Update\ConfigOverridesUpdateTest - */ - -use Drupal\Core\Database\Database; -use Symfony\Component\Yaml\Yaml; - -$connection = Database::getConnection(); - -// Install the incorrect override configuration. -$configs = [ - // The view has field titles translated and had an addition field added, - // translated and then removed. - 'views.view.content', - // The configuration has a bogus key. - 'system.cron', -]; -foreach ($configs as $config_name) { - $config = Yaml::parse(file_get_contents(__DIR__ . '/es-' . $config_name . '.yml')); - $connection->delete('config') - ->condition('name', $config_name) - ->condition('collection', 'language.es') - ->execute(); - $connection->insert('config') - ->fields(['data', 'name', 'collection']) - ->values([ - 'name' => $config_name, - 'data' => serialize($config), - 'collection' => 'language.es', - ]) - ->execute(); -} diff --git a/core/modules/system/tests/fixtures/update/drupal-8.convert-path-aliases-to-entities-2336597.php b/core/modules/system/tests/fixtures/update/drupal-8.convert-path-aliases-to-entities-2336597.php deleted file mode 100644 index 8f7cb770cec..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.convert-path-aliases-to-entities-2336597.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -/** - * @file - * Contains database additions to drupal-8.filled.standard.php.gz for testing - * the upgrade path of https://www.drupal.org/node/2336597. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Add a few more url aliases with various language codes. -$connection->insert('url_alias') -->fields([ - 'pid', - 'source', - 'alias', - 'langcode', -]) -->values([ - 'pid' => '2', - 'source' => '/node/1', - 'alias' => '/test-article-new-alias', - 'langcode' => 'und', -]) -->values([ - 'pid' => '3', - 'source' => '/node/8', - 'alias' => '/test-alias-for-any-language', - 'langcode' => 'und', -]) -->values([ - 'pid' => '4', - 'source' => '/node/8', - 'alias' => '/test-alias-in-english', - 'langcode' => 'en', -]) -->values([ - 'pid' => '5', - 'source' => '/node/8', - 'alias' => '/test-alias-in-spanish', - 'langcode' => 'es', -]) -->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php b/core/modules/system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php deleted file mode 100644 index c2e4cab1e93..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.editor-editor_update_8001.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of editor_update_8001(). - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Simulate an un-synchronized environment. - -// Disable the 'basic_html' editor. -$data = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'editor.editor.basic_html') - ->execute() - ->fetchField(); -$data = unserialize($data); -$data['status'] = FALSE; -$connection->update('config') - ->fields(['data' => serialize($data)]) - ->condition('name', 'editor.editor.basic_html') - ->execute(); - -// Disable the 'full_html' text format. -$data = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'filter.format.full_html') - ->execute() - ->fetchField(); -$data = unserialize($data); -$data['status'] = FALSE; -$connection->update('config') - ->fields(['data' => serialize($data)]) - ->condition('name', 'filter.format.full_html') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.entity-data-revision-metadata-fields-2248983.php b/core/modules/system/tests/fixtures/update/drupal-8.entity-data-revision-metadata-fields-2248983.php deleted file mode 100644 index 0c537f53453..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.entity-data-revision-metadata-fields-2248983.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to - * drupal-8.2.1.bare.standard_with_entity_test_enabled.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2248983. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Data for entity type "entity_test_revlog" -$connection->insert('entity_test_revlog') - ->fields([ - 'id', - 'revision_id', - 'type', - 'uuid', - 'langcode', - 'revision_created', - 'revision_user', - 'revision_log_message', - 'name', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '2', - 'type' => 'entity_test_revlog', - 'uuid' => 'f0b962b1-391b-441b-a664-2468ad520d96', - 'langcode' => 'en', - 'revision_created' => '1476268518', - 'revision_user' => '1', - 'revision_log_message' => 'second revision', - 'name' => 'entity 1', - ]) - ->execute(); - -$connection->insert('entity_test_revlog_revision') - ->fields([ - 'id', - 'revision_id', - 'langcode', - 'revision_created', - 'revision_user', - 'revision_log_message', - 'name', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'revision_created' => '1476268517', - 'revision_user' => '1', - 'revision_log_message' => 'first revision', - 'name' => 'entity 1', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - 'revision_created' => '1476268518', - 'revision_user' => '1', - 'revision_log_message' => 'second revision', - 'name' => 'entity 1', - ]) - ->execute(); - -// Data for entity type "entity_test_mul_revlog" -$connection->insert('entity_test_mul_revlog') - ->fields([ - 'id', - 'revision_id', - 'type', - 'uuid', - 'langcode', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '2', - 'type' => 'entity_test_mul_revlog', - 'uuid' => '6f04027a-1cbd-46e3-a67e-72636b493d4f', - 'langcode' => 'en', - ]) - ->execute(); - -$connection->insert('entity_test_mul_revlog_field_data') - ->fields([ - 'id', - 'revision_id', - 'type', - 'langcode', - 'revision_created', - 'revision_user', - 'revision_log_message', - 'name', - 'default_langcode', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '2', - 'type' => 'entity_test_mul_revlog', - 'langcode' => 'en', - 'revision_created' => '1476268518', - 'revision_user' => '1', - 'revision_log_message' => 'second revision', - 'name' => 'entity 1', - 'default_langcode' => '1', - ]) - ->execute(); - -$connection->insert('entity_test_mul_revlog_field_revision') - ->fields([ - 'id', - 'revision_id', - 'langcode', - 'revision_created', - 'revision_user', - 'revision_log_message', - 'name', - 'default_langcode', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - 'revision_created' => '1476268517', - 'revision_user' => '1', - 'revision_log_message' => 'first revision', - 'name' => 'entity 1', - 'default_langcode' => '1', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - 'revision_created' => '1476268518', - 'revision_user' => '1', - 'revision_log_message' => 'second revision', - 'name' => 'entity 1', - 'default_langcode' => '1', - ]) - ->execute(); - -$connection->insert('entity_test_mul_revlog_revision') - ->fields([ - 'id', - 'revision_id', - 'langcode', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '1', - 'langcode' => 'en', - ]) - ->values([ - 'id' => '1', - 'revision_id' => '2', - 'langcode' => 'en', - ]) - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.entity-test-schema-converter-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.entity-test-schema-converter-enabled.php deleted file mode 100644 index 3a5bc181bc7..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.entity-test-schema-converter-enabled.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Set the schema version. -$connection->merge('key_value') - ->fields([ - 'value' => 'i:8000;', - 'name' => 'entity_test_schema_converter', - 'collection' => 'system.schema', - ]) - ->condition('collection', 'system.schema') - ->condition('name', 'entity_test_schema_converter') - ->execute(); - -// Update core.extension. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['entity_test_schema_converter'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.field-schema-data-uninstall-2573667.php b/core/modules/system/tests/fixtures/update/drupal-8.field-schema-data-uninstall-2573667.php deleted file mode 100644 index e3531a0c12d..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.field-schema-data-uninstall-2573667.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2573667. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$connection->insert('key_value') - ->fields([ - 'collection', - 'name', - 'value', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.body', - 'value' => 'a:2:{s:19:"block_content__body";a:4:{s:11:"description";s:42:"Data storage for block_content field body.";s:6:"fields";a:9:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:10:"body_value";a:3:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:1;}s:12:"body_summary";a:3:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:0;}s:11:"body_format";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:255;s:8:"not null";b:0;}}s:11:"primary key";a:4:{i:0;s:9:"entity_id";i:1;s:7:"deleted";i:2;s:5:"delta";i:3;s:8:"langcode";}s:7:"indexes";a:3:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}s:11:"body_format";a:1:{i:0;s:11:"body_format";}}}s:28:"block_content_revision__body";a:4:{s:11:"description";s:54:"Revision archive storage for block_content field body.";s:6:"fields";a:9:{s:6:"bundle";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:88:"The field instance bundle to which this row belongs, used when deleting a field instance";}s:7:"deleted";a:5:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;s:7:"default";i:0;s:11:"description";s:60:"A boolean indicating whether this data item has been deleted";}s:9:"entity_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:38:"The entity id this data is attached to";}s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:47:"The entity revision id this data is attached to";}s:8:"langcode";a:5:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;s:7:"default";s:0:"";s:11:"description";s:37:"The language code for this data item.";}s:5:"delta";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;s:11:"description";s:67:"The sequence number for this data item, used for multi-value fields";}s:10:"body_value";a:3:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:1;}s:12:"body_summary";a:3:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:0;}s:11:"body_format";a:3:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:255;s:8:"not null";b:0;}}s:11:"primary key";a:5:{i:0;s:9:"entity_id";i:1;s:11:"revision_id";i:2;s:7:"deleted";i:3;s:5:"delta";i:4;s:8:"langcode";}s:7:"indexes";a:3:{s:6:"bundle";a:1:{i:0;s:6:"bundle";}s:11:"revision_id";a:1:{i:0;s:11:"revision_id";}s:11:"body_format";a:1:{i:0;s:11:"body_format";}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.changed', - 'value' => 'a:2:{s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:7:"changed";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:7:"changed";a:2:{s:4:"type";s:3:"int";s:8:"not null";b:0;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.default_langcode', - 'value' => 'a:2:{s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:16:"default_langcode";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:16:"default_langcode";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:1;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.id', - 'value' => 'a:4:{s:13:"block_content";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:22:"block_content_revision";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:2:"id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.info', - 'value' => 'a:2:{s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:4:"info";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:6:"binary";b:0;s:8:"not null";b:0;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:4:"info";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:6:"binary";b:0;s:8:"not null";b:0;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.langcode', - 'value' => 'a:4:{s:13:"block_content";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:12;s:8:"is_ascii";b:1;s:8:"not null";b:1;}}}s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:12;s:8:"is_ascii";b:1;s:8:"not null";b:1;}}}s:22:"block_content_revision";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:12;s:8:"is_ascii";b:1;s:8:"not null";b:1;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:8:"langcode";a:4:{s:4:"type";s:7:"varchar";s:6:"length";i:12;s:8:"is_ascii";b:1;s:8:"not null";b:1;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.revision_id', - 'value' => 'a:4:{s:13:"block_content";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:0;}}}s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:22:"block_content_revision";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:11:"revision_id";a:4:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:4:"size";s:6:"normal";s:8:"not null";b:1;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.revision_log', - 'value' => 'a:1:{s:22:"block_content_revision";a:1:{s:6:"fields";a:1:{s:12:"revision_log";a:3:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:0;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.revision_translation_affected', - 'value' => 'a:2:{s:24:"block_content_field_data";a:1:{s:6:"fields";a:1:{s:29:"revision_translation_affected";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}}}s:28:"block_content_field_revision";a:1:{s:6:"fields";a:1:{s:29:"revision_translation_affected";a:3:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.type', - 'value' => 'a:2:{s:13:"block_content";a:2:{s:6:"fields";a:1:{s:4:"type";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;}}s:7:"indexes";a:1:{s:36:"block_content_field__type__target_id";a:1:{i:0;s:4:"type";}}}s:24:"block_content_field_data";a:2:{s:6:"fields";a:1:{s:4:"type";a:4:{s:11:"description";s:28:"The ID of the target entity.";s:4:"type";s:13:"varchar_ascii";s:6:"length";i:32;s:8:"not null";b:1;}}s:7:"indexes";a:1:{s:36:"block_content_field__type__target_id";a:1:{i:0;s:4:"type";}}}}', - ]) - ->values([ - 'collection' => 'entity.storage_schema.sql', - 'name' => 'block_content.field_schema_data.uuid', - 'value' => 'a:1:{s:13:"block_content";a:2:{s:6:"fields";a:1:{s:4:"uuid";a:4:{s:4:"type";s:13:"varchar_ascii";s:6:"length";i:128;s:6:"binary";b:0;s:8:"not null";b:1;}}s:11:"unique keys";a:1:{s:32:"block_content_field__uuid__value";a:1:{i:0;s:4:"uuid";}}}}', - ]) - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.filled.standard.php.gz b/core/modules/system/tests/fixtures/update/drupal-8.filled.standard.php.gz Binary files differdeleted file mode 100644 index b3f2afb3002..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.filled.standard.php.gz +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.language-enabled.php b/core/modules/system/tests/fixtures/update/drupal-8.language-enabled.php Binary files differdeleted file mode 100644 index 477d95e2cf8..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.language-enabled.php +++ /dev/null diff --git a/core/modules/system/tests/fixtures/update/drupal-8.local-actions-tasks-into-blocks-507488.php b/core/modules/system/tests/fixtures/update/drupal-8.local-actions-tasks-into-blocks-507488.php deleted file mode 100644 index 0fa97e44f64..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.local-actions-tasks-into-blocks-507488.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/507488. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of a custom block with visibility settings. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testfor507488.yml')); - -foreach ($block_configs as $block_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'block.block.' . $block_config['id'], - 'data' => serialize($block_config), - ]) - ->execute(); -} - -// Update the config entity query "index". -$existing_blocks = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:seven') - ->execute() - ->fetchField(); -$existing_blocks = unserialize($existing_blocks); - -$connection->update('key_value') - ->fields([ - 'value' => serialize(array_merge($existing_blocks, ['block.block.seven_local_actions'])), - ]) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:seven') - ->execute(); - -// Enable test theme. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$connection->update('config') - ->fields([ - 'data' => serialize(array_merge_recursive($extensions, ['theme' => ['test_theme' => 0]])), - ]) - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.page-title-into-block-2476947.php b/core/modules/system/tests/fixtures/update/drupal-8.page-title-into-block-2476947.php deleted file mode 100644 index b51dbe8a0a3..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.page-title-into-block-2476947.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2476947. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of a custom block with visibility settings. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testfor2476947.yml')); - -foreach ($block_configs as $block_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'block.block.' . $block_config['id'], - 'data' => serialize($block_config), - ]) - ->execute(); -} - -// Update the config entity query "index". -$existing_blocks = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute() - ->fetchField(); -$existing_blocks = unserialize($existing_blocks); - -$connection->update('key_value') - ->fields([ - 'value' => serialize(array_merge($existing_blocks, ['block.block.bartik_page_title'])), - ]) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute(); - -// Enable test theme. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$connection->update('config') - ->fields([ - 'data' => serialize(array_merge_recursive($extensions, ['theme' => ['test_theme' => 0]])), - ]) - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php b/core/modules/system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php deleted file mode 100644 index 97c1b7bd993..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/507488. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of a custom block with visibility settings. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testfor2569529.yml')); - -foreach ($block_configs as $block_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'block.block.' . $block_config['id'], - 'data' => serialize($block_config), - ]) - ->execute(); -} - -// Update the config entity query "index". -$existing_blocks = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:seven') - ->execute() - ->fetchField(); -$existing_blocks = unserialize($existing_blocks); - -$connection->update('key_value') - ->fields([ - 'value' => serialize(array_merge($existing_blocks, ['block.block.seven_secondary_local_tasks'])), - ]) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:seven') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.site-branding-into-block-2005546.php b/core/modules/system/tests/fixtures/update/drupal-8.site-branding-into-block-2005546.php deleted file mode 100644 index 050dd38271c..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.site-branding-into-block-2005546.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2005546. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of a custom block with visibility settings. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testfor2005546.yml')); - -foreach ($block_configs as $block_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'block.block.' . $block_config['id'], - 'data' => serialize($block_config), - ]) - ->execute(); -} - -// Update the config entity query "index". -$existing_blocks = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute() - ->fetchField(); -$existing_blocks = unserialize($existing_blocks); - -$connection->update('key_value') - ->fields([ - 'value' => serialize(array_merge($existing_blocks, ['block.block.bartik_branding'])), - ]) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute(); - -// Enable test theme. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$connection->update('config') - ->fields([ - 'data' => serialize(array_merge_recursive($extensions, ['theme' => ['test_theme' => 0]])), - ]) - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.stable-base-theme-2575421.php b/core/modules/system/tests/fixtures/update/drupal-8.stable-base-theme-2575421.php deleted file mode 100644 index 537ecf1bac3..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.stable-base-theme-2575421.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2575421. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Enable test_stable theme. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$connection->update('config') - ->fields([ - 'data' => serialize(array_merge_recursive($extensions, ['theme' => ['test_stable' => 0]])), - ]) - ->condition('name', 'core.extension') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.taxonomy-parent-multilingual-3066439.php b/core/modules/system/tests/fixtures/update/drupal-8.taxonomy-parent-multilingual-3066439.php deleted file mode 100644 index caf941c99d1..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.taxonomy-parent-multilingual-3066439.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2455125. - */ - -use Drupal\Component\Uuid\Php; -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -$uuid = new Php(); - -$tids = []; - -for ($i = 0; $i < 60; $i++) { - $name = $this->randomString(); - - $tid = $connection->insert('taxonomy_term_data') - ->fields(['vid', 'uuid', 'langcode']) - ->values(['vid' => 'tags', 'uuid' => $uuid->generate(), 'langcode' => 'es']) - ->execute(); - - $connection->insert('taxonomy_term_field_data') - ->fields(['tid', 'vid', 'langcode', 'name', 'weight', 'changed', 'default_langcode']) - ->values(['tid' => $tid, 'vid' => 'tags', 'langcode' => 'en', 'name' => $name, 'weight' => 0, 'changed' => REQUEST_TIME, 'default_langcode' => 1]) - ->execute(); - - $connection->insert('taxonomy_term_field_data') - ->fields(['tid', 'vid', 'langcode', 'name', 'weight', 'changed', 'default_langcode']) - ->values(['tid' => $tid, 'vid' => 'tags', 'langcode' => 'es', 'name' => $name . ' es', 'weight' => 0, 'changed' => REQUEST_TIME, 'default_langcode' => 0]) - ->execute(); - - $tids[] = $tid; -} - -$query = $connection->insert('taxonomy_term_hierarchy')->fields(['tid', 'parent']); - -$previous_tid = 0; -foreach ($tids as $tid) { - $query->values(['tid' => $tid, 'parent' => $previous_tid]); - $previous_tid = $tid; -} - -// Insert an extra record with no corresponding term. -// See https://www.drupal.org/project/drupal/issues/2997982 -$query->values(['tid' => max($tids) + 1, 'parent' => 0]); - -$query->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.test-config-init.php b/core/modules/system/tests/fixtures/update/drupal-8.test-config-init.php deleted file mode 100644 index 18c3dcf7867..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.test-config-init.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -// @codingStandardsIgnoreFile - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Manually configure the test mail collector implementation to prevent -// tests from sending out emails and collect them in state instead. -// While this should be enforced via settings.php prior to installation, -// some tests expect to be able to test mail system implementations. -$config = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'system.mail') - ->execute() - ->fetchField(); -$config = unserialize($config); -$config['interface']['default'] = 'test_mail_collector'; -$connection->update('config') - ->fields([ - 'data' => serialize($config), - 'collection' => '', - 'name' => 'system.mail', - ]) - ->condition('collection', '') - ->condition('name', 'system.mail') - ->execute(); - -// By default, verbosely display all errors and disable all production -// environment optimizations for all tests to avoid needless overhead and -// ensure a sane default experience for test authors. -// @see https://www.drupal.org/node/2259167 -$config = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'system.logging') - ->execute() - ->fetchField(); -$config = unserialize($config); -$config['error_level'] = 'verbose'; -$connection->update('config') - ->fields([ - 'data' => serialize($config), - 'collection' => '', - 'name' => 'system.logging', - ]) - ->condition('collection', '') - ->condition('name', 'system.logging') - ->execute(); - -$config = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'system.performance') - ->execute() - ->fetchField(); -$config = unserialize($config); -$config['css']['preprocess'] = FALSE; -$config['js']['preprocess'] = FALSE; -$connection->update('config') - ->fields([ - 'data' => serialize($config), - 'collection' => '', - 'name' => 'system.performance', - ]) - ->condition('collection', '') - ->condition('name', 'system.performance') - ->execute(); - -// Set an explicit time zone to not rely on the system one, which may vary -// from setup to setup. The Australia/Sydney time zone is chosen so all -// tests are run using an edge case scenario (UTC10 and DST). This choice -// is made to prevent time zone related regressions and reduce the -// fragility of the testing system in general. -$config = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'system.date') - ->execute() - ->fetchField(); -$config = unserialize($config); -$config['timezone']['default'] = 'Australia/Sydney'; -$connection->update('config') - ->fields([ - 'data' => serialize($config), - 'collection' => '', - 'name' => 'system.date', - ]) - ->condition('collection', '') - ->condition('name', 'system.date') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.update-test-block-disabled-2513534.php b/core/modules/system/tests/fixtures/update/drupal-8.update-test-block-disabled-2513534.php deleted file mode 100644 index cf5f9dfebeb..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.update-test-block-disabled-2513534.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2513534. - */ - -use Drupal\Component\Serialization\Yaml; -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// A disabled block. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testfor2513534.yml')); - -// A block placed in the default region. -$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.secondtestfor2513534.yml')); - -foreach ($block_configs as $block_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'block.block.' . $block_config['id'], - 'data' => serialize($block_config), - ]) - ->execute(); -} - -// Update the config entity query "index". -$existing_blocks = $connection->select('key_value') - ->fields('key_value', ['value']) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute() - ->fetchField(); -$existing_blocks = unserialize($existing_blocks); - -$connection->update('key_value') - ->fields([ - 'value' => serialize(array_merge($existing_blocks, ['block.block.testfor2513534', 'block.block.secondtestfor2513534'])), - ]) - ->condition('collection', 'config.entity.key_store.block') - ->condition('name', 'theme:bartik') - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.php b/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.php deleted file mode 100644 index 7b04a3693c6..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2455125. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of a view with timestamp fields. -$views_configs = []; - -$views_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/drupal-8.views-entity-views-data-2455125.yml')); - -foreach ($views_configs as $views_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'views.view.' . $views_config['id'], - 'data' => serialize($views_config), - ]) - ->execute(); -} diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.yml b/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.yml deleted file mode 100644 index e3c1b630fe1..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.yml +++ /dev/null @@ -1,294 +0,0 @@ -uuid: e693b165-0e14-4dee-9909-9f0892037c23 -langcode: en -status: true -dependencies: - module: - - user -id: update_test -label: 'Update Test' -module: views -description: '' -tag: '' -base_table: users_field_data -base_field: uid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access user profiles' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - items_per_page: 0 - offset: 0 - style: - type: default - row: - type: fields - fields: - name: - id: name - table: users_field_data - field: name - entity_type: user - entity_field: name - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: user_name - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - created: - id: created - table: users_field_data - field: created - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: long - custom_date_format: '' - timezone: Africa/Abidjan - entity_type: user - entity_field: created - plugin_id: date - created_1: - id: created_1 - table: users_field_data - field: created - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: 'raw time ago' - custom_date_format: '' - timezone: '' - entity_type: user - entity_field: created - plugin_id: date - created_2: - id: created_2 - table: users_field_data - field: created - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: 'time ago' - custom_date_format: '' - timezone: '' - entity_type: user - entity_field: created - plugin_id: date - filters: { } - sorts: { } - title: 'Update Test' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - cacheable: false - block_1: - display_plugin: block - id: block_1 - display_title: Block - position: 1 - display_options: - display_extenders: { } - allow: - items_per_page: false - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - cacheable: false diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.php b/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.php deleted file mode 100644 index 2dcacb2c301..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2455125. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Structure of a view with timestamp fields. -$views_configs = []; - -$views_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/drupal-8.views-entity-views-data-2846614.yml')); - -foreach ($views_configs as $views_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'views.view.' . $views_config['id'], - 'data' => serialize($views_config), - ]) - ->execute(); -} diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.yml b/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.yml deleted file mode 100644 index 2d68cbe4c43..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.yml +++ /dev/null @@ -1,240 +0,0 @@ -uuid: 001475a0-daec-4e8a-8ca7-97b0d24100a6 -langcode: en -status: true -dependencies: - module: - - user -id: test_user_multi_value -label: test_user_multi_value -module: views -description: '' -tag: '' -base_table: users_field_data -base_field: uid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access user profiles' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - roles: - id: roles - table: user__roles - field: roles - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: user - entity_field: roles - plugin_id: field - filters: - roles: - id: roles - table: user__roles - field: roles - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: user - entity_field: roles - plugin_id: string - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: - roles: - id: roles - table: user__roles - field: roles - relationship: none - group_type: group - admin_label: '' - default_action: ignore - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: fixed - default_argument_options: - argument: '' - default_argument_skip_url: false - summary_options: - base_path: '' - count: true - items_per_page: 25 - override: false - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - glossary: false - limit: 0 - case: none - path_case: none - transform_dash: false - break_phrase: false - entity_type: user - entity_field: roles - plugin_id: string - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user.permissions - tags: { } diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-revision-metadata-fields-2248983.php b/core/modules/system/tests/fixtures/update/drupal-8.views-revision-metadata-fields-2248983.php deleted file mode 100644 index 4cc5227774f..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-revision-metadata-fields-2248983.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to - * drupal-8.2.1.bare.standard_with_entity_test_enabled.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2248983. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// View for the entity type "entity_test_revlog". -$views_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/views.view.entity_test_revlog_for_2248983.yml')); - -// View for the entity type "entity_test_mul_revlog". -$views_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/views.view.entity_test_mul_revlog_for_2248983.yml')); - - -foreach ($views_configs as $views_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'views.view.' . $views_config['id'], - 'data' => serialize($views_config), - ]) - ->execute(); -} diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.php b/core/modules/system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.php deleted file mode 100644 index 6d2c41c56e1..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2455125. - */ - -use Drupal\Component\Uuid\Php; -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$view_file = __DIR__ . '/drupal-8.views-taxonomy-parent-2543726.yml'; -$view_config = Yaml::decode(file_get_contents($view_file)); - -$connection->insert('config') - ->fields(['collection', 'name', 'data']) - ->values([ - 'collection' => '', - 'name' => "views.view.test_taxonomy_parent", - 'data' => serialize($view_config), - ]) - ->execute(); - -$uuid = new Php(); - -// The root tid. -$tids = [0]; - -for ($i = 0; $i < 4; $i++) { - $name = $this->randomString(); - - $tid = $connection->insert('taxonomy_term_data') - ->fields(['vid', 'uuid', 'langcode']) - ->values(['vid' => 'tags', 'uuid' => $uuid->generate(), 'langcode' => 'en']) - ->execute(); - - $connection->insert('taxonomy_term_field_data') - ->fields(['tid', 'vid', 'langcode', 'name', 'weight', 'changed', 'default_langcode']) - ->values(['tid' => $tid, 'vid' => 'tags', 'langcode' => 'en', 'name' => $name, 'weight' => 0, 'changed' => REQUEST_TIME, 'default_langcode' => 1]) - ->execute(); - - $tids[] = $tid; -} - -$hierarchy = [ - // Term with tid 1 has terms with tids 2 and 3 as parents. - 1 => [2, 3], - 2 => [3, 0], - 3 => [0], -]; - -$query = $connection->insert('taxonomy_term_hierarchy')->fields(['tid', 'parent']); - -foreach ($hierarchy as $tid => $parents) { - foreach ($parents as $parent) { - $query->values(['tid' => $tids[$tid], 'parent' => $tids[$parent]]); - } -} - -// Insert an extra record with no corresponding term. -// See https://www.drupal.org/project/drupal/issues/2997982 -$query->values(['tid' => max($tids) + 1, 'parent' => 0]); - -$query->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.yml b/core/modules/system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.yml deleted file mode 100644 index de8f63d7c45..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.yml +++ /dev/null @@ -1,222 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - taxonomy - - user -id: test_taxonomy_parent -label: test_taxonomy_parent -module: views -description: '' -tag: '' -base_table: taxonomy_term_data -base_field: tid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - quantity: 9 - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - id: name - table: taxonomy_term_data - field: name - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - plugin_id: field - type: string - settings: - link_to_entity: true - entity_type: taxonomy_term - entity_field: name - filters: - parent: - id: parent - table: taxonomy_term_hierarchy - field: parent - relationship: field_tags - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '' - group: 1 - exposed: true - expose: - operator_id: parent_op - label: 'Parent term' - description: '' - use_operator: false - operator: parent_op - identifier: parent - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - placeholder: '' - min_placeholder: '' - max_placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - parent_1: - id: parent_1 - table: taxonomy_term_hierarchy - field: parent - relationship: field_tags - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '' - group: 1 - exposed: true - expose: - operator_id: parent_1_op - label: 'Parent term' - description: '' - use_operator: false - operator: parent_1_op - identifier: parent_1 - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - placeholder: '' - min_placeholder: '' - max_placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: numeric - sorts: { } - header: { } - footer: { } - empty: { } - relationships: - parent: - id: parent - table: taxonomy_term__parent - field: parent_target_id - relationship: none - group_type: group - admin_label: Parent - required: true - plugin_id: standard - arguments: { } diff --git a/core/modules/system/tests/fixtures/update/drupal-8.without_automated_cron.php b/core/modules/system/tests/fixtures/update/drupal-8.without_automated_cron.php deleted file mode 100644 index b245f74e813..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal-8.without_automated_cron.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); -$config = $connection; - -$connection->merge('config') - ->condition('name', 'system.cron') - ->condition('collection', '') - ->fields([ - 'name' => 'system.cron', - 'collection' => '', - 'data' => serialize(['threshold' => ['autorun' => 0]]), - ]) - ->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.php b/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.php deleted file mode 100644 index 1fc1258ed6a..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8-rc1.bare.standard.php.gz for testing - * the upgrade path of https://www.drupal.org/node/2649914. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$views_config = Yaml::decode(file_get_contents(__DIR__ . '/drupal8.views-image-style-dependency-2649914.yml')); - -$connection->insert('config') - ->fields(['collection', 'name', 'data']) - ->values([ - 'collection' => '', - 'name' => 'views.view.' . $views_config['id'], - 'data' => serialize($views_config), - ])->execute(); diff --git a/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml b/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml deleted file mode 100644 index 585da34844e..00000000000 --- a/core/modules/system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.yml +++ /dev/null @@ -1,43 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_image - module: - - image - - node -id: foo -label: Foo -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - fields: - field_image: - id: field_image - table: node__field_image - field: field_image - type: image - settings: - image_style: thumbnail - image_link: '' - plugin_id: field - field_image_1: - id: field_image_1 - table: node__field_image - field: field_image - type: image - settings: - # This field's formatter is using a non-existent image style. - image_style: nonexistent - image_link: '' - plugin_id: field diff --git a/core/modules/system/tests/fixtures/update/es-system.cron.yml b/core/modules/system/tests/fixtures/update/es-system.cron.yml deleted file mode 100644 index 09d0f82f375..00000000000 --- a/core/modules/system/tests/fixtures/update/es-system.cron.yml +++ /dev/null @@ -1 +0,0 @@ -bogus_key: 'Should be cleaned by system_update_8200' diff --git a/core/modules/system/tests/fixtures/update/es-views.view.content.yml b/core/modules/system/tests/fixtures/update/es-views.view.content.yml deleted file mode 100644 index d9c9cce2d54..00000000000 --- a/core/modules/system/tests/fixtures/update/es-views.view.content.yml +++ /dev/null @@ -1,15 +0,0 @@ -label: 'Spanish Content' -description: 'Spanish Find and manage content.' -display: - default: - display_options: - fields: - title: - label: 'Spanish Title' - name: - label: 'Spanish Author' - nid: - label: 'Spanish ID' - display_title: 'Spanish Master' - page_1: - display_title: 'Spanish Page' diff --git a/core/modules/system/tests/fixtures/update/system.action.goto_2815379.yml b/core/modules/system/tests/fixtures/update/system.action.goto_2815379.yml deleted file mode 100644 index 1186ec94728..00000000000 --- a/core/modules/system/tests/fixtures/update/system.action.goto_2815379.yml +++ /dev/null @@ -1,12 +0,0 @@ -uuid: 2573293e-c7b6-4f53-905a-10ec7c55f3d0 -langcode: en -status: true -dependencies: - module: - - action -id: goto_2815379 -label: 'Goto action' -type: system -plugin: action_goto_action -configuration: - url: /user diff --git a/core/modules/system/tests/fixtures/update/system.action.message_2815379.yml b/core/modules/system/tests/fixtures/update/system.action.message_2815379.yml deleted file mode 100644 index 01b51cee702..00000000000 --- a/core/modules/system/tests/fixtures/update/system.action.message_2815379.yml +++ /dev/null @@ -1,12 +0,0 @@ -uuid: e34302d4-3afc-40ec-bdf0-cbd23e2f7f52 -langcode: en -status: true -dependencies: - module: - - action -id: message_2815379 -label: 'Display message' -type: system -plugin: action_message_action -configuration: - message: 'Test message' diff --git a/core/modules/system/tests/fixtures/update/system.action.send_email_2815379.yml b/core/modules/system/tests/fixtures/update/system.action.send_email_2815379.yml deleted file mode 100644 index 7651bcafdd9..00000000000 --- a/core/modules/system/tests/fixtures/update/system.action.send_email_2815379.yml +++ /dev/null @@ -1,14 +0,0 @@ -uuid: 741d330c-9260-45f8-8a81-67d2cd430f4a -langcode: en -status: true -dependencies: - module: - - action -id: send_email_2815379 -label: 'Send email' -type: system -plugin: action_send_email_action -configuration: - recipient: drupal@example.com - subject: Subject - message: Message diff --git a/core/modules/system/tests/fixtures/update/views.view.entity_test_mul_revlog_for_2248983.yml b/core/modules/system/tests/fixtures/update/views.view.entity_test_mul_revlog_for_2248983.yml deleted file mode 100644 index 532b22504c5..00000000000 --- a/core/modules/system/tests/fixtures/update/views.view.entity_test_mul_revlog_for_2248983.yml +++ /dev/null @@ -1,434 +0,0 @@ -uuid: 25b89168-a8e5-4ae1-8fb5-c8efb91f0938 -langcode: en -status: true -dependencies: - module: - - entity_test_revlog -id: entity_test_mul_revlog_for_2248983 -label: entity_test_mul_revlog -module: views -description: '' -tag: '' -base_table: entity_test_mul_revlog_property_data -base_field: id -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - name: name - info: - name: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - table: entity_test_mul_revlog_property_data - field: name - id: name - entity_type: entity_test_mul_revlog - entity_field: name - plugin_id: field - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - revision_created: - id: revision_created - table: entity_test_mul_revlog_property_data - field: revision_created - relationship: none - group_type: group - admin_label: '' - label: 'Revision create time' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp - settings: - date_format: medium - custom_date_format: '' - timezone: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_mul_revlog - entity_field: revision_created - plugin_id: field - revision_id: - id: revision_id - table: entity_test_mul_revlog_property_data - field: revision_id - relationship: none - group_type: group - admin_label: '' - label: 'Revision ID' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: number_integer - settings: - thousand_separator: '' - prefix_suffix: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_mul_revlog - entity_field: revision_id - plugin_id: field - revision_log_message: - id: revision_log_message - table: entity_test_mul_revlog_property_data - field: revision_log_message - relationship: none - group_type: group - admin_label: '' - label: 'Revision log message' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: basic_string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_mul_revlog - entity_field: revision_log_message - plugin_id: field - revision_user: - id: revision_user - table: entity_test_mul_revlog_property_data - field: revision_user - relationship: none - group_type: group - admin_label: '' - label: 'Revision user' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_mul_revlog - entity_field: revision_user - plugin_id: field - filters: { } - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - tags: { } diff --git a/core/modules/system/tests/fixtures/update/views.view.entity_test_revlog_for_2248983.yml b/core/modules/system/tests/fixtures/update/views.view.entity_test_revlog_for_2248983.yml deleted file mode 100644 index 22b3d996e92..00000000000 --- a/core/modules/system/tests/fixtures/update/views.view.entity_test_revlog_for_2248983.yml +++ /dev/null @@ -1,435 +0,0 @@ -uuid: 5a8b00d2-67ce-415b-9e7d-6c013bf7f6b8 -langcode: en -status: true -dependencies: - module: - - entity_test_revlog -id: entity_test_revlog_for_2248983 -label: entity_test_revlog -module: views -description: '' -tag: '' -base_table: entity_test_revlog -base_field: id -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: none - options: { } - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - name: name - info: - name: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - id: name - table: entity_test_revlog - field: name - relationship: none - group_type: group - admin_label: '' - label: Name - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: false - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_revlog - entity_field: name - plugin_id: field - revision_created: - id: revision_created - table: entity_test_revlog - field: revision_created - relationship: none - group_type: group - admin_label: '' - label: 'Revision create time' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp - settings: - date_format: medium - custom_date_format: '' - timezone: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_revlog - entity_field: revision_created - plugin_id: field - revision_id: - id: revision_id - table: entity_test_revlog - field: revision_id - relationship: none - group_type: group - admin_label: '' - label: 'Revision ID' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: number_integer - settings: - thousand_separator: '' - prefix_suffix: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_revlog - entity_field: revision_id - plugin_id: field - revision_log_message: - id: revision_log_message - table: entity_test_revlog - field: revision_log_message - relationship: none - group_type: group - admin_label: '' - label: 'Revision log message' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: basic_string - settings: { } - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_revlog - entity_field: revision_log_message - plugin_id: field - revision_user: - id: revision_user - table: entity_test_revlog - field: revision_user - relationship: none - group_type: group - admin_label: '' - label: 'Revision user' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: entity_test_revlog - entity_field: revision_user - plugin_id: field - filters: { } - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - tags: { } diff --git a/core/modules/system/tests/modules/entity_test_schema_converter/entity_test_schema_converter.info.yml b/core/modules/system/tests/modules/entity_test_schema_converter/entity_test_schema_converter.info.yml deleted file mode 100644 index c6291250ec1..00000000000 --- a/core/modules/system/tests/modules/entity_test_schema_converter/entity_test_schema_converter.info.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: 'Entity Schema Converter Test' -type: module -description: 'Provides testing for the entity schema converter.' -package: Testing -version: VERSION -dependencies: - - drupal:entity_test_update diff --git a/core/modules/system/tests/modules/entity_test_schema_converter/entity_test_schema_converter.post_update.php b/core/modules/system/tests/modules/entity_test_schema_converter/entity_test_schema_converter.post_update.php deleted file mode 100644 index ecddf31058a..00000000000 --- a/core/modules/system/tests/modules/entity_test_schema_converter/entity_test_schema_converter.post_update.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/** - * @file - * Post update functions for entity_test_schema_converter. - */ - -use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter; - -/** - * @addtogroup updates-8.4.x - * @{ - */ - -/** - * Update entity_test_update to be revisionable. - */ -function entity_test_schema_converter_post_update_make_revisionable(&$sandbox) { - $revisionableSchemaConverter = new SqlContentEntityStorageSchemaConverter( - 'entity_test_update', - \Drupal::entityTypeManager(), - \Drupal::entityDefinitionUpdateManager(), - \Drupal::service('entity.last_installed_schema.repository'), - \Drupal::keyValue('entity.storage_schema.sql'), - \Drupal::database() - ); - - $revisionableSchemaConverter->convertToRevisionable( - $sandbox, - [ - 'test_single_property', - 'test_multiple_properties', - 'test_single_property_multiple_values', - 'test_multiple_properties_multiple_values', - 'test_entity_base_field_info', - ]); -} - -/** - * @} End of "addtogroup updates-8.4.x". - */ diff --git a/core/modules/system/tests/modules/entity_test_update/entity_test_update.install b/core/modules/system/tests/modules/entity_test_update/entity_test_update.install deleted file mode 100644 index 7e709f15961..00000000000 --- a/core/modules/system/tests/modules/entity_test_update/entity_test_update.install +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -/** - * @file - * Install, update and uninstall functions for the Entity Test Update module. - */ - -$index = \Drupal::state()->get('entity_test_update.db_updates.entity_rev_pub_updates'); -module_load_include('inc', 'entity_test_update', 'update/entity_rev_pub_updates_' . $index); diff --git a/core/modules/system/tests/modules/entity_test_update/entity_test_update.module b/core/modules/system/tests/modules/entity_test_update/entity_test_update.module index 8702f24d97e..9f394c279cf 100644 --- a/core/modules/system/tests/modules/entity_test_update/entity_test_update.module +++ b/core/modules/system/tests/modules/entity_test_update/entity_test_update.module @@ -7,7 +7,6 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\StringTranslation\TranslatableMarkup; -use Drupal\entity_test_update\Entity\EntityTestUpdate; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -60,136 +59,3 @@ function entity_test_update_view_presave(EntityInterface $entity) { throw new \LogicException('The view could not be saved.'); } } - -/** - * Creates a given number of 'entity_test_update' entities. - * - * The 'drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz' db dump was - * created with the following characteristics: - * - Drupal 8.0.0-rc1 installed with the Standard profile; - * - The 'entity_test_update' module enabled; - * - 102 test entities created and saved. - * - * The 'drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz' db dump - * was created with the following characteristics: - * - Drupal 8.0.0-rc1 installed with the Standard profile; - * - Manually edited the annotation of the entity_test_update entity type in - * order to make it translatable; - * - The entity_test_update and Language module enabled; - * - Romanian language added; - * - 50 test entities created, translated and saved; - * - The Content Translation module enabled and configured for our test entity - * type. This was enabled after the first 50 entities were created in order - * to have NULL values for its translation metadata fields - * (e.g. content_translation_status); - * - 52 more test entities (with the IDs 51 - 102) crated, translated and saved. - * - * The 'drupal-8.0.0-rc1-filled.standard.entity_test_update_mul_rev.php.gz' db - * dump was created like the multilingual one described above, with one change: - * The annotation of the entity_test_update entity type was also manually edited - * in order to make it revisionable. - * - * @param int $start - * (optional) The entity ID to start from. Defaults to 1. - * @param int $end - * (optional) The entity ID to end with. Defaults to 50. - * @param bool $add_translation - * (optional) Whether to create a translation for each entity. If the number - * of entities is greater than 50, the default translation (en) of the 51st - * entity and the 52nd translation (ro) are disabled through the - * 'content_moderation_status' field. Defaults to FALSE. - * - * @see drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz - * @see drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz - */ -function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_translation = FALSE) { - for ($i = $start; $i <= $end; $i++) { - $entity = EntityTestUpdate::create([ - 'id' => $i, - 'name' => $i, - 'test_single_property' => $i . ' - test single property', - 'test_multiple_properties' => [ - [ - 'value1' => $i . ' - test multiple properties - value1', - 'value2' => $i . ' - test multiple properties - value2', - ], - ], - 'test_single_property_multiple_values' => [ - ['value' => $i . ' - test single property multiple values 0'], - ['value' => $i . ' - test single property multiple values 1'], - ], - 'test_multiple_properties_multiple_values' => [ - [ - 'value1' => $i . ' - test multiple properties multiple values - value1 0', - 'value2' => $i . ' - test multiple properties multiple values - value2 0', - ], - [ - 'value1' => $i . ' - test multiple properties multiple values - value1 1', - 'value2' => $i . ' - test multiple properties multiple values - value2 1', - ], - ], - 'test_non_rev_field' => $i . ' - test non-revisionable field', - 'test_non_mul_field' => $i . ' - test non-translatable field', - 'test_non_mulrev_field' => $i . ' - test non-translatable and non-revisionable field', - 'field_test_configurable_field' => [ - [ - 'value1' => $i . ' - field test configurable field - value1 0', - 'value2' => $i . ' - field test configurable field - value2 0', - ], - [ - 'value1' => $i . ' - field test configurable field - value1 1', - 'value2' => $i . ' - field test configurable field - value2 1', - ], - ], - 'test_entity_base_field_info' => $i . ' - test entity base field info', - ]); - - if ($add_translation) { - $entity->addTranslation('ro', [ - 'name' => $i . ' - ro', - 'test_single_property' => $i . ' - test single property - ro', - 'test_multiple_properties' => [ - [ - 'value1' => $i . ' - test multiple properties - value1 - ro', - 'value2' => $i . ' - test multiple properties - value2 - ro', - ], - ], - 'test_single_property_multiple_values' => [ - ['value' => $i . ' - test single property multiple values 0 - ro'], - ['value' => $i . ' - test single property multiple values 1 - ro'], - ], - 'test_multiple_properties_multiple_values' => [ - [ - 'value1' => $i . ' - test multiple properties multiple values - value1 0 - ro', - 'value2' => $i . ' - test multiple properties multiple values - value2 0 - ro', - ], - [ - 'value1' => $i . ' - test multiple properties multiple values - value1 1 - ro', - 'value2' => $i . ' - test multiple properties multiple values - value2 1 - ro', - ], - ], - 'test_non_rev_field' => $i . ' - test non-revisionable field - ro', - 'field_test_configurable_field' => [ - [ - 'value1' => $i . ' - field test configurable field - value1 0 - ro', - 'value2' => $i . ' - field test configurable field - value2 0 - ro', - ], - [ - 'value1' => $i . ' - field test configurable field - value1 1 - ro', - 'value2' => $i . ' - field test configurable field - value2 1 - ro', - ], - ], - 'test_entity_base_field_info' => $i . ' - test entity base field info - ro', - ]); - - if ($i == 101) { - $entity->getTranslation('en')->set('content_translation_status', FALSE); - } - if ($i == 102) { - $entity->getTranslation('ro')->set('content_translation_status', FALSE); - } - } - - $entity->save(); - } -} diff --git a/core/modules/system/tests/modules/entity_test_update/update/entity_rev_pub_updates_8400.inc b/core/modules/system/tests/modules/entity_test_update/update/entity_rev_pub_updates_8400.inc deleted file mode 100644 index 7f26597166e..00000000000 --- a/core/modules/system/tests/modules/entity_test_update/update/entity_rev_pub_updates_8400.inc +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/** - * @file - * Defines the 8400 db update for the "entity_rev_pub_updates" group. - */ - -use Drupal\Core\Field\BaseFieldDefinition; - -/** - * Add the 'published' entity key to entity_test_update. - */ -function entity_test_update_update_8400() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Add the published entity key to the entity_test_update entity type. - $entity_type = $definition_update_manager->getEntityType('entity_test_update'); - - $entity_keys = $entity_type->getKeys(); - $entity_keys['published'] = 'status'; - $entity_type->set('entity_keys', $entity_keys); - $definition_update_manager->updateEntityType($entity_type); - - // Add the status field. - $status = BaseFieldDefinition::create('boolean') - ->setLabel(t('Publishing status')) - ->setDescription(t('A boolean indicating the published state.')) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) - ->setDefaultValue(TRUE); - - $has_content_translation_status_field = \Drupal::moduleHandler()->moduleExists('content_translation') && $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'entity_test_update'); - if ($has_content_translation_status_field) { - $status->setInitialValueFromField('content_translation_status', TRUE); - } - else { - $status->setInitialValue(TRUE); - } - $definition_update_manager->installFieldStorageDefinition('status', 'entity_test_update', 'entity_test_update', $status); - - // Uninstall the 'content_translation_status' field if needed. - $database = \Drupal::database(); - if ($has_content_translation_status_field) { - // First we have to remove the field data. - $database->update($entity_type->getDataTable()) - ->fields(['content_translation_status' => NULL]) - ->execute(); - - // A site may have disabled revisionability for this entity type. - if ($entity_type->isRevisionable()) { - $database->update($entity_type->getRevisionDataTable()) - ->fields(['content_translation_status' => NULL]) - ->execute(); - } - - $content_translation_status = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'entity_test_update'); - $definition_update_manager->uninstallFieldStorageDefinition($content_translation_status); - } -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/LangcodeToAsciiUpdateFilledTest.php b/core/modules/system/tests/src/Functional/Entity/Update/LangcodeToAsciiUpdateFilledTest.php deleted file mode 100644 index e26fb88029e..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/LangcodeToAsciiUpdateFilledTest.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -/** - * Runs LangcodeToAsciiUpdateTest with a dump filled with content. - * - * @group Entity - * @group legacy - */ -class LangcodeToAsciiUpdateFilledTest extends LangcodeToAsciiUpdateTest { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../fixtures/update/drupal-8.filled.standard.php.gz', - ]; - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/LangcodeToAsciiUpdateTest.php b/core/modules/system/tests/src/Functional/Entity/Update/LangcodeToAsciiUpdateTest.php deleted file mode 100644 index 653a4372395..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/LangcodeToAsciiUpdateTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -use Drupal\Core\Database\Database; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that the entity langcode fields have been updated to varchar_ascii. - * - * @group Entity - * @group legacy - */ -class LangcodeToAsciiUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests that the column collation has been updated on MySQL. - */ - public function testLangcodeColumnCollation() { - // Only testable on MySQL. - // @see https://www.drupal.org/node/301038 - if (Database::getConnection()->databaseType() !== 'mysql') { - $this->pass('This test can only run on MySQL'); - return; - } - - // Check a few different tables. - $tables = [ - 'node_field_data' => ['langcode'], - 'users_field_data' => ['langcode', 'preferred_langcode', 'preferred_admin_langcode'], - ]; - foreach ($tables as $table => $columns) { - foreach ($columns as $column) { - // Depending on MYSQL versions you get different collations. - $this->assertContains($this->getColumnCollation($table, $column), ['utf8mb4_0900_ai_ci', 'utf8mb4_general_ci'], 'Found correct starting collation for ' . $table . '.' . $column); - } - } - - // Apply updates. - $this->runUpdates(); - - foreach ($tables as $table => $columns) { - foreach ($columns as $column) { - $this->assertEqual('ascii_general_ci', $this->getColumnCollation($table, $column), 'Found correct updated collation for ' . $table . '.' . $column); - } - } - } - - /** - * Determine the column collation. - * - * @param string $table - * The table name. - * @param string $column - * The column name. - */ - protected function getColumnCollation($table, $column) { - $query = Database::getConnection()->query("SHOW FULL COLUMNS FROM {" . $table . "}"); - while ($row = $query->fetchAssoc()) { - if ($row['Field'] === $column) { - return $row['Collation']; - } - } - $this->fail('No collation found for ' . $table . '.' . $column); - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php b/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php deleted file mode 100644 index 4333c1a30e2..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php +++ /dev/null @@ -1,252 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -use Drupal\Core\Entity\ContentEntityType; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for moving the revision metadata fields. - * - * This test uses the entity_test_revlog module, which intentionally omits the - * entity_metadata_keys fields. This causes deprecation errors. - * - * @group Update - * @group legacy - */ -class MoveRevisionMetadataFieldsUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../tests/fixtures/update/drupal-8.2.0.bare.standard_with_entity_test_revlog_enabled.php.gz', - __DIR__ . '/../../../../../tests/fixtures/update/drupal-8.entity-data-revision-metadata-fields-2248983.php', - __DIR__ . '/../../../../../tests/fixtures/update/drupal-8.views-revision-metadata-fields-2248983.php', - ]; - } - - /** - * Tests that the revision metadata fields are moved correctly. - * - * @expectedDeprecation The revision_user revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation The revision_created revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation The revision_log_message revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation Support for pre-8.3.0 revision table names in imported views is deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Imported views must reference the correct tables. See https://www.drupal.org/node/2831499 - */ - public function testSystemUpdate8400() { - $this->runUpdates(); - - foreach (['entity_test_revlog', 'entity_test_mul_revlog'] as $entity_type_id) { - /** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */ - $storage = \Drupal::entityTypeManager()->getStorage($entity_type_id); - /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */ - $entity_type = $storage->getEntityType(); - $revision_metadata_field_names = $entity_type->getRevisionMetadataKeys(); - - $database_schema = \Drupal::database()->schema(); - - // Test that the revision metadata fields are present only in the - // revision table. - foreach ($revision_metadata_field_names as $revision_metadata_field_name) { - if ($entity_type->isTranslatable()) { - $this->assertFalse($database_schema->fieldExists($entity_type->getDataTable(), $revision_metadata_field_name)); - $this->assertFalse($database_schema->fieldExists($entity_type->getRevisionDataTable(), $revision_metadata_field_name)); - } - else { - $this->assertFalse($database_schema->fieldExists($entity_type->getBaseTable(), $revision_metadata_field_name)); - } - $this->assertTrue($database_schema->fieldExists($entity_type->getRevisionTable(), $revision_metadata_field_name)); - } - - // Test that the revision metadata values have been transferred correctly - // and that the moved fields are accessible. - /** @var \Drupal\Core\Entity\RevisionLogInterface $entity_rev_first */ - $entity_rev_first = $storage->loadRevision(1); - $this->assertEqual($entity_rev_first->getRevisionUserId(), '1'); - $this->assertEqual($entity_rev_first->getRevisionLogMessage(), 'first revision'); - $this->assertEqual($entity_rev_first->getRevisionCreationTime(), '1476268517'); - - /** @var \Drupal\Core\Entity\RevisionLogInterface $entity_rev_second */ - $entity_rev_second = $storage->loadRevision(2); - $this->assertEqual($entity_rev_second->getRevisionUserId(), '1'); - $this->assertEqual($entity_rev_second->getRevisionLogMessage(), 'second revision'); - $this->assertEqual($entity_rev_second->getRevisionCreationTime(), '1476268518'); - - // Test that the views using revision metadata fields are updated - // properly. - $view = View::load($entity_type_id . '_for_2248983'); - $displays = $view->get('display'); - foreach ($displays as $display => $display_data) { - foreach ($display_data['display_options']['fields'] as $property_data) { - if (in_array($property_data['field'], $revision_metadata_field_names)) { - $this->assertEqual($property_data['table'], $entity_type->getRevisionTable()); - } - } - } - } - } - - /** - * Tests the addition of required revision metadata keys. - * - * This test ensures that already cached entity instances will only return the - * required revision metadata keys they have been cached with and only new - * instances will return all the new required revision metadata keys. - * - * @expectedDeprecation The revision_user revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation The revision_created revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation The revision_log_message revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - */ - public function testAddingRequiredRevisionMetadataKeys() { - // Ensure that cached entity types without required revision metadata keys - // will not return any of the newly added required revision metadata keys. - // Contains no revision metadata keys and the property holding the required - // metadata keys is empty, the entity type id is "entity_test_mul_revlog". - $cached_with_no_metadata_keys = 'Tzo4MjoiRHJ1cGFsXFRlc3RzXHN5c3RlbVxGdW5jdGlvbmFsXEVudGl0eVxVcGRhdGVcVGVzdFJldmlzaW9uTWV0YWRhdGFCY0xheWVyRW50aXR5VHlwZSI6Mzk6e3M6MjU6IgAqAHJldmlzaW9uX21ldGFkYXRhX2tleXMiO2E6MDp7fXM6MzE6IgAqAHJlcXVpcmVkUmV2aXNpb25NZXRhZGF0YUtleXMiO2E6MDp7fXM6MTU6IgAqAHN0YXRpY19jYWNoZSI7YjoxO3M6MTU6IgAqAHJlbmRlcl9jYWNoZSI7YjoxO3M6MTk6IgAqAHBlcnNpc3RlbnRfY2FjaGUiO2I6MTtzOjE0OiIAKgBlbnRpdHlfa2V5cyI7YTo1OntzOjg6InJldmlzaW9uIjtzOjA6IiI7czo2OiJidW5kbGUiO3M6MDoiIjtzOjg6Imxhbmdjb2RlIjtzOjA6IiI7czoxNjoiZGVmYXVsdF9sYW5nY29kZSI7czoxNjoiZGVmYXVsdF9sYW5nY29kZSI7czoyOToicmV2aXNpb25fdHJhbnNsYXRpb25fYWZmZWN0ZWQiO3M6Mjk6InJldmlzaW9uX3RyYW5zbGF0aW9uX2FmZmVjdGVkIjt9czo1OiIAKgBpZCI7czoyMjoiZW50aXR5X3Rlc3RfbXVsX3JldmxvZyI7czoxNjoiACoAb3JpZ2luYWxDbGFzcyI7TjtzOjExOiIAKgBoYW5kbGVycyI7YTozOntzOjY6ImFjY2VzcyI7czo0NToiRHJ1cGFsXENvcmVcRW50aXR5XEVudGl0eUFjY2Vzc0NvbnRyb2xIYW5kbGVyIjtzOjc6InN0b3JhZ2UiO3M6NDY6IkRydXBhbFxDb3JlXEVudGl0eVxTcWxcU3FsQ29udGVudEVudGl0eVN0b3JhZ2UiO3M6MTI6InZpZXdfYnVpbGRlciI7czozNjoiRHJ1cGFsXENvcmVcRW50aXR5XEVudGl0eVZpZXdCdWlsZGVyIjt9czoxOToiACoAYWRtaW5fcGVybWlzc2lvbiI7TjtzOjI1OiIAKgBwZXJtaXNzaW9uX2dyYW51bGFyaXR5IjtzOjExOiJlbnRpdHlfdHlwZSI7czo4OiIAKgBsaW5rcyI7YTowOnt9czoxNzoiACoAbGFiZWxfY2FsbGJhY2siO047czoyMToiACoAYnVuZGxlX2VudGl0eV90eXBlIjtOO3M6MTI6IgAqAGJ1bmRsZV9vZiI7TjtzOjE1OiIAKgBidW5kbGVfbGFiZWwiO047czoxMzoiACoAYmFzZV90YWJsZSI7TjtzOjIyOiIAKgByZXZpc2lvbl9kYXRhX3RhYmxlIjtOO3M6MTc6IgAqAHJldmlzaW9uX3RhYmxlIjtOO3M6MTM6IgAqAGRhdGFfdGFibGUiO047czoxNToiACoAdHJhbnNsYXRhYmxlIjtiOjA7czoxOToiACoAc2hvd19yZXZpc2lvbl91aSI7YjowO3M6ODoiACoAbGFiZWwiO3M6MDoiIjtzOjE5OiIAKgBsYWJlbF9jb2xsZWN0aW9uIjtzOjA6IiI7czoxNzoiACoAbGFiZWxfc2luZ3VsYXIiO3M6MDoiIjtzOjE1OiIAKgBsYWJlbF9wbHVyYWwiO3M6MDoiIjtzOjE0OiIAKgBsYWJlbF9jb3VudCI7YTowOnt9czoxNToiACoAdXJpX2NhbGxiYWNrIjtOO3M6ODoiACoAZ3JvdXAiO047czoxNDoiACoAZ3JvdXBfbGFiZWwiO047czoyMjoiACoAZmllbGRfdWlfYmFzZV9yb3V0ZSI7TjtzOjI2OiIAKgBjb21tb25fcmVmZXJlbmNlX3RhcmdldCI7YjowO3M6MjI6IgAqAGxpc3RfY2FjaGVfY29udGV4dHMiO2E6MDp7fXM6MTg6IgAqAGxpc3RfY2FjaGVfdGFncyI7YToxOntpOjA7czo5OiJ0ZXN0X2xpc3QiO31zOjE0OiIAKgBjb25zdHJhaW50cyI7YTowOnt9czoxMzoiACoAYWRkaXRpb25hbCI7YTowOnt9czo4OiIAKgBjbGFzcyI7TjtzOjExOiIAKgBwcm92aWRlciI7TjtzOjIwOiIAKgBzdHJpbmdUcmFuc2xhdGlvbiI7Tjt9'; - /** @var \Drupal\Tests\system\Functional\Entity\Update\TestRevisionMetadataBcLayerEntityType $entity_type */ - $entity_type = unserialize(base64_decode($cached_with_no_metadata_keys)); - $required_revision_metadata_keys_no_bc = []; - $this->assertEquals($required_revision_metadata_keys_no_bc, $entity_type->getRevisionMetadataKeys(FALSE)); - $required_revision_metadata_keys_with_bc = $required_revision_metadata_keys_no_bc + [ - 'revision_user' => 'revision_user', - 'revision_created' => 'revision_created', - 'revision_log_message' => 'revision_log_message', - ]; - $this->assertEquals($required_revision_metadata_keys_with_bc, $entity_type->getRevisionMetadataKeys(TRUE)); - - // Ensure that cached entity types with only one required revision metadata - // key will return only that one after a second required revision metadata - // key has been added. - // Contains one revision metadata key - revision_default which is also - // contained in the property holding the required revision metadata keys, - // the entity type id is "entity_test_mul_revlog". - $cached_with_metadata_key_revision_default = 'Tzo4MjoiRHJ1cGFsXFRlc3RzXHN5c3RlbVxGdW5jdGlvbmFsXEVudGl0eVxVcGRhdGVcVGVzdFJldmlzaW9uTWV0YWRhdGFCY0xheWVyRW50aXR5VHlwZSI6Mzk6e3M6MjU6IgAqAHJldmlzaW9uX21ldGFkYXRhX2tleXMiO2E6MTp7czoxNjoicmV2aXNpb25fZGVmYXVsdCI7czoxNjoicmV2aXNpb25fZGVmYXVsdCI7fXM6MzE6IgAqAHJlcXVpcmVkUmV2aXNpb25NZXRhZGF0YUtleXMiO2E6MTp7czoxNjoicmV2aXNpb25fZGVmYXVsdCI7czoxNjoicmV2aXNpb25fZGVmYXVsdCI7fXM6MTU6IgAqAHN0YXRpY19jYWNoZSI7YjoxO3M6MTU6IgAqAHJlbmRlcl9jYWNoZSI7YjoxO3M6MTk6IgAqAHBlcnNpc3RlbnRfY2FjaGUiO2I6MTtzOjE0OiIAKgBlbnRpdHlfa2V5cyI7YTo1OntzOjg6InJldmlzaW9uIjtzOjA6IiI7czo2OiJidW5kbGUiO3M6MDoiIjtzOjg6Imxhbmdjb2RlIjtzOjA6IiI7czoxNjoiZGVmYXVsdF9sYW5nY29kZSI7czoxNjoiZGVmYXVsdF9sYW5nY29kZSI7czoyOToicmV2aXNpb25fdHJhbnNsYXRpb25fYWZmZWN0ZWQiO3M6Mjk6InJldmlzaW9uX3RyYW5zbGF0aW9uX2FmZmVjdGVkIjt9czo1OiIAKgBpZCI7czoyMjoiZW50aXR5X3Rlc3RfbXVsX3JldmxvZyI7czoxNjoiACoAb3JpZ2luYWxDbGFzcyI7TjtzOjExOiIAKgBoYW5kbGVycyI7YTozOntzOjY6ImFjY2VzcyI7czo0NToiRHJ1cGFsXENvcmVcRW50aXR5XEVudGl0eUFjY2Vzc0NvbnRyb2xIYW5kbGVyIjtzOjc6InN0b3JhZ2UiO3M6NDY6IkRydXBhbFxDb3JlXEVudGl0eVxTcWxcU3FsQ29udGVudEVudGl0eVN0b3JhZ2UiO3M6MTI6InZpZXdfYnVpbGRlciI7czozNjoiRHJ1cGFsXENvcmVcRW50aXR5XEVudGl0eVZpZXdCdWlsZGVyIjt9czoxOToiACoAYWRtaW5fcGVybWlzc2lvbiI7TjtzOjI1OiIAKgBwZXJtaXNzaW9uX2dyYW51bGFyaXR5IjtzOjExOiJlbnRpdHlfdHlwZSI7czo4OiIAKgBsaW5rcyI7YTowOnt9czoxNzoiACoAbGFiZWxfY2FsbGJhY2siO047czoyMToiACoAYnVuZGxlX2VudGl0eV90eXBlIjtOO3M6MTI6IgAqAGJ1bmRsZV9vZiI7TjtzOjE1OiIAKgBidW5kbGVfbGFiZWwiO047czoxMzoiACoAYmFzZV90YWJsZSI7TjtzOjIyOiIAKgByZXZpc2lvbl9kYXRhX3RhYmxlIjtOO3M6MTc6IgAqAHJldmlzaW9uX3RhYmxlIjtOO3M6MTM6IgAqAGRhdGFfdGFibGUiO047czoxNToiACoAdHJhbnNsYXRhYmxlIjtiOjA7czoxOToiACoAc2hvd19yZXZpc2lvbl91aSI7YjowO3M6ODoiACoAbGFiZWwiO3M6MDoiIjtzOjE5OiIAKgBsYWJlbF9jb2xsZWN0aW9uIjtzOjA6IiI7czoxNzoiACoAbGFiZWxfc2luZ3VsYXIiO3M6MDoiIjtzOjE1OiIAKgBsYWJlbF9wbHVyYWwiO3M6MDoiIjtzOjE0OiIAKgBsYWJlbF9jb3VudCI7YTowOnt9czoxNToiACoAdXJpX2NhbGxiYWNrIjtOO3M6ODoiACoAZ3JvdXAiO047czoxNDoiACoAZ3JvdXBfbGFiZWwiO047czoyMjoiACoAZmllbGRfdWlfYmFzZV9yb3V0ZSI7TjtzOjI2OiIAKgBjb21tb25fcmVmZXJlbmNlX3RhcmdldCI7YjowO3M6MjI6IgAqAGxpc3RfY2FjaGVfY29udGV4dHMiO2E6MDp7fXM6MTg6IgAqAGxpc3RfY2FjaGVfdGFncyI7YToxOntpOjA7czo5OiJ0ZXN0X2xpc3QiO31zOjE0OiIAKgBjb25zdHJhaW50cyI7YTowOnt9czoxMzoiACoAYWRkaXRpb25hbCI7YTowOnt9czo4OiIAKgBjbGFzcyI7TjtzOjExOiIAKgBwcm92aWRlciI7TjtzOjIwOiIAKgBzdHJpbmdUcmFuc2xhdGlvbiI7Tjt9'; - $entity_type = unserialize(base64_decode($cached_with_metadata_key_revision_default)); - $required_revision_metadata_keys_no_bc = [ - 'revision_default' => 'revision_default', - ]; - $this->assertEquals($required_revision_metadata_keys_no_bc, $entity_type->getRevisionMetadataKeys(FALSE)); - $required_revision_metadata_keys_with_bc = $required_revision_metadata_keys_no_bc + [ - 'revision_user' => 'revision_user', - 'revision_created' => 'revision_created', - 'revision_log_message' => 'revision_log_message', - ]; - $this->assertEquals($required_revision_metadata_keys_with_bc, $entity_type->getRevisionMetadataKeys(TRUE)); - - // Ensure that newly instantiated entity types will return the two required - // revision metadata keys. - $entity_type = new TestRevisionMetadataBcLayerEntityType(['id' => 'test']); - $required_revision_metadata_keys = [ - 'revision_default' => 'revision_default', - 'second_required_key' => 'second_required_key', - ]; - $this->assertEquals($required_revision_metadata_keys, $entity_type->getRevisionMetadataKeys(FALSE)); - - // Load an entity type from the cache with no revision metadata keys in the - // annotation. - $entity_last_installed_schema_repository = \Drupal::service('entity.last_installed_schema.repository'); - $entity_type = $entity_last_installed_schema_repository->getLastInstalledDefinition('entity_test_mul_revlog'); - $revision_metadata_keys = []; - $this->assertEquals($revision_metadata_keys, $entity_type->getRevisionMetadataKeys(FALSE)); - $revision_metadata_keys = [ - 'revision_user' => 'revision_user', - 'revision_created' => 'revision_created', - 'revision_log_message' => 'revision_log_message', - ]; - $this->assertEquals($revision_metadata_keys, $entity_type->getRevisionMetadataKeys(TRUE)); - - // Load an entity type without using the cache with no revision metadata - // keys in the annotation. - $entity_type_manager = \Drupal::entityTypeManager(); - $entity_type_manager->useCaches(FALSE); - $entity_type = $entity_type_manager->getDefinition('entity_test_mul_revlog'); - $revision_metadata_keys = [ - 'revision_default' => 'revision_default', - ]; - $this->assertEquals($revision_metadata_keys, $entity_type->getRevisionMetadataKeys(FALSE)); - $revision_metadata_keys = [ - 'revision_user' => 'revision_user', - 'revision_created' => 'revision_created', - 'revision_log_message' => 'revision_log_message', - 'revision_default' => 'revision_default', - ]; - $this->assertEquals($revision_metadata_keys, $entity_type->getRevisionMetadataKeys(TRUE)); - - // Ensure that the BC layer will not be triggered if one of the required - // revision metadata keys is defined in the annotation. - $definition = [ - 'id' => 'entity_test_mul_revlog', - 'revision_metadata_keys' => [ - 'revision_default' => 'revision_default', - ], - ]; - $entity_type = new ContentEntityType($definition); - $revision_metadata_keys = [ - 'revision_default' => 'revision_default', - ]; - $this->assertEquals($revision_metadata_keys, $entity_type->getRevisionMetadataKeys(TRUE)); - - // Ensure that the BC layer will be triggered if no revision metadata keys - // have been defined in the annotation. - $definition = [ - 'id' => 'entity_test_mul_revlog', - ]; - $entity_type = new ContentEntityType($definition); - $revision_metadata_keys = [ - 'revision_default' => 'revision_default', - 'revision_user' => 'revision_user', - 'revision_created' => 'revision_created', - 'revision_log_message' => 'revision_log_message', - ]; - $this->assertEquals($revision_metadata_keys, $entity_type->getRevisionMetadataKeys(TRUE)); - } - - /** - * Tests that the revision metadata key BC layer was updated correctly. - * - * @expectedDeprecation The revision_user revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation The revision_created revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - * @expectedDeprecation The revision_log_message revision metadata key is not set for entity type: entity_test_mul_revlog See: https://www.drupal.org/node/2831499 - */ - public function testSystemUpdate8501() { - $this->runUpdates(); - - /** @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $definition_update_manager */ - $definition_update_manager = $this->container->get('entity.definition_update_manager'); - foreach (['block_content', 'node'] as $entity_type_id) { - $installed_entity_type = $definition_update_manager->getEntityType($entity_type_id); - $revision_metadata_keys = $installed_entity_type->get('revision_metadata_keys'); - $this->assertTrue(isset($revision_metadata_keys['revision_default'])); - $required_revision_metadata_keys = $installed_entity_type->get('requiredRevisionMetadataKeys'); - $this->assertTrue(isset($required_revision_metadata_keys['revision_default'])); - } - } - -} - -/** - * Test entity type class for adding new required revision metadata keys. - */ -class TestRevisionMetadataBcLayerEntityType extends ContentEntityType { - - /** - * {@inheritdoc} - */ - public function __construct($definition) { - // Only new instances should provide the required revision metadata keys. - // The cached instances should return only what already has been stored - // under the property $revision_metadata_keys. The BC layer in - // ::getRevisionMetadataKeys() has to detect if the revision metadata keys - // have been provided by the entity type annotation, therefore we add keys - // to the property $requiredRevisionMetadataKeys only if those keys aren't - // set in the entity type annotation. - if (!isset($definition['revision_metadata_keys']['second_required_key'])) { - $this->requiredRevisionMetadataKeys['second_required_key'] = 'second_required_key'; - } - parent::__construct($definition); - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterNonTranslatableTest.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterNonTranslatableTest.php deleted file mode 100644 index 32dd5aa44fe..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterNonTranslatableTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -/** - * Tests converting a non-translatable entity type with data to revisionable. - * - * @group Entity - * @group Update - * @group legacy - */ -class SqlContentEntityStorageSchemaConverterNonTranslatableTest extends SqlContentEntityStorageSchemaConverterTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update.php.gz', - __DIR__ . '/../../../../fixtures/update/drupal-8.entity-test-schema-converter-enabled.php', - ]; - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php deleted file mode 100644 index 33f2ca5cd18..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTestBase.php +++ /dev/null @@ -1,168 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; -use Drupal\Tests\Traits\ExpectDeprecationTrait; - -/** - * Defines a class for testing the conversion of entity types to revisionable. - */ -abstract class SqlContentEntityStorageSchemaConverterTestBase extends UpdatePathTestBase { - - use EntityDefinitionTestTrait; - use ExpectDeprecationTrait; - - /** - * The entity definition update manager. - * - * @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface - */ - protected $entityDefinitionUpdateManager; - - /** - * The last installed schema repository service. - * - * @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface - */ - protected $lastInstalledSchemaRepository; - - /** - * The key-value collection for tracking installed storage schema. - * - * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface - */ - protected $installedStorageSchema; - - /** - * The state service. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $this->entityDefinitionUpdateManager = \Drupal::entityDefinitionUpdateManager(); - $this->lastInstalledSchemaRepository = \Drupal::service('entity.last_installed_schema.repository'); - $this->installedStorageSchema = \Drupal::keyValue('entity.storage_schema.sql'); - $this->state = \Drupal::state(); - } - - /** - * Tests the conversion of an entity type to revisionable. - */ - public function testMakeRevisionable() { - // Check that entity type is not revisionable prior to running the update - // process. - $original_entity_type_definition = $this->lastInstalledSchemaRepository->getLastInstalledDefinition('entity_test_update'); - $original_field_storage_definitions = $this->lastInstalledSchemaRepository->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertFalse($original_entity_type_definition->isRevisionable()); - - $translatable = $original_entity_type_definition->isTranslatable(); - - // Make the entity type revisionable and run the updates. - if ($translatable) { - $this->updateEntityTypeToRevisionableAndTranslatable(); - } - else { - $this->updateEntityTypeToRevisionable(); - } - - $this->expectDeprecation('\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter is deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() instead. See https://www.drupal.org/node/3029997.'); - $this->runUpdates(); - - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_test_update */ - $entity_test_update = $this->lastInstalledSchemaRepository->getLastInstalledDefinition('entity_test_update'); - $field_storage_definitions = $this->lastInstalledSchemaRepository->getLastInstalledFieldStorageDefinitions('entity_test_update'); - - $this->assertTrue($entity_test_update->isRevisionable()); - $this->assertEquals($translatable, isset($field_storage_definitions['revision_translation_affected'])); - - /** @var \Drupal\Core\Entity\Sql\SqlEntityStorageInterface $storage */ - $storage = \Drupal::entityTypeManager()->getStorage('entity_test_update'); - $this->assertEqual(count($storage->loadMultiple()), 102, 'All test entities were found.'); - - // Check that each field value was copied correctly to the revision tables. - for ($i = 1; $i <= 102; $i++) { - /** @var \Drupal\Core\Entity\ContentEntityInterface $revision */ - $revision = $storage->loadRevision($i); - - $this->assertEqual($i, $revision->id()); - $this->assertEqual($i, $revision->getRevisionId()); - - $this->assertEqual($i . ' - test single property', $revision->test_single_property->value); - - $this->assertEqual($i . ' - test multiple properties - value1', $revision->test_multiple_properties->value1); - $this->assertEqual($i . ' - test multiple properties - value2', $revision->test_multiple_properties->value2); - - $this->assertEqual($i . ' - test single property multiple values 0', $revision->test_single_property_multiple_values->value); - $this->assertEqual($i . ' - test single property multiple values 1', $revision->test_single_property_multiple_values[1]->value); - - $this->assertEqual($i . ' - test multiple properties multiple values - value1 0', $revision->test_multiple_properties_multiple_values[0]->value1); - $this->assertEqual($i . ' - test multiple properties multiple values - value2 0', $revision->test_multiple_properties_multiple_values[0]->value2); - $this->assertEqual($i . ' - test multiple properties multiple values - value1 1', $revision->test_multiple_properties_multiple_values[1]->value1); - $this->assertEqual($i . ' - test multiple properties multiple values - value2 1', $revision->test_multiple_properties_multiple_values[1]->value2); - - $this->assertEqual($i . ' - field test configurable field - value1 0', $revision->field_test_configurable_field[0]->value1); - $this->assertEqual($i . ' - field test configurable field - value2 0', $revision->field_test_configurable_field[0]->value2); - $this->assertEqual($i . ' - field test configurable field - value1 1', $revision->field_test_configurable_field[1]->value1); - $this->assertEqual($i . ' - field test configurable field - value2 1', $revision->field_test_configurable_field[1]->value2); - - $this->assertEqual($i . ' - test entity base field info', $revision->test_entity_base_field_info->value); - - // Do the same checks for translated field values if the entity type is - // translatable. - if (!$translatable) { - continue; - } - - // Check that the correct initial value was provided for the - // 'revision_translation_affected' field. - $this->assertTrue($revision->revision_translation_affected->value); - - $translation = $revision->getTranslation('ro'); - - $this->assertEqual($i . ' - test single property - ro', $translation->test_single_property->value); - - $this->assertEqual($i . ' - test multiple properties - value1 - ro', $translation->test_multiple_properties->value1); - $this->assertEqual($i . ' - test multiple properties - value2 - ro', $translation->test_multiple_properties->value2); - - $this->assertEqual($i . ' - test single property multiple values 0 - ro', $translation->test_single_property_multiple_values[0]->value); - $this->assertEqual($i . ' - test single property multiple values 1 - ro', $translation->test_single_property_multiple_values[1]->value); - - $this->assertEqual($i . ' - test multiple properties multiple values - value1 0 - ro', $translation->test_multiple_properties_multiple_values[0]->value1); - $this->assertEqual($i . ' - test multiple properties multiple values - value2 0 - ro', $translation->test_multiple_properties_multiple_values[0]->value2); - $this->assertEqual($i . ' - test multiple properties multiple values - value1 1 - ro', $translation->test_multiple_properties_multiple_values[1]->value1); - $this->assertEqual($i . ' - test multiple properties multiple values - value2 1 - ro', $translation->test_multiple_properties_multiple_values[1]->value2); - - $this->assertEqual($i . ' - field test configurable field - value1 0 - ro', $translation->field_test_configurable_field[0]->value1); - $this->assertEqual($i . ' - field test configurable field - value2 0 - ro', $translation->field_test_configurable_field[0]->value2); - $this->assertEqual($i . ' - field test configurable field - value1 1 - ro', $translation->field_test_configurable_field[1]->value1); - $this->assertEqual($i . ' - field test configurable field - value2 1 - ro', $translation->field_test_configurable_field[1]->value2); - - $this->assertEqual($i . ' - test entity base field info - ro', $translation->test_entity_base_field_info->value); - } - - // Check that temporary tables have been removed at the end of the process. - $schema = \Drupal::database()->schema(); - $temporary_table_names = $storage->getCustomTableMapping($entity_test_update, $field_storage_definitions, 'tmp_')->getTableNames(); - $current_table_names = $storage->getCustomTableMapping($entity_test_update, $field_storage_definitions)->getTableNames(); - foreach (array_combine($temporary_table_names, $current_table_names) as $temp_table_name => $table_name) { - $this->assertTrue($schema->tableExists($table_name)); - $this->assertFalse($schema->tableExists($temp_table_name)); - } - - // Check that backup tables have been removed at the end of the process. - $table_mapping = $storage->getCustomTableMapping($original_entity_type_definition, $original_field_storage_definitions, 'old_'); - foreach ($table_mapping->getTableNames() as $table_name) { - $this->assertFalse($schema->tableExists($table_name)); - } - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTranslatableTest.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTranslatableTest.php deleted file mode 100644 index a2b804c64b0..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaConverterTranslatableTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -/** - * Tests converting a translatable entity type with data to revisionable. - * - * @group Entity - * @group Update - * @group legacy - */ -class SqlContentEntityStorageSchemaConverterTranslatableTest extends SqlContentEntityStorageSchemaConverterTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz', - __DIR__ . '/../../../../fixtures/update/drupal-8.entity-test-schema-converter-enabled.php', - ]; - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaIndexFilledTest.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaIndexFilledTest.php deleted file mode 100644 index ee0e5b51aa1..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaIndexFilledTest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -/** - * Runs SqlContentEntityStorageSchemaIndexTest with a dump filled with content. - * - * @group Entity - * @group legacy - */ -class SqlContentEntityStorageSchemaIndexFilledTest extends SqlContentEntityStorageSchemaIndexTest { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - parent::setDatabaseDumpFiles(); - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../fixtures/update/drupal-8.filled.standard.php.gz'; - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaIndexTest.php b/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaIndexTest.php deleted file mode 100644 index e3de0e0c153..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/SqlContentEntityStorageSchemaIndexTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -use Drupal\Core\Database\Database; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that a newly-added index is properly created during database updates. - * - * @group Entity - * @group legacy - */ -class SqlContentEntityStorageSchemaIndexTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests entity and field schema database updates and execution order. - */ - public function testIndex() { - $schema = Database::getConnection()->schema(); - - // The initial Drupal 8 database dump before any updates does not include - // the entity ID in the entity field data table indices that were added in - // https://www.drupal.org/node/2261669. - $this->assertTrue($schema->indexExists('node_field_data', 'node__default_langcode'), 'Index node__default_langcode exists prior to running updates.'); - $this->assertFalse($schema->indexExists('node_field_data', 'node__id__default_langcode__langcode'), 'Index node__id__default_langcode__langcode does not exist prior to running updates.'); - $this->assertFalse($schema->indexExists('users_field_data', 'user__id__default_langcode__langcode'), 'Index users__id__default_langcode__langcode does not exist prior to running updates.'); - - // Running database updates should update the entity schemata to add the - // indices from https://www.drupal.org/node/2261669. - $this->runUpdates(); - $this->assertFalse($schema->indexExists('node_field_data', 'node__default_langcode'), 'Index node__default_langcode properly removed.'); - $this->assertTrue($schema->indexExists('node_field_data', 'node__id__default_langcode__langcode'), 'Index node__id__default_langcode__langcode properly created on the node_field_data table.'); - $this->assertTrue($schema->indexExists('users_field_data', 'user__id__default_langcode__langcode'), 'Index users__id__default_langcode__langcode properly created on the user_field_data table.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php b/core/modules/system/tests/src/Functional/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php deleted file mode 100644 index 7efc11b74bf..00000000000 --- a/core/modules/system/tests/src/Functional/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php +++ /dev/null @@ -1,179 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Entity\Update; - -use Drupal\entity_test\Entity\EntityTest; -use Drupal\Tests\BrowserTestBase; -use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; -use Drupal\Tests\system\Functional\Update\DbUpdatesTrait; - -/** - * Tests performing entity updates through the Update API. - * - * @group Entity - */ -class UpdateApiEntityDefinitionUpdateTest extends BrowserTestBase { - - use DbUpdatesTrait; - use EntityDefinitionTestTrait; - - /** - * {@inheritdoc} - */ - protected static $modules = ['entity_test']; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $admin = $this->drupalCreateUser([], FALSE, TRUE); - $this->drupalLogin($admin); - } - - /** - * Tests that individual updates applied sequentially work as expected. - */ - public function testSingleUpdates() { - // Create a test entity. - $user_ids = [mt_rand(), mt_rand()]; - $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => $user_ids]); - $entity->save(); - - // Check that only a single value is stored for 'user_id'. - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id->target_id, $user_ids[0]); - - // Make 'user_id' multiple by applying updates. - $this->enableUpdates('entity_test', 'entity_definition_updates', 8001); - $this->applyUpdates(); - - // Ensure the 'entity_test__user_id' table got created. - $this->assertTrue(\Drupal::database()->schema()->tableExists('entity_test__user_id')); - - // Check that data was correctly migrated. - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id->target_id, $user_ids[0]); - - // Store multiple data and check it is correctly stored. - $entity->user_id = $user_ids; - $entity->save(); - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 2); - $this->assertEqual($entity->user_id[0]->target_id, $user_ids[0]); - $this->assertEqual($entity->user_id[1]->target_id, $user_ids[1]); - - // Make 'user_id' single again by applying updates. - $this->enableUpdates('entity_test', 'entity_definition_updates', 8002); - $this->applyUpdates(); - - // Check that data was correctly migrated/dropped. - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id->target_id, $user_ids[0]); - - // Check that only a single value is stored for 'user_id' again. - $entity->user_id = $user_ids; - $entity->save(); - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id[0]->target_id, $user_ids[0]); - } - - /** - * Tests that multiple updates applied in bulk work as expected. - */ - public function testMultipleUpdates() { - // Create a test entity. - $user_ids = [mt_rand(), mt_rand()]; - $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => $user_ids]); - $entity->save(); - - // Check that only a single value is stored for 'user_id'. - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id->target_id, $user_ids[0]); - - // Make 'user_id' multiple and then single again by applying updates. - $this->enableUpdates('entity_test', 'entity_definition_updates', 8002); - $this->applyUpdates(); - - // Check that data was correctly migrated back and forth. - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id->target_id, $user_ids[0]); - - // Check that only a single value is stored for 'user_id' again. - $entity->user_id = $user_ids; - $entity->save(); - $entity = $this->reloadEntity($entity); - $this->assertEqual(count($entity->user_id), 1); - $this->assertEqual($entity->user_id[0]->target_id, $user_ids[0]); - } - - /** - * Tests that entity updates are correctly reported in the status report page. - */ - public function testStatusReport() { - // Create a test entity. - $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => mt_rand()]); - $entity->save(); - - // Check that the status report initially displays no error. - $this->drupalGet('admin/reports/status'); - $this->assertNoRaw('Out of date'); - $this->assertNoRaw('Mismatched entity and/or field definitions'); - - // Enable an entity update and check that we have a dedicated status report - // item. - $this->container->get('state')->set('entity_test.remove_name_field', TRUE); - $this->drupalGet('admin/reports/status'); - $this->assertNoRaw('Out of date'); - $this->assertRaw('Mismatched entity and/or field definitions'); - - // Enable a db update and check that now the entity update status report - // item is no longer displayed. We assume an update function will fix the - // mismatch. - $this->enableUpdates('entity_test', 'status_report', 8001); - $this->drupalGet('admin/reports/status'); - $this->assertRaw('Out of date'); - $this->assertRaw('Mismatched entity and/or field definitions'); - - // Apply db updates and check that entity updates were not applied. - $this->applyUpdates(); - $this->drupalGet('admin/reports/status'); - $this->assertNoRaw('Out of date'); - $this->assertRaw('Mismatched entity and/or field definitions'); - - // Apply the entity updates and check that the entity update status report - // item is no longer displayed. - $this->applyEntityUpdates(); - $this->drupalGet('admin/reports/status'); - $this->assertNoRaw('Out of date'); - $this->assertNoRaw('Mismatched entity and/or field definitions'); - } - - /** - * Reloads the specified entity. - * - * @param \Drupal\entity_test\Entity\EntityTest $entity - * An entity object. - * - * @return \Drupal\entity_test\Entity\EntityTest - * The reloaded entity object. - */ - protected function reloadEntity(EntityTest $entity) { - \Drupal::entityTypeManager()->useCaches(FALSE); - \Drupal::service('entity_field.manager')->useCaches(FALSE); - return EntityTest::load($entity->id()); - } - -} diff --git a/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php b/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php index 0be9688a6cb..6e878b03982 100644 --- a/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php +++ b/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php @@ -299,9 +299,6 @@ class InstallUninstallTest extends ModuleTestBase { $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); switch ($module) { - case 'block': - $this->assertEmpty(array_diff(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates)); - break; case 'update_test_postupdate': $this->assertEmpty(array_diff(['update_test_postupdate_post_update_first', 'update_test_postupdate_post_update_second', 'update_test_postupdate_post_update_test1', 'update_test_postupdate_post_update_test0'], $existing_updates)); break; @@ -320,11 +317,11 @@ class InstallUninstallTest extends ModuleTestBase { $all_update_functions = $post_update_registry->getPendingUpdateFunctions(); switch ($module) { - case 'block': - $this->assertEmpty(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $all_update_functions), 'Asserts that no pending post update functions are available.'); + case 'update_test_postupdate': + $this->assertEmpty(array_intersect(['update_test_postupdate_post_update_first'], $all_update_functions), 'Asserts that no pending post update functions are available.'); $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); - $this->assertEmpty(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates), 'Asserts that no post update functions are stored in keyvalue store.'); + $this->assertEmpty(array_intersect(['update_test_postupdate_post_update_first'], $existing_updates), 'Asserts that no post update functions are stored in keyvalue store.'); break; } } diff --git a/core/modules/system/tests/src/Functional/Update/AdminThemeUpdateTest.php b/core/modules/system/tests/src/Functional/Update/AdminThemeUpdateTest.php deleted file mode 100644 index 52bdbb25480..00000000000 --- a/core/modules/system/tests/src/Functional/Update/AdminThemeUpdateTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests system.theme:admin is updated. - * - * @group system - * @group legacy - */ -class AdminThemeUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.admin_theme_0.php', - ]; - } - - /** - * Tests that system.theme:admin is updated as expected. - */ - public function testUpdateHookN() { - $this->assertSame('0', $this->config('system.theme')->get('admin')); - $this->runUpdates(); - $this->assertSame('', $this->config('system.theme')->get('admin')); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/AutomatedCronUpdateWithAutomatedCronTest.php b/core/modules/system/tests/src/Functional/Update/AutomatedCronUpdateWithAutomatedCronTest.php deleted file mode 100644 index 3cd9542b01b..00000000000 --- a/core/modules/system/tests/src/Functional/Update/AutomatedCronUpdateWithAutomatedCronTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Ensures that the automated cron module is installed on update. - * - * @group Update - * @group legacy - */ -class AutomatedCronUpdateWithAutomatedCronTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that automated cron module isn installed and the config migrated. - */ - public function testUpdate() { - $this->runUpdates(); - - $module_data = \Drupal::config('core.extension')->get('module'); - $this->assertTrue(isset($module_data['automated_cron']), 'The automated cron module was installed.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/AutomatedCronUpdateWithoutAutomatedCronTest.php b/core/modules/system/tests/src/Functional/Update/AutomatedCronUpdateWithoutAutomatedCronTest.php deleted file mode 100644 index 41243240bd9..00000000000 --- a/core/modules/system/tests/src/Functional/Update/AutomatedCronUpdateWithoutAutomatedCronTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Ensures that the automated cron module is not installed on update. - * - * @group Update - * @group legacy - */ -class AutomatedCronUpdateWithoutAutomatedCronTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.without_automated_cron.php', - ]; - } - - /** - * Ensures that automated cron module isn't installed and the config migrated. - */ - public function testUpdate() { - $this->runUpdates(); - $module_data = \Drupal::config('core.extension')->get('module'); - $this->assertFalse(isset($module_data['automated_cron']), 'The automated cron module was not installed.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/ConfigOverridesUpdateTest.php b/core/modules/system/tests/src/Functional/Update/ConfigOverridesUpdateTest.php deleted file mode 100644 index 8d565ac8523..00000000000 --- a/core/modules/system/tests/src/Functional/Update/ConfigOverridesUpdateTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests system_update_8200(). - * - * @see system_update_8200() - * - * @group Update - * @group legacy - */ -class ConfigOverridesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.config-override-fix.php', - ]; - } - - /** - * Tests that configuration has been updated. - */ - public function testUpdatedSite() { - $key_to_be_removed = 'display.default.display_options.fields.nid'; - /** @var \Drupal\Core\Config\Config $config_override */ - $language_config_override = \Drupal::service('language.config_factory_override'); - $config_override = $language_config_override->getOverride('es', 'views.view.content'); - $this->assertEqual('Spanish ID', $config_override->get($key_to_be_removed)['label'], 'The spanish override for the missing field exists before updating.'); - // Since the above view will be fixed by other updates that fix views - // configuration for example, - // views_post_update_update_cacheability_metadata(), also test configuration - // that has yet to be modified in an update path. - $config_override = $language_config_override->getOverride('es', 'system.cron'); - $this->assertEqual('Should be cleaned by system_update_8200', $config_override->get('bogus_key'), 'The spanish override in system.cron exists before updating.'); - - $this->runUpdates(); - - /** @var \Drupal\Core\Config\Config $config_override */ - $config_override = \Drupal::service('language.config_factory_override')->getOverride('es', 'views.view.content'); - $this->assertNull($config_override->get($key_to_be_removed), 'The spanish override for the missing field has been removed.'); - $config_override = $language_config_override->getOverride('es', 'system.cron'); - $this->assertTrue($config_override->isNew(), 'After updating the system.cron spanish override does not exist.'); - $this->assertTrue(empty($config_override->get()), 'After updating the system.cron spanish override has no data.'); - - // Test that the spanish overrides still work. - $this->drupalLogin($this->createUser(['access content overview'])); - $this->drupalGet('admin/content', ['language' => \Drupal::languageManager()->getLanguage('es')]); - $this->assertText('Spanish Title'); - $this->assertText('Spanish Author'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/DbUpdatesTrait.php b/core/modules/system/tests/src/Functional/Update/DbUpdatesTrait.php deleted file mode 100644 index 288003b7b20..00000000000 --- a/core/modules/system/tests/src/Functional/Update/DbUpdatesTrait.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\StringTranslation\StringTranslationTrait; -use Drupal\Core\Url; -use Drupal\Tests\RequirementsPageTrait; - -/** - * Provides methods to conditionally enable db update functions and apply - * pending db updates through the Update UI. - * - * This should be used only by classes extending \Drupal\Tests\BrowserTestBase. - */ -trait DbUpdatesTrait { - - use StringTranslationTrait; - use RequirementsPageTrait; - - /** - * Enables db updates until the specified index. - * - * @param string $module - * The name of the module defining the update functions. - * @param string $group - * A name identifying the group of update functions to enable. - * @param $index - * The index of the last update function to run. - */ - protected function enableUpdates($module, $group, $index) { - $this->container->get('state')->set($module . '.db_updates.' . $group, $index); - } - - /** - * Applies any pending DB updates through the Update UI. - */ - protected function applyUpdates() { - $this->drupalGet(Url::fromRoute('system.db_update')); - $this->updateRequirementsProblem(); - $this->clickLink($this->t('Continue')); - $this->clickLink($this->t('Apply pending updates')); - $this->checkForMetaRefresh(); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/EntityReferenceAutocompleteWidgetMatchLimitUpdateTest.php b/core/modules/system/tests/src/Functional/Update/EntityReferenceAutocompleteWidgetMatchLimitUpdateTest.php deleted file mode 100644 index fa196a88a40..00000000000 --- a/core/modules/system/tests/src/Functional/Update/EntityReferenceAutocompleteWidgetMatchLimitUpdateTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that the match_limit setting is added to entity_reference_autocomplete. - * - * @see system_post_update_entity_reference_autocomplete_match_limit() - * - * @group legacy - */ -class EntityReferenceAutocompleteWidgetMatchLimitUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests that the match_limit setting is added to the config. - * - * @expectedDeprecation Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting. The field_tags field on the node.article.default form display is missing it. This BC layer will be removed before 9.0.0. See https://www.drupal.org/node/2863188 - * @expectedDeprecation Any entity_reference_autocomplete component of an entity_form_display must have a match_limit setting. The uid field on the node.article.default form display is missing it. This BC layer will be removed before 9.0.0. See https://www.drupal.org/node/2863188 - */ - public function testViewsPostUpdateEntityLinkUrl() { - $display = EntityFormDisplay::load('node.article.default'); - $this->assertArrayNotHasKey('match_limit', $display->getComponent('field_tags')['settings']); - $this->assertArrayNotHasKey('match_limit', $display->getComponent('uid')['settings']); - - $this->runUpdates(); - - $display = EntityFormDisplay::load('node.article.default'); - $this->assertEquals(10, $display->getComponent('field_tags')['settings']['match_limit']); - $this->assertEquals(10, $display->getComponent('uid')['settings']['match_limit']); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php deleted file mode 100644 index 71375b0e305..00000000000 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionDefaultTest.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; - -/** - * Tests the upgrade path for adding the 'revision_default' field. - * - * @see https://www.drupal.org/project/drupal/issues/2891215 - * - * @group Update - * @group legacy - */ -class EntityUpdateAddRevisionDefaultTest extends UpdatePathTestBase { - - use EntityDefinitionTestTrait; - use DbUpdatesTrait; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * The state service. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Do not use this property after calling ::runUpdates(). - $this->state = \Drupal::state(); - } - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul_rev.php.gz', - ]; - } - - /** - * Tests the addition of the 'revision_default' base field. - * - * @see system_update_8501() - */ - public function testAddingTheRevisionDefaultField() { - // Make the entity type revisionable and translatable prior to running the - // updates. - $this->updateEntityTypeToRevisionableAndTranslatable(); - - // Check that the test entity type does not have the 'revision_default' - // field before running the updates. - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertFalse(isset($field_storage_definitions['revision_default'])); - - $this->runUpdates(); - - // Check that the 'revision_default' field has been added by - // system_update_8501(). - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertTrue(isset($field_storage_definitions['revision_default'])); - - // Check that the correct initial value was set when the field was - // installed. - /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = \Drupal::entityTypeManager()->getStorage('entity_test_update')->load(1); - $this->assertTrue($entity->wasDefaultRevision()); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php deleted file mode 100644 index 6e0d9985c32..00000000000 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateAddRevisionTranslationAffectedTest.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; - -/** - * Tests the upgrade path for adding the 'revision_translation_affected' field. - * - * @see https://www.drupal.org/node/2896845 - * - * @group Update - * @group legacy - */ -class EntityUpdateAddRevisionTranslationAffectedTest extends UpdatePathTestBase { - - use EntityDefinitionTestTrait; - use DbUpdatesTrait; - - /** - * The state service. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected static $modules = ['entity_test_update']; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - // Do not use this property after calling ::runUpdates(). - $this->state = \Drupal::state(); - } - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul_rev.php.gz', - ]; - } - - /** - * Tests the addition of the 'revision_translation_affected' base field. - * - * @see system_update_8402() - * @see system_update_8702() - */ - public function testAddingTheRevisionTranslationAffectedField() { - // Make the entity type revisionable and translatable prior to running the - // updates. - $this->updateEntityTypeToRevisionableAndTranslatable(); - - // Check that the test entity type does not have the - // 'revision_translation_affected' field before running the updates. - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertFalse(isset($field_storage_definitions['revision_translation_affected'])); - - $this->runUpdates(); - - // Check that the 'revision_translation_affected' field has been added by - // system_update_8402(). - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertTrue(isset($field_storage_definitions['revision_translation_affected'])); - - // Check that the entity type has the 'revision_translation_affected' key. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('entity_test_update'); - $this->assertEquals('revision_translation_affected', $entity_type->getKey('revision_translation_affected')); - - // Check that the correct initial value was set when the field was - // installed. - $entity = \Drupal::entityTypeManager()->getStorage('entity_test_update')->load(1); - $this->assertNotEmpty($entity->revision_translation_affected->value); - } - - /** - * Tests the 'revision_translation_affected' field on a deleted entity type. - */ - public function testDeletedEntityType() { - // Delete the entity type before running the update. This tests the case - // where the code of an entity type has been removed but its definition has - // not yet been uninstalled. - $this->deleteEntityType(); - \Drupal::entityTypeManager()->clearCachedDefinitions(); - - // Check that the test entity type does not have the - // 'revision_translation_affected' field before running the updates. - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertFalse(isset($field_storage_definitions['revision_translation_affected'])); - - $this->runUpdates(); - - // Check that the 'revision_translation_affected' field has not been added - // by system_update_8402(). - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('entity_test_update'); - $this->assertFalse(isset($field_storage_definitions['revision_translation_affected'])); - - // Check that the entity type definition has not been updated with the new - // 'revision_translation_affected' key. - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('entity_test_update'); - $this->assertFalse($entity_type->getKey('revision_translation_affected')); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateToPublishableTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateToPublishableTest.php deleted file mode 100644 index fd9a1d95e29..00000000000 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateToPublishableTest.php +++ /dev/null @@ -1,175 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\Field\BaseFieldDefinition; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\Tests\system\Functional\Entity\Traits\EntityDefinitionTestTrait; - -/** - * Tests the upgrade path for making an entity publishable. - * - * @group Update - * @group legacy - */ -class EntityUpdateToPublishableTest extends UpdatePathTestBase { - - use EntityDefinitionTestTrait; - use DbUpdatesTrait; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * The entity type manager service. - * - * @var \Drupal\Core\Entity\EntityTypeManagerInterface - */ - protected $entityTypeManager; - - /** - * The entity definition update manager. - * - * @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface - */ - protected $entityDefinitionUpdateManager; - - /** - * The last installed schema repository service. - * - * @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface - */ - protected $lastInstalledSchemaRepository; - - /** - * The key-value collection for tracking installed storage schema. - * - * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface - */ - protected $installedStorageSchema; - - /** - * The state service. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - - $this->entityTypeManager = \Drupal::entityTypeManager(); - $this->entityDefinitionUpdateManager = \Drupal::entityDefinitionUpdateManager(); - $this->lastInstalledSchemaRepository = \Drupal::service('entity.last_installed_schema.repository'); - $this->installedStorageSchema = \Drupal::keyValue('entity.storage_schema.sql'); - $this->state = \Drupal::state(); - } - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../fixtures/update/drupal-8.0.0-rc1-filled.standard.entity_test_update_mul.php.gz', -]; - } - - /** - * Tests the conversion of an entity type to be publishable. - * - * @see entity_test_update_update_8400() - */ - public function testConvertToPublishable() { - // Check that entity type is not publishable prior to running the update - // process. - $entity_test_update = $this->lastInstalledSchemaRepository->getLastInstalledDefinition('entity_test_update'); - $this->assertFalse($entity_test_update->getKey('published')); - - // Make the entity type translatable and publishable. - $this->updateEntityTypeDefinition(); - - $this->enableUpdates('entity_test_update', 'entity_rev_pub_updates', 8400); - $this->runUpdates(); - - /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_test_update */ - $entity_test_update = $this->lastInstalledSchemaRepository->getLastInstalledDefinition('entity_test_update'); - $this->assertEquals('status', $entity_test_update->getKey('published')); - - /** @var \Drupal\Core\Entity\Sql\SqlEntityStorageInterface $storage */ - $storage = \Drupal::entityTypeManager()->getStorage('entity_test_update'); - $this->assertCount(102, $storage->loadMultiple(), 'All test entities were found.'); - - // The test entity with ID 50 was created before Content Translation was - // enabled, which means it didn't have a 'content_translation_status' field. - // content_translation_update_8400() added values for that field which - // should now be reflected in the entity's 'status' field. - /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - $entity = $storage->load(50); - $this->assertEquals(1, $entity->status->value); - - $translation = $entity->getTranslation('ro'); - $this->assertEquals(1, $translation->status->value); - - // The test entity with ID 100 was created with Content Translation enabled - // and it should have the same values as entity 50. - $entity = $storage->load(100); - $this->assertEquals(1, $entity->status->value); - - $translation = $entity->getTranslation('ro'); - $this->assertEquals(1, $translation->status->value); - - // The test entity 101 had 'content_translation_status' set to 0 for the - // English (source) language. - $entity = $storage->load(101); - $this->assertEquals(0, $entity->status->value); - - $translation = $entity->getTranslation('ro'); - $this->assertEquals(1, $translation->status->value); - - // The test entity 102 had 'content_translation_status' set to 0 for the - // Romanian language. - $entity = $storage->load(102); - $this->assertEquals(1, $entity->status->value); - - $translation = $entity->getTranslation('ro'); - $this->assertEquals(0, $translation->status->value); - } - - /** - * Updates the 'entity_test_update' entity type to translatable and - * publishable. - */ - protected function updateEntityTypeDefinition() { - $entity_type = clone $this->entityTypeManager->getDefinition('entity_test_update'); - - $keys = $entity_type->getKeys(); - $keys['published'] = 'status'; - $entity_type->set('entity_keys', $keys); - - $entity_type->set('translatable', TRUE); - $entity_type->set('data_table', 'entity_test_update_data'); - - $this->state->set('entity_test_update.entity_type', $entity_type); - - // Add the status field to the entity type. - $status = BaseFieldDefinition::create('boolean') - ->setLabel(t('Publishing status')) - ->setDescription(t('A boolean indicating the published state.')) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) - ->setRequired(TRUE) - ->setDefaultValue(TRUE); - - $this->state->set('entity_test_update.additional_base_field_definitions', [ - 'status' => $status, - ]); - - $this->entityTypeManager->clearCachedDefinitions(); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/FieldSchemaDataUninstallUpdateTest.php b/core/modules/system/tests/src/Functional/Update/FieldSchemaDataUninstallUpdateTest.php deleted file mode 100644 index e4c90ebe7b0..00000000000 --- a/core/modules/system/tests/src/Functional/Update/FieldSchemaDataUninstallUpdateTest.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path after fixing field schema data uninstallation. - * - * @see https://www.drupal.org/node/2573667 - * - * @group Update - * @group legacy - */ -class FieldSchemaDataUninstallUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.block-content-uninstall.php', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.field-schema-data-uninstall-2573667.php', - ]; - } - - /** - * Tests the upgrade path after fixing field schema data uninstallation. - */ - public function testUpdateHookN() { - $this->assertFieldSchemaData(TRUE, 'Field schema data to be purged found before update.'); - $this->runUpdates(); - $this->assertFieldSchemaData(FALSE, 'No field schema data to be purged found after update.'); - } - - /** - * Asserts that field schema data to be purged is found. - * - * @param bool $found - * Whether field schema data is expected to be found or not. - * @param string $message - * The assert message. - * - * @return bool - * TRUE if the assertion succeeded, FALSE otherwise. - */ - protected function assertFieldSchemaData($found, $message) { - $query = \Drupal::database() - ->select('key_value', 'kv') - ->fields('kv'); - $query - ->condition('kv.collection', 'entity.storage_schema.sql') - ->condition('kv.name', 'block_content.field_schema_data.%', 'LIKE'); - $items = $query - ->execute() - ->fetchAll(); - - return $this->assertEqual((bool) $items, $found, $message); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/FilterHtmlUpdateTest.php b/core/modules/system/tests/src/Functional/Update/FilterHtmlUpdateTest.php deleted file mode 100644 index ebcf7f4c01a..00000000000 --- a/core/modules/system/tests/src/Functional/Update/FilterHtmlUpdateTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\filter\Entity\FilterFormat; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that the allowed html configurations are updated with attributes. - * - * @group Entity - * @group legacy - */ -class FilterHtmlUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests system_update_8009(). - */ - public function testAllowedHtmlUpdate() { - // Make sure we have the expected values before the update. - $filters_before = [ - 'basic_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6> <p> <br> <span> <img>', - 'restricted_html' => '<a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h4> <h5> <h6>', - ]; - foreach ($filters_before as $name => $before) { - $config = FilterFormat::load($name)->toArray(); - $this->assertIdentical($before, $config['filters']['filter_html']['settings']['allowed_html']); - } - - $this->runUpdates(); - - // Make sure we have the expected values after the update. - $filters_after = [ - 'basic_html' => '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h4 id> <h5 id> <h6 id> <p> <br> <span> <img src alt height width data-align data-caption>', - 'restricted_html' => '<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h4 id> <h5 id> <h6 id>', - ]; - foreach ($filters_after as $name => $after) { - $config = FilterFormat::load($name)->toArray(); - $this->assertIdentical($after, $config['filters']['filter_html']['settings']['allowed_html']); - } - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php b/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php deleted file mode 100644 index 9d3131ff9e7..00000000000 --- a/core/modules/system/tests/src/Functional/Update/InstallProfileSystemInstall8300Test.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\Site\Settings; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests system_update_8300(). - * - * @group Update - * @group legacy - */ -class InstallProfileSystemInstall8300Test extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that the system_update_8300() runs as expected. - * - * @expectedDeprecation To access the install profile in Drupal 8 use \Drupal::installProfile() or inject the install_profile container parameter into your service. See https://www.drupal.org/node/2538996 - */ - public function testUpdate() { - // Ensure the BC layers work and settings.php and configuration is in the - // expected state before updating. - $this->assertEqual('standard', \Drupal::installProfile()); - $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.'); - $this->assertNull($this->config('core.extension')->get('profile'), 'The install profile is not present in core.extension configuration.'); - - $this->runUpdates(); - // Confirm that Drupal recognizes this distribution as the current profile. - $this->assertEqual('standard', \Drupal::installProfile()); - $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.'); - $this->assertEqual('standard', $this->config('core.extension')->get('profile'), 'The install profile has been written to core.extension configuration.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php b/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php deleted file mode 100644 index 5b4e1bbd967..00000000000 --- a/core/modules/system/tests/src/Functional/Update/LocalActionsAndTasksConvertedIntoBlocksUpdateTest.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\node\Entity\Node; - -/** - * Tests the upgrade path for local actions/tasks being converted into blocks. - * - * @see https://www.drupal.org/node/507488 - * - * @group system - * @group legacy - */ -class LocalActionsAndTasksConvertedIntoBlocksUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.local-actions-tasks-into-blocks-507488.php', - ]; - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->refreshInfo(); - } - - /** - * Tests that local actions/tasks are being converted into blocks. - */ - public function testUpdateHookN() { - $this->runUpdates(); - - /** @var \Drupal\block\BlockInterface $block_storage */ - $block_storage = \Drupal::entityTypeManager()->getStorage('block'); - /* @var \Drupal\block\BlockInterface[] $help_blocks */ - $help_blocks = $block_storage->loadByProperties(['theme' => 'bartik', 'region' => 'help']); - - $this->assertRaw('Because your site has custom theme(s) installed, we had to set local actions and tasks blocks into the content region. Please manually review the block configurations and remove the removed variables from your templates.'); - - // Disable maintenance mode. - // @todo Can be removed once maintenance mode is automatically turned off - // after updates in https://www.drupal.org/node/2435135. - \Drupal::state()->set('system.maintenance_mode', FALSE); - - // We finished updating so we can log in the user now. - $this->drupalLogin($this->rootUser); - - $page = Node::create([ - 'type' => 'page', - 'title' => 'Page node', - ]); - $page->save(); - - // Ensures that blocks inside help region has been moved to content region. - foreach ($help_blocks as $block) { - $new_block = $block_storage->load($block->id()); - $this->assertEqual($new_block->getRegion(), 'content'); - } - - // Local tasks are visible on the node page. - $this->drupalGet('node/' . $page->id()); - $this->assertText(t('Edit')); - - // Local actions are visible on the content listing page. - $this->drupalGet('admin/content'); - $action_link = $this->cssSelect('.action-links'); - $this->assertNotEmpty($action_link); - - $this->drupalGet('admin/structure/block/list/seven'); - - /** @var \Drupal\Core\Config\StorageInterface $config_storage */ - $config_storage = \Drupal::service('config.storage'); - $this->assertTrue($config_storage->exists('block.block.test_theme_local_tasks'), 'Local task block has been created for the custom theme.'); - $this->assertTrue($config_storage->exists('block.block.test_theme_local_actions'), 'Local action block has been created for the custom theme.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/MenuBlockPostUpdateTest.php b/core/modules/system/tests/src/Functional/Update/MenuBlockPostUpdateTest.php deleted file mode 100644 index 0e4d6c63b3c..00000000000 --- a/core/modules/system/tests/src/Functional/Update/MenuBlockPostUpdateTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\block\Entity\Block; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests updating menu blocks configuration. - * - * @group Update - * @group legacy - */ -class MenuBlockPostUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - // Use a more recent fixture for performance, do not run all pre-8.4 - // updates when testing this feature. - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - ]; - } - - /** - * Tests updating blocks with default 'expand_all_items' value. - * - * @see system_post_update_add_expand_all_items_key_in_system_menu_block() - */ - public function testPostUpdateMenuBlockFields() { - $this->assertArrayNotHasKey('expand_all_items', Block::load('bartik_account_menu')->get('settings')); - $this->runUpdates(); - $settings = Block::load('bartik_account_menu')->get('settings'); - $this->assertArrayHasKey('expand_all_items', $settings); - $this->assertFalse($settings['expand_all_items']); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleFilledTest.php b/core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleFilledTest.php deleted file mode 100644 index 6433bf4a665..00000000000 --- a/core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleFilledTest.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -/** - * Runs MenuTreeSerializationTitleTest with a dump filled with content. - * - * @group Update - * @group legacy - */ -class MenuTreeSerializationTitleFilledTest extends MenuTreeSerializationTitleTest { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - parent::setDatabaseDumpFiles(); - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.filled.standard.php.gz'; - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleTest.php b/core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleTest.php deleted file mode 100644 index d9572b06e26..00000000000 --- a/core/modules/system/tests/src/Functional/Update/MenuTreeSerializationTitleTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\StringTranslation\TranslatableMarkup; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests system_update_8001(). - * - * @group Update - * @group legacy - */ -class MenuTreeSerializationTitleTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that the system_update_8001() runs as expected. - */ - public function testUpdate() { - $this->runUpdates(); - - // Ensure that some fields got dropped. - $database = \Drupal::database(); - $schema = $database->schema(); - - if (!$schema->tableExists('menu_tree')) { - return; - } - - $this->assertFalse($schema->fieldExists('menu_tree', 'title_arguments')); - $this->assertFalse($schema->fieldExists('menu_tree', 'title_contexts')); - - // Ensure that all titles and description values can be unserialized. - $select = $database->select('menu_tree'); - $result = $select->fields('menu_tree', ['id', 'title', 'description']) - ->execute() - ->fetchAllAssoc('id'); - - // The test coverage relies upon the fact that unserialize() would emit a - // warning if the value is not a valid serialized value. - foreach ($result as $link) { - $title = unserialize($link->title); - $description = unserialize($link->description); - // Verify that all the links from system module have a been updated with - // a TranslatableMarkup as title and description due to the rebuild. - if (strpos($link->id, 'system.') === 0) { - $this->assertTrue($title instanceof TranslatableMarkup, get_class($title)); - if ($description) { - $this->assertTrue($description instanceof TranslatableMarkup, get_class($description)); - } - } - } - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/MoveActionsToCoreTest.php b/core/modules/system/tests/src/Functional/Update/MoveActionsToCoreTest.php deleted file mode 100644 index ad0e8259305..00000000000 --- a/core/modules/system/tests/src/Functional/Update/MoveActionsToCoreTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\system\Entity\Action; - -/** - * Tests moving email, goto, and message actions to core namespace. - * - * @group Update - * @group legacy - */ -class MoveActionsToCoreTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.actions-2815379.php', - ]; - } - - /** - * Tests upgrading actions to core namespace. - * - * @see action_post_update_move_plugins() - */ - public function testUpdateActionPlugins() { - $actions = ['goto_2815379', 'message_2815379', 'send_email_2815379']; - $before = []; - - $dependencies = ['module' => ['action']]; - foreach ($actions as $key) { - $config = \Drupal::configFactory()->get('system.action.' . $key); - $this->assertSame($dependencies, $config->get('dependencies')); - $before[$key] = $config->getRawData(); - } - - $this->runUpdates(); - - foreach ($actions as $key) { - /** @var \Drupal\system\Entity\Action $key */ - $action = Action::load($key); - $this->assertSame([], $action->getDependencies()); - // Tests that other properties remains the same. - $config = \Drupal::configFactory()->get('system.action.' . $key); - $after = $before[$key]; - $after['dependencies'] = []; - $this->assertSame($after, $config->getRawData()); - } - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/NoDependenciesUpdateTest.php b/core/modules/system/tests/src/Functional/Update/NoDependenciesUpdateTest.php deleted file mode 100644 index 23c88142b56..00000000000 --- a/core/modules/system/tests/src/Functional/Update/NoDependenciesUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Test the system module updates with no dependencies installed. - * - * @group Update - * @group legacy - */ -class NoDependenciesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected $installProfile = 'testing'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.6.0.bare.testing.php.gz', - ]; - } - - /** - * Test the system module updates with no dependencies installed. - */ - public function testNoDependenciesUpdate() { - $this->runUpdates(); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/PageTitleConvertedIntoBlockUpdateTest.php b/core/modules/system/tests/src/Functional/Update/PageTitleConvertedIntoBlockUpdateTest.php deleted file mode 100644 index 6548db66f8d..00000000000 --- a/core/modules/system/tests/src/Functional/Update/PageTitleConvertedIntoBlockUpdateTest.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\node\Entity\Node; - -/** - * Tests the upgrade path for page title being converted into a block. - * - * @see https://www.drupal.org/node/2476947 - * - * @group system - * @group legacy - */ -class PageTitleConvertedIntoBlockUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.page-title-into-block-2476947.php', - ]; - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - // @todo Remove in https://www.drupal.org/node/2568069. - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->refreshInfo(); - } - - /** - * Tests that page title is being converted into a block. - */ - public function testUpdateHookN() { - $this->runUpdates(); - - /** @var \Drupal\block\BlockInterface $block_storage */ - $block_storage = \Drupal::entityTypeManager()->getStorage('block'); - - $this->assertRaw('Because your site has custom theme(s) installed, we have placed the page title block in the content region. Please manually review the block configuration and remove the page title variables from your page templates.'); - - // Disable maintenance mode. - // @todo Can be removed once maintenance mode is automatically turned off - // after updates in https://www.drupal.org/node/2435135. - \Drupal::state()->set('system.maintenance_mode', FALSE); - - // We finished updating so we can log in the user now. - $this->drupalLogin($this->rootUser); - - $page = Node::create([ - 'type' => 'page', - 'title' => 'Page node', - ]); - $page->save(); - - // Page title is visible on the home page. - $this->drupalGet('/node'); - $this->assertRaw('page-title'); - - // Page title is visible on a node page. - $this->drupalGet('node/' . $page->id()); - $this->assertRaw('page-title'); - - $this->drupalGet('admin/structure/block/list/bartik'); - - /** @var \Drupal\Core\Config\StorageInterface $config_storage */ - $config_storage = \Drupal::service('config.storage'); - $this->assertTrue($config_storage->exists('block.block.test_theme_page_title'), 'Page title block has been created for the custom theme.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/PathAliasToEntityUpdateTest.php b/core/modules/system/tests/src/Functional/Update/PathAliasToEntityUpdateTest.php deleted file mode 100644 index 7a860906e93..00000000000 --- a/core/modules/system/tests/src/Functional/Update/PathAliasToEntityUpdateTest.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\path_alias\Entity\PathAlias; - -/** - * Tests the conversion of path aliases to entities. - * - * @group Update - * @group legacy - */ -class PathAliasToEntityUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.convert-path-aliases-to-entities-2336597.php', - ]; - } - - /** - * Tests the conversion of path aliases to entities. - * - * @see system_update_8803() - * @see system_update_8804() - */ - public function testConversionToEntities() { - $database = \Drupal::database(); - $schema = $database->schema(); - $this->assertTrue($schema->tableExists('url_alias')); - - $query = $database->select('url_alias'); - $query->addField('url_alias', 'pid', 'id'); - $query->addField('url_alias', 'source', 'path'); - $query->addField('url_alias', 'alias'); - $query->addField('url_alias', 'langcode'); - - // Path aliases did not have a 'status' value before the conversion to - // entities, but we're adding it here to ensure that the field was installed - // and populated correctly. - $query->addExpression('1', 'status'); - $original_records = $query->execute()->fetchAllAssoc('id'); - - // drupal-8.filled.standard.php.gz contains one URL alias and - // drupal-8.convert-path-aliases-to-entities-2336597.php adds another four. - $url_alias_count = 5; - $this->assertCount($url_alias_count, $original_records); - - $this->runUpdates(); - - /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ - $module_handler = $this->container->get('module_handler'); - $this->assertTrue($module_handler->moduleExists('path_alias')); - - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('path_alias'); - $this->assertEquals('path_alias', $entity_type->getProvider()); - $this->assertEquals(PathAlias::class, $entity_type->getClass()); - - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('path_alias'); - $this->assertEquals('path_alias', $field_storage_definitions['id']->getProvider()); - $this->assertEquals('path_alias', $field_storage_definitions['revision_id']->getProvider()); - $this->assertEquals('path_alias', $field_storage_definitions['langcode']->getProvider()); - $this->assertEquals('path_alias', $field_storage_definitions['uuid']->getProvider()); - $this->assertEquals('path_alias', $field_storage_definitions['status']->getProvider()); - $this->assertEquals('path_alias', $field_storage_definitions['path']->getProvider()); - $this->assertEquals('path_alias', $field_storage_definitions['alias']->getProvider()); - - // Check that the 'path_alias' entity tables have been created and the - // 'url_alias' table has been deleted. - $this->assertTrue($schema->tableExists('path_alias')); - $this->assertTrue($schema->tableExists('path_alias_revision')); - $this->assertFalse($schema->tableExists('url_alias')); - - // Check that we have a backup of the old table. - $this->assertCount(1, $schema->findTables('old_%_url_alias')); - - $path_alias_count = \Drupal::entityTypeManager()->getStorage('path_alias')->loadMultiple(); - $this->assertCount($url_alias_count, $path_alias_count); - - // Make sure that existing aliases still work. - $assert_session = $this->assertSession(); - $this->drupalGet('test-article'); - $assert_session->responseContains('/node/1'); - $assert_session->pageTextContains('Test Article - New title'); - - $this->drupalGet('test-article-new-alias'); - $assert_session->responseContains('/node/1'); - $assert_session->pageTextContains('Test Article - New title'); - - $this->drupalGet('test-alias-for-any-language'); - $assert_session->responseContains('/node/8'); - $assert_session->pageTextContains('Test title'); - - $this->drupalGet('test-alias-in-english'); - $assert_session->responseContains('/node/8'); - $assert_session->pageTextContains('Test title'); - - $spanish = \Drupal::languageManager()->getLanguage('es'); - - $this->drupalGet('test-alias-for-any-language', ['language' => $spanish]); - $assert_session->responseContains('/es/node/8'); - $assert_session->pageTextContains('Test title Spanish'); - - $this->drupalGet('test-alias-in-spanish', ['language' => $spanish]); - $assert_session->responseContains('/es/node/8'); - $assert_session->pageTextContains('Test title Spanish'); - - // Check that correct data was written in both the base and the revision - // tables. - $base_table_records = $database->select('path_alias') - ->fields('path_alias', ['id', 'path', 'alias', 'langcode', 'status']) - ->execute()->fetchAllAssoc('id'); - $this->assertEquals($original_records, $base_table_records); - - $revision_table_records = $database->select('path_alias_revision') - ->fields('path_alias_revision', ['id', 'path', 'alias', 'langcode', 'status']) - ->execute()->fetchAllAssoc('id'); - $this->assertEquals($original_records, $revision_table_records); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/README.txt b/core/modules/system/tests/src/Functional/Update/README.txt new file mode 100644 index 00000000000..a8f97e35509 --- /dev/null +++ b/core/modules/system/tests/src/Functional/Update/README.txt @@ -0,0 +1,3 @@ +This folder contains tests of System module's hook_update_N() and +hook_post_update_NAME() implementations. Tests of the update system should be +placed in core/modules/system/tests/src/Functional/UpdateSystem. diff --git a/core/modules/system/tests/src/Functional/Update/RecalculatedDependencyTest.php b/core/modules/system/tests/src/Functional/Update/RecalculatedDependencyTest.php deleted file mode 100644 index e2f262a8ebd..00000000000 --- a/core/modules/system/tests/src/Functional/Update/RecalculatedDependencyTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests system_post_update_recalculate_dependencies_for_installed_config_entities(). - * - * @group Update - * @group legacy - */ -class RecalculatedDependencyTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that the entities are resaved so they have the new dependency. - */ - public function testUpdate() { - // Test the configuration pre update. - $data = \Drupal::config('field.field.node.article.field_tags')->get(); - $this->assertEqual(['entity_reference'], $data['dependencies']['module']); - $this->assertEqual([ - 'field.storage.node.field_tags', - 'node.type.article', - ], $data['dependencies']['config']); - - $data = \Drupal::config('field.field.user.user.user_picture')->get(); - $this->assertFalse(isset($data['dependencies']['module'])); - - $data = \Drupal::config('field.storage.node.field_image')->get(); - $this->assertEqual(['node', 'image'], $data['dependencies']['module']); - - // Explicitly break an optional configuration dependencies to ensure it is - // recalculated. Use active configuration storage directly so that no events - // are fired. - $config_storage = \Drupal::service('config.storage'); - $data = $config_storage->read('search.page.node_search'); - unset($data['dependencies']); - $config_storage->write('search.page.node_search', $data); - // Ensure the update is successful. - $data = \Drupal::config('search.page.node_search')->get(); - $this->assertFalse(isset($data['dependencies']['module'])); - - // Run the updates. - $this->runUpdates(); - - // Test the configuration post update. - $data = \Drupal::config('field.field.node.article.field_tags')->get(); - $this->assertFalse(isset($data['dependencies']['module'])); - $this->assertEqual([ - 'field.storage.node.field_tags', - 'node.type.article', - 'taxonomy.vocabulary.tags', - ], $data['dependencies']['config']); - - $data = \Drupal::config('field.field.user.user.user_picture')->get(); - $this->assertEqual(['image', 'user'], $data['dependencies']['module']); - - $data = \Drupal::config('field.storage.node.field_image')->get(); - $this->assertEqual(['file', 'image', 'node'], $data['dependencies']['module']); - - $data = \Drupal::config('search.page.node_search')->get(); - $this->assertEqual(['node'], $data['dependencies']['module']); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/RemoveResponseGzipFromSystemPerformanceConfigurationTest.php b/core/modules/system/tests/src/Functional/Update/RemoveResponseGzipFromSystemPerformanceConfigurationTest.php deleted file mode 100644 index 9ab66fd2696..00000000000 --- a/core/modules/system/tests/src/Functional/Update/RemoveResponseGzipFromSystemPerformanceConfigurationTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Ensures that response.gzip is removed from system.performance configuration. - * - * @group Update - * @group legacy - */ -class RemoveResponseGzipFromSystemPerformanceConfigurationTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that response.gzip is removed from system.performance - * configuration. - */ - public function testUpdate() { - \Drupal::configFactory()->getEditable('system.performance') - ->set('response.gzip', 1) - ->save(); - - $this->runUpdates(); - - $system_performance = \Drupal::config('system.performance')->get(); - $this->assertFalse(isset($system_performance['response.gzip']), 'Configuration response.gzip has been removed from system.performance.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationFilledTest.php b/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationFilledTest.php deleted file mode 100644 index e7454c03104..00000000000 --- a/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationFilledTest.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -/** - * Runs RouterIndexOptimizationTest with a dump filled with content. - * - * @group Update - * @group legacy - */ -class RouterIndexOptimizationFilledTest extends RouterIndexOptimizationTest { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - parent::setDatabaseDumpFiles(); - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.filled.standard.php.gz'; - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationTest.php b/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationTest.php deleted file mode 100644 index 884a8dc265b..00000000000 --- a/core/modules/system/tests/src/Functional/Update/RouterIndexOptimizationTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests system_update_8002(). - * - * @group Update - * @group legacy - */ -class RouterIndexOptimizationTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Ensures that the system_update_8002() runs as expected. - */ - public function testUpdate() { - $this->runUpdates(); - $database = $this->container->get('database'); - // Removed index. - $this->assertFalse($database->schema()->indexExists( - 'router', 'pattern_outline_fit' - )); - // Added index. - $this->assertTrue($database->schema()->indexExists( - 'router', 'pattern_outline_parts' - )); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php b/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php deleted file mode 100644 index a5637564b88..00000000000 --- a/core/modules/system/tests/src/Functional/Update/SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for converting seven secondary local tasks into a block. - * - * @see https://www.drupal.org/node/2569529 - * - * @group system - * @group legacy - */ -class SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php', - ]; - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->refreshInfo(); - } - - /** - * Tests that local actions/tasks are being converted into blocks. - */ - public function testUpdateHookN() { - $this->runUpdates(); - - /** @var \Drupal\block\BlockInterface $block_storage */ - $block_storage = \Drupal::entityTypeManager()->getStorage('block'); - - // Disable maintenance mode. - // @todo Can be removed once maintenance mode is automatically turned off - // after updates in https://www.drupal.org/node/2435135. - \Drupal::state()->set('system.maintenance_mode', FALSE); - - // We finished updating so we can log in the user now. - $this->drupalLogin($this->rootUser); - - // Local actions are visible on the content listing page. - $this->drupalGet('admin/structure/block'); - $action_link = $this->cssSelect('#secondary-tabs-title'); - $this->assertNotEmpty($action_link); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/SiteBrandingConvertedIntoBlockUpdateTest.php b/core/modules/system/tests/src/Functional/Update/SiteBrandingConvertedIntoBlockUpdateTest.php deleted file mode 100644 index 4470398b25a..00000000000 --- a/core/modules/system/tests/src/Functional/Update/SiteBrandingConvertedIntoBlockUpdateTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for page site variables being converted into a block. - * - * @group system - * @group legacy - */ -class SiteBrandingConvertedIntoBlockUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.site-branding-into-block-2005546.php', - ]; - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $theme_handler->refreshInfo(); - } - - /** - * Tests that site branding elements are being converted into blocks. - */ - public function testUpdateHookN() { - $this->runUpdates(); - - /** @var \Drupal\block\BlockInterface $block_storage */ - $block_storage = \Drupal::entityTypeManager()->getStorage('block'); - - $this->assertRaw('Because your site has custom theme(s) installed, we had to set the branding block into the content region. Please manually review the block configuration and remove the site name, slogan, and logo variables from your templates.'); - - // Disable maintenance mode. - // @todo Can be removed once maintenance mode is automatically turned off - // after updates in https://www.drupal.org/node/2435135. - \Drupal::state()->set('system.maintenance_mode', FALSE); - - // We finished updating so we can log in the user now. - $this->drupalLogin($this->rootUser); - - // Site branding is visible on the home page. - $this->drupalGet('/node'); - $this->assertRaw('site-branding__logo'); - $this->assertRaw('site-branding__name'); - $this->assertNoRaw('site-branding__slogan'); - - $this->drupalGet('admin/structure/block/list/bartik'); - - /** @var \Drupal\Core\Config\StorageInterface $config_storage */ - $config_storage = \Drupal::service('config.storage'); - $this->assertTrue($config_storage->exists('block.block.test_theme_branding'), 'Site branding block has been created for the custom theme.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/StableBaseThemeUpdateTest.php b/core/modules/system/tests/src/Functional/Update/StableBaseThemeUpdateTest.php deleted file mode 100644 index 5675cb99bb3..00000000000 --- a/core/modules/system/tests/src/Functional/Update/StableBaseThemeUpdateTest.php +++ /dev/null @@ -1,144 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\DependencyInjection\ContainerBuilder; -use Drupal\Core\DependencyInjection\ServiceProviderInterface; -use Drupal\Core\Extension\ExtensionDiscovery; -use Drupal\Core\Extension\InfoParser; -use Drupal\Core\Extension\InfoParserInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\Core\Extension\ThemeEngineExtensionList; -use Drupal\Core\Extension\ThemeExtensionList; -use Drupal\Core\State\StateInterface; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use org\bovigo\vfs\vfsStream; - -/** - * Tests the upgrade path for introducing the Stable base theme. - * - * @see https://www.drupal.org/node/2575421 - * - * @group system - * @group legacy - */ -class StableBaseThemeUpdateTest extends UpdatePathTestBase implements ServiceProviderInterface { - - /** - * The theme handler. - * - * @var \Drupal\Core\Extension\ThemeHandlerInterface - */ - protected $themeHandler; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.stable-base-theme-2575421.php', - ]; - } - - /** - * {@inheritdoc} - */ - public function register(ContainerBuilder $container) { - $container->getDefinition('extension.list.theme') - ->setClass(VfsThemeExtensionList::class); - } - - /** - * {@inheritdoc} - */ - protected function prepareEnvironment() { - parent::prepareEnvironment(); - $GLOBALS['conf']['container_service_providers']['test'] = $this; - } - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->themeHandler = $this->container->get('theme_handler'); - $this->themeHandler->refreshInfo(); - - $vfs_root = vfsStream::setup('core'); - vfsStream::create([ - 'themes' => [ - 'test_stable' => [ - 'test_stable.info.yml' => file_get_contents(DRUPAL_ROOT . '/core/tests/fixtures/test_stable/test_stable.info.yml'), - 'test_stable.theme' => file_get_contents(DRUPAL_ROOT . '/core/tests/fixtures/test_stable/test_stable.theme'), - ], - 'stable' => [ - 'stable.info.yml' => file_get_contents(DRUPAL_ROOT . '/core/themes/stable/stable.info.yml'), - 'stable.theme' => file_get_contents(DRUPAL_ROOT . '/core/themes/stable/stable.theme'), - ], - ], - ], $vfs_root); - } - - /** - * Tests that the Stable base theme is installed if necessary. - * - * @expectedDeprecation There is no `base theme` property specified in the test_stable.info.yml file. The optionality of the `base theme` property is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. All Drupal 8 themes must add `base theme: stable` to their *.info.yml file for them to continue to work as-is in future versions of Drupal. Drupal 9 requires the `base theme` property to be specified. See https://www.drupal.org/node/3066038 - */ - public function testUpdateHookN() { - $this->assertTrue($this->themeHandler->themeExists('test_stable')); - $this->assertFalse($this->themeHandler->themeExists('stable')); - - $this->runUpdates(); - - // Refresh the theme handler now that Stable has been installed. - $this->themeHandler->refreshInfo(); - $this->assertTrue($this->themeHandler->themeExists('stable')); - } - -} - -class VfsThemeExtensionList extends ThemeExtensionList { - - /** - * The extension discovery for this extension list. - * - * @var \Drupal\Core\Extension\ExtensionDiscovery - */ - protected $extensionDiscovery; - - /** - * {@inheritdoc} - */ - public function __construct(string $root, string $type, CacheBackendInterface $cache, InfoParserInterface $info_parser, ModuleHandlerInterface $module_handler, StateInterface $state, ConfigFactoryInterface $config_factory, ThemeEngineExtensionList $engine_list, $install_profile) { - parent::__construct($root, $type, $cache, $info_parser, $module_handler, $state, $config_factory, $engine_list, $install_profile); - $this->extensionDiscovery = new ExtensionDiscovery('vfs://core'); - $this->infoParser = new VfsInfoParser('vfs:/'); - } - - /** - * {@inheritdoc} - */ - public function getExtensionDiscovery() { - return $this->extensionDiscovery; - } - -} - -class VfsInfoParser extends InfoParser { - - /** - * {@inheritdoc} - */ - public function parse($filename) { - return parent::parse("vfs://core/$filename"); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php b/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php deleted file mode 100644 index db5928ef1a9..00000000000 --- a/core/modules/system/tests/src/Functional/Update/UpdateActionsWithEntityPluginsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\system\Entity\Action; - -/** - * Tests upgrading comment and node actions to generic entity ones. - * - * @group Update - * @group legacy - */ -class UpdateActionsWithEntityPluginsTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [__DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz']; - } - - /** - * Tests upgrading comment and node actions to generic entity ones. - * - * @see system_post_update_change_action_plugins() - */ - public function testUpdateActionsWithEntityPlugins() { - $old_new_action_id_map = [ - 'comment_publish_action' => ['comment_publish_action', 'entity:publish_action:comment'], - 'comment_unpublish_action' => ['comment_unpublish_action', 'entity:unpublish_action:comment'], - 'comment_save_action' => ['comment_save_action', 'entity:save_action:comment'], - 'node_publish_action' => ['node_publish_action', 'entity:publish_action:node'], - 'node_unpublish_action' => ['node_unpublish_action', 'entity:unpublish_action:node'], - 'node_save_action' => ['node_save_action', 'entity:save_action:node'], - ]; - - foreach ($old_new_action_id_map as $key => list($before, $after)) { - $config = \Drupal::configFactory()->get('system.action.' . $key); - $this->assertSame($before, $config->get('plugin')); - } - - $this->runUpdates(); - - foreach ($old_new_action_id_map as $key => list($before, $after)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = Action::load($key); - $this->assertSame($after, $action->getPlugin()->getPluginId()); - $config = \Drupal::configFactory()->get('system.action.' . $key); - $this->assertSame($after, $config->get('plugin')); - - // Check that the type the action is based on will be a module dependency. - $this->assertArraySubset(['module' => [$action->getPluginDefinition()['type']]], $action->getDependencies()); - } - } - - /** - * Tests upgrading comment and node delete actions to generic entity ones. - * - * @see system_post_update_change_delete_action_plugins() - */ - public function testUpdateDeleteActionsWithEntityPlugins() { - // comment_delete_actions is not part of the dump files. - $array = [ - 'node_delete_action' => ['node_delete_action', 'entity:delete_action:node'], - ]; - - foreach ($array as $key => list($before, $after)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = Action::load($key); - $this->assertSame($before, $action->getPlugin()->getPluginId()); - } - - $this->runUpdates(); - - foreach ($array as $key => list($before, $after)) { - /** @var \Drupal\system\Entity\Action $action */ - $action = Action::load($key); - $this->assertSame($after, $action->getPlugin()->getPluginId()); - - // Check that the type the action is based on will be a module dependency. - $this->assertArraySubset(['module' => [$action->getPluginDefinition()['type']]], $action->getDependencies()); - } - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/UpdateEntityDisplayTest.php b/core/modules/system/tests/src/Functional/Update/UpdateEntityDisplayTest.php deleted file mode 100644 index 5599462ebdc..00000000000 --- a/core/modules/system/tests/src/Functional/Update/UpdateEntityDisplayTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\Core\Entity\Entity\EntityViewDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests updates for entity displays. - * - * @group Update - * @group legacy - */ -class UpdateEntityDisplayTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests that entity displays are updated with regions for their fields. - * - * @see system_post_update_add_region_to_entity_displays() - */ - public function testRegionUpdate() { - // No region key appears pre-update. - $entity_form_display = EntityFormDisplay::load('node.article.default'); - $options = $entity_form_display->getComponent('body'); - $this->assertFalse(array_key_exists('region', $options)); - - $entity_view_display = EntityViewDisplay::load('node.article.default'); - $options = $entity_view_display->getComponent('body'); - $this->assertFalse(array_key_exists('region', $options)); - - $this->runUpdates(); - - // The region key has been populated with 'content'. - $entity_form_display = EntityFormDisplay::load('node.article.default'); - $options = $entity_form_display->getComponent('body'); - $this->assertIdentical('content', $options['region']); - - $entity_view_display = EntityViewDisplay::load('node.article.default'); - $options = $entity_view_display->getComponent('body'); - $this->assertIdentical('content', $options['region']); - } - - /** - * Tests that entity displays are updated to properly store extra fields. - * - * @see system_post_update_extra_fields() - */ - public function testExtraFieldsUpdate() { - $assertion = function ($expected_keys) { - $entity_view_display = EntityViewDisplay::load('node.article.default'); - $this->assertEquals($expected_keys, array_keys($entity_view_display->getComponent('links'))); - }; - - // Before the update extra fields are missing additional configuration. - $assertion(['weight', 'region']); - $this->runUpdates(); - // After the update the additional configuration is present. - $assertion(['weight', 'region', 'settings', 'third_party_settings']); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/UpdatePathRC1TestBaseFilledTest.php b/core/modules/system/tests/src/Functional/Update/UpdatePathRC1TestBaseFilledTest.php deleted file mode 100644 index 0b59c4b6f4f..00000000000 --- a/core/modules/system/tests/src/Functional/Update/UpdatePathRC1TestBaseFilledTest.php +++ /dev/null @@ -1,433 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\node\Entity\Node; -use Drupal\node\Entity\NodeType; -use Drupal\user\Entity\User; - -/** - * Runs UpdatePathTestBaseTest with a RC1 dump filled with content. - * - * @group Update - * @group legacy - */ -class UpdatePathRC1TestBaseFilledTest extends UpdatePathRC1TestBaseTest { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - parent::setDatabaseDumpFiles(); - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz'; - } - - /** - * Tests that the content and configuration were properly updated. - */ - public function testUpdatedSite() { - $this->runUpdates(); - - $spanish = \Drupal::languageManager()->getLanguage('es'); - - $expected_node_data = [ - [1, 'article', 'en', 'Test Article - New title'], - [2, 'book', 'en', 'Book page'], - [3, 'forum', 'en', 'Forum topic'], - [4, 'page', 'en', 'Test page'], - [8, 'test_content_type', 'en', 'Test title'], - ]; - foreach ($expected_node_data as $node_data) { - $id = $node_data[0]; - $type = $node_data[1]; - $langcode = $node_data[2]; - $title = $node_data[3]; - - // Make sure our English nodes still exist. - $node = Node::load($id); - $this->assertEqual($node->language()->getId(), $langcode); - $this->assertEqual($node->getType(), $type); - $this->assertEqual($node->getTitle(), $title); - // Assert that nodes are all published. - $this->assertTrue($node->isPublished()); - $this->drupalGet('node/' . $id); - $this->assertText($title); - } - - // Make sure the translated node still exists. - $translation = Node::load(8)->getTranslation('es'); - $this->assertEqual('Test title Spanish', $translation->getTitle()); - - // Make sure our alias still works. - $this->drupalGet('test-article'); - $this->assertText('Test Article - New title'); - $this->assertText('Body'); - $this->assertText('Tags'); - - // Make sure a translated page exists. - $this->drupalGet('node/8', ['language' => $spanish]); - // Check for text of two comments. - $this->assertText('Hola'); - $this->assertText('Hello'); - // The user entity reference field is access restricted. - $this->assertNoText('Test 12'); - // Make sure all other field labels are there. - for ($i = 1; $i <= 23; $i++) { - if ($i != 12) { - $this->assertText('Test ' . $i); - } - } - - // Make sure the translated slogan appears. - $this->assertText('drupal Spanish'); - - // Make sure the custom block appears. - $this->drupalGet('<front>'); - // Block title. - $this->assertText('Another block'); - // Block body. - $this->assertText('Hello'); - - // Log in as user 1. - $account = User::load(1); - $account->passRaw = 'drupal'; - $this->drupalLogin($account); - - // Make sure we can see the access-restricted entity reference field - // now that we're logged in. - $this->drupalGet('node/8', ['language' => $spanish]); - $this->assertText('Test 12'); - $this->assertLink('drupal'); - - // Make sure the content for node 8 is still in the edit form. - $this->drupalGet('node/8/edit'); - $this->assertText('Test title'); - $this->assertText('Test body'); - $this->assertFieldChecked('edit-field-test-1-value'); - $this->assertRaw('2015-08-16'); - $this->assertRaw('test@example.com'); - $this->assertRaw('drupal.org'); - $this->assertText('0.1'); - $this->assertText('0.2'); - $this->assertRaw('+31612345678'); - $this->assertRaw('+31612345679'); - $this->assertText('Test Article - New title'); - $this->assertText('test.txt'); - $this->assertText('druplicon.small'); - $this->assertRaw('General discussion'); - $this->assertText('Test Article - New title'); - $this->assertText('Test 1'); - $this->assertRaw('0.01'); - $this->drupalPostForm('node/8/edit', [], 'Save (this translation)'); - $this->assertResponse(200); - $this->drupalGet('node/8/edit', ['language' => $spanish]); - $this->assertText('Test title Spanish'); - $this->assertText('Test body Spanish'); - - // Make sure the user page is correct. - $this->drupalGet('user/3'); - $this->assertText('usuario_test'); - $this->assertRaw('druplicon.small'); - $this->assertText('Test file field'); - $this->assertLink('test.txt'); - - // Make sure the user is translated. - $this->drupalGet('user/3/translations'); - $this->assertNoText('Not translated'); - - // Make sure the custom field on the user is still there. - $this->drupalGet('admin/config/people/accounts/fields'); - $this->assertText('Test file field'); - - // Make sure the test view still exists. - $this->drupalGet('admin/structure/views/view/test_view'); - $this->assertText('Test view'); - - // Make sure the book node exists. - $this->drupalGet('admin/structure/book'); - $this->clickLink('Test Article - New title'); - $this->assertText('Body'); - $this->assertText('Tags'); - $this->assertRaw('Text format'); - - // Make sure that users still exist. - $this->drupalGet('admin/people'); - $this->assertText('usuario_test'); - $this->assertText('drupal'); - $this->drupalGet('user/1/edit'); - $this->assertRaw('drupal@example.com'); - - // Make sure the content view works. - $this->drupalGet('admin/content'); - $this->assertText('Test title'); - - // Make sure our custom blocks show up. - $this->drupalGet('admin/structure/block'); - $this->assertText('Another block'); - $this->assertText('Test block'); - $this->drupalGet('admin/structure/block/block-content'); - $this->assertText('Another block'); - $this->assertText('Test block'); - - // Make sure our custom visibility conditions are correct. - $this->drupalGet('admin/structure/block/manage/testblock'); - $this->assertNoFieldChecked('edit-visibility-language-langcodes-es'); - $this->assertFieldChecked('edit-visibility-language-langcodes-en'); - $this->assertNoFieldChecked('edit-visibility-node-type-bundles-book'); - $this->assertFieldChecked('edit-visibility-node-type-bundles-test-content-type'); - - // Make sure our block is still translated. - $this->drupalGet('admin/structure/block/manage/testblock/translate/es/edit'); - $this->assertRaw('Test block spanish'); - - // Make sure our custom text format exists. - $this->drupalGet('admin/config/content/formats'); - $this->assertText('Test text format'); - $this->drupalGet('admin/config/content/formats/manage/test_text_format'); - $this->assertResponse('200'); - - // Make sure our feed still exists. - $this->drupalGet('admin/config/services/aggregator'); - $this->assertText('Test feed'); - $this->drupalGet('admin/config/services/aggregator/fields'); - $this->assertText('field_test'); - - // Make sure our view appears in the overview. - $this->drupalGet('admin/structure/views'); - $this->assertText('test_view'); - $this->assertText('Test view'); - - // Make sure our custom forum exists. - $this->drupalGet('admin/structure/forum'); - $this->assertText('Test forum'); - - // Make sure our custom menu exists. - $this->drupalGet('admin/structure/menu'); - $this->assertText('Test menu'); - - // Make sure our custom menu exists. - $this->drupalGet('admin/structure/menu/manage/test-menu'); - $this->clickLink('Admin'); - // Make sure the translation for the menu is still correct. - $this->drupalGet('admin/structure/menu/manage/test-menu/translate/es/edit'); - $this->assertRaw('Menu test'); - // Make sure our custom menu link exists. - $this->drupalGet('admin/structure/menu/item/1/edit'); - $this->assertFieldChecked('edit-enabled-value'); - - // Make sure our comment type exists. - $this->drupalGet('admin/structure/comment'); - $this->assertText('Test comment type'); - $this->drupalGet('admin/structure/comment/manage/test_comment_type/fields'); - $this->assertText('comment_body'); - - // Make sure our contact form exists. - $this->drupalGet('admin/structure/contact'); - $this->assertText('Test contact form'); - $this->drupalGet('admin/structure/types'); - $this->assertText('Test content type description'); - $this->drupalGet('admin/structure/types/manage/test_content_type/fields'); - - // Make sure fields are the right type. - $this->assertLink('Text (formatted, long, with summary)'); - $this->assertLink('Boolean'); - $this->assertLink('Comments'); - $this->assertLink('Date'); - $this->assertLink('Email'); - $this->assertLink('Link'); - $this->assertLink('List (float)'); - $this->assertLink('Telephone number'); - $this->assertLink('Entity reference'); - $this->assertLink('File'); - $this->assertLink('Image'); - $this->assertLink('Text (plain, long)'); - $this->assertLink('List (text)'); - $this->assertLink('Text (formatted, long)'); - $this->assertLink('Text (plain)'); - $this->assertLink('List (integer)'); - $this->assertLink('Number (integer)'); - $this->assertLink('Number (float)'); - - // Make sure our form mode exists. - $this->drupalGet('admin/structure/display-modes/form'); - $this->assertText('New form mode'); - - // Make sure our view mode exists. - $this->drupalGet('admin/structure/display-modes/view'); - $this->assertText('New view mode'); - $this->drupalGet('admin/structure/display-modes/view/manage/node.new_view_mode'); - $this->assertResponse(200); - - // Make sure our other language is still there. - $this->drupalGet('admin/config/regional/language'); - $this->assertText('Spanish'); - - // Make sure our custom date format exists. - $this->drupalGet('admin/config/regional/date-time'); - $this->assertText('Test date format'); - $this->drupalGet('admin/config/regional/date-time/formats/manage/test_date_format'); - $this->assertOptionSelected('edit-langcode', 'es'); - - // Make sure our custom image style exists. - $this->drupalGet('admin/config/media/image-styles/manage/test_image_style'); - $this->assertText('Test image style'); - $this->assertText('Desaturate'); - $this->assertText('Convert PNG'); - - // Make sure our custom responsive image style exists. - $this->drupalGet('admin/config/media/responsive-image-style/test'); - $this->assertResponse(200); - $this->assertText('Test'); - - // Make sure our custom shortcut exists. - $this->drupalGet('admin/config/user-interface/shortcut'); - $this->assertText('Test shortcut'); - $this->drupalGet('admin/config/user-interface/shortcut/manage/test/customize'); - $this->assertText('All content'); - - // Make sure our language detection settings are still correct. - $this->drupalGet('admin/config/regional/language/detection'); - $this->assertFieldChecked('edit-language-interface-enabled-language-user-admin'); - $this->assertFieldChecked('edit-language-interface-enabled-language-url'); - $this->assertFieldChecked('edit-language-interface-enabled-language-session'); - $this->assertFieldChecked('edit-language-interface-enabled-language-user'); - $this->assertFieldChecked('edit-language-interface-enabled-language-browser'); - - // Make sure strings are still translated. - $this->drupalGet('admin/structure/views/view/content/translate/es/edit'); - $this->assertText('Contenido'); - $this->drupalPostForm('admin/config/regional/translate', ['string' => 'Full comment'], 'Filter'); - $this->assertText('Comentario completo'); - - // Make sure our custom action is still there. - $this->drupalGet('admin/config/system/actions'); - $this->assertText('Test action'); - $this->drupalGet('admin/config/system/actions/configure/test_action'); - $this->assertText('test_action'); - $this->assertRaw('drupal.org'); - - // Make sure our ban still exists. - $this->drupalGet('admin/config/people/ban'); - $this->assertText('8.8.8.8'); - - // Make sure our vocabulary exists. - $this->drupalGet('admin/structure/taxonomy/manage/test_vocabulary/overview'); - - // Make sure our terms exist. - $this->assertText('Test root term'); - $this->assertText('Test child term'); - $this->drupalGet('taxonomy/term/3'); - $this->assertResponse('200'); - - // Make sure the terms are still translated. - $this->drupalGet('taxonomy/term/2/translations'); - $this->assertLink('Test root term - Spanish'); - - // Make sure our contact form exists. - $this->drupalGet('admin/structure/contact'); - $this->assertText('Test contact form'); - $this->drupalGet('admin/structure/contact/manage/test_contact_form'); - $this->assertText('test@example.com'); - $this->assertText('Hello'); - $this->drupalGet('admin/structure/contact/manage/test_contact_form/translate/es/edit'); - $this->assertText('Hola'); - $this->assertRaw('Test contact form Spanish'); - - // Make sure our modules are still enabled. - $expected_enabled_modules = [ - 'action', - 'aggregator', - 'ban', - 'basic_auth', - 'block', - 'block_content', - 'book', - 'breakpoint', - 'ckeditor', - 'color', - 'comment', - 'config', - 'config_translation', - 'contact', - 'content_translation', - 'contextual', - 'datetime', - 'dblog', - 'editor', - 'field', - 'field_ui', - 'file', - 'filter', - 'hal', - 'help', - 'history', - 'image', - 'language', - 'link', - 'locale', - 'menu_ui', - 'migrate', - 'migrate_drupal', - 'node', - 'options', - 'page_cache', - 'path', - 'quickedit', - 'rdf', - 'responsive_image', - 'rest', - 'search', - 'serialization', - 'shortcut', - 'statistics', - 'syslog', - 'system', - 'taxonomy', - 'telephone', - 'text', - 'toolbar', - 'tour', - 'tracker', - 'update', - 'user', - 'views_ui', - 'forum', - 'menu_link_content', - 'views', - 'standard', - ]; - foreach ($expected_enabled_modules as $module) { - $this->assertTrue($this->container->get('module_handler')->moduleExists($module), 'The "' . $module . '" module is still enabled.'); - } - - // Make sure our themes are still enabled. - $expected_enabled_themes = [ - 'bartik', - 'classy', - 'seven', - 'stark', - ]; - foreach ($expected_enabled_themes as $theme) { - $this->assertTrue($this->container->get('theme_handler')->themeExists($theme), 'The "' . $theme . '" is still enabled.'); - } - - // Ensure that the Book module's node type does not have duplicated enforced - // dependencies. - // @see system_post_update_fix_enforced_dependencies() - $book_node_type = NodeType::load('book'); - $this->assertEqual(['enforced' => ['module' => ['book']]], $book_node_type->get('dependencies')); - } - - /** - * {@inheritdoc} - */ - protected function replaceUser1() { - // Do not replace the user from our dump. - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/UpdatePathRC1TestBaseTest.php b/core/modules/system/tests/src/Functional/Update/UpdatePathRC1TestBaseTest.php deleted file mode 100644 index c3e0cdb0515..00000000000 --- a/core/modules/system/tests/src/Functional/Update/UpdatePathRC1TestBaseTest.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Component\Render\FormattableMarkup; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the update path base class with the RC1 database dump. - * - * @group Update - * @group legacy - */ -class UpdatePathRC1TestBaseTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['update_test_schema']; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - ]; - } - - /** - * Tests that the database was properly loaded. - */ - public function testDatabaseLoaded() { - $extensions = \Drupal::service('config.storage')->read('core.extension'); - $this->assertFalse(isset($extensions['theme']['stable']), 'Stable is not installed before updating.'); - $hook_updates = [ - 'user' => '8000', - 'node' => '8003', - 'system' => '8013', - ]; - foreach ($hook_updates as $module => $schema) { - $this->assertEqual(drupal_get_installed_schema_version($module), $schema, new FormattableMarkup('Module @module schema is @schema', ['@module' => $module, '@schema' => $schema])); - } - - // Test post_update key value stores contains a list of the update functions - // that have run. - $existing_updates = array_count_values(\Drupal::keyValue('post_update')->get('existing_updates')); - $expected_updates = [ - 'system_post_update_recalculate_configuration_entity_dependencies', - 'field_post_update_save_custom_storage_property', - 'field_post_update_entity_reference_handler_setting', - 'block_post_update_disable_blocks_with_missing_contexts', - 'views_post_update_update_cacheability_metadata', - ]; - foreach ($expected_updates as $expected_update) { - $this->assertEqual($existing_updates[$expected_update], 1, new FormattableMarkup("@expected_update exists in 'existing_updates' key and only appears once.", ['@expected_update' => $expected_update])); - } - - $this->runUpdates(); - $this->assertEqual(\Drupal::config('system.site')->get('name'), 'Site-Install'); - $this->drupalGet('<front>'); - $this->assertText('Site-Install'); - $extensions = \Drupal::service('config.storage')->read('core.extension'); - $this->assertTrue(isset($extensions['theme']['stable']), 'Stable is installed after updating.'); - $blocks = \Drupal::entityTypeManager()->getStorage('block')->loadByProperties(['theme' => 'stable']); - $this->assertTrue(empty($blocks), 'No blocks have been placed for Stable.'); - } - -} diff --git a/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php b/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php deleted file mode 100644 index 69810efae20..00000000000 --- a/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Drupal\Tests\system\Functional\Update; - -use Drupal\Core\Database\Database; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Symfony\Component\DependencyInjection\ContainerInterface; - -/** - * Updates from 8.6.0 with warm caches. - * - * @group Update - * @group legacy - */ -class WarmCacheUpdateFrom8dot6Test extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - // Created by installing minimal on 8.6.0, logging on as user 1 and doing: - // php ./core/scripts/db-tools.php dump-database-d8-mysql --schema-only=sessions,watchdog - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.6.0-minimal-with-warm-caches.sql.gz'; - $this->databaseDumpFiles[1] = __DIR__ . '/../../../../tests/fixtures/update/drupal-8.test-config-init.php'; - } - - /** - * Tests \Drupal\Core\Update\UpdateKernel::fixSerializedExtensionObjects(). - */ - public function testUpdatedSite() { - // The state API cannot be used because the value is corrupted. - $row_count = Database::getConnection()->select('key_value') - ->condition('collection', 'state') - ->condition('name', 'system.theme.data') - ->countQuery() - ->execute() - ->fetchField(); - $this->assertSame('1', $row_count, 'The system.theme.data key exists in state.'); - $this->runUpdates(); - $this->drupalGet(''); - - // Ensure that drupal-8.test-config-init.php has run correctly. - $this->assertSame('test_mail_collector', $this->config('system.mail')->get('interface.default')); - $this->assertSame('verbose', $this->config('system.logging')->get('error_level')); - $this->assertSame(FALSE, $this->config('system.performance')->get('css.preprocess')); - $this->assertSame(FALSE, $this->config('system.performance')->get('js.preprocess')); - $this->assertSame('Australia/Sydney', $this->config('system.date')->get('timezone.default')); - - // Ensure \Drupal\Core\Update\UpdateKernel::fixSerializedExtensionObjects() - // has removed the corrupted state key. - $this->assertNull(\Drupal::state()->get('system.theme.data'), 'The system.theme.data key does not exist in state.'); - } - - /** - * Tests system_update_8601(). - */ - public function testWithMissingProfile() { - // Remove the install profile from the module list to simulate how Drush 8 - // and update_fix_compatibility() worked together to remove the install - // profile. See https://www.drupal.org/project/drupal/issues/3031740. - $connection = Database::getConnection(); - $config = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); - $config = unserialize($config); - unset($config['module']['minimal']); - $connection->update('config') - ->fields([ - 'data' => serialize($config), - 'collection' => '', - 'name' => 'core.extension', - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - - $this->runUpdates(); - $this->assertSession()->pageTextContains('The minimal install profile has been added to the installed module list.'); - - // Login and check that the status report is working correctly. - $this->drupalLogin($this->rootUser); - $this->drupalGet('admin/reports/status'); - $this->assertSession()->pageTextContains("Installation Profile Minimal"); - } - - /** - * {@inheritdoc} - */ - protected function initConfig(ContainerInterface $container) { - // Don't touch configuration before running the updates as this invokes - // \Drupal\system\EventSubscriber\ConfigCacheTag::onSave() which lists - // themes. This functionality is replicated in - // core/modules/system/tests/fixtures/update/drupal-8.test-config-init.php. - } - -} diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/README.txt b/core/modules/system/tests/src/Functional/UpdateSystem/README.txt new file mode 100644 index 00000000000..d297b4e0bfa --- /dev/null +++ b/core/modules/system/tests/src/Functional/UpdateSystem/README.txt @@ -0,0 +1,3 @@ +This folder contains tests of the update system. Tests of System module's +hook_update_N() and hook_post_update_NAME() implementations should be placed in +core/modules/system/tests/src/Functional/Update. diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php index 8a292e502d4..676a56adfe6 100644 --- a/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php +++ b/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php @@ -37,8 +37,8 @@ class DbImportCommandTest extends KernelTestBase { 'key_value_expire', 'menu_link_content', 'menu_link_content_data', + 'path_alias', 'sessions', - 'url_alias', 'user__roles', 'users', 'users_field_data', @@ -60,7 +60,7 @@ class DbImportCommandTest extends KernelTestBase { $command = new DbImportCommand(); $command_tester = new CommandTester($command); $command_tester->execute([ - 'script' => __DIR__ . '/../../../fixtures/update/drupal-8.bare.standard.php.gz', + 'script' => __DIR__ . '/../../../fixtures/update/drupal-8.8.0.bare.standard.php.gz', '--database' => $this->databasePrefix, ]); diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install index bcf64aca5d5..b03fda2ac46 100644 --- a/core/modules/taxonomy/taxonomy.install +++ b/core/modules/taxonomy/taxonomy.install @@ -5,246 +5,9 @@ * Install, update and uninstall functions for the taxonomy module. */ -use Drupal\Core\Entity\Sql\SqlEntityStorageInterface; -use Drupal\Core\Field\BaseFieldDefinition; -use Drupal\Core\Site\Settings; - -/** - * Convert the custom taxonomy term hierarchy storage to a default storage. - */ -function taxonomy_update_8501() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - /** @var \Drupal\Core\Field\BaseFieldDefinition $field_storage_definition */ - $field_storage_definition = $definition_update_manager->getFieldStorageDefinition('parent', 'taxonomy_term'); - $field_storage_definition->setCustomStorage(FALSE); - $definition_update_manager->updateFieldStorageDefinition($field_storage_definition); -} - -/** - * Copy hierarchy from {taxonomy_term_hierarchy} to {taxonomy_term__parent}. - */ -function taxonomy_update_8502(&$sandbox) { - $database = \Drupal::database(); - - if (!isset($sandbox['current'])) { - // Set batch ops sandbox. - $sandbox['current'] = 0; - $sandbox['tid'] = -1; - $sandbox['delta'] = 0; - $sandbox['limit'] = Settings::get('entity_update_batch_size', 50); - - // Count records using a join, as there might be orphans in the hierarchy - // table. See https://www.drupal.org/project/drupal/issues/2997982. - $select = $database->select('taxonomy_term_hierarchy', 'h'); - $select->join('taxonomy_term_data', 'd', 'h.tid = d.tid'); - $sandbox['max'] = $select - ->countQuery() - ->execute() - ->fetchField(); - } - - // Save the hierarchy. - $select = $database->select('taxonomy_term_hierarchy', 'h'); - $select->join('taxonomy_term_data', 'd', 'h.tid = d.tid'); - $hierarchy = $select - ->fields('h', ['tid', 'parent']) - ->fields('d', ['vid', 'langcode']) - ->range($sandbox['current'], $sandbox['limit']) - ->orderBy('tid', 'ASC') - ->orderBy('parent', 'ASC') - ->execute() - ->fetchAll(); - - // Restore data. - $insert = $database->insert('taxonomy_term__parent') - ->fields(['bundle', 'entity_id', 'revision_id', 'langcode', 'delta', 'parent_target_id']); - - foreach ($hierarchy as $row) { - if ($row->tid !== $sandbox['tid']) { - $sandbox['delta'] = 0; - $sandbox['tid'] = $row->tid; - } - - $insert->values([ - 'bundle' => $row->vid, - 'entity_id' => $row->tid, - 'revision_id' => $row->tid, - 'langcode' => $row->langcode, - 'delta' => $sandbox['delta'], - 'parent_target_id' => $row->parent, - ]); - - $sandbox['delta']++; - $sandbox['current']++; - } - - $insert->execute(); - - $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['current'] / $sandbox['max']); - - if ($sandbox['#finished'] >= 1) { - // Update the entity type because the 'taxonomy_term_hierarchy' table is no - // longer part of its shared tables schema. - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $definition_update_manager->updateEntityType($definition_update_manager->getEntityType('taxonomy_term')); - - // \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::onEntityTypeUpdate() - // only deletes *known* entity tables (i.e. the base, data and revision - // tables), so we have to drop it manually. - $database->schema()->dropTable('taxonomy_term_hierarchy'); - - return t('Taxonomy term hierarchy has been converted to default entity reference storage.'); - } -} - -/** - * Update views to use {taxonomy_term__parent} in relationships. - */ -function taxonomy_update_8503() { - $config_factory = \Drupal::configFactory(); - - foreach ($config_factory->listAll('views.view.') as $id) { - $view = $config_factory->getEditable($id); - - foreach (array_keys($view->get('display')) as $display_id) { - $changed = FALSE; - - foreach (['relationships', 'filters', 'arguments'] as $handler_type) { - $base_path = "display.$display_id.display_options.$handler_type"; - $handlers = $view->get($base_path); - - if (!$handlers) { - continue; - } - - foreach ($handlers as $handler_key => $handler_config) { - $table_path = "$base_path.$handler_key.table"; - $field_path = "$base_path.$handler_key.field"; - $table = $view->get($table_path); - $field = $view->get($field_path); - - if (($table && ($table === 'taxonomy_term_hierarchy')) && ($field && ($field === 'parent'))) { - $view->set($table_path, 'taxonomy_term__parent'); - $view->set($field_path, 'parent_target_id'); - - $changed = TRUE; - } - } - } - - if ($changed) { - $view->save(TRUE); - } - } - } -} - -/** - * Add the publishing status fields to taxonomy terms. - */ -function taxonomy_update_8601() { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $definition_update_manager->getEntityType('taxonomy_term'); - - // Bail out early if a field named 'status' is already installed. - if ($definition_update_manager->getFieldStorageDefinition('status', 'taxonomy_term')) { - $message = \Drupal::state()->get('taxonomy_update_8601_skip_message', t('The publishing status field has <strong>not</strong> been added to taxonomy terms. See <a href=":link">this page</a> for more information on how to install it.', [ - ':link' => 'https://www.drupal.org/node/2985366', - ])); - return $message; - } - - // Add the 'published' entity key to the taxonomy_term entity type. - $entity_keys = $entity_type->getKeys(); - $entity_keys['published'] = 'status'; - $entity_type->set('entity_keys', $entity_keys); - - $definition_update_manager->updateEntityType($entity_type); - - // Add the status field. - $status = BaseFieldDefinition::create('boolean') - ->setLabel(t('Publishing status')) - ->setDescription(t('A boolean indicating the published state.')) - ->setRevisionable(TRUE) - ->setTranslatable(TRUE) - ->setDefaultValue(TRUE); - - $has_content_translation_status_field = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'taxonomy_term'); - if ($has_content_translation_status_field) { - $status->setInitialValueFromField('content_translation_status', TRUE); - } - else { - $status->setInitialValue(TRUE); - } - $definition_update_manager->installFieldStorageDefinition('status', 'taxonomy_term', 'taxonomy_term', $status); - - // Uninstall the 'content_translation_status' field if needed. - if ($has_content_translation_status_field) { - $content_translation_status = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'taxonomy_term'); - $definition_update_manager->uninstallFieldStorageDefinition($content_translation_status); - } - - return t('The publishing status field has been added to taxonomy terms.'); -} - /** - * Add an index on the 'taxonomy_term__parent' field table. + * Implements hook_update_last_removed(). */ -function taxonomy_update_8701() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $storage_definition = $entity_definition_update_manager->getFieldStorageDefinition('parent', 'taxonomy_term'); - $entity_definition_update_manager->updateFieldStorageDefinition($storage_definition); -} - -/** - * Fix the parent field langcode data. - */ -function taxonomy_update_8702(&$sandbox) { - $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $field_storage_definition = $definition_update_manager->getFieldStorageDefinition('parent', 'taxonomy_term'); - $entity_type = $definition_update_manager->getEntityType('taxonomy_term'); - - // Only perform the update if: - // - The field is not translatable. It's possible that custom or contrib code - // has overridden this. - // - The field is not revisionable. If it is then - // taxonomy_post_update_make_taxonomy_term_revisionable() has already run - // and this used to fix the parent field langcode data. - // - Terms are using a SQL-based storage class. - if (!$field_storage_definition->isTranslatable() && - !$entity_type->isRevisionable() && - is_subclass_of($entity_type->getStorageClass(), SqlEntityStorageInterface::class) - ) { - // taxonomy_update_8502() populated the langcode field of - // 'taxonomy_term__parent' using the term's langcode. However, the field is - // not translatable and, therefore, should use the term's default language. - $database = \Drupal::database(); - $select = $database->select('taxonomy_term__parent', 'tp'); - $select->join('taxonomy_term_field_data', 'tdf', 'tp.entity_id = tdf.tid AND tdf.langcode <> tp.langcode'); - $select->fields('tp', ['entity_id']) - ->fields('tdf', ['tid', 'langcode']) - ->condition('tdf.default_langcode', 1); - - if (!isset($sandbox['max'])) { - $count_query = clone $select; - $sandbox['max'] = $count_query->countQuery()->execute()->fetchField(); - $sandbox['current'] = 0; - } - - $result = $select->execute(); - $processed = 0; - while ($row = $result->fetchAssoc()) { - $database->update('taxonomy_term__parent') - ->condition('entity_id', $row['tid']) - ->fields(['langcode' => $row['langcode']]) - ->execute(); - $sandbox['current']++; - $processed++; - if ($processed >= Settings::get('entity_update_batch_size', 50)) { - break; - } - } - } - $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['current'] / $sandbox['max']); +function taxonomy_update_last_removed() { + return 8702; } diff --git a/core/modules/taxonomy/tests/fixtures/update/core.entity_form_display.taxonomy_term.tags.default.yml b/core/modules/taxonomy/tests/fixtures/update/core.entity_form_display.taxonomy_term.tags.default.yml deleted file mode 100644 index 7835d227ea8..00000000000 --- a/core/modules/taxonomy/tests/fixtures/update/core.entity_form_display.taxonomy_term.tags.default.yml +++ /dev/null @@ -1,43 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - taxonomy.vocabulary.tags - module: - - path - - text -id: taxonomy_term.tags.default -targetEntityType: taxonomy_term -bundle: tags -mode: default -content: - description: - type: text_textarea - weight: 0 - region: content - settings: - placeholder: '' - rows: 5 - third_party_settings: { } - name: - type: string_textfield - weight: -5 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } - path: - type: path - weight: 30 - region: content - settings: { } - third_party_settings: { } - status: - type: boolean_checkbox - settings: - display_label: false - weight: 100 - region: content - third_party_settings: { } -hidden: { } diff --git a/core/modules/taxonomy/tests/fixtures/update/drupal-8.taxonomy-term-publishing-status-ui-2899923.php b/core/modules/taxonomy/tests/fixtures/update/drupal-8.taxonomy-term-publishing-status-ui-2899923.php deleted file mode 100644 index f665fb13394..00000000000 --- a/core/modules/taxonomy/tests/fixtures/update/drupal-8.taxonomy-term-publishing-status-ui-2899923.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.filled.standard.php.gz for testing - * the upgrade path of https://www.drupal.org/project/drupal/issues/2899923. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$taxonomy_form_display_file = __DIR__ . '/core.entity_form_display.taxonomy_term.tags.default.yml'; -$taxonomy_form_display_config = Yaml::decode(file_get_contents($taxonomy_form_display_file)); - -$connection->insert('config') - ->fields(['collection', 'name', 'data']) - ->values([ - 'collection' => '', - 'name' => 'core.entity_form_display.taxonomy_term.tags.default', - 'data' => serialize($taxonomy_form_display_config), - ]) - ->execute(); diff --git a/core/modules/taxonomy/tests/fixtures/update/drupal-8.views-taxonomy-term-publishing-status-2981887.php b/core/modules/taxonomy/tests/fixtures/update/drupal-8.views-taxonomy-term-publishing-status-2981887.php deleted file mode 100644 index 13374dbb7ff..00000000000 --- a/core/modules/taxonomy/tests/fixtures/update/drupal-8.views-taxonomy-term-publishing-status-2981887.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.filled.standard.php.gz for testing - * the upgrade path of https://www.drupal.org/project/drupal/issues/2981887. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$view_file = __DIR__ . '/views.view.test_taxonomy_term_view_with_content_translation_status.yml'; -$view_with_cts_config = Yaml::decode(file_get_contents($view_file)); - -$view_file = __DIR__ . '/views.view.test_taxonomy_term_view_without_content_translation_status.yml'; -$view_without_cts_config = Yaml::decode(file_get_contents($view_file)); - -$connection->insert('config') - ->fields(['collection', 'name', 'data']) - ->values([ - 'collection' => '', - 'name' => 'views.view.test_taxonomy_term_view_with_content_translation_status', - 'data' => serialize($view_with_cts_config), - ]) - ->values([ - 'collection' => '', - 'name' => 'views.view.test_taxonomy_term_view_without_content_translation_status', - 'data' => serialize($view_without_cts_config), - ]) - ->execute(); diff --git a/core/modules/taxonomy/tests/fixtures/update/views.view.test_taxonomy_term_view_with_content_translation_status.yml b/core/modules/taxonomy/tests/fixtures/update/views.view.test_taxonomy_term_view_with_content_translation_status.yml deleted file mode 100644 index 16875664ba0..00000000000 --- a/core/modules/taxonomy/tests/fixtures/update/views.view.test_taxonomy_term_view_with_content_translation_status.yml +++ /dev/null @@ -1,249 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - taxonomy - - user -id: test_taxonomy_term_view_with_content_translation_status -label: 'Test taxonomy term view with content translation status' -module: views -description: '' -tag: '' -base_table: taxonomy_term_field_data -base_field: tid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - offset: 0 - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - id: name - table: taxonomy_term_field_data - field: name - entity_type: taxonomy_term - entity_field: name - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - type: string - settings: - link_to_entity: true - plugin_id: term_name - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - convert_spaces: false - content_translation_status: - id: content_translation_status - table: taxonomy_term_field_data - field: content_translation_status - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: boolean - settings: - format: true-false - format_custom_true: '' - format_custom_false: '' - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: taxonomy_term - entity_field: content_translation_status - plugin_id: field - filters: - content_translation_status: - id: content_translation_status - table: taxonomy_term_field_data - field: content_translation_status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: All - group: 1 - exposed: true - expose: - operator_id: '' - label: 'Translation status' - description: '' - use_operator: false - operator: content_translation_status_op - identifier: content_translation_status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: taxonomy_term - entity_field: content_translation_status - plugin_id: boolean - sorts: - content_translation_status: - id: content_translation_status - table: taxonomy_term_field_data - field: content_translation_status - relationship: none - group_type: group - admin_label: '' - order: ASC - exposed: false - expose: - label: '' - entity_type: taxonomy_term - entity_field: content_translation_status - plugin_id: standard - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - user.permissions - tags: { } diff --git a/core/modules/taxonomy/tests/fixtures/update/views.view.test_taxonomy_term_view_without_content_translation_status.yml b/core/modules/taxonomy/tests/fixtures/update/views.view.test_taxonomy_term_view_without_content_translation_status.yml deleted file mode 100644 index e3de9491ce6..00000000000 --- a/core/modules/taxonomy/tests/fixtures/update/views.view.test_taxonomy_term_view_without_content_translation_status.yml +++ /dev/null @@ -1,127 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - taxonomy - - user -id: test_taxonomy_term_view_without_content_translation_status -label: 'Test taxonomy term view without content translation status' -module: views -description: '' -tag: '' -base_table: taxonomy_term_field_data -base_field: tid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: none - options: - offset: 0 - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - name: - id: name - table: taxonomy_term_field_data - field: name - entity_type: taxonomy_term - entity_field: name - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - type: string - settings: - link_to_entity: true - plugin_id: term_name - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - convert_spaces: false - filters: { } - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - tags: { } diff --git a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php deleted file mode 100644 index 1580b8c5cfb..00000000000 --- a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -namespace Drupal\Tests\taxonomy\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\taxonomy\Entity\Term; - -/** - * Ensure that the taxonomy updates are running as expected. - * - * @group taxonomy - * @group Update - * @group legacy - */ -class TaxonomyParentUpdateTest extends UpdatePathTestBase { - - /** - * The database connection. - * - * @var \Drupal\Core\Database\Connection - */ - protected $db; - - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->db = $this->container->get('database'); - } - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.views-taxonomy-parent-2543726.php', - ]; - } - - /** - * Tests taxonomy term parents update. - * - * @see taxonomy_update_8501() - * @see taxonomy_update_8502() - * @see taxonomy_update_8503() - */ - public function testTaxonomyUpdateParents() { - // Run updates. - $this->runUpdates(); - - /** @var \Drupal\taxonomy\TermInterface $term */ - $term = Term::load(1); - $parents = [2, 3]; - $this->assertCount(2, $term->parent); - $this->assertTrue(in_array($term->parent[0]->entity->id(), $parents)); - $this->assertTrue(in_array($term->parent[1]->entity->id(), $parents)); - - $term = Term::load(2); - $parents = [0, 3]; - $this->assertCount(2, $term->parent); - $this->assertTrue(in_array($term->parent[0]->target_id, $parents)); - $this->assertTrue(in_array($term->parent[1]->target_id, $parents)); - - $term = Term::load(3); - $this->assertCount(1, $term->parent); - // Target ID is returned as string. - $this->assertSame(0, (int) $term->get('parent')[0]->target_id); - - // Test if the view has been converted to use the {taxonomy_term__parent} - // table instead of the {taxonomy_term_hierarchy} table. - $view = $this->config("views.view.test_taxonomy_parent"); - - $relationship_base_path = 'display.default.display_options.relationships.parent'; - $this->assertSame('taxonomy_term__parent', $view->get("$relationship_base_path.table")); - $this->assertSame('parent_target_id', $view->get("$relationship_base_path.field")); - - $filters_base_path_1 = 'display.default.display_options.filters.parent'; - $this->assertSame('taxonomy_term__parent', $view->get("$filters_base_path_1.table")); - $this->assertSame('parent_target_id', $view->get("$filters_base_path_1.field")); - - $filters_base_path_2 = 'display.default.display_options.filters.parent'; - $this->assertSame('taxonomy_term__parent', $view->get("$filters_base_path_2.table")); - $this->assertSame('parent_target_id', $view->get("$filters_base_path_2.field")); - - // The {taxonomy_term_hierarchy} table has been removed. - $this->assertFalse($this->db->schema()->tableExists('taxonomy_term_hierarchy')); - } - -} diff --git a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermParentMultilingualTest.php b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermParentMultilingualTest.php deleted file mode 100644 index 077a97af21e..00000000000 --- a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermParentMultilingualTest.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -namespace Drupal\Tests\taxonomy\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\taxonomy\Entity\Term; -use Drupal\user\Entity\User; - -/** - * Tests the upgrade path for taxonomy parents with multilingual terms. - * - * @group taxonomy - * @group Update - * @group legacy - */ -class TaxonomyTermParentMultilingualTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.taxonomy-parent-multilingual-3066439.php', - ]; - } - - /** - * Tests taxonomy multilingual term parents update. - * - * @see taxonomy_update_8501() - * @see taxonomy_update_8502() - * @see taxonomy_update_8503() - * @see taxonomy_update_8702() - */ - public function testMultilingualTermParentUpdate() { - // There are 65 terms in the database. Process them in groups of 30 to test - // batching. - $settings['entity_update_batch_size'] = (object) [ - 'value' => 30, - 'required' => TRUE, - ]; - - $this->writeSettings($settings); - $this->runUpdates(); - - $term = Term::load(65); - $this->assertSame('64', $term->parent[0]->target_id); - - // Term 2 should have the root parent. - $term = Term::load(2); - $this->assertSame('0', $term->parent[0]->target_id); - - // Log in as user 1. - $account = User::load(1); - $account->passRaw = 'drupal'; - $this->drupalLogin($account); - - // Make sure our vocabulary exists. - $this->drupalGet('admin/structure/taxonomy/manage/test_vocabulary/overview'); - - // Make sure our terms exist. - $assert_session = $this->assertSession(); - $assert_session->pageTextContains('Test root term'); - $assert_session->pageTextContains('Test child term'); - - // Make sure the terms are still translated. - $this->drupalGet('taxonomy/term/2/translations'); - $assert_session->linkExists('Test root term - Spanish'); - - $storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term'); - - // Check that the 'content_translation_status' field has been updated - // correctly. - /** @var \Drupal\taxonomy\TermInterface $term */ - $term = $storage->load(2); - $translation = $term->getTranslation('es'); - $this->assertTrue($translation->isPublished()); - } - - /** - * {@inheritdoc} - */ - protected function replaceUser1() { - // Do not replace the user from our dump. - } - -} diff --git a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php deleted file mode 100644 index 4d897715f34..00000000000 --- a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php +++ /dev/null @@ -1,264 +0,0 @@ -<?php - -namespace Drupal\Tests\taxonomy\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\user\Entity\User; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for taxonomy terms. - * - * @group taxonomy - * @group Update - * @group legacy - */ -class TaxonomyTermUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.views-taxonomy-term-publishing-status-2981887.php', - __DIR__ . '/../../../fixtures/update/drupal-8.taxonomy-term-publishing-status-ui-2899923.php', - ]; - } - - /** - * Tests the conversion of taxonomy terms to be publishable. - * - * @see taxonomy_update_8601() - */ - public function testPublishable() { - $this->runUpdates(); - - // Log in as user 1. - $account = User::load(1); - $account->passRaw = 'drupal'; - $this->drupalLogin($account); - - // Make sure our vocabulary exists. - $this->drupalGet('admin/structure/taxonomy/manage/test_vocabulary/overview'); - - // Make sure our terms exist. - $assert_session = $this->assertSession(); - $assert_session->pageTextContains('Test root term'); - $assert_session->pageTextContains('Test child term'); - - $this->drupalGet('taxonomy/term/3'); - $assert_session->statusCodeEquals('200'); - - // Make sure the terms are still translated. - $this->drupalGet('taxonomy/term/2/translations'); - $assert_session->linkExists('Test root term - Spanish'); - - $storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term'); - - // Check that the 'content_translation_status' field has been updated - // correctly. - /** @var \Drupal\taxonomy\TermInterface $term */ - $term = $storage->load(2); - $translation = $term->getTranslation('es'); - $this->assertTrue($translation->isPublished()); - - // Check that taxonomy terms can be created, saved and then loaded. - $term = $storage->create([ - 'name' => 'Test term', - 'vid' => 'tags', - ]); - $term->save(); - - $term = $storage->loadUnchanged($term->id()); - - $this->assertEquals('Test term', $term->label()); - $this->assertEquals('tags', $term->bundle()); - $this->assertTrue($term->isPublished()); - - // Check that the term can be unpublished. - $term->setUnpublished(); - $term->save(); - $term = $storage->loadUnchanged($term->id()); - $this->assertFalse($term->isPublished()); - - // Test the update does not run when a status field already exists. - module_load_install('taxonomy'); - $this->assertEquals('The publishing status field has <strong>not</strong> been added to taxonomy terms. See <a href="https://www.drupal.org/node/2985366">this page</a> for more information on how to install it.', (string) taxonomy_update_8601()); - // Test the message can be overridden. - \Drupal::state()->set('taxonomy_update_8601_skip_message', 'Another message'); - $this->assertEquals('Another message', (string) taxonomy_update_8601()); - } - - /** - * Tests taxonomy term views updates succeed even if Views is not installed. - */ - public function testPublishingStatusUpdateForTaxonomyTermViewsWithoutViews() { - // Uninstalling Views will trigger some activity in the menu tree storage - // system, which will cause errors until system_update_8001() is run. This - // is because, in the drupal-8.filled.standard database fixture used for - // this update test, the menu link titles are not serialized (this is what - // gets done by system_update_8001()). Since this method is not testing - // anything relating to menu links, it's OK to just truncate the menu_tree - // table before uninstalling Views. - $this->container->get('database')->truncate('menu_tree')->execute(); - $this->container->get('module_installer')->uninstall(['views']); - $this->runUpdates(); - } - - /** - * Tests handling of the publishing status in taxonomy term views updates. - * - * @see taxonomy_post_update_handle_publishing_status_addition_in_views() - */ - public function testPublishingStatusUpdateForTaxonomyTermViews() { - // Check that the test view was previously using the - // 'content_translation_status' field. - $config = \Drupal::config('views.view.test_taxonomy_term_view_with_content_translation_status'); - $display_options = $config->get('display.default.display_options'); - $this->assertEquals('content_translation_status', $display_options['fields']['content_translation_status']['field']); - $this->assertEquals('content_translation_status', $display_options['filters']['content_translation_status']['field']); - $this->assertEquals('content_translation_status', $display_options['sorts']['content_translation_status']['field']); - - // Check a test view without any filter. - $config = \Drupal::config('views.view.test_taxonomy_term_view_without_content_translation_status'); - $display_options = $config->get('display.default.display_options'); - $this->assertEmpty($display_options['filters']); - - $this->runUpdates(); - - // Check that a view which had a field, filter and a sort on the - // 'content_translation_status' field has been updated to use the new - // 'status' field. - $view = View::load('test_taxonomy_term_view_with_content_translation_status'); - foreach ($view->get('display') as $display) { - $this->assertEquals('status', $display['display_options']['fields']['content_translation_status']['field']); - $this->assertEquals('status', $display['display_options']['sorts']['content_translation_status']['field']); - $this->assertEquals('status', $display['display_options']['filters']['content_translation_status']['field']); - } - - // Check that a view without any filters has been updated to include a - // filter for the 'status' field. - $view = View::load('test_taxonomy_term_view_without_content_translation_status'); - foreach ($view->get('display') as $display) { - $this->assertNotEmpty($display['display_options']['filters']); - $this->assertEquals('status', $display['display_options']['filters']['status']['field']); - } - } - - /** - * Tests the conversion of taxonomy terms to be revisionable. - * - * @see taxonomy_post_update_make_taxonomy_term_revisionable() - */ - public function testConversionToRevisionable() { - $this->runUpdates(); - - // Check the database tables and the field storage definitions. - $schema = \Drupal::database()->schema(); - $this->assertTrue($schema->tableExists('taxonomy_term_data')); - $this->assertTrue($schema->tableExists('taxonomy_term_field_data')); - $this->assertTrue($schema->tableExists('taxonomy_term_revision')); - $this->assertTrue($schema->tableExists('taxonomy_term_field_revision')); - - $field_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions('taxonomy_term'); - $this->assertTrue($field_storage_definitions['langcode']->isRevisionable()); - $this->assertTrue($field_storage_definitions['name']->isRevisionable()); - $this->assertTrue($field_storage_definitions['description']->isRevisionable()); - $this->assertTrue($field_storage_definitions['changed']->isRevisionable()); - - // Log in as user 1. - $account = User::load(1); - $account->passRaw = 'drupal'; - $this->drupalLogin($account); - - // Make sure our vocabulary exists. - $this->drupalGet('admin/structure/taxonomy/manage/test_vocabulary/overview'); - - // Make sure our terms exist. - $assert_session = $this->assertSession(); - $assert_session->pageTextContains('Test root term'); - $assert_session->pageTextContains('Test child term'); - - $this->drupalGet('taxonomy/term/3'); - $assert_session->statusCodeEquals('200'); - - // Make sure the terms are still translated. - $this->drupalGet('taxonomy/term/2/translations'); - $assert_session->linkExists('Test root term - Spanish'); - - $storage = \Drupal::entityTypeManager()->getStorage('taxonomy_term'); - - // Check that taxonomy terms can be created, saved and then loaded. - /** @var \Drupal\taxonomy\TermInterface $term */ - $term = $storage->create([ - 'name' => 'Test term', - 'vid' => 'article', - 'revision_log_message' => 'Initial revision.', - ]); - $term->save(); - - $storage->resetCache(); - $term = $storage->loadRevision($term->getRevisionId()); - - $this->assertEquals('Test term', $term->label()); - $this->assertEquals('article', $term->bundle()); - $this->assertEquals('Initial revision.', $term->getRevisionLogMessage()); - $this->assertTrue($term->isPublished()); - } - - /** - * {@inheritdoc} - */ - protected function replaceUser1() { - // Do not replace the user from our dump. - } - - /** - * Tests that the taxonomy_term entity form has the status checkbox. - * - * @see taxonomy_post_update_configure_status_field_widget() - */ - public function testStatusCheckbox() { - $ids = \Drupal::entityQuery('entity_form_display') - ->condition('targetEntityType', 'taxonomy_term') - ->execute(); - - // Make sure we have the expected values before the update. - $config_keys = []; - foreach ($ids as $id) { - $config_keys[] = 'core.entity_form_display.' . $id; - } - /* @var \Drupal\Core\Config\ImmutableConfig[] $form_display_configs */ - $form_display_configs = $this->container->get('config.factory')->loadMultiple($config_keys); - foreach ($form_display_configs as $config) { - $status_config = $config->get('content.status'); - if ($config->getName() == 'core.entity_form_display.taxonomy_term.tags.default') { - $this->assertNotNull($status_config); - $this->assertEquals(['display_label' => FALSE], $status_config['settings']); - } - else { - $this->assertNull($status_config); - } - } - - // Run updates. - $this->runUpdates(); - - /* @var \Drupal\Core\Entity\Display\EntityDisplayInterface[] $form_displays */ - $form_displays = EntityFormDisplay::loadMultiple($ids); - foreach ($form_displays as $form_display) { - $component = $form_display->getComponent('status'); - if ($form_display->id() == 'taxonomy_term.tags.default') { - // Display label should not have been set to TRUE by the upgrade path. - $this->assertEquals(['display_label' => FALSE], $component['settings']); - } - else { - $this->assertEquals('boolean_checkbox', $component['type']); - $this->assertEquals(['display_label' => TRUE], $component['settings']); - } - } - } - -} diff --git a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyVocabularyHierarchyUpdateTest.php b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyVocabularyHierarchyUpdateTest.php deleted file mode 100644 index 5b94490e0d4..00000000000 --- a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyVocabularyHierarchyUpdateTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\Tests\taxonomy\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\Tests\Core\Database\SchemaIntrospectionTestTrait; - -/** - * Tests that the 'hierarchy' property is removed from vocabularies. - * - * @group taxonomy - * @group Update - * @group legacy - */ -class TaxonomyVocabularyHierarchyUpdateTest extends UpdatePathTestBase { - - use SchemaIntrospectionTestTrait; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.filled.standard.php.gz', - ]; - } - - /** - * Tests that the 'hierarchy' property is removed from vocabularies. - * - * @see taxonomy_post_update_remove_hierarchy_from_vocabularies() - * @see taxonomy_update_8701() - */ - public function testTaxonomyUpdateParents() { - $hierarchy = \Drupal::config('taxonomy.vocabulary.test_vocabulary')->get('hierarchy'); - $this->assertSame(1, $hierarchy); - - // We can not test whether an index on the 'bundle' column existed before - // running the updates because the 'taxonomy_term__parent' table itself is - // created by an update function. - - // Run updates. - $this->runUpdates(); - - $hierarchy = \Drupal::config('taxonomy.vocabulary.test_vocabulary')->get('hierarchy'); - $this->assertNull($hierarchy); - - $this->assertNoIndexOnColumns('taxonomy_term__parent', ['bundle']); - $this->assertIndexOnColumns('taxonomy_term__parent', ['bundle', 'delta', 'parent_target_id']); - } - -} diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php index bbc08470df3..cd79aefd38f 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php @@ -99,53 +99,4 @@ class TaxonomyIndexTidFilterTest extends TaxonomyTestBase { ], $view->calculateDependencies()->getDependencies()); } - /** - * Tests post update function fixes dependencies. - * - * @see views_post_update_taxonomy_index_tid() - */ - public function testPostUpdateFunction() { - /** @var \Drupal\views\Entity\View $view */ - $view = View::load('test_filter_taxonomy_index_tid__non_existing_dependency'); - - // Dependencies are sorted. - $content_dependencies = [ - $this->terms[3]->getConfigDependencyName(), - $this->terms[4]->getConfigDependencyName(), - ]; - sort($content_dependencies); - - $this->assertEquals([ - 'config' => [ - 'taxonomy.vocabulary.tags', - ], - 'content' => $content_dependencies, - 'module' => [ - 'node', - 'taxonomy', - 'user', - ], - ], $view->calculateDependencies()->getDependencies()); - - $this->terms[3]->delete(); - - \Drupal::moduleHandler()->loadInclude('views', 'post_update.php'); - views_post_update_taxonomy_index_tid(); - - $view = View::load('test_filter_taxonomy_index_tid__non_existing_dependency'); - $this->assertEquals([ - 'config' => [ - 'taxonomy.vocabulary.tags', - ], - 'content' => [ - $this->terms[4]->getConfigDependencyName(), - ], - 'module' => [ - 'node', - 'taxonomy', - 'user', - ], - ], $view->getDependencies()); - } - } diff --git a/core/modules/text/tests/src/Functional/TextRequiredSummaryUpdateTest.php b/core/modules/text/tests/src/Functional/TextRequiredSummaryUpdateTest.php deleted file mode 100644 index ba94af28cc6..00000000000 --- a/core/modules/text/tests/src/Functional/TextRequiredSummaryUpdateTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace Drupal\Tests\text\Functional; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\field\Entity\FieldConfig; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests updates for adding required summary flags to widgets and fields. - * - * @group text - * @group legacy - */ -class TextRequiredSummaryUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - ]; - } - - /** - * Tests that widgets and fields are updated for required summary flag. - * - * @see text_post_update_add_required_summary_flag() - */ - public function testFieldAndWidgetUpdate() { - // No show summary flag exists pre-update. - $entity_form_display = EntityFormDisplay::load('node.article.default'); - $options = $entity_form_display->getComponent('body'); - $this->assertFalse(array_key_exists('show_summary', $options['settings'])); - - $field = FieldConfig::load('node.article.body'); - $settings = $field->getSettings(); - $this->assertFalse(array_key_exists('required_summary', $settings)); - - $this->runUpdates(); - - // The show summary setting has been populated on the widget. - $entity_form_display = EntityFormDisplay::load('node.article.default'); - $options = $entity_form_display->getComponent('body'); - $this->assertIdentical(FALSE, $options['settings']['show_summary']); - - // And the so has the required sumamry setting on the field. - $field = FieldConfig::load('node.article.body'); - $settings = $field->getSettings(); - $this->assertIdentical(FALSE, $settings['required_summary']); - } - -} diff --git a/core/modules/update/update.install b/core/modules/update/update.install index 811c629adff..5d035902f30 100644 --- a/core/modules/update/update.install +++ b/core/modules/update/update.install @@ -158,13 +158,8 @@ function _update_requirement_check($project, $type) { } /** - * Rebuild the router to ensure admin/reports/updates/check has CSRF protection. + * Implements hook_update_last_removed(). */ -function update_update_8001() { - // Empty update forces a call to drupal_flush_all_caches() which rebuilds the - // router. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. +function update_update_last_removed() { + return 8001; } diff --git a/core/modules/user/tests/fixtures/update/drupal-8.user-email-token-2587275.php b/core/modules/user/tests/fixtures/update/drupal-8.user-email-token-2587275.php deleted file mode 100644 index 8f19b6e17c9..00000000000 --- a/core/modules/user/tests/fixtures/update/drupal-8.user-email-token-2587275.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing the - * upgrade path of https://www.drupal.org/node/2587275. - */ - -use Drupal\Core\Database\Database; - -$connection = Database::getConnection(); - -// Replace the user.mail configuration because the dump contains the right token -// already. -$connection->delete('config')->condition('name', 'user.mail')->execute(); -$connection->insert('config') - ->fields(['collection', 'name', 'data']) - ->values([ - 'collection' => '', - 'name' => 'user.mail', - 'data' => "a:10:{s:14:\"cancel_confirm\";a:2:{s:4:\"body\";s:369:\"[user:name],\n\nA request to cancel your account has been made at [site:name].\n\nYou may now cancel your account on [site:url-brief] by clicking this link or copying and pasting it into your browser:\n\n[user:cancel-url]\n\nNOTE: The cancellation of your account is not reversible.\n\nThis link expires in one day and nothing will happen if it is not used.\n\n-- [site:name] team\";s:7:\"subject\";s:59:\"Account cancellation request for [user:name] at [site:name]\";}s:14:\"password_reset\";a:2:{s:4:\"body\";s:397:\"[user:name],\n\nA request to reset the password for your account has been made at [site:name].\n\nYou may now log in by clicking this link or copying and pasting it to your browser:\n\n[user:one-time-login-url]\n\nThis link can only be used once to log in and will lead you to a page where you can set your password. It expires after one day and nothing will happen if it's not used.\n\n-- [site:name] team\";s:7:\"subject\";s:60:\"Replacement login information for [user:name] at [site:name]\";}s:22:\"register_admin_created\";a:2:{s:4:\"body\";s:463:\"[user:name],\n\nA site administrator at [site:name] has created an account for you. You may now log in by clicking this link or copying and pasting it to your browser:\n\n[user:one-time-login-url]\n\nThis link can only be used once to log in and will lead you to a page where you can set your password.\n\nAfter setting your password, you will be able to log in at [site:login-url] in the future using:\n\nusername: [user:name]\npassword: Your password\n\n-- [site:name] team\";s:7:\"subject\";s:58:\"An administrator created an account for you at [site:name]\";}s:29:\"register_no_approval_required\";a:2:{s:4:\"body\";s:437:\"[user:name],\n\nThank you for registering at [site:name]. You may now log in by clicking this link or copying and pasting it to your browser:\n\n[user:one-time-login-url]\n\nThis link can only be used once to log in and will lead you to a page where you can set your password.\n\nAfter setting your password, you will be able to log in at [site:login-url] in the future using:\n\nusername: [user:name]\npassword: Your password\n\n-- [site:name] team\";s:7:\"subject\";s:46:\"Account details for [user:name] at [site:name]\";}s:25:\"register_pending_approval\";a:2:{s:4:\"body\";s:281:\"[user:name],\n\nThank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.\n\n\n-- [site:name] team\";s:7:\"subject\";s:71:\"Account details for [user:name] at [site:name] (pending admin approval)\";}s:31:\"register_pending_approval_admin\";a:2:{s:4:\"body\";s:56:\"[user:name] has applied for an account.\n\n[user:edit-url]\";s:7:\"subject\";s:71:\"Account details for [user:name] at [site:name] (pending admin approval)\";}s:16:\"status_activated\";a:2:{s:4:\"body\";s:446:\"[user:name],\n\nYour account at [site:name] has been activated.\n\nYou may now log in by clicking this link or copying and pasting it into your browser:\n\n[user:one-time-login-url]\n\nThis link can only be used once to log in and will lead you to a page where you can set your password.\n\nAfter setting your password, you will be able to log in at [site:login-url] in the future using:\n\nusername: [user:name]\npassword: Your password\n\n-- [site:name] team\";s:7:\"subject\";s:57:\"Account details for [user:name] at [site:name] (approved)\";}s:14:\"status_blocked\";a:2:{s:4:\"body\";s:89:\"[user:name],\n\nYour account on [site:account-name] has been blocked.\n\n-- [site:name] team\";s:7:\"subject\";s:56:\"Account details for [user:name] at [site:name] (blocked)\";}s:15:\"status_canceled\";a:2:{s:4:\"body\";s:82:\"[user:name],\n\nYour account on [site:name] has been canceled.\n\n-- [site:name] team\";s:7:\"subject\";s:57:\"Account details for [user:name] at [site:name] (canceled)\";}s:8:\"langcode\";s:2:\"en\";}", -])->execute(); diff --git a/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php b/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php deleted file mode 100644 index 4e4b9f62818..00000000000 --- a/core/modules/user/tests/src/Functional/Update/UserUpdateEmailToken.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -namespace Drupal\Tests\user\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests user email token upgrade path. - * - * @group Update - * @group legacy - */ -class UserUpdateEmailToken extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.user-email-token-2587275.php', - ]; - } - - /** - * Tests that email token in status_blocked of user.mail is updated. - */ - public function testEmailToken() { - $mail = \Drupal::config('user.mail')->get('status_blocked'); - $this->assertContains('[site:account-name]', $mail['body']); - $this->runUpdates(); - $mail = \Drupal::config('user.mail')->get('status_blocked'); - $this->assertNotContains('[site:account-name]', $mail['body']); - } - -} diff --git a/core/modules/user/tests/src/Functional/Update/UserUpdateOrderPermissionsTest.php b/core/modules/user/tests/src/Functional/Update/UserUpdateOrderPermissionsTest.php deleted file mode 100644 index 75934cd6875..00000000000 --- a/core/modules/user/tests/src/Functional/Update/UserUpdateOrderPermissionsTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Drupal\Tests\user\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests user permissions sort upgrade path. - * - * @group Update - * @group legacy - */ -class UserUpdateOrderPermissionsTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - ]; - } - - /** - * Tests that permissions are ordered by machine name. - */ - public function testPermissionsOrder() { - $authenticated = \Drupal::config('user.role.authenticated'); - $permissions = $authenticated->get('permissions'); - sort($permissions); - $this->assertNotSame($permissions, $authenticated->get('permissions')); - - $this->runUpdates(); - $authenticated = \Drupal::config('user.role.authenticated'); - $this->assertSame($permissions, $authenticated->get('permissions')); - } - -} diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 2540ac2cd34..8375992ce7e 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -92,14 +92,8 @@ function user_install() { } /** - * Fix invalid token in the status_blocked email body. + * Implements hook_update_last_removed(). */ -function user_update_8100() { - $config_factory = \Drupal::configFactory(); - $config = $config_factory->getEditable('user.mail'); - $mail = $config->get('status_blocked'); - if (strpos($mail['body'], '[site:account-name]') !== FALSE) { - $mail['body'] = str_replace('[site:account-name]', '[site:name]', $mail['body']); - $config->set('status_blocked', $mail)->save(TRUE); - } +function user_update_last_removed() { + return 8100; } diff --git a/core/modules/views/tests/fixtures/update/argument-placeholder.php b/core/modules/views/tests/fixtures/update/argument-placeholder.php deleted file mode 100644 index 2158eb270b7..00000000000 --- a/core/modules/views/tests/fixtures/update/argument-placeholder.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Text fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.test_token_view', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/modules/views_test_config/test_views/views.view.test_token_view.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/block.block.exposedformtest_exposed_blockpage_1.yml b/core/modules/views/tests/fixtures/update/block.block.exposedformtest_exposed_blockpage_1.yml deleted file mode 100644 index 26931797d0b..00000000000 --- a/core/modules/views/tests/fixtures/update/block.block.exposedformtest_exposed_blockpage_1.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - views.view.test_exposed_block - module: - - views - theme: - - bartik -id: exposedformtest_exposed_blockpage_1 -theme: bartik -region: content -weight: 0 -provider: null -plugin: 'views_exposed_filter_block:test_exposed_block-page_1' -settings: - id: 'views_exposed_filter_block:test_exposed_block-page_1' - label: '' - provider: views - label_display: visible - views_label: '' -visibility: { } diff --git a/core/modules/views/tests/fixtures/update/boolean-filter-values.php b/core/modules/views/tests/fixtures/update/boolean-filter-values.php deleted file mode 100644 index 2b8e78fb97a..00000000000 --- a/core/modules/views/tests/fixtures/update/boolean-filter-values.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.test_boolean_filter_values', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/fixtures/update/views.view.test_boolean_filter_values.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/duplicate-field-handler.php b/core/modules/views/tests/fixtures/update/duplicate-field-handler.php deleted file mode 100644 index 21cf164f41a..00000000000 --- a/core/modules/views/tests/fixtures/update/duplicate-field-handler.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.test_duplicate_field_handlers', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/modules/views_test_config/test_views/views.view.test_duplicate_field_handlers.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/entity-link-output-url.php b/core/modules/views/tests/fixtures/update/entity-link-output-url.php deleted file mode 100644 index 8d2aabeed42..00000000000 --- a/core/modules/views/tests/fixtures/update/entity-link-output-url.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.node_link_update_test', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/fixtures/update/views.view.node_link_update_test.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/exposed-filter-blocks.php b/core/modules/views/tests/fixtures/update/exposed-filter-blocks.php deleted file mode 100644 index 5b2b9df69f0..00000000000 --- a/core/modules/views/tests/fixtures/update/exposed-filter-blocks.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -// Install the view configuration. -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.test_exposed_block', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml'))), - ]) - ->execute(); - -// Install the block configuration. -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'block.block.exposedformtest_exposed_blockpage_1', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/fixtures/update/block.block.exposedformtest_exposed_blockpage_1.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/filter-placeholder-text.php b/core/modules/views/tests/fixtures/update/filter-placeholder-text.php deleted file mode 100644 index e7c493a2802..00000000000 --- a/core/modules/views/tests/fixtures/update/filter-placeholder-text.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.placeholder_text_test', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/fixtures/update/views.view.placeholder_text_test.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/legacy-bulk-form-update.php b/core/modules/views/tests/fixtures/update/legacy-bulk-form-update.php deleted file mode 100644 index e3ec6a4b92e..00000000000 --- a/core/modules/views/tests/fixtures/update/legacy-bulk-form-update.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.legacy_bulk_form', - 'data' => serialize(Yaml::decode(file_get_contents(__DIR__ . '/views.view.legacy_bulk_form.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/limit-exposed-operators.php b/core/modules/views/tests/fixtures/update/limit-exposed-operators.php deleted file mode 100644 index 92c173aea1b..00000000000 --- a/core/modules/views/tests/fixtures/update/limit-exposed-operators.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.test_exposed_filters', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/fixtures/update/views.view.test_exposed_filters.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/table-cache-max-age.php b/core/modules/views/tests/fixtures/update/table-cache-max-age.php deleted file mode 100644 index b6757c706e4..00000000000 --- a/core/modules/views/tests/fixtures/update/table-cache-max-age.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * @file - * Test fixture. - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; - -$connection = Database::getConnection(); - -$connection->insert('config') - ->fields([ - 'collection' => '', - 'name' => 'views.view.test_table_max_age', - 'data' => serialize(Yaml::decode(file_get_contents('core/modules/views/tests/fixtures/update/views.view.test_table_max_age.yml'))), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/views-data-table-dependency.php b/core/modules/views/tests/fixtures/update/views-data-table-dependency.php deleted file mode 100644 index f4bce285419..00000000000 --- a/core/modules/views/tests/fixtures/update/views-data-table-dependency.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -/** - * @file - * Contains database additions to drupal-8.bare.standard.php.gz for testing - * views_post_update_views_data_table_dependencies(). - */ - -use Drupal\Core\Database\Database; -use Drupal\Core\Serialization\Yaml; -use Drupal\views\Tests\ViewTestData; - -$connection = Database::getConnection(); - -// Install the views_test_data module. -$extensions = $connection->select('config') - ->fields('config', ['data']) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute() - ->fetchField(); -$extensions = unserialize($extensions); -$extensions['module']['views_test_data'] = 8000; -$connection->update('config') - ->fields([ - 'data' => serialize($extensions), - ]) - ->condition('collection', '') - ->condition('name', 'core.extension') - ->execute(); - -$views_configs = []; -// A view that should depend on views_data_test. -$views_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/views.view.test_table_dependency_update.yml')); - -foreach ($views_configs as $views_config) { - $connection->insert('config') - ->fields([ - 'collection', - 'name', - 'data', - ]) - ->values([ - 'collection' => '', - 'name' => 'views.view.' . $views_config['id'], - 'data' => serialize($views_config), - ]) - ->execute(); -} - -// We need the views_test_data table to exist and state entries for -// views_test_data_schema() and views_test_data_views_data(). -$schema = ViewTestData::schemaDefinition(); -$connection->schema()->createTable('views_test_data', $schema['views_test_data']); -$connection->insert('key_value') - ->fields([ - 'collection', - 'name', - 'value', - ]) - ->values([ - 'collection' => 'state', - 'name' => 'views_test_data_schema', - 'value' => serialize($schema), - ]) - ->values([ - 'collection' => 'state', - 'name' => 'views_test_data_views_data', - 'value' => serialize(ViewTestData::viewsData()), - ]) - ->execute(); diff --git a/core/modules/views/tests/fixtures/update/views.view.legacy_bulk_form.yml b/core/modules/views/tests/fixtures/update/views.view.legacy_bulk_form.yml deleted file mode 100644 index 8a367e9a69b..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.legacy_bulk_form.yml +++ /dev/null @@ -1,242 +0,0 @@ -uuid: 67e001ab-bf26-4317-98a0-9ef7c8e6773a -langcode: en -status: true -dependencies: - module: - - node - - system - - user -id: legacy_bulk_form -label: 'legacy bulk form' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - nid: - id: nid - table: node_field_data - field: nid - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: number_integer - settings: - thousand_separator: '' - prefix_suffix: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: nid - plugin_id: field - node_bulk_form: - id: node_bulk_form - table: node - field: node_bulk_form - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - action_title: Action - include_exclude: exclude - selected_actions: { } - entity_type: node - plugin_id: bulk_form - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/views/tests/fixtures/update/views.view.node_link_update_test.yml b/core/modules/views/tests/fixtures/update/views.view.node_link_update_test.yml deleted file mode 100644 index 2ec9f228abb..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.node_link_update_test.yml +++ /dev/null @@ -1,225 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user -id: node_link_update_test -label: 'node link update test' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - path: - id: path - table: node - field: path - entity_type: node - plugin_id: node_path - view_node: - id: view_node - table: node - field: view_node - relationship: none - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - text: view - entity_type: node - plugin_id: entity_link - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/views/tests/fixtures/update/views.view.placeholder_text_test.yml b/core/modules/views/tests/fixtures/update/views.view.placeholder_text_test.yml deleted file mode 100644 index 0d46952b673..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.placeholder_text_test.yml +++ /dev/null @@ -1,265 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - module: - - node - - user -id: placeholder_text_test -label: 'Placeholder text test' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - title: title - info: - title: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: 'entity:node' - options: - view_mode: teaser - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: title - plugin_id: string - created: - id: created - table: node_field_data - field: created - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '' - type: date - group: 1 - exposed: true - expose: - operator_id: created_op - label: 'Authored on' - description: '' - use_operator: false - operator: created_op - identifier: created - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: created - plugin_id: date - sorts: { } - title: 'Placeholder text test' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - filter_groups: - operator: AND - groups: - 1: AND - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: placeholder-text-test - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/views/tests/fixtures/update/views.view.test_boolean_filter_values.yml b/core/modules/views/tests/fixtures/update/views.view.test_boolean_filter_values.yml deleted file mode 100644 index 4be00a71a4c..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.test_boolean_filter_values.yml +++ /dev/null @@ -1,603 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user -id: test_boolean_filter_values -label: Content -module: node -description: 'Find and manage content.' -tag: default -base_table: node_field_data -base_field: nid -display: - default: - display_options: - access: - type: perm - options: - perm: 'access content overview' - cache: - type: tag - query: - type: views_query - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 50 - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: true - caption: '' - summary: '' - description: '' - columns: - node_bulk_form: node_bulk_form - title: title - type: type - name: name - status: status - changed: changed - edit_node: edit_node - delete_node: delete_node - dropbutton: dropbutton - timestamp: title - info: - node_bulk_form: - align: '' - separator: '' - empty_column: false - responsive: '' - title: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - type: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - name: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: priority-low - status: - sortable: true - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - changed: - sortable: true - default_sort_order: desc - align: '' - separator: '' - empty_column: false - responsive: priority-low - edit_node: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - delete_node: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - dropbutton: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - timestamp: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: changed - empty_table: true - row: - type: fields - fields: - node_bulk_form: - id: node_bulk_form - table: node - field: node_bulk_form - label: '' - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: node_bulk_form - entity_type: node - title: - id: title - table: node_field_data - field: title - label: Title - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - entity_type: node - entity_field: title - type: string - settings: - link_to_entity: true - plugin_id: field - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - label: 'Content type' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: false - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - entity_type: node - entity_field: type - plugin_id: field - name: - id: name - table: users_field_data - field: name - relationship: uid - label: Author - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - plugin_id: field - type: user_name - entity_type: user - entity_field: name - status: - id: status - table: node_field_data - field: status - label: Status - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: boolean - settings: - format: custom - format_custom_true: Published - format_custom_false: Unpublished - plugin_id: field - entity_type: node - entity_field: status - changed: - id: changed - table: node_field_data - field: changed - label: Updated - exclude: false - alter: - alter_text: false - element_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: timestamp - settings: - date_format: short - custom_date_format: '' - timezone: '' - plugin_id: field - entity_type: node - entity_field: changed - operations: - id: operations - table: node - field: operations - relationship: none - group_type: group - admin_label: '' - label: Operations - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - destination: true - plugin_id: entity_operations - filters: - status_extra: - id: status_extra - table: node_field_data - field: status_extra - operator: '=' - value: false - plugin_id: node_status - group: 1 - entity_type: node - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: true - group: 1 - exposed: true - expose: - operator_id: '' - label: Status - description: '' - use_operator: false - operator: status_op - identifier: status - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: true - group_info: - label: 'Published status' - description: '' - identifier: status - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: - 1: - title: Published - operator: '=' - value: '1' - 2: - title: Unpublished - operator: '=' - value: '0' - plugin_id: boolean - entity_type: node - entity_field: status - type: - id: type - table: node_field_data - field: type - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: type_op - label: 'Content type' - description: '' - use_operator: false - operator: type_op - identifier: type - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: bundle - entity_type: node - entity_field: type - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: contains - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: false - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: string - entity_type: node - entity_field: title - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - operator: in - value: { } - group: 1 - exposed: true - expose: - operator_id: langcode_op - label: Language - description: '' - use_operator: false - operator: langcode_op - identifier: langcode - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: language - entity_type: node - entity_field: langcode - sorts: { } - title: Content - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - empty: true - content: 'No content available.' - plugin_id: text_custom - arguments: { } - relationships: - uid: - id: uid - table: node_field_data - field: uid - admin_label: author - required: true - plugin_id: standard - show_admin_links: false - filter_groups: - operator: AND - groups: - 1: AND - display_extenders: { } - display_plugin: default - display_title: Master - id: default - position: 0 - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - - 'user.node_grants:view' - - user.permissions - max-age: 0 - tags: { } - page_1: - display_options: - path: admin/content/node - menu: - type: 'default tab' - title: Content - description: '' - menu_name: admin - weight: -10 - context: '' - tab_options: - type: normal - title: Content - description: 'Find and manage content' - menu_name: admin - weight: -10 - display_extenders: { } - display_plugin: page - display_title: Page - id: page_1 - position: 1 - cache_metadata: - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - user - - 'user.node_grants:view' - - user.permissions - max-age: 0 - tags: { } diff --git a/core/modules/views/tests/fixtures/update/views.view.test_exposed_filters.yml b/core/modules/views/tests/fixtures/update/views.view.test_exposed_filters.yml deleted file mode 100644 index 822b51a96ba..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.test_exposed_filters.yml +++ /dev/null @@ -1,271 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user -id: test_exposed_filters -label: 'Test Exposed filters' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: default - row: - type: fields - options: - default_field_elements: true - inline: { } - separator: '' - hide_empty: false - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: title_op - label: Title - description: '' - use_operator: true - operator: title_op - identifier: title - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: title - plugin_id: string - created: - id: created - table: node_field_data - field: created - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: - min: '' - max: '' - value: '' - type: date - group: 1 - exposed: true - expose: - operator_id: created_op - label: 'Authored on' - description: '' - use_operator: true - operator: created_op - identifier: created - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - anonymous: '0' - administrator: '0' - placeholder: '' - min_placeholder: '' - max_placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - entity_type: node - entity_field: created - plugin_id: date - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Test Exposed filters' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: 1 - display_options: - display_extenders: { } - path: test-exposed-filters - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/views/tests/fixtures/update/views.view.test_table_dependency_update.yml b/core/modules/views/tests/fixtures/update/views.view.test_table_dependency_update.yml deleted file mode 100644 index 36a2871d29f..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.test_table_dependency_update.yml +++ /dev/null @@ -1,78 +0,0 @@ -langcode: en -status: true -dependencies: { } -id: test_table_dependency_update -label: '' -module: views -description: '' -tag: '' -base_table: views_test_data -base_field: nid -display: - default: - display_options: - defaults: - fields: false - pager: false - sorts: false - fields: - id: - field: id - id: id - relationship: none - table: views_test_data - plugin_id: numeric - pager: - options: - offset: 0 - type: none - sorts: - id: - field: id - id: id - order: ASC - relationship: none - table: views_test_data - plugin_id: numeric - empty: - title: - field: title - id: title - table: views - plugin_id: title - title: test_title_empty - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - empty: true - content: "start: @start | end: @end | total: @total | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count" - plugin_id: result - display_plugin: default - display_title: Master - id: default - position: 0 - page_1: - display_options: - path: test-area-result - defaults: - header: false - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - empty: false - content: "start: @start | end: @end | total: @total | label: @label | per page: @per_page | current page: @current_page | current record count: @current_record_count | page count: @page_count" - plugin_id: result - display_plugin: page - display_title: 'Page 1' - id: page_1 - position: 1 diff --git a/core/modules/views/tests/fixtures/update/views.view.test_table_max_age.yml b/core/modules/views/tests/fixtures/update/views.view.test_table_max_age.yml deleted file mode 100644 index 859a5f0a9f8..00000000000 --- a/core/modules/views/tests/fixtures/update/views.view.test_table_max_age.yml +++ /dev/null @@ -1,184 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - user -id: test_table_max_age -label: test-table-max-age -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: mini - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: ‹‹ - next: ›› - style: - type: table - options: - grouping: { } - row_class: '' - default_row_class: true - override: true - sticky: false - caption: '' - summary: '' - description: '' - columns: - title: title - info: - title: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - default: '-1' - empty_table: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - value: '1' - table: node_field_data - field: status - plugin_id: boolean - entity_type: node - entity_field: status - id: status - expose: - operator: '' - group: 1 - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: 0 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.rest_export_with_authorization.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.rest_export_with_authorization.yml deleted file mode 100644 index 63569d57a24..00000000000 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.rest_export_with_authorization.yml +++ /dev/null @@ -1,215 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - user.role.authenticated - module: - - node - - rest - - user -id: rest_export_with_authorization -label: 'Rest Export' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -display: - default: - display_plugin: default - id: default - display_title: Master - position: 0 - display_options: - access: - type: role - options: - role: - authenticated: authenticated - cache: - type: tag - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: '‹ Previous' - next: 'Next ›' - first: '« First' - last: 'Last »' - quantity: 9 - style: - type: default - row: - type: 'entity:node' - options: - view_mode: teaser - fields: - title: - id: title - table: node_field_data - field: title - entity_type: node - entity_field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - settings: - link_to_entity: true - plugin_id: field - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - click_sort_column: value - type: string - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - filters: - status: - id: status - table: node_field_data - field: status - relationship: none - group_type: group - admin_label: '' - operator: '=' - value: '0' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: boolean - entity_type: node - entity_field: status - sorts: - created: - id: created - table: node_field_data - field: created - order: DESC - entity_type: node - entity_field: created - plugin_id: date - relationship: none - group_type: group - admin_label: '' - exposed: false - expose: - label: '' - granularity: second - title: 'Rest Export' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url.query_args - - 'user.node_grants:view' - - user.roles - tags: { } - rest_export_1: - display_plugin: rest_export - id: rest_export_1 - display_title: 'REST export' - position: 2 - display_options: - display_extenders: { } - path: unpublished-content - auth: - basic_auth: basic_auth - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - request_format - - 'user.node_grants:view' - - user.roles - tags: { } diff --git a/core/modules/views/tests/src/Functional/Update/ArgumentPlaceholderUpdatePathTest.php b/core/modules/views/tests/src/Functional/Update/ArgumentPlaceholderUpdatePathTest.php deleted file mode 100644 index 03e37b53c00..00000000000 --- a/core/modules/views/tests/src/Functional/Update/ArgumentPlaceholderUpdatePathTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the argument placeholder update path. - * - * @see views_update_8002() - * - * @group views - * @group legacy - */ -class ArgumentPlaceholderUpdatePathTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/argument-placeholder.php', - ]; - } - - /** - * Ensures that %1 and !1 are converted to twig tokens in existing views. - */ - public function testArgumentPlaceholderUpdate() { - $this->runUpdates(); - $view = View::load('test_token_view'); - - $data = $view->toArray(); - $this->assertEqual('{{ arguments.nid }}-test-class-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['style']['options']['col_class_custom']); - $this->assertEqual('{{ arguments.nid }}-test-class-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['style']['options']['row_class_custom']); - $this->assertEqual('{{ arguments.nid }}-description-{{ raw_arguments.nid }}', $data['display']['feed_1']['display_options']['style']['options']['description']); - $this->assertEqual('{{ arguments.nid }}-custom-text-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['fields']['title']['alter']['text']); - $this->assertEqual('test_token_view {{ arguments.nid }} {{ raw_arguments.nid }}', $data['display']['default']['display_options']['title']); - $this->assertEqual('{{ arguments.nid }}-custom-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['header']['area_text_custom']['content']); - $this->assertEqual('{{ arguments.nid }}-text-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['footer']['area']['content']['value']); - $this->assertEqual("Displaying @start - @end of @total\n\n{{ arguments.nid }}-result-{{ raw_arguments.nid }}", $data['display']['default']['display_options']['empty']['result']['content']); - $this->assertEqual('{{ arguments.nid }}-title-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['empty']['title']['title']); - $this->assertEqual('{{ arguments.nid }}-entity-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['empty']['entity_node']['target']); - $this->assertEqual('{{ arguments.nid }} title {{ raw_arguments.nid }}', $data['display']['default']['display_options']['arguments']['nid']['title']); - $this->assertEqual('{{ arguments.nid }} exception-title {{ raw_arguments.nid }}', $data['display']['default']['display_options']['arguments']['nid']['exception']['title']); - $this->assertEqual('{{ arguments.nid }}-more-text-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['use_more_text']); - $this->assertEqual('{{ arguments.nid }}-custom-url-{{ raw_arguments.nid }}', $data['display']['default']['display_options']['link_url']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/BooleanFilterValuesUpdateTest.php b/core/modules/views/tests/src/Functional/Update/BooleanFilterValuesUpdateTest.php deleted file mode 100644 index 38e8dc9f2aa..00000000000 --- a/core/modules/views/tests/src/Functional/Update/BooleanFilterValuesUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for boolean field values. - * - * @see views_post_update_boolean_filter_values() - * - * @group Update - * @group legacy - */ -class BooleanFilterValuesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/boolean-filter-values.php', - ]; - } - - /** - * Tests that boolean filter values are updated properly. - */ - public function testViewsPostUpdateBooleanFilterValues() { - $this->runUpdates(); - - // Load and initialize our test view. - $view = View::load('test_boolean_filter_values'); - $data = $view->toArray(); - // Check that the field is using the expected string value. - $this->assertIdentical('1', $data['display']['default']['display_options']['filters']['status']['value']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/BulkFormUpdateTest.php b/core/modules/views/tests/src/Functional/Update/BulkFormUpdateTest.php deleted file mode 100644 index 7ef25863afd..00000000000 --- a/core/modules/views/tests/src/Functional/Update/BulkFormUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests Views image style dependencies update. - * - * @group views - * @group legacy - */ -class BulkFormUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/legacy-bulk-form-update.php', - ]; - } - - /** - * Tests the updating of dependencies for Views using the bulk_form plugin. - */ - public function testBulkFormDependencies() { - $module_dependencies = View::load('legacy_bulk_form')->getDependencies()['module']; - - $this->assertTrue(in_array('system', $module_dependencies)); - - $this->runUpdates(); - - $module_dependencies = View::load('legacy_bulk_form')->getDependencies()['module']; - - $this->assertFalse(in_array('system', $module_dependencies)); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/CacheabilityMetadataUpdateTest.php b/core/modules/views/tests/src/Functional/Update/CacheabilityMetadataUpdateTest.php deleted file mode 100644 index f22049672b6..00000000000 --- a/core/modules/views/tests/src/Functional/Update/CacheabilityMetadataUpdateTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Tests that views cacheability metadata post update hook runs properly. - * - * @see views_post_update_update_cacheability_metadata(). - * - * @group Update - * @group legacy - */ -class CacheabilityMetadataUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz']; - } - - /** - * Tests that views cacheability metadata updated properly. - */ - public function testUpdateHookN() { - $this->runUpdates(); - foreach (Views::getAllViews() as $view) { - $displays = $view->get('display'); - foreach (array_keys($displays) as $display_id) { - $display = $view->getDisplay($display_id); - $this->assertFalse(isset($display['cache_metadata']['cacheable'])); - $this->assertTrue(isset($display['cache_metadata']['contexts'])); - $this->assertTrue(isset($display['cache_metadata']['max-age'])); - $this->assertTrue(isset($display['cache_metadata']['tags'])); - } - } - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/EntityLinkOutputUrlUpdateTest.php b/core/modules/views/tests/src/Functional/Update/EntityLinkOutputUrlUpdateTest.php deleted file mode 100644 index 11c9b758ce2..00000000000 --- a/core/modules/views/tests/src/Functional/Update/EntityLinkOutputUrlUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests that the additional settings are added to the entity link field. - * - * @see views_post_update_entity_link_url() - * - * @group legacy - */ -class EntityLinkOutputUrlUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/entity-link-output-url.php', - ]; - } - - /** - * Tests that the additional settings are added to the config. - */ - public function testViewsPostUpdateEntityLinkUrl() { - $this->runUpdates(); - - // Load and initialize our test view. - $view = View::load('node_link_update_test'); - $data = $view->toArray(); - // Check that the field contains the new values. - $this->assertIdentical(FALSE, $data['display']['default']['display_options']['fields']['view_node']['output_url_as_text']); - $this->assertIdentical(FALSE, $data['display']['default']['display_options']['fields']['view_node']['absolute']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/EntityViewsDataUpdateFilledTest.php b/core/modules/views/tests/src/Functional/Update/EntityViewsDataUpdateFilledTest.php deleted file mode 100644 index ec0cb4e7ebd..00000000000 --- a/core/modules/views/tests/src/Functional/Update/EntityViewsDataUpdateFilledTest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -/** - * Runs EntityViewsDataUpdateTest with a dump filled with content. - * - * @group Update - * @group legacy - */ -class EntityViewsDataUpdateFilledTest extends EntityViewsDataUpdateTest { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - parent::setDatabaseDumpFiles(); - $this->databaseDumpFiles[0] = __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz'; - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/EntityViewsDataUpdateTest.php b/core/modules/views/tests/src/Functional/Update/EntityViewsDataUpdateTest.php deleted file mode 100644 index 44e73cb972c..00000000000 --- a/core/modules/views/tests/src/Functional/Update/EntityViewsDataUpdateTest.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Tests the upgrade path for views field plugins. - * - * @see https://www.drupal.org/node/2455125 - * - * @group Update - * @group legacy - */ -class EntityViewsDataUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.views-entity-views-data-2455125.php', - ]; - } - - /** - * Tests that field plugins are updated properly. - */ - public function testUpdateHookN() { - $this->runUpdates(); - - // Load and initialize our test view. - $view = Views::getView('update_test'); - $view->initHandlers(); - - // Extract the fields from the test view that were updated. - /** @var \Drupal\views\Plugin\views\field\EntityField $field */ - $created = $view->field['created']; - /** @var \Drupal\views\Plugin\views\field\EntityField $field */ - $created_1 = $view->field['created_1']; - /** @var \Drupal\views\Plugin\views\field\EntityField $field */ - $created_2 = $view->field['created_2']; - - // Make sure the plugins were converted from date to field. - $this->assertEqual($created->getPluginId(), 'field', 'created has correct plugin_id'); - $this->assertEqual($created_1->getPluginId(), 'field', 'created has correct plugin_id'); - $this->assertEqual($created_2->getPluginId(), 'field', 'created has correct plugin_id'); - - // Check options on 'created'. - $options = $created->options; - $this->assertEqual($options['type'], 'timestamp'); - $this->assertFalse(array_key_exists('date_format', $options)); - $this->assertFalse(array_key_exists('custom_date_format', $options)); - $this->assertFalse(array_key_exists('timezone', $options)); - $this->assertEqual($options['settings']['date_format'], 'long'); - $this->assertEqual($options['settings']['custom_date_format'], ''); - $this->assertEqual($options['settings']['timezone'], 'Africa/Abidjan'); - - // Check options on 'created'. - $options = $created_1->options; - $this->assertEqual($options['type'], 'timestamp_ago'); - $this->assertFalse(array_key_exists('date_format', $options)); - $this->assertFalse(array_key_exists('custom_date_format', $options)); - $this->assertFalse(array_key_exists('timezone', $options)); - $this->assertEqual($options['settings']['future_format'], '@interval'); - $this->assertEqual($options['settings']['past_format'], '@interval'); - $this->assertEqual($options['settings']['granularity'], 2); - - // Check options on 'created'. - $options = $created_2->options; - $this->assertEqual($options['type'], 'timestamp_ago'); - $this->assertFalse(array_key_exists('date_format', $options)); - $this->assertFalse(array_key_exists('custom_date_format', $options)); - $this->assertFalse(array_key_exists('timezone', $options)); - $this->assertEqual($options['settings']['future_format'], '@interval hence'); - $this->assertEqual($options['settings']['past_format'], '@interval ago'); - $this->assertEqual($options['settings']['granularity'], 2); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php b/core/modules/views/tests/src/Functional/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php deleted file mode 100644 index 44516e97a5e..00000000000 --- a/core/modules/views/tests/src/Functional/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Tests the upgrade path for views multi-value base field data. - * - * @see views_update_8500() - * - * @group legacy - */ -class EntityViewsMultiValueBaseFieldDataUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.views-entity-views-data-2846614.php', - ]; - } - - /** - * Tests multi-value base field views data is updated correctly. - */ - public function testUpdateMultiValueBaseFields() { - $this->runUpdates(); - - $view = Views::getView('test_user_multi_value'); - $display = $view->storage->get('display'); - - // Check each handler type present in the configuration to make sure the - // field got updated correctly. - foreach (['fields', 'filters', 'arguments'] as $type) { - $handler_config = $display['default']['display_options'][$type]['roles']; - - // The ID should remain unchanged. Otherwise the update handler could - // overwrite a separate handler config. - $this->assertEqual('roles', $handler_config['id']); - // The field should be updated from 'roles' to the correct column name. - $this->assertEqual('roles_target_id', $handler_config['field']); - // Check the table is still correct. - $this->assertEqual('user__roles', $handler_config['table']); - - // The plugin ID should be updated as well. - $this->assertEqual($type === 'arguments' ? 'user__roles_rid' : 'user_roles', $handler_config['plugin_id']); - } - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/ExposedFilterBlocksUpdateTest.php b/core/modules/views/tests/src/Functional/Update/ExposedFilterBlocksUpdateTest.php deleted file mode 100644 index 8f985574bf0..00000000000 --- a/core/modules/views/tests/src/Functional/Update/ExposedFilterBlocksUpdateTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\block\Entity\Block; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests that the additional settings are added to the entity link field. - * - * @see views_post_update_entity_link_url() - * - * @group legacy - */ -class ExposedFilterBlocksUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/exposed-filter-blocks.php', - ]; - } - - /** - * Tests that exposed filter blocks label display are disabled. - */ - public function testViewsPostUpdateExposedFilterBlocks() { - $this->runUpdates(); - - // Assert the label display has been disabled after the update. - $block = Block::load('exposedformtest_exposed_blockpage_1'); - $config = $block->getPlugin()->getConfiguration(); - $this->assertEquals('0', $config['label_display']); - } - - /** - * Tests that the update succeeds even if Block is not installed. - */ - public function testViewsPostUpdateExposedFilterBlocksWithoutBlock() { - // This block is created during the update process, but since we are - // uninstalling the Block module for this test, it will fail config schema - // validation. Since that's okay for the purposes of this test, just make - // the config schema checker ignore the block. - static::$configSchemaCheckerExclusions[] = 'block.block.seven_secondary_local_tasks'; - - // We need to uninstall the menu_link_content module because - // menu_link_content_entity_predelete() invokes alias processing and we - // don't have a working path alias system until system_update_8803() runs. - // Note that path alias processing is disabled during the regular database - // update process, so this only happens because we uninstall the Block - // module before running the updates. - // @see \Drupal\Core\Update\UpdateServiceProvider::alter() - $this->container->get('module_installer')->uninstall(['menu_link_content', 'block']); - $this->runUpdates(); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/FieldHandlersUpdateTest.php b/core/modules/views/tests/src/Functional/Update/FieldHandlersUpdateTest.php deleted file mode 100644 index 1da3d9bf1e3..00000000000 --- a/core/modules/views/tests/src/Functional/Update/FieldHandlersUpdateTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for views field handlers. - * - * @see views_post_update_cleanup_duplicate_views_data() - * - * @group Update - * @group legacy - */ -class FieldHandlersUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/duplicate-field-handler.php', - ]; - } - - /** - * Tests that field handlers are updated properly. - */ - public function testViewsUpdate8004() { - $this->runUpdates(); - - // Load and initialize our test view. - $view = View::load('test_duplicate_field_handlers'); - $data = $view->toArray(); - // Check that the field is using the expected base table. - $this->assertEqual('node_field_data', $data['display']['default']['display_options']['fields']['nid']['table']); - $this->assertEqual('node_field_data', $data['display']['default']['display_options']['filters']['type']['table']); - $this->assertEqual('node_field_data', $data['display']['default']['display_options']['sorts']['vid']['table']); - $this->assertEqual('node_field_data', $data['display']['default']['display_options']['arguments']['nid']['table']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/ImageStyleDependencyUpdateTest.php b/core/modules/views/tests/src/Functional/Update/ImageStyleDependencyUpdateTest.php deleted file mode 100644 index d0bd731e927..00000000000 --- a/core/modules/views/tests/src/Functional/Update/ImageStyleDependencyUpdateTest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests Views image style dependencies update. - * - * @group views - * @group legacy - */ -class ImageStyleDependencyUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz', - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal8.views-image-style-dependency-2649914.php', - ]; - } - - /** - * Tests the updating of views dependencies to image styles. - */ - public function testUpdateImageStyleDependencies() { - $config_dependencies = View::load('foo')->getDependencies()['config']; - - // Checks that 'thumbnail' image style is not a dependency of view 'foo'. - $this->assertFalse(in_array('image.style.thumbnail', $config_dependencies)); - - // We test the case the the field formatter image style doesn't exist. - // Checks that 'nonexistent' image style is not a dependency of view 'foo'. - $this->assertFalse(in_array('image.style.nonexistent', $config_dependencies)); - - // Run updates. - $this->runUpdates(); - - $config_dependencies = View::load('foo')->getDependencies()['config']; - - // Checks that 'thumbnail' image style is a dependency of view 'foo'. - $this->assertTrue(in_array('image.style.thumbnail', $config_dependencies)); - - // The 'nonexistent' style doesn't exist, thus is not a dependency. Checks - // that 'nonexistent' image style is a not dependency of view 'foo'. - $this->assertFalse(in_array('image.style.nonexistent', $config_dependencies)); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/LimitOperatorsDefaultsTest.php b/core/modules/views/tests/src/Functional/Update/LimitOperatorsDefaultsTest.php deleted file mode 100644 index 64c74a4c3aa..00000000000 --- a/core/modules/views/tests/src/Functional/Update/LimitOperatorsDefaultsTest.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for limit operators feature. - * - * @see views_post_update_limit_operator_defaults() - * - * @group Update - * @group legacy - */ -class LimitOperatorsDefaultsTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/limit-exposed-operators.php', - ]; - } - - /** - * Tests that default settings for limit operators are present. - */ - public function testViewsPostUpdateLimitOperatorsDefaultValues() { - // Load and initialize our test view. - $view = View::load('test_exposed_filters'); - $data = $view->toArray(); - - // Check that the filters have no defaults values to limit operators. - $title_filter = $data['display']['default']['display_options']['filters']['title']['expose']; - $this->assertArrayNotHasKey('operator_limit_selection', $title_filter); - $this->assertArrayNotHasKey('operator_list', $title_filter); - - $created_filter = $data['display']['default']['display_options']['filters']['created']['expose']; - $this->assertArrayNotHasKey('operator_limit_selection', $created_filter); - $this->assertArrayNotHasKey('operator_list', $created_filter); - - $this->runUpdates(); - - // Load and initialize our test view. - $view = View::load('test_exposed_filters'); - $data = $view->toArray(); - - // Check that the filters have defaults values to limit operators. - $title_filter = $data['display']['default']['display_options']['filters']['title']['expose']; - $this->assertIdentical(FALSE, $title_filter['operator_limit_selection']); - $this->assertIdentical([], $title_filter['operator_list']); - - $created_filter = $data['display']['default']['display_options']['filters']['created']['expose']; - $this->assertIdentical(FALSE, $created_filter['operator_limit_selection']); - $this->assertIdentical([], $created_filter['operator_list']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/PlaceholderTextUpdateTest.php b/core/modules/views/tests/src/Functional/Update/PlaceholderTextUpdateTest.php deleted file mode 100644 index cc2dfac301d..00000000000 --- a/core/modules/views/tests/src/Functional/Update/PlaceholderTextUpdateTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for placeholder text. - * - * @see views_post_update_filter_placeholder_text() - * - * @group Update - * @group legacy - */ -class PlaceholderTextUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/filter-placeholder-text.php', - ]; - } - - /** - * Tests that boolean filter values are updated properly. - */ - public function testViewsPostUpdatePlaceholderText() { - $this->runUpdates(); - - // Load and initialize our test view. - $view = View::load('placeholder_text_test'); - $data = $view->toArray(); - // Check that new settings exist. - $this->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['title']['expose']); - $this->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['created']['expose']); - $this->assertArrayHasKey('min_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']); - $this->assertArrayHasKey('max_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/TableDisplayCacheMaxAgeTest.php b/core/modules/views/tests/src/Functional/Update/TableDisplayCacheMaxAgeTest.php deleted file mode 100644 index bbde0a8e321..00000000000 --- a/core/modules/views/tests/src/Functional/Update/TableDisplayCacheMaxAgeTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Entity\View; - -/** - * Tests the upgrade path for cache max age with table displays. - * - * @see views_post_update_table_display_cache_max_age() - * - * @group Update - * @group legacy - */ -class TableDisplayCacheMaxAgeTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/table-cache-max-age.php', - ]; - } - - /** - * Tests the upgrade path for cache max age with table displays. - */ - public function testViewsPostUpdateTableDisplayMaxCacheAge() { - $view = View::load('test_table_max_age'); - $data = $view->toArray(); - $this->assertSame(0, $data['display']['default']['cache_metadata']['max-age']); - - $this->runUpdates(); - - // Load and initialize our test view. - $view = View::load('test_table_max_age'); - $data = $view->toArray(); - // Check that the field is using the expected max age value. - $this->assertSame(-1, $data['display']['default']['cache_metadata']['max-age']); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/ViewCoreUpdateTest.php b/core/modules/views/tests/src/Functional/Update/ViewCoreUpdateTest.php deleted file mode 100644 index 4926a5fffd4..00000000000 --- a/core/modules/views/tests/src/Functional/Update/ViewCoreUpdateTest.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; - -/** - * Tests the upgrade path for removing the core key from views configuration. - * - * @see views_post_update_remove_core_key() - * - * @group Update - * @group legacy - */ -class ViewCoreUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - ]; - } - - /** - * Tests that the core key is removed from views configuration. - */ - public function testPostUpdate() { - $this->assertArrayHasKey('core', \Drupal::config('views.view.frontpage')->get()); - $this->runUpdates(); - - // Load and initialize our test view. - $this->assertArrayNotHasKey('core', \Drupal::config('views.view.frontpage')->get()); - } - -} diff --git a/core/modules/views/tests/src/Functional/Update/ViewsDataTableDependencyUpdateTest.php b/core/modules/views/tests/src/Functional/Update/ViewsDataTableDependencyUpdateTest.php deleted file mode 100644 index 52ce7bab911..00000000000 --- a/core/modules/views/tests/src/Functional/Update/ViewsDataTableDependencyUpdateTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Drupal\Tests\views\Functional\Update; - -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\views\Views; - -/** - * Tests the upgrade path for views data table provider dependencies. - * - * @see views_post_update_views_data_table_dependencies() - * - * @group Update - * @group legacy - */ -class ViewsDataTableDependencyUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz', - // This creates a view called test_table_dependency_update which has no - // dependencies. - __DIR__ . '/../../../fixtures/update/views-data-table-dependency.php', - ]; - } - - /** - * Tests that dependencies are correct after update. - */ - public function testPostUpdate() { - $this->runUpdates(); - - // Load and initialize our test view. - $view = Views::getView('test_table_dependency_update'); - $this->assertEquals(['module' => ['views_test_data']], $view->getDependencies()); - } - -} diff --git a/core/modules/views/views.install b/core/modules/views/views.install index 002ad013215..a7ed0b99a85 100644 --- a/core/modules/views/views.install +++ b/core/modules/views/views.install @@ -5,9 +5,6 @@ * Contains install and update functions for Views. */ -use Drupal\Core\Config\Schema\ArrayElement; -use Drupal\views\Views; - /** * Implements hook_install(). */ @@ -16,519 +13,8 @@ function views_install() { } /** - * Update views field plugins. - */ -function views_update_8001(&$sandbox) { - $config_factory = \Drupal::configFactory(); - $ids = []; - $message = NULL; - $ago_formats = [ - 'time ago', - 'time hence', - 'time span', - 'raw time ago', - 'raw time hence', - 'raw time span', - 'inverse time span', - ]; - - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $view = $config_factory->getEditable($view_config_name); - - $displays = $view->get('display'); - - foreach ($displays as $display_name => $display) { - if (!empty($display['display_options']['fields'])) { - foreach ($display['display_options']['fields'] as $field_name => $field) { - if (isset($field['entity_type']) && $field['plugin_id'] === 'date') { - $ids[] = $view->get('id'); - - // Grab the settings we need to move to a different place in the - // config schema. - $date_format = !empty($field['date_format']) ? $field['date_format'] : 'medium'; - $custom_date_format = !empty($field['custom_date_format']) ? $field['custom_date_format'] : ''; - $timezone = !empty($field['timezone']) ? $field['timezone'] : ''; - - // Save off the base part of the config path we are updating. - $base = "display.$display_name.display_options.fields.$field_name"; - - if (in_array($date_format, $ago_formats)) { - // Update the field to use the Field API formatter. - $view->set($base . '.plugin_id', 'field'); - $view->set($base . '.type', 'timestamp_ago'); - - // Ensure the granularity is an integer, which is defined in the - // field.formatter.settings.timestamp_ago schema. - $granularity = is_numeric($custom_date_format) ? (int) $custom_date_format : 2; - - // Add the new settings. - if ($date_format === 'time ago' || $date_format === 'time hence' || $date_format === 'time span') { - $view->set($base . '.settings.future_format', '@interval hence'); - $view->set($base . '.settings.past_format', '@interval ago'); - $view->set($base . '.settings.granularity', $granularity); - } - elseif ($date_format === 'raw time ago' || $date_format === 'raw time hence') { - $view->set($base . '.settings.future_format', '@interval'); - $view->set($base . '.settings.past_format', '@interval'); - $view->set($base . '.settings.granularity', $granularity); - } - elseif ($date_format === 'raw time span') { - $view->set($base . '.settings.future_format', '@interval'); - $view->set($base . '.settings.past_format', '-@interval'); - $view->set($base . '.settings.granularity', $granularity); - } - elseif ($date_format === 'inverse time span') { - $view->set($base . '.settings.future_format', '-@interval'); - $view->set($base . '.settings.past_format', '@interval'); - $view->set($base . '.settings.granularity', $granularity); - } - } - else { - // Update the field to use the Field API formatter. - $view->set($base . '.plugin_id', 'field'); - $view->set($base . '.type', 'timestamp'); - - // Add the new settings, and make sure everything is a string - // to conform with the field.formatter.settings.timestamp schema. - $view->set($base . '.settings.date_format', (string) $date_format); - $view->set($base . '.settings.custom_date_format', (string) $custom_date_format); - $view->set($base . '.settings.timezone', (string) $timezone); - } - - // Remove the old settings. - $view->clear($base . '.date_format'); - $view->clear($base . '.custom_date_format'); - $view->clear($base . '.timezone'); - } - } - } - } - - $view->save(TRUE); - } - - if (!empty($ids)) { - $message = \Drupal::translation()->translate('Updated field plugins for views: @ids', ['@ids' => implode(', ', array_unique($ids))]); - } - - return $message; -} - -/** - * Updates %1 and !1 tokens to argument tokens. - */ -function views_update_8002() { - $config_factory = \Drupal::configFactory(); - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $view = $config_factory->getEditable($view_config_name); - - $displays = $view->get('display'); - $argument_map_per_display = _views_update_argument_map($displays); - - $changed = FALSE; - - // Update all the field settings, which support tokens. - foreach ($displays as $display_name => &$display) { - if (!empty($display['display_options']['fields'])) { - $token_values = [ - 'path', - 'alt', - 'link_class', - 'rel', - 'target', - 'query', - 'fragment', - 'prefix', - 'suffix', - 'more_link_text', - 'more_link_path', - 'link_attributes', - 'text', - ]; - - foreach ($display['display_options']['fields'] as $field_name => &$field) { - foreach ($token_values as $token_name) { - if (!empty($field['alter'][$token_name])) { - if (is_array($field['alter'][$token_name])) { - foreach (array_keys($field['alter'][$token_name]) as $key) { - $field['alter'][$token_name][$key] = _views_update_8002_token_update($field['alter'][$token_name][$key], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - } - else { - $field['alter'][$token_name] = _views_update_8002_token_update($field['alter'][$token_name], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - } - } - } - } - } - - // Update the area handlers with tokens. - foreach ($displays as $display_name => &$display) { - $area_types = ['header', 'footer', 'empty']; - foreach ($area_types as $area_type) { - if (!empty($display['display_options'][$area_type])) { - foreach ($display['display_options'][$area_type] as &$area) { - switch ($area['plugin_id']) { - case 'title': - $area['title'] = _views_update_8002_token_update($area['title'], $argument_map_per_display[$display_name]); - $changed = TRUE; - break; - case 'result': - $area['content'] = _views_update_8002_token_update($area['content'], $argument_map_per_display[$display_name]); - $changed = TRUE; - break; - case 'text': - $area['content']['value'] = _views_update_8002_token_update($area['content']['value'], $argument_map_per_display[$display_name]); - $changed = TRUE; - break; - case 'text_custom': - $area['content'] = _views_update_8002_token_update($area['content'], $argument_map_per_display[$display_name]); - $changed = TRUE; - break; - case 'entity': - $area['target'] = _views_update_8002_token_update($area['target'], $argument_map_per_display[$display_name]); - $changed = TRUE; - break; - } - } - } - } - } - - // Update the argument title settings. - foreach ($displays as $display_name => &$display) { - if (!empty($display['display_options']['arguments'])) { - foreach ($display['display_options']['arguments'] as &$argument) { - if (isset($argument['exception']['title'])) { - $argument['exception']['title'] = _views_update_8002_token_update($argument['exception']['title'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - if (isset($argument['title'])) { - $argument['title'] = _views_update_8002_token_update($argument['title'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - } - } - } - - // Update the display title settings. - // Update the more link text and more link URL. - foreach ($displays as $display_name => &$display) { - if (!empty($display['display_options']['title'])) { - $display['display_options']['title'] = _views_update_8002_token_update($display['display_options']['title'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - if (!empty($display['display_options']['use_more_text'])) { - $display['display_options']['use_more_text'] = _views_update_8002_token_update($display['display_options']['use_more_text'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - if (!empty($display['display_options']['link_url'])) { - $display['display_options']['link_url'] = _views_update_8002_token_update($display['display_options']['link_url'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - } - - // Update custom classes for row class + grid classes. - // Update RSS description field. - foreach ($displays as $display_name => &$display) { - if (!empty($display['display_options']['style'])) { - if (!empty($display['display_options']['style']['options']['row_class_custom'])) { - $display['display_options']['style']['options']['row_class_custom'] = _views_update_8002_token_update($display['display_options']['style']['options']['row_class_custom'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - if (!empty($display['display_options']['style']['options']['col_class_custom'])) { - $display['display_options']['style']['options']['col_class_custom'] = _views_update_8002_token_update($display['display_options']['style']['options']['col_class_custom'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - if (!empty($display['display_options']['style']['options']['description'])) { - $display['display_options']['style']['options']['description'] = _views_update_8002_token_update($display['display_options']['style']['options']['description'], $argument_map_per_display[$display_name]); - $changed = TRUE; - } - } - } - - if ($changed) { - $view->set('display', $displays); - $view->save(TRUE); - } - } -} - -/** - * Updates a views configuration string from using %/! to twig tokens. - * - * @param string $text - * Text in which to search for argument tokens and replace them with their - * twig representation. - * @param array $argument_map - * A map of argument machine names keyed by their previous index. - * - * @return string - * The updated token. - */ -function _views_update_8002_token_update($text, array $argument_map) { - $text = preg_replace_callback('/%(\d)/', function ($match) use ($argument_map) { - return "{{ arguments.{$argument_map[$match[1]]} }}"; - }, $text); - $text = preg_replace_callback('/!(\d)/', function ($match) use ($argument_map) { - return "{{ raw_arguments.{$argument_map[$match[1]]} }}"; - }, $text); - - return $text; -} - -/** - * Builds an argument map for each Views display. - * - * @param array $displays - * A list of Views displays. - * - * @return array - * The argument map keyed by display id. - */ -function _views_update_argument_map($displays) { - $argument_map = []; - foreach ($displays as $display_id => $display) { - $argument_map[$display_id] = []; - if (isset($display['display_options']['arguments'])) { - foreach (array_keys($display['display_options']['arguments']) as $number => $name) { - $argument_map[$display_id][$number + 1] = $name; - } - } - elseif (isset($displays['default']['display_options']['arguments'])) { - foreach (array_keys($displays['default']['display_options']['arguments']) as $number => $name) { - $argument_map[$display_id][$number + 1] = $name; - } - } - } - - return $argument_map; -} - -/** - * Clear caches to fix entity operations field. - */ -function views_update_8003() { - // Empty update to cause a cache flush so that views data is rebuilt. Entity - // types that don't implement a list builder cannot have the entity operations - // field. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Clear caches due to updated entity views data. - */ -function views_update_8004() { - // Empty update to cause a cache flush so that views data is rebuilt. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Clear views data cache. - */ -function views_update_8005() { - // Empty update function to rebuild the views data. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Clear caches due to updated entity views data. - */ -function views_update_8100() { - // Empty update to cause a cache flush so that views data is rebuilt. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Set default values for enabled/expanded flag on page displays. - */ -function views_update_8101() { - $config_factory = \Drupal::configFactory(); - foreach ($config_factory->listAll('views.view.') as $view_config_name) { - $view = $config_factory->getEditable($view_config_name); - $save = FALSE; - foreach ($view->get('display') as $display_id => $display) { - if ($display['display_plugin'] == 'page') { - $display['display_options']['menu']['enabled'] = TRUE; - $display['display_options']['menu']['expanded'] = FALSE; - $view->set("display.$display_id", $display); - $save = TRUE; - } - } - if ($save) { - $view->save(); - } - } -} - -/** - * Rebuild the container to add a new container parameter. - */ -function views_update_8200() { - // Empty update to cause a cache rebuild so that the container is rebuilt. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Rebuild cache to refresh the views config schema. - */ -function views_update_8201() { - // Empty update to cause a cache rebuild so that config schema get refreshed. - - // Use hook_post_update_NAME() instead to clear the cache.The use - // of hook_update_N to clear the cache has been deprecated see - // https://www.drupal.org/node/2960601 for more details. -} - -/** - * Update field names for multi-value base fields. + * Implements hook_update_last_removed(). */ -function views_update_8500() { - // Find all multi-value base fields for content entities. - $entity_type_manager = \Drupal::entityTypeManager(); - $entity_field_manager = \Drupal::service('entity_field.manager'); - $table_update_info = []; - - foreach ($entity_type_manager->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->hasHandlerClass('views_data')) { - $base_field_definitions = $entity_field_manager->getBaseFieldDefinitions($entity_type_id); - - $entity_storage = $entity_type_manager->getStorage($entity_type_id); - $table_mapping = $entity_storage->getTableMapping($base_field_definitions); - - foreach ($base_field_definitions as $field_name => $base_field_definition) { - $base_field_storage_definition = $base_field_definition->getFieldStorageDefinition(); - - // Skip single value and custom storage base fields. - if (!$base_field_storage_definition->isMultiple() || $base_field_storage_definition->hasCustomStorage()) { - continue; - } - - // Get the actual table, as well as the column for the main property - // name so we can perform an update later on the views. - $table_name = $table_mapping->getFieldTableName($field_name); - $main_property_name = $base_field_storage_definition->getMainPropertyName(); - - $table_update_info[$table_name][$field_name] = $table_mapping->getFieldColumnName($base_field_storage_definition, $main_property_name); - } - } - } - - if (empty($table_update_info)) { - return; - } - - $config_factory = \Drupal::configFactory(); - /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager */ - $typed_config_manager = \Drupal::service('config.typed'); - $views_data = Views::viewsData(); - $handler_types = ['field', 'argument', 'sort', 'relationship', 'filter']; - - $required_cleanup_handlers = []; - foreach ($config_factory->listAll('views.view.') as $id) { - $view = $config_factory->getEditable($id); - $changed = FALSE; - - foreach ($view->get('display') as $display_id => &$display) { - foreach ($handler_types as $handler_type_singular) { - $handler_type_plural = $handler_type_singular . 's'; - $handler_data = $view->get("display.$display_id.display_options.$handler_type_plural"); - - if (empty($handler_data)) { - continue; - } - - foreach ($handler_data as $key => $data) { - // If this handler has a table we're interested in, update the field - // name. - $table = $data['table']; - if (isset($table_update_info[$table])) { - $path_to_handler = "display.$display_id.display_options.$handler_type_plural.$key"; - $path_field = "{$path_to_handler}.field"; - $path_plugin_id = "{$path_to_handler}.plugin_id"; - $original_field_name = $view->get($path_field); - - // Only if the wrong field name is set do we change the field. It - // could already be using the correct field. Like - // user__roles/roles_target_id. - if (isset($table_update_info[$table][$original_field_name])) { - $required_cleanup_handlers[$id][] = $path_to_handler; - - // Set both the new table field as well as new 'plugin_id' field. - $view->set($path_field, $table_update_info[$table][$original_field_name]); - $view->set($path_plugin_id, $views_data->get($table)[$table_update_info[$table][$original_field_name]][$handler_type_singular]['id']); - - $changed = TRUE; - } - } - } - } - } - - if ($changed) { - $view->save(TRUE); - } - } - - // Beside of updating the field and plugin ID we also need to truncate orphan - // keys so the configuration applies to the config schema. - // We cannot do that inline in the other code, due to caching issues with - // typed configuration. - foreach ($required_cleanup_handlers as $id => $paths_to_handlers) { - $changed = FALSE; - $typed_view = $typed_config_manager->get($id); - $view = $config_factory->getEditable($id); - foreach ($paths_to_handlers as $path_to_handler) { - /** @var \Drupal\Core\Config\Schema\TypedConfigInterface $typed_view */ - - /** @var \Drupal\Core\Config\Schema\ArrayElement $typed_config */ - $typed_config = $typed_view->get($path_to_handler); - $config = $typed_config->getValue(); - - // Filter values we want to convert from a string to an array. - if (strpos($path_to_handler, 'filters') !== FALSE && $typed_config->get('value') instanceof ArrayElement && is_string($config['value'])) { - // An empty string casted to an array is an array with one - // element. - if ($config['value'] === '') { - $config['value'] = []; - } - else { - $config['value'] = (array) $config['value']; - } - } - - // For all the other fields we try to determine the fields using - // config schema and remove everything which is not needed. - foreach (array_keys($config) as $config_key) { - if (!isset($typed_config->getDataDefinition()['mapping'][$config_key])) { - unset($config[$config_key]); - $changed = TRUE; - } - } - $typed_config->setValue($config); - $view->set($path_to_handler, $typed_config->getValue()); - } - - if ($changed) { - $view->save(); - } - } +function views_update_last_removed() { + return 8500; } diff --git a/core/modules/workspaces/tests/fixtures/update/drupal-8.6.0-workspaces_installed.php b/core/modules/workspaces/tests/fixtures/update/drupal-8.6.0-workspaces_installed.php Binary files differdeleted file mode 100644 index 459a7207e77..00000000000 --- a/core/modules/workspaces/tests/fixtures/update/drupal-8.6.0-workspaces_installed.php +++ /dev/null diff --git a/core/modules/workspaces/tests/src/Functional/Update/WorkspacesUpdateTest.php b/core/modules/workspaces/tests/src/Functional/Update/WorkspacesUpdateTest.php deleted file mode 100644 index a518434163e..00000000000 --- a/core/modules/workspaces/tests/src/Functional/Update/WorkspacesUpdateTest.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -namespace Drupal\Tests\workspaces\Functional\Update; - -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\FunctionalTests\Update\UpdatePathTestBase; -use Drupal\workspaces\Entity\Workspace; - -/** - * Tests the upgrade path for the Workspaces module. - * - * @group workspaces - * @group Update - * @group legacy - */ -class WorkspacesUpdateTest extends UpdatePathTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['workspaces', 'workspace_update_test']; - - /** - * {@inheritdoc} - */ - public function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [ - __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.6.0-workspaces_installed.php', - ]; - } - - /** - * Tests the move of workspace association data to a custom table. - * - * @see workspaces_update_8801() - * @see workspaces_post_update_move_association_data() - */ - public function testWorkspaceAssociationRemoval() { - $database = \Drupal::database(); - - // Check that we have two records in the 'workspace_association' base table - // and three records in its revision table. - $wa_records = $database->select('workspace_association')->countQuery()->execute()->fetchField(); - $this->assertEquals(2, $wa_records); - $war_records = $database->select('workspace_association_revision')->countQuery()->execute()->fetchField(); - $this->assertEquals(3, $war_records); - - // Check that the node entity type does not have a 'workspace' field. - $this->assertNull(\Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('workspace', 'node')); - - $this->runUpdates(); - - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Check that the 'workspace' field has been installed for an entity type - // that was workspace-supported before Drupal 8.7.0. - $this->assertTrue($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'node')); - - // Check that the 'workspace' field has been installed for an entity type - // which became workspace-supported as part of an entity schema update. - $this->assertTrue($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'taxonomy_term')); - - // Check that the 'workspace' field has been installed for an entity type - // that has been added in an update function. - $this->assertTrue($entity_definition_update_manager->getFieldStorageDefinition('workspace', 'path_alias')); - - // Check that the 'workspace' revision metadata field has been created only - // in the revision table. - $schema = $database->schema(); - $this->assertTrue($schema->fieldExists('node_revision', 'workspace')); - $this->assertFalse($schema->fieldExists('node', 'workspace')); - $this->assertFalse($schema->fieldExists('node_field_data', 'workspace')); - $this->assertFalse($schema->fieldExists('node_field_revision', 'workspace')); - - // Check that the 'workspace_association' records have been migrated - // properly. - $wa_records = $database->select('workspace_association')->fields('workspace_association')->execute()->fetchAll(\PDO::FETCH_ASSOC); - $expected = [ - [ - 'workspace' => 'stage', - 'target_entity_type_id' => 'node', - 'target_entity_id' => '1', - 'target_entity_revision_id' => '2', - ], - [ - 'workspace' => 'dev', - 'target_entity_type_id' => 'node', - 'target_entity_id' => '8', - 'target_entity_revision_id' => '10', - ], - ]; - $this->assertEquals($expected, $wa_records); - - // Check that the 'workspace_association' revisions has been migrated - // properly to the new 'workspace' revision metadata field. - $revisions = \Drupal::entityTypeManager()->getStorage('node')->loadMultipleRevisions([2, 9, 10]); - $this->assertEquals('stage', $revisions[2]->workspace->target_id); - $this->assertEquals('dev', $revisions[9]->workspace->target_id); - $this->assertEquals('dev', $revisions[10]->workspace->target_id); - - // Check that the 'workspace_association' entity type has been uninstalled. - $this->assertNull($entity_definition_update_manager->getEntityType('workspace_association')); - $this->assertNull($entity_definition_update_manager->getFieldStorageDefinition('id', 'workspace_association')); - $this->assertNull(\Drupal::keyValue('entity.storage_schema.sql')->get('workspace_association.entity_schema_data')); - - // Check that the 'workspace_association_revision' table has been removed. - $this->assertFalse($schema->tableExists('workspace_association_revision')); - } - - /** - * Tests the addition of the workspace 'parent' field. - * - * @see workspaces_update_8802() - * @see workspaces_post_update_update_deploy_form_display() - */ - public function testWorkspaceParentField() { - $this->runUpdates(); - - $this->assertNotEmpty(\Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('parent', 'workspace')); - $stage = Workspace::load('stage'); - $this->assertTrue($stage->hasField('parent')); - $this->assertTrue($stage->parent->isEmpty()); - - // Check that the 'parent' field is hidden in the Deploy form display. - $form_display = EntityFormDisplay::load('workspace.workspace.deploy'); - $this->assertNull($form_display->getComponent('parent')); - } - - /** - * {@inheritdoc} - */ - protected function replaceUser1() { - // Do not replace the user from our dump. - } - -} diff --git a/core/modules/workspaces/workspaces.install b/core/modules/workspaces/workspaces.install index acf3b21fd3d..193507a9e16 100644 --- a/core/modules/workspaces/workspaces.install +++ b/core/modules/workspaces/workspaces.install @@ -6,8 +6,6 @@ */ use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\Entity\ContentEntityNullStorage; -use Drupal\Core\Field\BaseFieldDefinition; use Drupal\workspaces\Entity\Workspace; /** @@ -124,74 +122,8 @@ function workspaces_schema() { } /** - * Add the 'workspace' revision metadata field on all supported entity types. + * Implements hook_update_last_removed(). */ -function workspaces_update_8801() { - /** @var \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager */ - $workspace_manager = \Drupal::service('workspaces.manager'); - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - foreach ($entity_definition_update_manager->getEntityTypes() as $entity_type_id => $entity_type) { - if ($workspace_manager->isEntityTypeSupported($entity_type)) { - $revision_metadata_keys = $entity_type->get('revision_metadata_keys'); - - if (!isset($revision_metadata_keys['workspace'])) { - // Bail out if there's an existing field called 'workspace'. - if ($entity_definition_update_manager->getFieldStorageDefinition('workspace', $entity_type_id)) { - throw new \RuntimeException("An existing 'workspace' field was found for the '$entity_type_id' entity type. Set the 'workspace' revision metadata key to use a different field name and run this update function again."); - } - - $revision_metadata_keys['workspace'] = 'workspace'; - $entity_type->set('revision_metadata_keys', $revision_metadata_keys); - $entity_definition_update_manager->updateEntityType($entity_type); - } - - $field_storage = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Workspace')) - ->setDescription(t('Indicates the workspace that this revision belongs to.')) - ->setSetting('target_type', 'workspace') - ->setInternal(TRUE) - ->setTranslatable(FALSE) - ->setRevisionable(TRUE); - - $entity_definition_update_manager->installFieldStorageDefinition($revision_metadata_keys['workspace'], $entity_type_id, 'workspaces', $field_storage); - } - } - - return t("The 'workspace' revision metadata field has been installed."); -} - -/** - * Add the 'parent' field to the 'workspace' entity type. - */ -function workspaces_update_8802() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - - // Install the new 'parent' field. - $storage_definition = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Parent')) - ->setDescription(t('The parent workspace.')) - ->setSetting('target_type', 'workspace') - ->setReadOnly(TRUE); - - $entity_definition_update_manager->installFieldStorageDefinition('parent', 'workspace', 'workspaces', $storage_definition); -} - -/** - * Remove the Workspace Association entity storage if necessary. - */ -function workspaces_update_8803() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $entity_definition_update_manager->getEntityType('workspace_association'); - - // We can't migrate the workspace association data if the entity type is not - // using its default storage. - // @see workspaces_post_update_move_association_data() - if ($entity_type && $entity_type->getHandlerClasses()['storage'] === 'Drupal\workspaces\WorkspaceAssociationStorage') { - \Drupal::state()->set('workspaces_update_8803.tables', [ - 'base_table' => $entity_type->getBaseTable(), - 'revision_table' => $entity_type->getRevisionTable(), - ]); - $entity_type->setStorageClass(ContentEntityNullStorage::class); - $entity_definition_update_manager->uninstallEntityType($entity_type); - } +function workspaces_update_last_removed() { + return 8803; } diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php index c043e327b54..98ba5be9c53 100644 --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php @@ -54,11 +54,11 @@ abstract class UpdatePathTestBase extends BrowserTestBase { /** * The file path(s) to the dumped database(s) to load into the child site. * - * The file system/tests/fixtures/update/drupal-8.bare.standard.php.gz is + * The file system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz is * normally included first -- this sets up the base database from a bare * standard Drupal installation. * - * The file system/tests/fixtures/update/drupal-8.filled.standard.php.gz + * The file system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz * can also be used in case we want to test with a database filled with * content, and with all core modules enabled. * |