diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index 834a55e..10e57c1 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -2,8 +2,8 @@ namespace Drupal\aggregator\Entity; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\aggregator\FeedInterface; @@ -39,13 +39,14 @@ * render_cache = FALSE, * entity_keys = { * "id" = "fid", + * "revision" = "revision_id", * "label" = "title", * "langcode" = "langcode", * "uuid" = "uuid", * } * ) */ -class Feed extends ContentEntityBase implements FeedInterface { +class Feed extends RevisionableContentEntityBase implements FeedInterface { /** * {@inheritdoc} diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php index 330aacb..0369c28 100644 --- a/core/modules/aggregator/src/Entity/Item.php +++ b/core/modules/aggregator/src/Entity/Item.php @@ -3,10 +3,10 @@ namespace Drupal\aggregator\Entity; use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\aggregator\ItemInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Url; @@ -29,12 +29,13 @@ * list_cache_tags = { "aggregator_feed_list" }, * entity_keys = { * "id" = "iid", + * "revision" = "revision_id", * "label" = "title", * "langcode" = "langcode", * } * ) */ -class Item extends ContentEntityBase implements ItemInterface { +class Item extends RevisionableContentEntityBase implements ItemInterface { /** * {@inheritdoc} @@ -91,7 +92,8 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['description'] = BaseFieldDefinition::create('string_long') ->setLabel(t('Description')) - ->setDescription(t('The body of the feed item.')); + ->setDescription(t('The body of the feed item.')) + ->setRevisionable(TRUE); $fields['timestamp'] = BaseFieldDefinition::create('created') ->setLabel(t('Posted on')) diff --git a/core/modules/aggregator/tests/src/Kernel/AggregatorTitleTest.php b/core/modules/aggregator/tests/src/Kernel/AggregatorTitleTest.php index 782ac6f..49759de 100644 --- a/core/modules/aggregator/tests/src/Kernel/AggregatorTitleTest.php +++ b/core/modules/aggregator/tests/src/Kernel/AggregatorTitleTest.php @@ -19,7 +19,7 @@ class AggregatorTitleTest extends KernelTestBase { * * @var array */ - public static $modules = ['file', 'field', 'options', 'aggregator', 'system']; + public static $modules = ['user', 'file', 'field', 'options', 'aggregator', 'system']; /** * The field name that is tested. diff --git a/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php b/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php index e44bd4f..e76b048 100644 --- a/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php +++ b/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php @@ -15,7 +15,7 @@ class ItemWithoutFeedTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['aggregator', 'options']; + public static $modules = ['aggregator', 'options', 'user']; /** * {@inheritdoc} diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index d626be3..ff3bf41 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -4,11 +4,11 @@ use Drupal\Component\Utility\Number; use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\comment\CommentInterface; use Drupal\Core\Entity\EntityChangedTrait; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\field\Entity\FieldStorageConfig; use Drupal\user\Entity\User; @@ -40,6 +40,7 @@ * translatable = TRUE, * entity_keys = { * "id" = "cid", + * "revision" = "revision_id", * "bundle" = "comment_type", * "label" = "subject", * "langcode" = "langcode", @@ -57,7 +58,7 @@ * } * ) */ -class Comment extends ContentEntityBase implements CommentInterface { +class Comment extends RevisionableContentEntityBase implements CommentInterface { use EntityChangedTrait; diff --git a/core/modules/contact/src/Entity/Message.php b/core/modules/contact/src/Entity/Message.php index 20f360f..7cc3100 100644 --- a/core/modules/contact/src/Entity/Message.php +++ b/core/modules/contact/src/Entity/Message.php @@ -2,9 +2,9 @@ namespace Drupal\contact\Entity; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\contact\MessageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; /** @@ -23,6 +23,7 @@ * }, * admin_permission = "administer contact forms", * entity_keys = { + * "revision" = "revision_id", * "bundle" = "contact_form", * "uuid" = "uuid", * "langcode" = "langcode" @@ -31,7 +32,7 @@ * field_ui_base_route = "entity.contact_form.edit_form", * ) */ -class Message extends ContentEntityBase implements MessageInterface { +class Message extends RevisionableContentEntityBase implements MessageInterface { /** * {@inheritdoc} diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php index da6d7c5..28b4d85 100644 --- a/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -2,10 +2,10 @@ namespace Drupal\file\Entity; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityChangedTrait; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\file\FileInterface; use Drupal\user\UserInterface; @@ -25,13 +25,14 @@ * base_table = "file_managed", * entity_keys = { * "id" = "fid", + * "revision" = "revision_id", * "label" = "filename", * "langcode" = "langcode", * "uuid" = "uuid" * } * ) */ -class File extends ContentEntityBase implements FileInterface { +class File extends RevisionableContentEntityBase implements FileInterface { use EntityChangedTrait; diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index d70889b..88e2fbe 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -2,10 +2,10 @@ namespace Drupal\menu_link_content\Entity; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityChangedTrait; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\link\LinkItemInterface; use Drupal\menu_link_content\MenuLinkContentInterface; @@ -34,6 +34,7 @@ * translatable = TRUE, * entity_keys = { * "id" = "id", + * "revision" = "revision_id", * "label" = "title", * "langcode" = "langcode", * "uuid" = "uuid", @@ -46,7 +47,7 @@ * } * ) */ -class MenuLinkContent extends ContentEntityBase implements MenuLinkContentInterface { +class MenuLinkContent extends RevisionableContentEntityBase implements MenuLinkContentInterface { use EntityChangedTrait; @@ -290,6 +291,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setLabel(t('Link')) ->setDescription(t('The location this menu link points to.')) ->setRequired(TRUE) + ->setRevisionable(TRUE) ->setSettings(array( 'link_type' => LinkItemInterface::LINK_GENERIC, 'title' => DRUPAL_DISABLED, diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php index 12d8d35..49de60a 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php @@ -18,7 +18,7 @@ class MenuLinkContentDeriverTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['menu_link_content', 'link', 'system', 'menu_link_content_dynamic_route']; + public static $modules = ['menu_link_content', 'link', 'system', 'menu_link_content_dynamic_route', 'user']; /** * {@inheritdoc} diff --git a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php index 046deb4..408f60c 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php @@ -18,7 +18,7 @@ class PathAliasMenuLinkContentTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['menu_link_content', 'system', 'link', 'test_page_test']; + public static $modules = ['menu_link_content', 'system', 'link', 'test_page_test', 'user']; /** * {@inheritdoc} diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php index 6ddaf05..b8edc86 100644 --- a/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -3,9 +3,9 @@ namespace Drupal\shortcut\Entity; use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\link\LinkItemInterface; use Drupal\shortcut\ShortcutInterface; @@ -33,6 +33,7 @@ * translatable = TRUE, * entity_keys = { * "id" = "id", + * "revision" = "revision_id", * "uuid" = "uuid", * "bundle" = "shortcut_set", * "label" = "title", @@ -47,7 +48,7 @@ * bundle_entity_type = "shortcut_set" * ) */ -class Shortcut extends ContentEntityBase implements ShortcutInterface { +class Shortcut extends RevisionableContentEntityBase implements ShortcutInterface { /** * {@inheritdoc} @@ -121,6 +122,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setLabel(t('Name')) ->setDescription(t('The name of the shortcut.')) ->setRequired(TRUE) + ->setRevisionable(TRUE) ->setTranslatable(TRUE) ->setSetting('max_length', 255) ->setDisplayOptions('form', array( @@ -139,6 +141,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setLabel(t('Path')) ->setDescription(t('The location this shortcut points to.')) ->setRequired(TRUE) + ->setRevisionable(TRUE) ->setSettings(array( 'link_type' => LinkItemInterface::LINK_INTERNAL, 'title' => DRUPAL_DISABLED, diff --git a/core/modules/shortcut/tests/src/Kernel/ShortcutSevenIntegrationTest.php b/core/modules/shortcut/tests/src/Kernel/ShortcutSevenIntegrationTest.php index 0d58c31..d0b2af8 100644 --- a/core/modules/shortcut/tests/src/Kernel/ShortcutSevenIntegrationTest.php +++ b/core/modules/shortcut/tests/src/Kernel/ShortcutSevenIntegrationTest.php @@ -11,7 +11,7 @@ */ class ShortcutSevenIntegrationTest extends KernelTestBase { - public static $modules = ['system']; + public static $modules = ['system', 'user']; /** * Tests shortcut_install() and shortcut_uninstall(). diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index 2e41e2d..7a9e3bd 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -2,10 +2,10 @@ namespace Drupal\taxonomy\Entity; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityChangedTrait; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\taxonomy\TermInterface; @@ -34,6 +34,7 @@ * translatable = TRUE, * entity_keys = { * "id" = "tid", + * "revision" = "revision_id", * "bundle" = "vid", * "label" = "name", * "langcode" = "langcode", @@ -50,7 +51,7 @@ * permission_granularity = "bundle" * ) */ -class Term extends ContentEntityBase implements TermInterface { +class Term extends RevisionableContentEntityBase implements TermInterface { use EntityChangedTrait; @@ -134,6 +135,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['description'] = BaseFieldDefinition::create('text_long') ->setLabel(t('Description')) ->setDescription(t('A description of the term.')) + ->setRevisionable(TRUE) ->setTranslatable(TRUE) ->setDisplayOptions('view', array( 'label' => 'hidden', diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 030b9a9..1169f99 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -2,10 +2,10 @@ namespace Drupal\user\Entity; -use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityChangedTrait; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Entity\RevisionableContentEntityBase; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Language\LanguageInterface; use Drupal\user\RoleInterface; @@ -43,6 +43,7 @@ * translatable = TRUE, * entity_keys = { * "id" = "uid", + * "revision" = "revision_id", * "langcode" = "langcode", * "uuid" = "uuid" * }, @@ -56,7 +57,7 @@ * common_reference_target = TRUE * ) */ -class User extends ContentEntityBase implements UserInterface { +class User extends RevisionableContentEntityBase implements UserInterface { use EntityChangedTrait;