first commit

This commit is contained in:
2024-07-15 12:33:27 +02:00
commit ce50ae282b
22084 changed files with 2623791 additions and 0 deletions

View File

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

View File

View File

View File

@@ -0,0 +1,33 @@
{
"linkset": [
{
"anchor": "/aa/system/menu/main/linkset",
"item": [
{
"href": "/aa",
"title": "Home",
"hierarchy": ["0"],
"machine-name": ["main"]
},
{
"href": "/aa/node/1",
"title": "aa|A multi-lingual-node",
"hierarchy": ["1"],
"machine-name": ["main"]
},
{
"href": "/aa/node/2",
"title": "aa|Second multi-lingual-node",
"hierarchy": ["2"],
"machine-name": ["main"]
},
{
"href": "/aa/node/3",
"title": "aa|Third multi-lingual-node",
"hierarchy": ["3"],
"machine-name": ["main"]
}
]
}
]
}

View File

@@ -0,0 +1,33 @@
{
"linkset": [
{
"anchor": "/bb/system/menu/main/linkset",
"item": [
{
"href": "/bb",
"title": "Home",
"hierarchy": ["0"],
"machine-name": ["main"]
},
{
"href": "/bb/node/1",
"title": "bb|A multi-lingual-node",
"hierarchy": ["1"],
"machine-name": ["main"]
},
{
"href": "/bb/node/2",
"title": "bb|Second multi-lingual-node",
"hierarchy": ["2"],
"machine-name": ["main"]
},
{
"href": "/bb/node/3",
"title": "bb|Third multi-lingual-node",
"hierarchy": ["3"],
"machine-name": ["main"]
}
]
}
]
}

View File

@@ -0,0 +1,33 @@
{
"linkset": [
{
"anchor": "/cc/system/menu/main/linkset",
"item": [
{
"href": "/cc",
"title": "Home",
"hierarchy": ["0"],
"machine-name": ["main"]
},
{
"href": "/cc/node/1",
"title": "cc|A multi-lingual-node",
"hierarchy": ["1"],
"machine-name": ["main"]
},
{
"href": "/cc/node/2",
"title": "aa|Second multi-lingual-node",
"hierarchy": ["2"],
"machine-name": ["main"]
},
{
"href": "/cc/node/3",
"title": "aa|Third multi-lingual-node",
"hierarchy": ["3"],
"machine-name": ["main"]
}
]
}
]
}

View File

@@ -0,0 +1,33 @@
{
"linkset": [
{
"anchor": "/dd/system/menu/main/linkset",
"item": [
{
"href": "/dd",
"title": "Home",
"hierarchy": ["0"],
"machine-name": ["main"]
},
{
"href": "/dd/node/1",
"title": "A multi-lingual-node",
"hierarchy": ["1"],
"machine-name": ["main"]
},
{
"href": "/dd/node/2",
"title": "Second multi-lingual-node",
"hierarchy": ["2"],
"machine-name": ["main"]
},
{
"href": "/dd/node/3",
"title": "Third multi-lingual-node",
"hierarchy": ["3"],
"machine-name": ["main"]
}
]
}
]
}

View File

@@ -0,0 +1,33 @@
{
"linkset": [
{
"anchor": "/system/menu/main/linkset",
"item": [
{
"href": "/",
"title": "Home",
"hierarchy": ["0"],
"machine-name": ["main"]
},
{
"href": "/node/1",
"title": "A multi-lingual-node",
"hierarchy": ["1"],
"machine-name": ["main"]
},
{
"href": "/node/2",
"title": "Second multi-lingual-node",
"hierarchy": ["2"],
"machine-name": ["main"]
},
{
"href": "/node/3",
"title": "Third multi-lingual-node",
"hierarchy": ["3"],
"machine-name": ["main"]
}
]
}
]
}

View File

@@ -0,0 +1,47 @@
{
"linkset": [
{
"anchor": "/system/menu/main/linkset",
"item": [
{
"href": "/",
"title": "Home",
"hierarchy": ["0"],
"machine-name": ["main"]
},
{
"href": "/about",
"title": "About us",
"hierarchy": ["1"],
"machine-name": ["main"]
},
{
"href": "/about/custom-attributes",
"title": "Custom attributes test page",
"hierarchy": ["1", "0"],
"class": [
"foo",
"bar",
"1729",
"1",
"",
"0",
"-1",
"3.141592"
],
"data-baz": [
"42"
],
"¯\\_(ツ)_/¯": ["ok"],
"machine-name": ["main"]
},
{
"href": "/about/name",
"title": "Our name",
"hierarchy": ["1","1"],
"machine-name": ["main"]
}
]
}
]
}

View File

