Commit f82579cb authored by webchick's avatar webchick

Issue #2088027 by tim.plunkett | YesCT: Just placed block keeps changed color...

Issue #2088027 by tim.plunkett | YesCT: Just placed block keeps changed color even after saving the block layout page.
parent 363445ae
......@@ -408,6 +408,10 @@ public function submitForm(array &$form, array &$form_state) {
$entity->save();
}
drupal_set_message(t('The block settings have been updated.'));
// Remove any previously set block placement.
$this->request->query->remove('block-placement');
Cache::invalidateTags(array('content' => TRUE));
}
......
......@@ -176,4 +176,23 @@ public function testMachineNameSuggestion() {
$this->assertFieldByName('id', 'displaymessage_3', 'Block form appends _3 to plugin-suggested machine name when two instances already exist.');
}
/**
* Tests the block placement indicator.
*/
public function testBlockPlacementIndicator() {
// Select the 'Powered by Drupal' block to be placed.
$block = array();
$block['id'] = strtolower($this->randomName());
$block['theme'] = 'stark';
$block['region'] = 'content';
// After adding a block, it will indicate which block was just added.
$this->drupalPostForm('admin/structure/block/add/system_powered_by_block', $block, t('Save block'));
$this->assertUrl('admin/structure/block/list/stark?block-placement=' . drupal_html_class($block['id']));
// Resaving the block page will remove the block indicator.
$this->drupalPostForm(NULL, array(), t('Save blocks'));
$this->assertUrl('admin/structure/block/list/stark');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment