Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -18,8 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
class ShortcutController extends ControllerBase {
|
||||
|
||||
/**
|
||||
* Returns a rendered edit form to create a new shortcut associated to the
|
||||
* given shortcut set.
|
||||
* Returns a form to add a new shortcut to a given set.
|
||||
*
|
||||
* @param \Drupal\shortcut\ShortcutSetInterface $shortcut_set
|
||||
* The shortcut set this shortcut will be added to.
|
||||
|
|
|
@ -132,7 +132,6 @@ class Shortcut extends ContentEntityBase implements ShortcutInterface {
|
|||
->setDescription(t('The name of the shortcut.'))
|
||||
->setRequired(TRUE)
|
||||
->setTranslatable(TRUE)
|
||||
->setDefaultValue('')
|
||||
->setSetting('max_length', 255)
|
||||
->setDisplayOptions('form', array(
|
||||
'type' => 'string_textfield',
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\shortcut\Form;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
|
@ -71,7 +70,7 @@ class SwitchShortcutSet extends FormBase {
|
|||
|
||||
// Prepare the list of shortcut sets.
|
||||
$options = array_map(function (ShortcutSet $set) {
|
||||
return SafeMarkup::checkPlain($set->label());
|
||||
return $set->label();
|
||||
}, $this->shortcutSetStorage->loadMultiple());
|
||||
|
||||
$current_set = shortcut_current_displayed_set($this->user);
|
||||
|
|
|
@ -46,7 +46,7 @@ class ShortcutSetListBuilder extends ConfigEntityListBuilder {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildRow(EntityInterface $entity) {
|
||||
$row['name'] = $this->getLabel($entity);
|
||||
$row['name'] = $entity->label();
|
||||
return $row + parent::buildRow($entity);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\shortcut\Tests;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\shortcut\Entity\ShortcutSet;
|
||||
|
||||
/**
|
||||
|
@ -17,6 +16,22 @@ use Drupal\shortcut\Entity\ShortcutSet;
|
|||
*/
|
||||
class ShortcutSetsTest extends ShortcutTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public static $modules = ['block'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->drupalPlaceBlock('local_actions_block');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests creating a shortcut set.
|
||||
*/
|
||||
|
@ -133,9 +148,8 @@ class ShortcutSetsTest extends ShortcutTestBase {
|
|||
function testShortcutSetSwitchNoSetName() {
|
||||
$edit = array('set' => 'new');
|
||||
$this->drupalPostForm('user/' . $this->adminUser->id() . '/shortcuts', $edit, t('Change set'));
|
||||
$this->assertRaw(\Drupal::translation()->formatPlural(1, '1 error has been found: !errors', '@count errors have been found: !errors', [
|
||||
'!errors' => SafeMarkup::set('<a href="#edit-label">Label</a>')
|
||||
]));
|
||||
$this->assertRaw('1 error has been found:');
|
||||
$this->assertRaw('<a href="#edit-label">Label</a>');
|
||||
$current_set = shortcut_current_displayed_set($this->adminUser);
|
||||
$this->assertEqual($current_set->id(), $this->set->id(), 'Attempting to switch to a new shortcut set without providing a set name does not succeed.');
|
||||
$this->assertFieldByXPath("//input[@name='label' and contains(concat(' ', normalize-space(@class), ' '), ' error ')]", NULL, 'The new set label field has the error class');
|
||||
|
|
|
@ -21,7 +21,7 @@ class ShortcutTranslationUITest extends ContentTranslationUITestBase {
|
|||
/**
|
||||
* {inheritdoc}
|
||||
*/
|
||||
protected $defaultCacheContexts = ['languages:language_interface', 'theme', 'user', 'url.site'];
|
||||
protected $defaultCacheContexts = ['languages:language_interface', 'theme', 'user', 'url.path', 'url.query_args', 'url.site'];
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
|
|
Reference in a new issue