Commit 44a5c4cb authored by xjm's avatar xjm

Issue #2901739 by andriyun, Jo Fitzgerald, mfernea, xjm: Fix...

Issue #2901739 by andriyun, Jo Fitzgerald, mfernea, xjm: Fix 'Squiz.Arrays.ArrayDeclaration' coding standard
parent cc34cb80
......@@ -754,8 +754,7 @@ function install_tasks($install_state) {
'run' => $install_state['settings_verified'] ? INSTALL_TASK_SKIP : INSTALL_TASK_RUN_IF_NOT_COMPLETED,
'function' => 'Drupal\Core\Installer\Form\SiteSettingsForm',
],
'install_write_profile' => [
],
'install_write_profile' => [],
'install_verify_database_ready' => [
'run' => $install_state['database_ready'] ? INSTALL_TASK_SKIP : INSTALL_TASK_RUN_IF_NOT_COMPLETED,
],
......@@ -770,10 +769,8 @@ function install_tasks($install_state) {
'display_name' => t('Install site'),
'type' => 'batch',
],
'install_profile_themes' => [
],
'install_install_profile' => [
],
'install_profile_themes' => [],
'install_install_profile' => [],
'install_import_translations' => [
'display_name' => t('Set up translations'),
'display' => $needs_translations,
......@@ -813,8 +810,7 @@ function install_tasks($install_state) {
'type' => 'batch',
'run' => $needs_translations ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
],
'install_finished' => [
],
'install_finished' => [],
];
// Allow the installation profile to modify the full list of tasks.
......
......@@ -143,7 +143,9 @@ public function word($length) {
$vowels = ["a", "e", "i", "o", "u"];
$cons = ["b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr",
"cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr", "sl", "cl", "sh"];
"cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr",
"sl", "cl", "sh",
];
$num_vowels = count($vowels);
$num_cons = count($cons);
......@@ -219,7 +221,8 @@ public function sentences($min_word_count, $capitalize = FALSE) {
"utrum", "uxor", "valde", "valetudo", "validus", "vel", "velit",
"veniam", "venio", "vereor", "vero", "verto", "vicis", "vindico",
"virtus", "voco", "volutpat", "vulpes", "vulputate", "wisi", "ymo",
"zelus"];
"zelus",
];
$dictionary_flipped = array_flip($dictionary);
$greeking = '';
......
......@@ -318,7 +318,8 @@ public function getCollectionName() {
public function getAllCollectionNames() {
try {
return $this->connection->query('SELECT DISTINCT collection FROM {' . $this->connection->escapeTable($this->table) . '} WHERE collection <> :collection ORDER by collection', [
':collection' => StorageInterface::DEFAULT_COLLECTION]
':collection' => StorageInterface::DEFAULT_COLLECTION,
]
)->fetchCol();
}
catch (\Exception $e) {
......
......@@ -54,20 +54,21 @@ class Connection extends DatabaseConnection {
* @see http://www.postgresql.org/docs/9.4/static/sql-keywords-appendix.html
*/
protected $postgresqlReservedKeyWords = ['all', 'analyse', 'analyze', 'and',
'any', 'array', 'as', 'asc', 'asymmetric', 'authorization', 'binary', 'both',
'case', 'cast', 'check', 'collate', 'collation', 'column', 'concurrently',
'constraint', 'create', 'cross', 'current_catalog', 'current_date',
'current_role', 'current_schema', 'current_time', 'current_timestamp',
'current_user', 'default', 'deferrable', 'desc', 'distinct', 'do', 'else',
'end', 'except', 'false', 'fetch', 'for', 'foreign', 'freeze', 'from', 'full',
'grant', 'group', 'having', 'ilike', 'in', 'initially', 'inner', 'intersect',
'into', 'is', 'isnull', 'join', 'lateral', 'leading', 'left', 'like', 'limit',
'localtime', 'localtimestamp', 'natural', 'not', 'notnull', 'null', 'offset',
'on', 'only', 'or', 'order', 'outer', 'over', 'overlaps', 'placing',
'primary', 'references', 'returning', 'right', 'select', 'session_user',
'similar', 'some', 'symmetric', 'table', 'then', 'to', 'trailing', 'true',
'union', 'unique', 'user', 'using', 'variadic', 'verbose', 'when', 'where',
'window', 'with'];
'any', 'array', 'as', 'asc', 'asymmetric', 'authorization', 'binary', 'both',
'case', 'cast', 'check', 'collate', 'collation', 'column', 'concurrently',
'constraint', 'create', 'cross', 'current_catalog', 'current_date',
'current_role', 'current_schema', 'current_time', 'current_timestamp',
'current_user', 'default', 'deferrable', 'desc', 'distinct', 'do', 'else',
'end', 'except', 'false', 'fetch', 'for', 'foreign', 'freeze', 'from', 'full',
'grant', 'group', 'having', 'ilike', 'in', 'initially', 'inner', 'intersect',
'into', 'is', 'isnull', 'join', 'lateral', 'leading', 'left', 'like', 'limit',
'localtime', 'localtimestamp', 'natural', 'not', 'notnull', 'null', 'offset',
'on', 'only', 'or', 'order', 'outer', 'over', 'overlaps', 'placing',
'primary', 'references', 'returning', 'right', 'select', 'session_user',
'similar', 'some', 'symmetric', 'table', 'then', 'to', 'trailing', 'true',
'union', 'unique', 'user', 'using', 'variadic', 'verbose', 'when', 'where',
'window', 'with',
];
/**
* Constructs a connection object.
......
......@@ -32,11 +32,13 @@ public static function publishedBaseFieldDefinitions(EntityTypeInterface $entity
throw new UnsupportedEntityTypeDefinitionException('The entity type ' . $entity_type->id() . ' does not have a "published" entity key.');
}
return [$entity_type->getKey('published') => BaseFieldDefinition::create('boolean')
->setLabel(new TranslatableMarkup('Published'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDefaultValue(TRUE)];
return [
$entity_type->getKey('published') => BaseFieldDefinition::create('boolean')
->setLabel(new TranslatableMarkup('Published'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDefaultValue(TRUE),
];
}
/**
......
......@@ -449,8 +449,7 @@ function hook_install_tasks(&$install_state) {
// tasks are complete, with a link to reload the current page and therefore
// pass on to the final Drupal installation tasks when the user is ready to
// do so).
'myprofile_final_site_setup' => [
],
'myprofile_final_site_setup' => [],
];
return $tasks;
}
......
......@@ -106,7 +106,8 @@ public static function htmlToText($string, $allowed_tags = NULL) {
if (empty(static::$supportedTags)) {
static::$supportedTags = ['a', 'em', 'i', 'strong', 'b', 'br', 'p',
'blockquote', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'h1', 'h2', 'h3',
'h4', 'h5', 'h6', 'hr'];
'h4', 'h5', 'h6', 'hr',
];
}
// Make sure only supported tags are kept.
......
......@@ -31,9 +31,11 @@ public function setContent($content) {
// A render array can automatically be converted to a string and set the
// necessary metadata.
if (is_array($content) && (isset($content['#markup']))) {
$content += ['#attached' => [
'html_response_attachment_placeholders' => [],
'placeholders' => []],
$content += [
'#attached' => [
'html_response_attachment_placeholders' => [],
'placeholders' => [],
],
];
$this->addCacheableDependency(CacheableMetadata::createFromRenderArray($content));
$this->setAttachments($content['#attached']);
......
......@@ -347,7 +347,8 @@ protected function getRoutesByPath($path) {
// dump the route pattern without those optional parts.
try {
$routes = $this->connection->query("SELECT name, route, fit FROM {" . $this->connection->escapeTable($this->tableName) . "} WHERE pattern_outline IN ( :patterns[] ) AND number_parts >= :count_parts", [
':patterns[]' => $ancestors, ':count_parts' => count($parts),
':patterns[]' => $ancestors,
':count_parts' => count($parts),
])
->fetchAll(\PDO::FETCH_ASSOC);
}
......
......@@ -84,11 +84,13 @@ public function fetch(FeedInterface $feed) {
/** @var \Psr\Http\Message\UriInterface $actual_uri */
$actual_uri = NULL;
$response = $this->httpClientFactory->fromOptions(['allow_redirects' => [
'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
$actual_uri = (string) $uri;
}
]])->send($request);
$response = $this->httpClientFactory->fromOptions([
'allow_redirects' => [
'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
$actual_uri = (string) $uri;
}
],
])->send($request);
// In case of a 304 Not Modified, there is no new content, so return
// FALSE.
......
......@@ -83,25 +83,29 @@ public function placeholdersProvider() {
'_no_big_pipe present, no session, no-JS cookie present' => [$placeholders, 'GET', TRUE, FALSE, TRUE, []],
'_no_big_pipe present, session, no-JS cookie absent' => [$placeholders, 'GET', TRUE, TRUE, FALSE, []],
'_no_big_pipe present, session, no-JS cookie present' => [$placeholders, 'GET', TRUE, TRUE, TRUE, []],
'_no_big_pipe absent, session, no-JS cookie absent: (JS-powered) BigPipe placeholder used for HTML placeholders' => [$placeholders, 'GET', FALSE, TRUE, FALSE, [
$cases['html']->placeholder => $cases['html']->bigPipePlaceholderRenderArray,
$cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
$cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipePlaceholderRenderArray,
$cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipePlaceholderRenderArray,
$cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipePlaceholderRenderArray,
]],
'_no_big_pipe absent, session, no-JS cookie absent: (JS-powered) BigPipe placeholder used for HTML placeholders' => [
$placeholders, 'GET', FALSE, TRUE, FALSE, [
$cases['html']->placeholder => $cases['html']->bigPipePlaceholderRenderArray,
$cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
$cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipePlaceholderRenderArray,
$cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipePlaceholderRenderArray,
$cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipePlaceholderRenderArray,
],
],
'_no_big_pipe absent, session, no-JS cookie absent: (JS-powered) BigPipe placeholder used for HTML placeholders — but unsafe method' => [$placeholders, 'POST', FALSE, TRUE, FALSE, []],
'_no_big_pipe absent, session, no-JS cookie present: no-JS BigPipe placeholder used for HTML placeholders' => [$placeholders, 'GET', FALSE, TRUE, TRUE, [
$cases['html']->placeholder => $cases['html']->bigPipeNoJsPlaceholderRenderArray,
$cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
$cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
$cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
$cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipeNoJsPlaceholderRenderArray,
]],
'_no_big_pipe absent, session, no-JS cookie present: no-JS BigPipe placeholder used for HTML placeholders' => [
$placeholders, 'GET', FALSE, TRUE, TRUE, [
$cases['html']->placeholder => $cases['html']->bigPipeNoJsPlaceholderRenderArray,
$cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
$cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
$cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
$cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
$cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipeNoJsPlaceholderRenderArray,
],
],
'_no_big_pipe absent, session, no-JS cookie present: no-JS BigPipe placeholder used for HTML placeholders — but unsafe method' => [$placeholders, 'POST', FALSE, TRUE, TRUE, []],
];
}
......
......@@ -267,7 +267,7 @@ public function testBlockRendering() {
$result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2');
$this->assertTrue(empty($result), 'The title is not visible.');
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block' , 'http_response', 'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block', 'http_response', 'rendered']));
}
/**
......@@ -293,7 +293,7 @@ public function testBlockEmptyRendering() {
$this->assertEqual(0, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
// Ensure that the view cacheability metadata is propagated even, for an
// empty block.
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'http_response', 'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block', 'http_response', 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Add a header displayed on empty result.
......@@ -311,7 +311,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(1, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'http_response', 'rendered']));
$this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block', 'http_response', 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Hide the header on empty results.
......
......@@ -16,9 +16,9 @@ protected function setUp() {
$this->directoryList = ['block' => 'core/modules/block'];
parent::setUp();
$config_factory = $this->getConfigFactoryStub(['system.theme' => [
'default' => 'test_c',
]]);
$config_factory = $this->getConfigFactoryStub([
'system.theme' => ['default' => 'test_c'],
]);
$themes = [];
$themes['test_a'] = (object) [
......
......@@ -19,9 +19,9 @@ protected function setUp() {
];
parent::setUp();
$config_factory = $this->getConfigFactoryStub(['system.theme' => [
'default' => 'test_c',
]]);
$config_factory = $this->getConfigFactoryStub([
'system.theme' => ['default' => 'test_c'],
]);
$themes = [];
$themes['test_a'] = (object) [
......
......@@ -479,7 +479,7 @@ protected function getDefaultToolbarConfig() {
],
[
'name' => 'Tools',
'items' => ['Source', ],
'items' => ['Source'],
],
'/',
];
......
......@@ -101,13 +101,17 @@ public function testLoading() {
list($settings, $editor_settings_present, $editor_js_present, $body, $format_selector) = $this->getThingsToCheck();
$ckeditor_plugin = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');
$editor = Editor::load('filtered_html');
$expected = ['formats' => ['filtered_html' => [
'format' => 'filtered_html',
'editor' => 'ckeditor',
'editorSettings' => $this->castSafeStrings($ckeditor_plugin->getJSSettings($editor)),
'editorSupportsContentFiltering' => TRUE,
'isXssSafe' => FALSE,
]]];
$expected = [
'formats' => [
'filtered_html' => [
'format' => 'filtered_html',
'editor' => 'ckeditor',
'editorSettings' => $this->castSafeStrings($ckeditor_plugin->getJSSettings($editor)),
'editorSupportsContentFiltering' => TRUE,
'isXssSafe' => FALSE,
],
],
];
$this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page.");
$this->assertIdentical($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct.");
$this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.');
......@@ -138,7 +142,9 @@ public function testLoading() {
'editorSettings' => $this->castSafeStrings($ckeditor_plugin->getJSSettings($editor)),
'editorSupportsContentFiltering' => TRUE,
'isXssSafe' => FALSE,
]]];
],
],
];
$this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page.");
$this->assertIdentical($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct.");
$this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.');
......
......@@ -126,12 +126,15 @@ public function buildComponents(array &$build, array $entities, array $displays,
$display = $displays[$entity->bundle()];
if ($display->getComponent('links')) {
$build[$id]['links'] = [
'#lazy_builder' => ['comment.lazy_builders:renderLinks', [
$entity->id(),
$view_mode,
$entity->language()->getId(),
!empty($entity->in_preview),
]],
'#lazy_builder' => [
'comment.lazy_builders:renderLinks',
[
$entity->id(),
$view_mode,
$entity->language()->getId(),
!empty($entity->in_preview),
],
],
'#create_placeholder' => TRUE,
];
}
......
......@@ -192,12 +192,15 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
$elements['#cache']['contexts'][] = 'user.roles';
if ($this->currentUser->hasPermission('post comments')) {
$output['comment_form'] = [
'#lazy_builder' => ['comment.lazy_builders:renderForm', [
$entity->getEntityTypeId(),
$entity->id(),
$field_name,
$this->getFieldSetting('comment_type'),
]],
'#lazy_builder' => [
'comment.lazy_builders:renderForm',
[
$entity->getEntityTypeId(),
$entity->id(),
$field_name,
$this->getFieldSetting('comment_type'),
],
],
'#create_placeholder' => TRUE,
];
}
......
......@@ -21,8 +21,9 @@ class Comment extends DrupalSqlBase {
public function query() {
$query = $this->select('comments', 'c')
->fields('c', ['cid', 'pid', 'nid', 'uid', 'subject',
'comment', 'hostname', 'timestamp', 'status', 'thread', 'name',
'mail', 'homepage', 'format']);
'comment', 'hostname', 'timestamp', 'status', 'thread', 'name',
'mail', 'homepage', 'format',
]);
$query->innerJoin('node', 'n', 'c.nid = n.nid');
$query->fields('n', ['type']);
$query->orderBy('c.timestamp');
......
......@@ -129,10 +129,12 @@ public function testCommentNewCommentsIndicator() {
$response = $this->renderNewCommentsNodeLinks([$this->node->id()]);
$this->assertResponse(200);
$json = Json::decode($response);
$expected = [$this->node->id() => [
'new_comment_count' => 1,
'first_new_comment_link' => $this->node->url('canonical', ['fragment' => 'new']),
]];
$expected = [
$this->node->id() => [
'new_comment_count' => 1,
'first_new_comment_link' => $this->node->url('canonical', ['fragment' => 'new']),
],
];
$this->assertIdentical($expected, $json);
// Failing to specify node IDs for the endpoint should return a 404.
......
......@@ -147,8 +147,8 @@ public function testCRUD() {
try {
$id_length_config_test->save();
$this->pass(SafeMarkup::format("config_test entity with ID length @length was saved.", [
'@length' => strlen($id_length_config_test->id())]
));
'@length' => strlen($id_length_config_test->id()),
]));
}
catch (ConfigEntityIdLengthException $e) {
$this->fail($e->getMessage());
......
......@@ -18,13 +18,13 @@ public function loadOverrides($names) {
$overrides = [];
if (!empty($GLOBALS['config_test_run_module_overrides'])) {
if (in_array('system.site', $names)) {
$overrides = ['system.site' =>
[
$overrides = [
'system.site' => [
'name' => 'Should not apply because of higher priority listener',
// This override should apply because it is not overridden by the
// higher priority listener.
'slogan' => 'Yay for overrides!',
]
],
];
}
}
......
......@@ -88,44 +88,52 @@ public function providerTestHasTranslatable() {
[$this->getElement(['aaa' => 'bbb']), FALSE],
[$this->getElement(['translatable' => FALSE]), FALSE],
[$this->getElement(['translatable' => TRUE]), TRUE],
[$this->getNestedElement([
$this->getElement([]),
]), FALSE],
[$this->getNestedElement([
$this->getElement(['translatable' => TRUE]),
]), TRUE],
[$this->getNestedElement([
$this->getElement(['aaa' => 'bbb']),
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['eee' => 'fff']),
]), FALSE],
[$this->getNestedElement([
$this->getElement(['aaa' => 'bbb']),
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['translatable' => TRUE]),
]), TRUE],
[$this->getNestedElement([
$this->getElement(['aaa' => 'bbb']),
[$this->getNestedElement([$this->getElement([])]), FALSE],
[$this->getNestedElement([$this->getElement(['translatable' => TRUE])]), TRUE],
[
$this->getNestedElement([
$this->getElement(['aaa' => 'bbb']),
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['eee' => 'fff']),
]),
FALSE,
],
[
$this->getNestedElement([
$this->getElement(['ggg' => 'hhh']),
$this->getElement(['iii' => 'jjj']),
$this->getElement(['aaa' => 'bbb']),
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['translatable' => TRUE]),
]),
]), FALSE],
[$this->getNestedElement([
$this->getElement(['aaa' => 'bbb']),
TRUE,
],
[
$this->getNestedElement([
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['eee' => 'fff']),
$this->getElement(['aaa' => 'bbb']),
$this->getNestedElement([
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['eee' => 'fff']),
]),
$this->getNestedElement([
$this->getElement(['ggg' => 'hhh']),
$this->getElement(['iii' => 'jjj']),
]),
]),
FALSE
],
[
$this->getNestedElement([
$this->getElement(['ggg' => 'hhh']),
$this->getElement(['translatable' => TRUE]),
$this->getElement(['aaa' => 'bbb']),
$this->getNestedElement([
$this->getElement(['ccc' => 'ddd']),
$this->getElement(['eee' => 'fff']),
]),
$this->getNestedElement([
$this->getElement(['ggg' => 'hhh']),
$this->getElement(['translatable' => TRUE]),
]),
]),
]), TRUE],
TRUE,
],
];
}
......
......@@ -65,7 +65,8 @@ public function contactSitePage(ContactFormInterface $contact_form = NULL) {
if (empty($contact_form)) {
if ($this->currentUser()->hasPermission('administer contact forms')) {
drupal_set_message($this->t('The contact form has not been configured. <a href=":add">Add one or more forms</a> .', [
':add' => $this->url('contact.form_add')]), 'error');
':add' => $this->url('contact.form_add'),
]), 'error');
return [];
}
else {
......
......@@ -196,14 +196,16 @@ public function overview(RouteMatchInterface $route_match, $entity_type_id = NUL
if (isset($links['edit'])) {
$links['edit']['title'] = $this->t('Edit');
}
$status = ['data' => [
'#type' => 'inline_template',
'#template' => '<span class="status">{% if status %}{{ "Published"|t }}{% else %}{{ "Not published"|t }}{% endif %}</span>{% if outdated %} <span class="marker">{{ "outdated"|t }}</span>{% endif %}',
'#context' => [
'status' => $metadata->isPublished(),
'outdated' => $metadata->isOutdated(),
$status = [
'data' => [
'#type' => 'inline_template',
'#template' => '<span class="status">{% if status %}{{ "Published"|t }}{% else %}{{ "Not published"|t }}{% endif %}</span>{% if outdated %} <span class="marker">{{ "outdated"|t }}</span>{% endif %}',
'#context' => [
'status' => $metadata->isPublished(),
'outdated' => $metadata->isOutdated(),
],
],
]];
];
if ($is_original) {
$language_name = $this->t('<strong>@language_name (Original language)</strong>', ['@language_name' => $language_name]);
......
......@@ -49,20 +49,30 @@ public function testBlockAdminDisplay($route, $expected) {
*/
public function providerTestBlockAdminDisplay() {
return [
['entity.node.canonical', [[
'content_translation.local_tasks:entity.node.content_translation_overview',
[
'entity.node.canonical',
'entity.node.edit_form',
'entity.node.delete_form',
'entity.node.version_history',
]]],
['entity.node.content_translation_overview', [[
'content_translation.local_tasks:entity.node.content_translation_overview',
'entity.node.canonical',
'entity.node.edit_form',
'entity.node.delete_form',
'entity.node.version_history',
]]],
[
[
'content_translation.local_tasks:entity.node.content_translation_overview',
'entity.node.canonical',
'entity.node.edit_form',
'entity.node.delete_form',
'entity.node.version_history',
],
],
],
[
'entity.node.content_translation_overview',
[
[
'content_translation.local_tasks:entity.node.content_translation_overview',
'entity.node.canonical',
'entity.node.edit_form',
'entity.node.delete_form',
'entity.node.version_history',
],
],
],
];
}
......
......@@ -573,35 +573,48 @@ public function testDatelistWidget() {
protected function datelistDataProvider($field_label) {
return [
// Nothing selected.
[['year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''], [
"The $field_label date is required.",
]],
[
['year' => '', 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''],
["The $field_label date is required."],
],
// Year only selected, validation error on Month, Day, Hour, Minute.