From 243f1668c85e190512800ecbc9127e6d516d026b Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Tue, 7 Jan 2014 22:27:22 -0800
Subject: [PATCH] Issue #2149841 by drastik, xjm, amateescu: The
 'aggregator_feed' entity type doesn't have a UUID field.

---
 core/modules/aggregator/aggregator.install               | 6 ++++++
 .../aggregator/lib/Drupal/aggregator/Entity/Feed.php     | 9 ++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/core/modules/aggregator/aggregator.install b/core/modules/aggregator/aggregator.install
index 4c11c118e706..23e26c07a3ea 100644
--- a/core/modules/aggregator/aggregator.install
+++ b/core/modules/aggregator/aggregator.install
@@ -35,6 +35,12 @@ function aggregator_schema() {
         'not null' => TRUE,
         'description' => 'Primary Key: Unique feed ID.',
       ),
+      'uuid' => array(
+        'description' => 'Unique Key: Universally unique identifier for this entity.',
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => FALSE,
+      ),
       'title' => array(
         'type' => 'varchar',
         'length' => 255,
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
index f65174201400..84940c672138 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
@@ -25,7 +25,7 @@
  *     "form" = {
  *       "default" = "Drupal\aggregator\FeedFormController",
  *       "delete" = "Drupal\aggregator\Form\FeedDeleteForm",
- *       "remove_items" = "Drupal\aggregator\Form\FeedItemsRemoveForm"
+ *       "remove_items" = "Drupal\aggregator\Form\FeedItemsRemoveForm",
  *     }
  *   },
  *   base_table = "aggregator_feed",
@@ -33,6 +33,7 @@
  *   entity_keys = {
  *     "id" = "fid",
  *     "label" = "title",
+ *     "uuid" = "uuid",
  *   }
  * )
  */
@@ -233,8 +234,10 @@ public static function baseFieldDefinitions($entity_type) {
       ->setDescription(t('The ID of the aggregator feed.'))
       ->setReadOnly(TRUE);
 
-    // @todo Add a UUID field for this entity type in
-    // https://drupal.org/node/2149841.
+    $fields['uuid'] = FieldDefinition::create('uuid')
+      ->setLabel(t('UUID'))
+      ->setDescription(t('The aggregator feed UUID.'))
+      ->setReadOnly(TRUE);
 
     $fields['title'] = FieldDefinition::create('string')
       ->setLabel(t('Title'))
-- 
GitLab