Commit 69fd4ce1 authored by alexpott's avatar alexpott

Issue #2277117 by duellj, ivanjaros: BlockListBuilder uses href for links instead of route.

parent c06901ff
......@@ -355,7 +355,11 @@ public function buildForm(array $form, array &$form_state) {
}
$form['place_blocks']['list'][$category_key]['content']['#links'][$plugin_id] = array(
'title' => $plugin_definition['admin_label'],
'href' => 'admin/structure/block/add/' . $plugin_id . '/' . $this->theme,
'route_name' => 'block.admin_add',
'route_parameters' => array(
'plugin_id' => $plugin_id,
'theme' => $this->theme
),
'attributes' => array(
'class' => array('use-ajax', 'block-filter-text-source'),
'data-accepts' => 'application/vnd.drupal-modal',
......
......@@ -71,7 +71,10 @@ public function testBlockCategory() {
$arguments = array(
':id' => 'edit-category-lists-views',
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-1',
':href' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_1/stark'),
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_1',
'theme' => 'stark',
)),
':text' => $edit['label'],
);
$this->drupalGet('admin/structure/block');
......@@ -107,7 +110,10 @@ public function testBlockCategory() {
$arguments = array(
':id' => 'edit-category-lists-views',
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-2',
':href' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_2/stark'),
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_2',
'theme' => 'stark',
)),
':text' => $edit['label'],
);
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
......@@ -116,7 +122,10 @@ public function testBlockCategory() {
$arguments = array(
':id' => $category_id,
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-3',
':href' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_3/stark'),
':href' => \Drupal::Url('block.admin_add', array(
'plugin_id' => 'views_block:' . $edit['id'] . '-block_3',
'theme' => 'stark',
)),
':text' => $edit['label'],
);
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
......
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