diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index ea408af..3d6fd9b 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -157,7 +157,7 @@ public function testViewsBlockForm() { // expected machine name. $this->assertTrue(!empty($blocks), 'The expected block was loaded.'); - for ($i = 1; $i <= 2; $i++) { + for ($i = 2; $i <= 3; $i++) { // Place the same block again and make sure we have a new ID. $this->drupalPost('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme, array(), t('Save block')); $storage = \Drupal::entityManager()->getStorageController('block'); diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 6bab6a1..077b29d 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -1828,8 +1828,7 @@ function views_form_block_form_alter(&$form, &$form_state) { unset($form['machine_name']['#machine_name']['source']); // Load the Views plugin object using form_state array and create a // block machine_name based on the View ID and View Display ID. - $block_plugin = $form_state['build_info']['callback_object']->getEntity() - ->getPlugin(); + $block_plugin = $form_state['build_info']['callback_object']->getEntity()->getPlugin(); // Override the Views block's machine_name by providing a default_value. $form['machine_name']['#default_value'] = $block_plugin->generateBlockInstanceID(Drupal::entityManager()->getStorageController('block')); // Prevent users from changing the auto-generate block machine_name.