Skip to content
Snippets Groups Projects
Commit f82579cb authored by Angie Byron's avatar Angie Byron
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment