Issue #2086447 by tim.plunkett, damiankloip: Remove 'View:' prefix from views block derivative admin labels.
parent
b9a4a7ceb7
commit
6360399987
|
@ -69,7 +69,7 @@ class DisplayBlockTest extends ViewTestBase {
|
||||||
':id' => 'edit-views-test-data',
|
':id' => 'edit-views-test-data',
|
||||||
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-1',
|
':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' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_1/stark'),
|
||||||
':text' => 'View: ' . $edit['label'],
|
':text' => $edit['label'],
|
||||||
);
|
);
|
||||||
$this->drupalGet('admin/structure/block');
|
$this->drupalGet('admin/structure/block');
|
||||||
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
|
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
|
||||||
|
@ -105,7 +105,7 @@ class DisplayBlockTest extends ViewTestBase {
|
||||||
':id' => 'edit-views-test-data',
|
':id' => 'edit-views-test-data',
|
||||||
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-2',
|
':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' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_2/stark'),
|
||||||
':text' => 'View: ' . $edit['label'],
|
':text' => $edit['label'],
|
||||||
);
|
);
|
||||||
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
|
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
|
||||||
$this->assertTrue(!empty($elements), 'The first cloned test block remains in the original category.');
|
$this->assertTrue(!empty($elements), 'The first cloned test block remains in the original category.');
|
||||||
|
@ -114,7 +114,7 @@ class DisplayBlockTest extends ViewTestBase {
|
||||||
':id' => $category_id,
|
':id' => $category_id,
|
||||||
':li_class' => 'views-block' . drupal_html_class($edit['id']) . '-block-3',
|
':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' => url('admin/structure/block/add/views_block:' . $edit['id'] . '-block_3/stark'),
|
||||||
':text' => 'View: ' . $edit['label'],
|
':text' => $edit['label'],
|
||||||
);
|
);
|
||||||
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
|
$elements = $this->xpath('//details[@id=:id]//li[contains(@class, :li_class)]/a[contains(@href, :href) and text()=:text]', $arguments);
|
||||||
$this->assertTrue(!empty($elements), 'The second cloned test block appears in the custom category.');
|
$this->assertTrue(!empty($elements), 'The second cloned test block appears in the custom category.');
|
||||||
|
|
|
@ -93,10 +93,10 @@ class ViewsBlock implements ContainerDerivativeInterface {
|
||||||
|
|
||||||
if (empty($desc)) {
|
if (empty($desc)) {
|
||||||
if ($display->display['display_title'] == $display->definition['title']) {
|
if ($display->display['display_title'] == $display->definition['title']) {
|
||||||
$desc = t('View: !view', array('!view' => $view->label()));
|
$desc = t('!view', array('!view' => $view->label()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$desc = t('View: !view: !display', array('!view' => $view->label(), '!display' => $display->display['display_title']));
|
$desc = t('!view: !display', array('!view' => $view->label(), '!display' => $display->display['display_title']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->derivatives[$delta] = array(
|
$this->derivatives[$delta] = array(
|
||||||
|
|
|
@ -45,7 +45,7 @@ class BasicTest extends WizardTestBase {
|
||||||
|
|
||||||
// This view should not have a block.
|
// This view should not have a block.
|
||||||
$this->drupalGet('admin/structure/block');
|
$this->drupalGet('admin/structure/block');
|
||||||
$this->assertNoText('View: ' . $view1['label']);
|
$this->assertNoText($view1['label']);
|
||||||
|
|
||||||
// Create two nodes.
|
// Create two nodes.
|
||||||
$node1 = $this->drupalCreateNode(array('type' => 'page'));
|
$node1 = $this->drupalCreateNode(array('type' => 'page'));
|
||||||
|
@ -123,7 +123,7 @@ class BasicTest extends WizardTestBase {
|
||||||
|
|
||||||
// Confirm that the block is available in the block administration UI.
|
// Confirm that the block is available in the block administration UI.
|
||||||
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
||||||
$this->assertText('View: ' . $view3['label']);
|
$this->assertText($view3['label']);
|
||||||
|
|
||||||
// Place the block.
|
// Place the block.
|
||||||
$this->drupalPlaceBlock("views_block:{$view3['id']}-block_1");
|
$this->drupalPlaceBlock("views_block:{$view3['id']}-block_1");
|
||||||
|
|
|
@ -76,7 +76,7 @@ class ItemsPerPageTest extends WizardTestBase {
|
||||||
|
|
||||||
// Confirm that the block is listed in the block administration UI.
|
// Confirm that the block is listed in the block administration UI.
|
||||||
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
||||||
$this->assertText('View: ' . $view['label']);
|
$this->assertText($view['label']);
|
||||||
|
|
||||||
// Place the block, visit a page that displays the block, and check that the
|
// Place the block, visit a page that displays the block, and check that the
|
||||||
// nodes we expect appear in the correct order.
|
// nodes we expect appear in the correct order.
|
||||||
|
|
|
@ -55,7 +55,7 @@ class OverrideDisplaysTest extends UITestBase {
|
||||||
|
|
||||||
// Confirm that the view block is available in the block administration UI.
|
// Confirm that the view block is available in the block administration UI.
|
||||||
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
||||||
$this->assertText('View: ' . $view['label']);
|
$this->assertText($view['label']);
|
||||||
|
|
||||||
// Place the block.
|
// Place the block.
|
||||||
$this->drupalPlaceBlock("views_block:{$view['id']}-block_1");
|
$this->drupalPlaceBlock("views_block:{$view['id']}-block_1");
|
||||||
|
@ -113,7 +113,7 @@ class OverrideDisplaysTest extends UITestBase {
|
||||||
|
|
||||||
// Confirm that the block is available in the block administration UI.
|
// Confirm that the block is available in the block administration UI.
|
||||||
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
$this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
|
||||||
$this->assertText('View: ' . $view['label']);
|
$this->assertText($view['label']);
|
||||||
|
|
||||||
// Put the block into the first sidebar region, and make sure it will not
|
// Put the block into the first sidebar region, and make sure it will not
|
||||||
// display on the view's page display (since we will be searching for the
|
// display on the view's page display (since we will be searching for the
|
||||||
|
|
Loading…
Reference in New Issue