Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / comment / src / CommentStorageSchema.php
index 2106a8ec2b85905c7dc5387e9d2cee948765f92e..58c8423e4c399a39c3fd4f88a739c41c06736256 100644 (file)
@@ -17,24 +17,26 @@ class CommentStorageSchema extends SqlContentEntityStorageSchema {
   protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
     $schema = parent::getEntitySchema($entity_type, $reset);
 
-    $schema['comment_field_data']['indexes'] += [
-      'comment__status_pid' => ['pid', 'status'],
-      'comment__num_new' => [
-        'entity_id',
-        'entity_type',
-        'comment_type',
-        'status',
-        'created',
-        'cid',
-        'thread',
-      ],
-      'comment__entity_langcode' => [
-        'entity_id',
-        'entity_type',
-        'comment_type',
-        'default_langcode',
-      ],
-    ];
+    if ($data_table = $this->storage->getDataTable()) {
+      $schema[$data_table]['indexes'] += [
+        'comment__status_pid' => ['pid', 'status'],
+        'comment__num_new' => [
+          'entity_id',
+          'entity_type',
+          'comment_type',
+          'status',
+          'created',
+          'cid',
+          'thread',
+        ],
+        'comment__entity_langcode' => [
+          'entity_id',
+          'entity_type',
+          'comment_type',
+          'default_langcode',
+        ],
+      ];
+    }
 
     return $schema;
   }