diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index 7b55d62..c7fb3cd 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -251,7 +251,7 @@ public function form(array $form, array &$form_state) { '#ajax' => array( 'callback' => array($this, 'themeSwitch'), 'wrapper' => 'edit-block-region-wrapper', - ), + ), ); } // Region settings. @@ -293,7 +293,7 @@ public function validate(array $form, array &$form_state) { $entity = $this->entity; if ($entity->isNew()) { - form_set_value($form['id'], $entity->get('theme') . '.' . $form_state['values']['machine_name'], $form_state); + form_set_value($form['id'], $form_state['values']['theme'] . '.' . $form_state['values']['machine_name'], $form_state); } if (!empty($form['machine_name']['#disabled'])) { $config_id = explode('.', $form_state['values']['machine_name']); @@ -329,7 +329,7 @@ public function submit(array $form, array &$form_state) { drupal_set_message($this->t('The block configuration has been saved.')); Cache::invalidateTags(array('content' => TRUE)); - $form_state['redirect'] = array('admin/structure/block/list/' . $entity->get('theme'), array( + $form_state['redirect'] = array('admin/structure/block/list/' . $form_state['values']['theme'], array( 'query' => array('block-placement' => drupal_html_class($this->entity->id())), )); } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 018a2b8..13064c6 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -156,6 +156,8 @@ public function testBlockThemeSelector() { $this->drupalPost('admin/structure/block/add/system_powered_by_block', $block, t('Save block')); $this->assertText(t('The block configuration has been saved.')); + $elements = $this->xpath('//div[@id = :id]', array(':id' => drupal_html_id('block-' . $block['machine_name']))); + $this->assertTrue(!empty($elements), 'The block was found.'); } /**