diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockStorageController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockStorageController.php
index 9c5eb21..aa90090 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockStorageController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockStorageController.php
@@ -25,7 +25,7 @@ protected function attachLoad(&$blocks, $load_revision = FALSE) {
     // Create an array of block types for passing as a load argument.
     // Note that blocks at this point are still \StdClass objects returned from
     // the database.
-    foreach ($blocks as $id => $entity) {
+    foreach ($blocks as $entity) {
       $types[$entity->type] = $entity->type;
     }
 
