diff --git a/core/profiles/minimal/minimal.info.yml b/core/profiles/minimal/minimal.info.yml index 2617270..fb63c92 100644 --- a/core/profiles/minimal/minimal.info.yml +++ b/core/profiles/minimal/minimal.info.yml @@ -9,5 +9,9 @@ dependencies: - dblog - page_cache - dynamic_page_cache + - entity_test + - locale + - language + - content_translation themes: - stark diff --git a/core/profiles/minimal/minimal.install b/core/profiles/minimal/minimal.install index b9aab3c..e433be4 100644 --- a/core/profiles/minimal/minimal.install +++ b/core/profiles/minimal/minimal.install @@ -18,4 +18,64 @@ function minimal_install() { // Allow visitor account creation, but with administrative approval. \Drupal::configFactory()->getEditable('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(TRUE); + + \Drupal\language\Entity\ConfigurableLanguage::createFromLangcode('de')->save(); + + $entity = \Drupal\entity_test\Entity\EntityTestMulRev::create([ + 'name' => 'Three revisions', + ]); + $entity->save(); + + $entity->setNewRevision(TRUE); + $entity->save(); + + $entity->setNewRevision(TRUE); + $entity->save(); + + $two_forward_revisions = \Drupal\entity_test\Entity\EntityTestMulRev::create([ + 'name' => 'Two forward revisions', + ]); + $two_forward_revisions->save(); + + $two_forward_revisions->setNewRevision(TRUE); + $two_forward_revisions->isDefaultRevision(FALSE); + $two_forward_revisions->save(); + + $two_forward_revisions->setNewRevision(TRUE); + $two_forward_revisions->isDefaultRevision(FALSE); + $two_forward_revisions->save(); + + $with_translation = \Drupal\entity_test\Entity\EntityTestMulRev::create([ + 'name' => 'Translated Forward Revision', + ]); + $with_translation->save(); + + $translated = $with_translation->addTranslation('de', ['name' => 'Translated Forward Revision (DE)']); + $translated->save(); + + $revisionable_entity = \Drupal\entity_test\Entity\EntityTestRev::create([ + 'name' => 'One forward revision ' + ]); + $revisionable_entity->save(); + + $revisionable_entity->setNewRevision(TRUE); + $revisionable_entity->isDefaultRevision(FALSE); + $revisionable_entity->save(); + +// mysql> select * from test12172181entity_test_mulrev_property_data; +// +----+-------------+--------------------+----------+-----------------+----------------------------------+------------+---------+---------------+------------------+ +// | id | revision_id | type | langcode | latest_revision | name | created | user_id | non_rev_field | default_langcode | +// +----+-------------+--------------------+----------+-----------------+----------------------------------+------------+---------+---------------+------------------+ +// | 1 | 3 | entity_test_mulrev | en | 3 | Three revisions | 1490788029 | 1 | NULL | 1 | +// | 2 | 4 | entity_test_mulrev | en | 6 | Two forward revisions | 1490788029 | 1 | NULL | 1 | +// | 3 | 7 | entity_test_mulrev | de | 7 | Translated Forward Revision (DE) | 1490788029 | 1 | NULL | 0 | +// | 3 | 7 | entity_test_mulrev | en | 7 | Translated Forward Revision | 1490788029 | 1 | NULL | 1 | +// +----+-------------+--------------------+----------+-----------------+----------------------------------+------------+---------+---------------+------------------+ +// +// mysql> select * from test12172181entity_test_rev; +// +----+-------------+-----------------+--------------------------------------+----------+-----------------+-----------------------+------------+---------+---------------+ +// | id | revision_id | type | uuid | langcode | latest_revision | name | created | user_id | non_rev_field | +// +----+-------------+-----------------+--------------------------------------+----------+-----------------+-----------------------+------------+---------+---------------+ +// | 1 | 1 | entity_test_rev | 43426f0e-bc52-48b3-8b09-8e19625ae7b9 | en | NULL | One forward revision | 1490788029 | 1 | NULL | +// +----+-------------+-----------------+--------------------------------------+----------+-----------------+-----------------------+------------+---------+---------------+ }