@@ -0,0 +1 @@
[{"title":"You can't parse this! Oh no! 🔥🙀🐶

View File

@@ -0,0 +1,80 @@
[
{
"title":"Critical Release - SA-2019-02-19",
"link":"https:\/\/www.drupal.org\/sa-2019-02-19",
"project":"drupal",
"type":"core",
"insecure":[
"7.65",
"8.5.14",
"8.6.13",
"8.7.0-alpha2",
"8.7.0-beta1",
"8.7.0-beta2",
"8.6.14",
"8.6.15",
"7.66",
"8.7.0",
"[CORE_VERSION]"
],
"is_psa":"0",
"pubDate":"Tue, 19 Feb 2019 14:11:01 +0000"
},
{
"title":"Critical Release - PSA-Really Old",
"link":"https:\/\/www.drupal.org\/psa",
"project":"drupal",
"type":"core",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Feb 2017 14:11:01 +0000"
},
{
"title":"Generic Module1 Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_project",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Generic Module1 Test - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_test",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Generic Module2 project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module2_project",
"type":"module",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Missing Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"missing_project",
"type":"module",
"is_psa":"1",
"insecure":[
"7.x-1.7",
"8.x-1.4"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
}
]

View File

@@ -0,0 +1,58 @@
[
{
"title":"Critical Release - SA-2019-02-19",
"link":"https:\/\/www.drupal.org\/sa-2019-02-19",
"project":"drupal",
"type":"core",
"insecure":[
"7.65",
"8.5.14",
"8.6.13",
"8.7.0-alpha2",
"8.7.0-beta1",
"8.7.0-beta2",
"8.6.14",
"8.6.15",
"7.66",
"8.7.0",
"[CORE_VERSION]"
],
"is_psa":"0",
"pubDate":"Tue, 19 Feb 2019 14:11:01 +0000"
},
{
"title":"Generic Module1 Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_project",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Generic Module1 Test - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_test",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Missing Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"missing_project",
"type":"module",
"is_psa":"1",
"insecure":[
"7.x-1.7",
"8.x-1.4"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
}
]

View File

@@ -0,0 +1,47 @@
[
{
"title":"Critical Release - PSA-Really Old",
"link":"https:\/\/www.drupal.org\/psa",
"project":"drupal",
"type":"core",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Feb 2017 14:11:01 +0000"
},
{
"title":"Generic Module1 Test - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_test",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Generic Module2 project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module2_project",
"type":"module",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Missing Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"missing_project",
"type":"module",
"is_psa":"1",
"insecure":[
"7.x-1.7",
"8.x-1.4"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
}
]

View File

@@ -0,0 +1,92 @@
[
{
"title":"Critical Release - SA-2019-02-19",
"link":"https:\/\/www.drupal.org\/sa-2019-02-19",
"project":"drupal",
"type":"core",
"insecure":[
"7.65",
"8.5.14",
"8.6.13",
"8.7.0-alpha2",
"8.7.0-beta1",
"8.7.0-beta2",
"8.6.14",
"8.6.15",
"7.66",
"8.7.0",
"[CORE_VERSION]"
],
"is_psa":"0",
"pubDate":"Tue, 19 Feb 2019 14:11:01 +0000"
},
{
"title":"Critical Release - PSA-Really Old",
"link":"https:\/\/www.drupal.org\/psa",
"project":"drupal",
"type":"core",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Feb 2017 14:11:01 +0000"
},
{
"title":"Generic Module1 Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_project",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1",
"8.x-8.7.0"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Generic Module1 Test - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module1_test",
"type":"module",
"is_psa":"0",
"insecure":[
"8.x-1.1",
"8.x-8.7.0"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Generic Module2 project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"generic_module2_project",
"type":"module",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Missing Project - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02",
"link":"https:\/\/www.drupal.org\/SA-CONTRIB-2019-02-02",
"project":"missing_project",
"type":"module",
"is_psa":"1",
"insecure":[
"7.x-1.7",
"8.x-1.4"
],
"pubDate":"Tue, 19 Mar 2019 12:50:00 +0000"
},
{
"title":"Critical Release - PSA because 2020",
"link":"https:\/\/www.drupal.org\/psa",
"project":"drupal",
"type":"core",
"is_psa":"1",
"insecure":[
],
"pubDate":"Tue, 19 Feb 2020 14:11:01 +0000"
}
]

View File

@@ -0,0 +1,69 @@
<?php
/**
* @file
* Contains database additions for testing year 2038 update.
*/
use Drupal\Core\Database\Database;
// cspell:ignore destid sourceid
$connection = Database::getConnection();
// Add a migrate map table.
$connection->schema()->createTable('migrate_map_d7_file', [
'fields' => [
'source_ids_hash' => [
'type' => 'varchar',
'not null' => TRUE,
'length' => '64',
],
'sourceid1' => [
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
],
'destid1' => [
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
],
'source_row_status' => [
'type' => 'int',
'not null' => TRUE,
'size' => 'tiny',
'default' => '0',
'unsigned' => TRUE,
],
'rollback_action' => [
'type' => 'int',
'not null' => TRUE,
'size' => 'tiny',
'default' => '0',
'unsigned' => TRUE,
],
'last_imported' => [
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
'default' => '0',
'unsigned' => TRUE,
],
'hash' => [
'type' => 'varchar',
'not null' => FALSE,
'length' => '64',
],
],
'primary key' => [
'source_ids_hash',
],
'indexes' => [
'source' => [
'sourceid1',
],
],
'mysql_character_set' => 'utf8mb4',
]);

View File

@@ -0,0 +1,58 @@
<?php
/**
* @file
* Provides database changes for testing upgrade path of system_update_8404().
*
* @see \Drupal\Tests\system\Functional\Update\SqlContentEntityStorageRevisionDataCleanupTest
*/
use Drupal\Core\Database\Database;
use Drupal\Core\Language\LanguageInterface;
$connection = Database::getConnection();
// Manually add a record to the node_revision
$connection->insert('node_field_revision')
->fields([
'nid' => 8,
'vid' => 8,
'langcode' => 'en',
'title' => 'Deleted revision',
'uid' => 1,
'status' => 1,
'created' => 1439731773,
'changed' => 1439732036,
'promote' => 1,
'sticky' => 0,
'revision_translation_affected' => 1,
'default_langcode' => 1,
'content_translation_source' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
'content_translation_outdated' => 0,
])
->execute();
// Add 100 more rows to test the loop in system_update_10201.
for ($i = 1; $i <= 100; $i++) {
// Ensure that the new nodes use a vid that is greater than the maximum vid
// in drupal-9.4.0.filled.standard.php.gz for node id 8.
$vid = 10 + $i;
$connection->insert('node_field_revision')
->fields([
'nid' => 8,
'vid' => $vid,
'langcode' => 'en',
'title' => 'Deleted revision',
'uid' => 1,
'status' => 1,
'created' => 1439732773,
'changed' => 1439733036,
'promote' => 1,
'sticky' => 0,
'revision_translation_affected' => 1,
'default_langcode' => 1,
'content_translation_source' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
'content_translation_outdated' => 0,
])
->execute();
}

View File

@@ -0,0 +1,21 @@
<?php
/**
* @file
* Database to mimic the installation of the update_test_schema module.
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Set the schema version.
$connection->merge('key_value')
->condition('collection', 'system.schema')
->condition('name', 'update_test_schema')
->fields([
'collection' => 'system.schema',
'name' => 'update_test_schema',
'value' => 's:4:"8901";',
])
->execute();

View File

@@ -0,0 +1,54 @@
<?php
/**
* @file
* Partial database to mimic the installation of the update_test_schema module.
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Create the table.
$connection->schema()->createTable('update_test_schema_table', [
'fields' => [
'a' => [
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
],
'b' => [
'type' => 'blob',
'not null' => FALSE,
'size' => 'normal',
],
],
]);
// Set the schema version.
$connection->merge('key_value')
->condition('collection', 'system.schema')
->condition('name', 'update_test_schema')
->fields([
'collection' => 'system.schema',
'name' => 'update_test_schema',
'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']['update_test_schema'] = 8000;
$connection->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();

View File

@@ -0,0 +1,38 @@
<?php
/**
* @file
* Database to mimic the installation of the update_test_semver_update_n module.
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Set the schema version.
$connection->merge('key_value')
->condition('collection', 'system.schema')
->condition('name', 'update_test_semver_update_n')
->fields([
'collection' => 'system.schema',
'name' => 'update_test_semver_update_n',
'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']['update_test_semver_update_n'] = 8000;
$connection->update('config')
->fields([
'data' => serialize($extensions),
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();

View File

@@ -0,0 +1,139 @@
<?php
/**
* @file
* Provides database changes for testing the TimestampFormatter upgrade path.
*
* @see \Drupal\Tests\system\Functional\Update\TimestampFormatterSettingsUpdateTest
*/
use Drupal\Core\Database\Database;
use Drupal\field\Entity\FieldStorageConfig;
$connection = Database::getConnection();
// Add a new timestamp field 'field_foo'.
$connection->insert('config')
->fields(['collection', 'name', 'data'])->values([
'collection' => '',
'name' => 'field.storage.node.field_foo',
'data' => $field_storage = 'a:16:{s:4:"uuid";s:36:"815278cf-a977-4700-aad9-d58034de0115";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:14:"node.field_foo";s:10:"field_name";s:9:"field_foo";s:11:"entity_type";s:4:"node";s:4:"type";s:9:"timestamp";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;}',
])->values([
'collection' => '',
'name' => 'field.field.node.page.field_foo',
'data' => 'a:16:{s:4:"uuid";s:36:"ea669e7e-532e-41ad-9322-13ba6a9901b0";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:1:{s:6:"config";a:2:{i:0;s:28:"field.storage.node.field_foo";i:1;s:14:"node.type.page";}}s:2:"id";s:19:"node.page.field_foo";s:10:"field_name";s:9:"field_foo";s:11:"entity_type";s:4:"node";s:6:"bundle";s:4:"page";s:5:"label";s:3:"Foo";s:11:"description";s:0:"";s:8:"required";b:0;s:12:"translatable";b:0;s:13:"default_value";a:1:{i:0;a:1:{s:5:"value";i:1511630653;}}s:22:"default_value_callback";s:0:"";s:8:"settings";a:0:{}s:10:"field_type";s:9:"timestamp";}',
])->execute();
$connection->insert('key_value')
->fields(['collection', 'name', 'value'])
->values([
'collection' => 'config.entity.key_store.field_config',
'name' => 'uuid:ea669e7e-532e-41ad-9322-13ba6a9901b0',
'value' => 'a:1:{i:0;s:31:"field.field.node.page.field_foo";}',
])
->values([
'collection' => 'config.entity.key_store.field_storage_config',
'name' => 'uuid:815278cf-a977-4700-aad9-d58034de0115',
'value' => 'a:1:{i:0;s:28:"field.storage.node.field_foo";}',
])
->values([
'collection' => 'entity.storage_schema.sql',
'name' => 'node.field_schema_data.field_foo',
'value' => 'a:2:{s:15:"node__field_foo";a:4:{s:11:"description";s:38:"Data storage for node field field_foo.";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:15:"field_foo_value";a:2:{s:4:"type";s:3:"int";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:24:"node_revision__field_foo";a:4:{s:11:"description";s:50:"Revision archive storage for node field field_foo.";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:15:"field_foo_value";a:2:{s:4:"type";s:3:"int";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";}}}}',
])
->execute();
$data = $connection->select('key_value')
->fields('key_value', ['value'])
->condition('collection', 'entity.definitions.bundle_field_map')
->condition('name', 'node')
->execute()
->fetchField();
$data = unserialize($data);
$data['field_foo']['type'] = 'timestamp';
$data['field_foo']['bundles']['page'] = 'page';
$connection->update('key_value')
->fields(['value' => serialize($data)])
->condition('collection', 'entity.definitions.bundle_field_map')
->condition('name', 'node')
->execute();
$data = $connection->select('key_value')
->fields('key_value', ['value'])
->condition('collection', 'entity.definitions.installed')
->condition('name', 'node.field_storage_definitions')
->execute()
->fetchField();
$data = unserialize($data);
$data['field_foo'] = new FieldStorageConfig(unserialize($field_storage));
$connection->update('key_value')
->fields(['value' => serialize($data)])
->condition('collection', 'entity.definitions.installed')
->condition('name', 'node.field_storage_definitions')
->execute();
// Add the new field to default entity view display.
$config = $connection->select('config')
->fields('config', ['data'])
->condition('collection', '')
->condition('name', 'core.entity_view_display.node.page.default')
->execute()
->fetchField();
$config = unserialize($config);
$config['content']['field_foo'] = [
'type' => 'timestamp',
'label' => 'hidden',
'weight' => 0,
'region' => 'content',
'settings' => [
'date_format' => 'custom',
'custom_date_format' => 'Y-m-d',
'timezone' => '',
],
'third_party_settings' => [],
];
$config['third_party_settings']['layout_builder'] = [
'enabled' => TRUE,
'allow_custom' => FALSE,
'sections' => [
[
'layout_id' => 'layout_onecol',
'layout_settings' => [
'label' => '',
],
'components' => [
'93bf4359-06a6-4263-bce9-15c90dc8f357' => [
'uuid' => '93bf4359-06a6-4263-bce9-15c90dc8f357',
'region' => 'content',
'configuration' => [
'id' => 'field_block:node:page:field_foo',
'label_display' => '0',
'context_mapping' => [
'entity' => 'layout_builder.entity',
],
'formatter' => [
'type' => 'timestamp',
'label' => 'inline',
'settings' => [
'date_format' => 'custom',
'custom_date_format' => 'Y-m-d',
'timezone' => '',
],
'third_party_settings' => [],
],
],
'weight' => 0,
'additional' => [],
],
],
'third_party_settings' => [],
],
],
];
$connection->update('config')
->fields(['data' => serialize($config)])
->condition('collection', '')
->condition('name', 'core.entity_view_display.node.page.default')
->execute();