diff --git a/core/modules/block/custom_block/custom_block.pages.inc b/core/modules/block/custom_block/custom_block.pages.inc index eba88fb..75ff6d3 100644 --- a/core/modules/block/custom_block/custom_block.pages.inc +++ b/core/modules/block/custom_block/custom_block.pages.inc @@ -100,11 +100,12 @@ function custom_block_delete_form($form, &$form_state, CustomBlock $block) { ); $instances = entity_load_multiple_by_properties('block', array('plugin' => 'custom_block:' . $block->uuid->value)); + $form['instances'] = array( + '#type' => 'value', + '#value' => $instances, + ); + if (!empty($instances)) { - $form['instances'] = array( - '#type' => 'value', - '#value' => $instances, - ); $form['message'] = array( '#type' => 'markup', '#markup' => format_plural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.'),