diff --git a/core/lib/Drupal/Component/Utility/Xss.php b/core/lib/Drupal/Component/Utility/Xss.php index 9081fae..7a06e124 100644 --- a/core/lib/Drupal/Component/Utility/Xss.php +++ b/core/lib/Drupal/Component/Utility/Xss.php @@ -192,7 +192,6 @@ protected static function attributes($attributes) { $mode = 0; $attribute_name = ''; $skip = FALSE; - $skip_protocol_filtering = FALSE; while (strlen($attributes) != 0) { // Was the last operation successful? @@ -204,20 +203,6 @@ protected static function attributes($attributes) { if (preg_match('/^([-a-zA-Z]+)/', $attributes, $match)) { $attribute_name = strtolower($match[1]); $skip = ($attribute_name == 'style' || substr($attribute_name, 0, 2) == 'on'); - - // Values for attributes of type URI should be filtered for - // potentially malicious protocols (for example, an href-attribute - // starting with "javascript:"). However, for some non-URI - // attributes performing this filtering causes valid and safe data - // to be mangled. We prevent this by skipping protocol filtering on - // such attributes. - // @see \Drupal\Component\Utility\UrlHelper::filterBadProtocol() - // @see http://www.w3.org/TR/html4/index/attributes.html - $skip_protocol_filtering = substr($attribute_name, 0, 5) === 'data-' || in_array($attribute_name, array( - 'title', - 'alt', - )); - $working = $mode = 1; $attributes = preg_replace('/^[-a-zA-Z]+/', '', $attributes); } @@ -243,7 +228,7 @@ protected static function attributes($attributes) { case 2: // Attribute value, a URL after href= for instance. if (preg_match('/^"([^"]*)"(\s+|$)/', $attributes, $match)) { - $thisval = $skip_protocol_filtering ? $match[1] : UrlHelper::filterBadProtocol($match[1]); + $thisval = UrlHelper::filterBadProtocol($match[1]); if (!$skip) { $attributes_array[] = "$attribute_name=\"$thisval\""; @@ -255,7 +240,7 @@ protected static function attributes($attributes) { } if (preg_match("/^'([^']*)'(\s+|$)/", $attributes, $match)) { - $thisval = $skip_protocol_filtering ? $match[1] : UrlHelper::filterBadProtocol($match[1]); + $thisval = UrlHelper::filterBadProtocol($match[1]); if (!$skip) { $attributes_array[] = "$attribute_name='$thisval'"; @@ -266,7 +251,7 @@ protected static function attributes($attributes) { } if (preg_match("%^([^\s\"']+)(\s+|$)%", $attributes, $match)) { - $thisval = $skip_protocol_filtering ? $match[1] : UrlHelper::filterBadProtocol($match[1]); + $thisval = UrlHelper::filterBadProtocol($match[1]); if (!$skip) { $attributes_array[] = "$attribute_name=\"$thisval\""; diff --git a/core/lib/Drupal/Core/Mail/MailManagerInterface.php b/core/lib/Drupal/Core/Mail/MailManagerInterface.php index ded236b..5cb446a 100644 --- a/core/lib/Drupal/Core/Mail/MailManagerInterface.php +++ b/core/lib/Drupal/Core/Mail/MailManagerInterface.php @@ -116,7 +116,7 @@ * hook_mail_alter() may cancel sending by setting $message['send'] to * FALSE. * - * @return array + * @return string * The $message array structure containing all details of the message. If * already sent ($send = TRUE), then the 'result' element will contain the * success indicator of the email, failure being already written to the diff --git a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php index d12522a..8821930 100644 --- a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php @@ -157,10 +157,12 @@ public function renderResponse(array $main_content, Request $request, RouteMatch // entire render cache, regardless of the cache bin. $cache_contexts = []; $cache_tags = ['rendered']; + $cache_max_age = Cache::PERMANENT; foreach (['page_top', 'page', 'page_bottom'] as $region) { if (isset($html[$region])) { $cache_contexts = Cache::mergeContexts($cache_contexts, $html[$region]['#cache']['contexts']); $cache_tags = Cache::mergeTags($cache_tags, $html[$region]['#cache']['tags']); + $cache_max_age = Cache::mergeMaxAges($cache_max_age, $html[$region]['#cache']['max-age']); } } @@ -172,6 +174,11 @@ public function renderResponse(array $main_content, Request $request, RouteMatch 'X-Drupal-Cache-Contexts' => implode(' ', $this->cacheContexts->optimizeTokens($cache_contexts)), 'X-Generator' => 'Drupal ' . $version . ' (https://www.drupal.org)' ]); + // If an explicit non-infinite max-age is specified by a part of the page, + // respect that by applying it to the response's headers. + if ($cache_max_age !== Cache::PERMANENT) { + $response->setMaxAge($cache_max_age); + } return $response; } diff --git a/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php index 3c71930..52b3542 100644 --- a/core/lib/Drupal/Core/Session/SessionManager.php +++ b/core/lib/Drupal/Core/Session/SessionManager.php @@ -174,7 +174,6 @@ protected function startNow() { // Restore session data. if ($this->startedLazy) { $_SESSION = $session_data; - $this->loadSession(); } return $result; diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 44b0a2a..a2b1f59 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -215,8 +215,6 @@ public function getUrl($name, $parameters = array(), $options = array()) { * * @return string * The generated absolute URL for the given path. - * - * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 8.0.0. */ public function getUrlFromPath($path, $options = array()) { $options['absolute'] = TRUE; diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index 1cc7515..d0c6241 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -158,7 +158,7 @@ if (this.tableSettings.hasOwnProperty(group)) { // Find the first field in this group. for (var d in this.tableSettings[group]) { if (this.tableSettings[group].hasOwnProperty(d)) { - var field = $table.find('.' + this.tableSettings[group][d].target).eq(0); + var field = $table.find('.' + this.tableSettings[group][d].target + ':first'); if (field.length && this.tableSettings[group][d].hidden) { hidden = this.tableSettings[group][d].hidden; cell = field.closest('td'); @@ -311,18 +311,18 @@ var self = this; var $item = $(item); // Add a class to the title link - $item.find('td').eq(0).find('a').addClass('menu-item__link'); + $item.find('td:first a').addClass('menu-item__link'); // Create the handle. var handle = $('
 
').attr('title', Drupal.t('Drag to re-order')); // Insert the handle after indentations (if any). - var $indentationLast = $item.find('td').eq(0).find('.js-indentation').eq(-1); + var $indentationLast = $item.find('td:first .js-indentation:last'); if ($indentationLast.length) { $indentationLast.after(handle); // Update the total width of indentation in this entire table. self.indentCount = Math.max($item.find('.js-indentation').length, self.indentCount); } else { - $item.find('td').eq(0).prepend(handle); + $item.find('td:first').prepend(handle); } if (Modernizr.touch) { @@ -417,7 +417,7 @@ break; case 40: // Down arrow. case 63233: // Safari down arrow. - var $nextRow = $(self.rowObject.group).eq(-1).next('tr').eq(0); + var $nextRow = $(self.rowObject.group).filter(':last').next('tr').eq(0); var nextRow = $nextRow.get(0); while (nextRow && $nextRow.is(':hidden')) { $nextRow = $(nextRow).next('tr').eq(0); @@ -436,7 +436,7 @@ $(nextGroup.group).each(function () { groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight; }); - var nextGroupRow = $(nextGroup.group).eq(-1).get(0); + var nextGroupRow = $(nextGroup.group).filter(':last').get(0); self.rowObject.swap('after', nextGroupRow); // No need to check for indentation, 0 is the only valid one. window.scrollBy(0, parseInt(groupHeight, 10)); @@ -808,7 +808,7 @@ // Use the first row in the table as source, because it's guaranteed to // be at the root level. Find the first item, then compare this row // against it as a sibling. - sourceRow = $(this.table).find('tr.draggable').eq(0).get(0); + sourceRow = $(this.table).find('tr.draggable:first').get(0); if (sourceRow === this.rowObject.element) { sourceRow = $(this.rowObject.group[this.rowObject.group.length - 1]).next('tr.draggable').get(0); } @@ -1147,7 +1147,7 @@ // Determine the valid indentations interval if not available yet. if (!this.interval) { var prevRow = $(this.element).prev('tr').get(0); - var nextRow = $group.eq(-1).next('tr').get(0); + var nextRow = $group.filter(':last').next('tr').get(0); this.interval = this.validIndentInterval(prevRow, nextRow); } @@ -1160,11 +1160,11 @@ for (var n = 1; n <= Math.abs(indentDiff); n++) { // Add or remove indentations. if (indentDiff < 0) { - $group.find('.js-indentation').eq(0).remove(); + $group.find('.js-indentation:first').remove(); this.indents--; } else { - $group.find('td').eq(0).prepend(Drupal.theme('tableDragIndentation')); + $group.find('td:first').prepend(Drupal.theme('tableDragIndentation')); this.indents++; } } @@ -1244,7 +1244,7 @@ */ Drupal.tableDrag.prototype.row.prototype.markChanged = function () { var marker = Drupal.theme('tableDragChangedMarker'); - var cell = $(this.element).find('td').eq(0); + var cell = $(this.element).find('td:first'); if (cell.find('abbr.tabledrag-changed').length === 0) { cell.append(marker); } diff --git a/core/misc/tableresponsive.js b/core/misc/tableresponsive.js index e13acce..93b7f83 100644 --- a/core/misc/tableresponsive.js +++ b/core/misc/tableresponsive.js @@ -89,7 +89,7 @@ var $header = $(this); var position = $header.prevAll('th').length; self.$table.find('tbody tr').each(function () { - var $cells = $(this).find('td').eq(position); + var $cells = $(this).find('td:eq(' + position + ')'); $cells.show(); // Keep track of the revealed cells, so they can be hidden later. self.$revealedCells = $().add(self.$revealedCells).add($cells); diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index 1b51850..faed095 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -55,8 +55,8 @@ } }); - $(tab_list).find('> li').eq(0).addClass('first'); - $(tab_list).find('> li').eq(-1).addClass('last'); + $(tab_list).find('> li:first').addClass('first'); + $(tab_list).find('> li:last').addClass('last'); if (!tab_focus) { // If the current URL has a fragment and one of the tabs contains an @@ -66,7 +66,7 @@ tab_focus = $locationHash.closest('.vertical-tabs__pane'); } else { - tab_focus = $this.find('> .vertical-tabs__pane').eq(0); + tab_focus = $this.find('> .vertical-tabs__pane:first'); } } if (tab_focus.length) { @@ -102,7 +102,7 @@ if (event.keyCode === 13) { self.focus(); // Set focus on the first input field of the visible details/tab pane. - $(".vertical-tabs__pane :input:visible:enabled").eq(0).trigger('focus'); + $(".vertical-tabs__pane :input:visible:enabled:first").trigger('focus'); } }); @@ -154,7 +154,7 @@ // actual DOM element order as jQuery implements sortOrder, but not as public // method. this.item.parent().children('.vertical-tabs__menu-item').removeClass('first') - .filter(':visible').eq(0).addClass('first'); + .filter(':visible:first').addClass('first'); // Display the details element. this.details.removeClass('vertical-tab--hidden').show(); // Focus this tab. @@ -172,11 +172,11 @@ // actual DOM element order as jQuery implements sortOrder, but not as public // method. this.item.parent().children('.vertical-tabs__menu-item').removeClass('first') - .filter(':visible').eq(0).addClass('first'); + .filter(':visible:first').addClass('first'); // Hide the details element. this.details.addClass('vertical-tab--hidden').hide(); // Focus the first visible tab (if there is one). - var $firstTab = this.details.siblings('.vertical-tabs__pane:not(.vertical-tab--hidden)').eq(0); + var $firstTab = this.details.siblings('.vertical-tabs__pane:not(.vertical-tab--hidden):first'); if ($firstTab.length) { $firstTab.data('verticalTab').focus(); } diff --git a/core/modules/block/js/block.js b/core/modules/block/js/block.js index 3a42f37..2b727c4 100644 --- a/core/modules/block/js/block.js +++ b/core/modules/block/js/block.js @@ -99,7 +99,7 @@ tableDrag.rowObject = new tableDrag.row(row); // Find the correct region and insert the row as the last in the region. - table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').eq(-1).before(row); + table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').last().before(row); // Modify empty regions with added or removed fields. checkEmptyRegions(table, row); diff --git a/core/modules/block_content/block_content.routing.yml b/core/modules/block_content/block_content.routing.yml index 3542ca8..1c78f0c 100644 --- a/core/modules/block_content/block_content.routing.yml +++ b/core/modules/block_content/block_content.routing.yml @@ -2,7 +2,7 @@ entity.block_content_type.collection: path: '/admin/structure/block/block-content/types' defaults: _entity_list: 'block_content_type' - _title: 'Custom block library' + _title: 'Edit' requirements: _permission: 'administer blocks' diff --git a/core/modules/color/color.js b/core/modules/color/color.js index a44f49f..f9eebf2 100644 --- a/core/modules/color/color.js +++ b/core/modules/color/color.js @@ -210,10 +210,9 @@ i = inputs.length; if (inputs.length) { var toggleClick = true; - var lock = $('').on('click', function (e) { - e.preventDefault(); + var lock = $('
').on('click', function () { if (toggleClick) { - $(this).addClass('unlocked').html(Drupal.t('Lock')); + $(this).addClass('unlocked'); $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook up' : 'hook' ); @@ -222,7 +221,7 @@ ); } else { - $(this).removeClass('unlocked').html(Drupal.t('Unlock')); + $(this).removeClass('unlocked'); $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.unlocked)') ? 'hook both' : 'hook down' ); diff --git a/core/modules/color/css/color.admin.css b/core/modules/color/css/color.admin.css index e904c85..5da8c35 100644 --- a/core/modules/color/css/color.admin.css +++ b/core/modules/color/css/color.admin.css @@ -63,7 +63,6 @@ height: 19px; background: url(../images/lock.png) no-repeat 50% 0; cursor: pointer; - text-indent: -9999px; } [dir="rtl"] #palette .lock { float: right; diff --git a/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php b/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php index dc68a29..2e0a241 100644 --- a/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php +++ b/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php @@ -67,7 +67,7 @@ public function render() { */ public function buildRow(EntityInterface $entity) { $row['label']['data'] = $this->getLabel($entity); - $row['label']['class'][] = 'table-filter-text-source'; + $row['label']['class'] = 'table-filter-text-source'; return $row + parent::buildRow($entity); } diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php index 10664da..87be04c 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php @@ -182,6 +182,23 @@ function testSettingsUI() { $this->assertEqual($definitions['body']->isTranslatable(), $translatable, 'Field translatability correctly switched.'); $this->assertEqual($field->isTranslatable(), $definitions['body']->isTranslatable(), 'Configurable field translatability correctly switched.'); } + // Test that that the order of the languages list is similar to other + // listings like views_ui for UX. + $this->drupalGet('admin/config/regional/content-language'); + + $expected_elements = array( + 'site_default', + 'current_interface', + 'authors_default', + 'en', + 'und', + 'zxx', + ); + $elements = $this->xpath('//select[@id="edit-settings-node-article-settings-language-langcode"]/option'); + // Compare values inside the option elements with expected values. + for ($i = 0; $i < count($elements); $i++) { + $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + } } /** diff --git a/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js index 1e27ec4..e00b011 100644 --- a/core/modules/contextual/js/contextual.js +++ b/core/modules/contextual/js/contextual.js @@ -64,7 +64,7 @@ // Create a model and the appropriate views. var model = new contextual.StateModel({ - title: $region.find('h2').eq(0).text().trim() + title: $region.find('h2:first').text().trim() }); var viewOptions = $.extend({el: $contextual, model: model}, options); contextual.views.push({ diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php index d6dcfab..722759f 100644 --- a/core/modules/dblog/src/Controller/DbLogController.php +++ b/core/modules/dblog/src/Controller/DbLogController.php @@ -276,7 +276,7 @@ public function eventDetails($event_id) { ), array( array('data' => $this->t('Operations'), 'header' => TRUE), - SafeMarkup::checkAdminXss($dblog->link), + $dblog->link, ), ); $build['dblog_table'] = array( diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php index 7db1b16..848c1ab 100644 --- a/core/modules/dblog/src/Tests/DbLogTest.php +++ b/core/modules/dblog/src/Tests/DbLogTest.php @@ -10,7 +10,6 @@ use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Xss; use Drupal\Core\Logger\RfcLogLevel; -use Drupal\Core\Url; use Drupal\dblog\Controller\DbLogController; use Drupal\simpletest\WebTestBase; @@ -72,7 +71,6 @@ function testDbLog() { $this->verifyEvents(); $this->verifyReports(); $this->verifyBreadcrumbs(); - $this->verifyLinkEscaping(); // Verify the overview table sorting. $orders = array('Date', 'Type', 'User'); $sorts = array('asc', 'desc'); @@ -131,33 +129,21 @@ private function verifyCron($row_limit) { * * @param int $count * Number of watchdog entries to generate. - * @param array $options - * These options are used to override the defaults for the test. - * An associative array containing any of the following keys: - * - 'channel': String identifying the log channel to be output to. - * If the channel is not set, the default of 'custom' will be used. - * - 'message': String containing a message to be output to the log. - * A simple default message is used if not provided. - * - 'variables': Array of variables that match the message string. - * - 'severity': Log severity level as defined in logging_severity_levels. - * - 'link': String linking to view the result of the event. - * - 'user': String identifying the username. - * - 'uid': Int identifying the user id for the user. - * - 'request_uri': String identifying the location of the request. - * - 'referer': String identifying the referring url. - * - 'ip': String The ip address of the client machine triggering the log - * entry. - * - 'timestamp': Int unix timestamp. + * @param string $type + * (optional) The type of watchdog entry. Defaults to 'custom'. + * @param int $severity + * (optional) The severity of the watchdog entry. Defaults to + * \Drupal\Core\Logger\RfcLogLevel::NOTICE. */ - private function generateLogEntries($count, $options = array()) { + private function generateLogEntries($count, $type = 'custom', $severity = RfcLogLevel::NOTICE) { global $base_root; // Prepare the fields to be logged - $log = $options + array( - 'channel' => 'custom', - 'message' => 'Dblog test log message', + $log = array( + 'channel' => $type, + 'message' => 'Log entry added to test the dblog row limit.', 'variables' => array(), - 'severity' => RfcLogLevel::NOTICE, + 'severity' => $severity, 'link' => NULL, 'user' => $this->adminUser, 'uid' => $this->adminUser->id(), @@ -165,13 +151,11 @@ private function generateLogEntries($count, $options = array()) { 'referer' => \Drupal::request()->server->get('HTTP_REFERER'), 'ip' => '127.0.0.1', 'timestamp' => REQUEST_TIME, - ); - - $logger = $this->container->get('logger.dblog'); - $message = $log['message'] . ' Entry #'; + ); + $message = 'Log entry added to test the dblog row limit. Entry #'; for ($i = 0; $i < $count; $i++) { $log['message'] = $message . $i; - $logger->log($log['severity'], $log['message'], $log); + $this->container->get('logger.dblog')->log($severity, $log['message'], $log); } } @@ -263,25 +247,6 @@ public function verifySort($sort = 'asc', $order = 'Date') { } /** - * Tests the escaping of links in the operation row of a database log detail - * page. - */ - private function verifyLinkEscaping() { - $link = \Drupal::l('View', Url::fromRoute('entity.node.canonical', array('node' => 1))); - $message = 'Log entry added to do the verifyLinkEscaping test.'; - $this->generateLogEntries(1, array( - 'message' => $message, - 'link' => $link, - )); - - $result = db_query_range('SELECT wid FROM {watchdog} ORDER BY wid DESC', 0, 1); - $this->drupalGet('admin/reports/dblog/event/' . $result->fetchField()); - - // Check if the link exists (unescaped). - $this->assertRaw($link); - } - - /** * Generates and then verifies some user events. */ private function doUser() { @@ -532,10 +497,7 @@ public function testFilter() { 'type' => $type_name, 'severity' => $severity++, ); - $this->generateLogEntries($type['count'], array( - 'channel' => $type['type'], - 'severity' => $type['severity'], - )); + $this->generateLogEntries($type['count'], $type['type'], $type['severity']); } } diff --git a/core/modules/editor/js/editor.formattedTextEditor.js b/core/modules/editor/js/editor.formattedTextEditor.js index faf4a6d..75b20b6 100644 --- a/core/modules/editor/js/editor.formattedTextEditor.js +++ b/core/modules/editor/js/editor.formattedTextEditor.js @@ -41,7 +41,7 @@ // Store the actual value of this field. We'll need this to restore the // original value when the user discards his modifications. - this.$textElement = this.$el.find('.field-item').eq(0); + this.$textElement = this.$el.find('.field-item:first'); this.model.set('originalValue', this.$textElement.html()); }, diff --git a/core/modules/editor/src/EditorXssFilter/Standard.php b/core/modules/editor/src/EditorXssFilter/Standard.php index 43ef797..b34e349 100644 --- a/core/modules/editor/src/EditorXssFilter/Standard.php +++ b/core/modules/editor/src/EditorXssFilter/Standard.php @@ -7,9 +7,7 @@ namespace Drupal\editor\EditorXssFilter; -use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Xss; -use Drupal\Component\Utility\SafeMarkup; use Drupal\filter\FilterFormatInterface; use Drupal\editor\EditorXssFilterInterface; @@ -87,39 +85,7 @@ public static function filterXss($html, FilterFormatInterface $format, FilterFor // Also blacklist tags that are explicitly forbidden in either text format. $blacklisted_tags = array_merge($blacklisted_tags, $forbidden_tags); - $output = static::filter($html, $blacklisted_tags); - - // Since data-attributes can contain encoded HTML markup that could be - // decoded and interpreted by editors, we need to apply XSS filtering to - // their contents. - return static::filterXssDataAttributes($output); - } - - /** - * Applies a very permissive XSS/HTML filter to data-attributes. - * - * @param string $html - * The string to apply the data-attributes filtering to. - * - * @return string - * The filtered string. - */ - protected static function filterXssDataAttributes($html) { - if (stristr($html, 'data-') !== FALSE) { - $dom = Html::load($html); - $xpath = new \DOMXPath($dom); - foreach ($xpath->query('//@*[starts-with(name(.), "data-")]') as $node) { - // The data-attributes contain an HTML-encoded value, so we need to - // decode the value, apply XSS filtering and then re-save as encoded - // value. There is no need to explicitly decode $node->value, since the - // DOMAttr::value getter returns the decoded value. - $value = Xss::filterAdmin($node->value); - $node->value = SafeMarkup::checkPlain($value); - } - $html = Html::serialize($dom); - } - - return $html; + return static::filter($html, $blacklisted_tags); } diff --git a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php index 13c8311..ee25b00 100644 --- a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php +++ b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php @@ -512,17 +512,6 @@ public function providerTestFilterXss() { // sites, it only forbids linking to any protocols other than those that are // whitelisted. - // Test XSS filtering on data-attributes. - // @see \Drupal\editor\EditorXssFilter::filterXssDataAttributes() - - // The following two test cases verify that XSS attack vectors are filtered. - $data[] = array('', ''); - $data[] = array('', ''); - - // When including HTML-tags as visible content, they are double-escaped. - // This test case ensures that we leave that content unchanged. - $data[] = array('', ''); - return $data; } diff --git a/core/modules/filter/src/Tests/FilterUnitTest.php b/core/modules/filter/src/Tests/FilterUnitTest.php index d2b515b..87eb773 100644 --- a/core/modules/filter/src/Tests/FilterUnitTest.php +++ b/core/modules/filter/src/Tests/FilterUnitTest.php @@ -9,8 +9,6 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\SafeMarkup; -use Drupal\editor\EditorXssFilter\Standard; -use Drupal\filter\Entity\FilterFormat; use Drupal\filter\FilterPluginCollection; use Drupal\simpletest\KernelTestBase; @@ -178,74 +176,6 @@ function testCaptionFilter() { $output = $test($input); $this->assertIdentical($expected, $output->getProcessedText()); $this->assertIdentical($attached_library, $output->getAssets()); - - // So far we've tested that the caption filter works correctly. But we also - // want to make sure that it works well in tandem with the "Limit allowed - // HTML tags" filter, which it is typically used with. - $html_filter = $this->filters['filter_html']; - $html_filter->setConfiguration(array( - 'settings' => array( - 'allowed_html' => '', - 'filter_html_help' => 1, - 'filter_html_nofollow' => 0, - ) - )); - $test_with_html_filter = function ($input) use ($filter, $html_filter) { - // 1. Apply HTML filter's processing step. - $output = $html_filter->process($input, 'und'); - // 2. Apply caption filter's processing step. - $output = $filter->process($output, 'und'); - return $output->getProcessedText(); - }; - // Editor XSS filter. - $test_editor_xss_filter = function ($input) { - $dummy_filter_format = FilterFormat::create(); - return Standard::filterXss($input, $dummy_filter_format); - }; - - // All the tricky cases encountered at https://drupal.org/node/2105841. - // A plain URL preceded by text. - $input = ''; - $expected = '
See http://drupal.org
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $this->assertIdentical($input, $test_editor_xss_filter($input)); - - // An anchor. - $input = ''; - $expected = '
This is a quick test…
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $this->assertIdentical($input, $test_editor_xss_filter($input)); - - // A plain URL surrounded by parentheses. - $input = ''; - $expected = '
(http://drupal.org)
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $this->assertIdentical($input, $test_editor_xss_filter($input)); - - // A source being credited. - $input = ''; - $expected = '
Source: Wikipedia
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $this->assertIdentical($input, $test_editor_xss_filter($input)); - - // A source being credited, without a space after the colon. - $input = ''; - $expected = '
Source:Wikipedia
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $this->assertIdentical($input, $test_editor_xss_filter($input)); - - // A pretty crazy edge case where we have two colons. - $input = ''; - $expected = '
Interesting (Scope resolution operator ::)
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $this->assertIdentical($input, $test_editor_xss_filter($input)); - - // An evil anchor (to ensure XSS filtering is applied to the caption also). - $input = ''; - $expected = '
This is an evil test…
'; - $this->assertIdentical($expected, $test_with_html_filter($input)); - $expected_xss_filtered = ''; - $this->assertIdentical($expected_xss_filtered, $test_editor_xss_filter($input)); } /** diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 2e86973..0418c72 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -11,7 +11,6 @@ use Drupal\file\Entity\File; use Drupal\field\FieldStorageConfigInterface; use Drupal\field\FieldConfigInterface; -use Drupal\image\Entity\ImageStyle; /** * Image style constant for user presets in the database. @@ -214,7 +213,7 @@ function image_file_predelete(File $file) { * The Drupal file path to the original image. */ function image_path_flush($path) { - $styles = ImageStyle::loadMultiple(); + $styles = entity_load_multiple('image_style'); foreach ($styles as $style) { $style->flush($path); } @@ -229,7 +228,7 @@ function image_path_flush($path) { * Array of image styles both key and value are set to style name. */ function image_style_options($include_empty = TRUE) { - $styles = ImageStyle::loadMultiple(); + $styles = entity_load_multiple('image_style'); $options = array(); if ($include_empty && !empty($styles)) { $options[''] = t('- None -'); @@ -271,7 +270,7 @@ function image_style_options($include_empty = TRUE) { * - attributes: Associative array of attributes to be placed in the img tag. */ function template_preprocess_image_style(&$variables) { - $style = ImageStyle::load($variables['style_name']); + $style = entity_load('image_style', $variables['style_name']); // Determine the dimensions of the styled image. $dimensions = array( diff --git a/core/modules/image/src/Form/ImageEffectFormBase.php b/core/modules/image/src/Form/ImageEffectFormBase.php index 7b7f25b..5aaf1a6 100644 --- a/core/modules/image/src/Form/ImageEffectFormBase.php +++ b/core/modules/image/src/Form/ImageEffectFormBase.php @@ -97,7 +97,6 @@ public function buildForm(array $form, FormStateInterface $form_state, ImageStyl '#type' => 'link', '#title' => $this->t('Cancel'), '#url' => $this->imageStyle->urlInfo('edit-form'), - '#attributes' => ['class' => ['button']], ); return $form; } diff --git a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php index 0e12d10..38a163c 100644 --- a/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php +++ b/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php @@ -7,7 +7,6 @@ namespace Drupal\image\Plugin\Field\FieldFormatter; -use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; @@ -46,13 +45,6 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi protected $linkGenerator; /** - * The image style entity storage. - * - * @var \Drupal\Core\Entity\EntityStorageInterface - */ - protected $imageStyleStorage; - - /** * Constructs an ImageFormatter object. * * @param string $plugin_id @@ -74,11 +66,10 @@ class ImageFormatter extends ImageFormatterBase implements ContainerFactoryPlugi * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator * The link generator service. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator, EntityStorageInterface $image_style_storage) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->currentUser = $current_user; $this->linkGenerator = $link_generator; - $this->imageStyleStorage = $image_style_storage; } /** @@ -94,8 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration['view_mode'], $configuration['third_party_settings'], $container->get('current_user'), - $container->get('link_generator'), - $container->get('entity.manager')->getStorage('image_style') + $container->get('link_generator') ); } @@ -202,7 +192,7 @@ public function viewElements(FieldItemListInterface $items) { // Collect cache tags to be added for each item in the field. $cache_tags = array(); if (!empty($image_style_setting)) { - $image_style = $this->imageStyleStorage->load($image_style_setting); + $image_style = entity_load('image_style', $image_style_setting); $cache_tags = $image_style->getCacheTags(); } diff --git a/core/modules/image/src/Tests/FileMoveTest.php b/core/modules/image/src/Tests/FileMoveTest.php index 34c54a7..6a4454b 100644 --- a/core/modules/image/src/Tests/FileMoveTest.php +++ b/core/modules/image/src/Tests/FileMoveTest.php @@ -8,7 +8,6 @@ namespace Drupal\image\Tests; use Drupal\simpletest\WebTestBase; -use Drupal\image\Entity\ImageStyle; /** * Tests the file move function for images and image styles. @@ -32,7 +31,7 @@ function testNormal() { $file = entity_create('file', (array) current($this->drupalGetTestFiles('image'))); // Create derivative image. - $styles = ImageStyle::loadMultiple(); + $styles = entity_load_multiple('image_style'); $style = reset($styles); $original_uri = $file->getFileUri(); $derivative_uri = $style->buildUri($original_uri); diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php index dedb9b5..6a9a9e5 100644 --- a/core/modules/image/src/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php @@ -8,7 +8,6 @@ namespace Drupal\image\Tests; use Drupal\Component\Utility\SafeMarkup; -use Drupal\image\Entity\ImageStyle; use Drupal\image\ImageStyleInterface; use Drupal\node\Entity\Node; @@ -130,7 +129,7 @@ function testStyle() { } // Load the saved image style. - $style = ImageStyle::load($style_name); + $style = entity_load('image_style', $style_name); // Ensure that third party settings were added to the config entity. // These are added by a hook_image_style_presave() implemented in @@ -212,7 +211,7 @@ function testStyle() { $this->assertEqual($this->getImageCount($style), 0, format_string('Image style %style was flushed after renaming the style and updating the order of effects.', array('%style' => $style->label()))); // Load the style by the new name with the new weights. - $style = ImageStyle::load($style_name); + $style = entity_load('image_style', $style_name); // Confirm the new style order was saved. $effect_edits_order = array_reverse($effect_edits_order); @@ -270,7 +269,7 @@ function testStyle() { $directory = file_default_scheme() . '://styles/' . $style_name; $this->assertFalse(is_dir($directory), format_string('Image style %style directory removed on style deletion.', array('%style' => $style->label()))); - $this->assertFalse(ImageStyle::load($style_name), format_string('Image style %style successfully deleted.', array('%style' => $style->label()))); + $this->assertFalse(entity_load('image_style', $style_name), format_string('Image style %style successfully deleted.', array('%style' => $style->label()))); } @@ -320,7 +319,7 @@ function testStyleReplacement() { $this->drupalGet('node/' . $nid); // Reload the image style using the new name. - $style = ImageStyle::load($new_style_name); + $style = entity_load('image_style', $new_style_name); $this->assertRaw($style->buildUrl($original_uri), 'Image displayed using style replacement style.'); // Delete the style and choose a replacement style. @@ -331,7 +330,7 @@ function testStyleReplacement() { $message = t('The image style %name has been deleted.', array('%name' => $new_style_label)); $this->assertRaw($message); - $replacement_style = ImageStyle::load('thumbnail'); + $replacement_style = entity_load('image_style', 'thumbnail'); $this->drupalGet('node/' . $nid); $this->assertRaw($replacement_style->buildUrl($original_uri), 'Image displayed using style replacement style.'); } @@ -449,7 +448,7 @@ function testConfigImport() { $staging->delete('image.style.' . $style_name); $this->configImporter()->import(); - $this->assertFalse(ImageStyle::load($style_name), 'Style deleted after config import.'); + $this->assertFalse(entity_load('image_style', $style_name), 'Style deleted after config import.'); $this->assertEqual($this->getImageCount($style), 0, 'Image style was flushed after being deleted by config import.'); } diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php index c112437..47d7712 100644 --- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -10,7 +10,6 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\field\Entity\FieldStorageConfig; use Drupal\user\RoleInterface; -use Drupal\image\Entity\ImageStyle; /** * Tests the display of image fields. @@ -176,7 +175,7 @@ function _testImageFieldFormatters($scheme) { // Ensure the derivative image is generated so we do not have to deal with // image style callback paths. - $this->drupalGet(ImageStyle::load('thumbnail')->buildUrl($image_uri)); + $this->drupalGet(entity_load('image_style', 'thumbnail')->buildUrl($image_uri)); $image_style = array( '#theme' => 'image_style', '#uri' => $image_uri, @@ -194,7 +193,7 @@ function _testImageFieldFormatters($scheme) { if ($scheme == 'private') { // Log out and try to access the file. $this->drupalLogout(); - $this->drupalGet(ImageStyle::load('thumbnail')->buildUrl($image_uri)); + $this->drupalGet(entity_load('image_style', 'thumbnail')->buildUrl($image_uri)); $this->assertResponse('403', 'Access denied to image style thumbnail as anonymous user.'); } } diff --git a/core/modules/image/src/Tests/ImageStyleFlushTest.php b/core/modules/image/src/Tests/ImageStyleFlushTest.php index 0a6a5fa..1ebe27b 100644 --- a/core/modules/image/src/Tests/ImageStyleFlushTest.php +++ b/core/modules/image/src/Tests/ImageStyleFlushTest.php @@ -7,8 +7,6 @@ namespace Drupal\image\Tests; -use Drupal\image\Entity\ImageStyle; - /** * Tests flushing of image styles. * @@ -81,7 +79,7 @@ function testFlush() { } // Load the saved image style. - $style = ImageStyle::load($style_name); + $style = entity_load('image_style', $style_name); // Create an image for the 'public' wrapper. $image_path = $this->createSampleImage($style, 'public'); diff --git a/core/modules/language/src/Element/LanguageConfiguration.php b/core/modules/language/src/Element/LanguageConfiguration.php index aa6f94b..82c6f8f 100644 --- a/core/modules/language/src/Element/LanguageConfiguration.php +++ b/core/modules/language/src/Element/LanguageConfiguration.php @@ -97,7 +97,7 @@ public static function processLanguageConfiguration(&$element, FormStateInterfac protected static function getDefaultOptions() { $language_options = array( LanguageInterface::LANGCODE_SITE_DEFAULT => t("Site's default language (!language)", array('!language' => static::languageManager()->getDefaultLanguage()->getName())), - 'current_interface' => t('Current interface language'), + 'current_interface' => t('!type language selected for page', array('!type' => t('User interface text'))), 'authors_default' => t("Author's preferred language"), ); diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php index 722548f..9834792 100644 --- a/core/modules/menu_ui/src/Tests/MenuTest.php +++ b/core/modules/menu_ui/src/Tests/MenuTest.php @@ -864,13 +864,13 @@ public function testMenuParentsJsAccess() { $admin = $this->drupalCreateUser(array('administer menu')); $this->drupalLogin($admin); // Just check access to the callback overall, the POST data is irrelevant. - $this->drupalGetAjax('admin/structure/menu/parents'); + $this->drupalGetAJAX('admin/structure/menu/parents'); $this->assertResponse(200); // Do standard user tests. // Login the user. $this->drupalLogin($this->authenticatedUser); - $this->drupalGetAjax('admin/structure/menu/parents'); + $this->drupalGetAJAX('admin/structure/menu/parents'); $this->assertResponse(403); } diff --git a/core/modules/migrate/src/Tests/MigrateDumpAlterInterface.php b/core/modules/migrate/src/Tests/MigrateDumpAlterInterface.php deleted file mode 100644 index 94b8a3d..0000000 --- a/core/modules/migrate/src/Tests/MigrateDumpAlterInterface.php +++ /dev/null @@ -1,28 +0,0 @@ -loadDumps($files); - if ($this instanceof MigrateDumpAlterInterface) { - static::migrateDumpAlter($this); - } } /** diff --git a/core/modules/migrate_drupal/src/Tests/MigrateFullDrupalTestBase.php b/core/modules/migrate_drupal/src/Tests/MigrateFullDrupalTestBase.php index 09dd3cd..956a4e6 100644 --- a/core/modules/migrate_drupal/src/Tests/MigrateFullDrupalTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/MigrateFullDrupalTestBase.php @@ -54,11 +54,6 @@ public function testDrupal() { $this->loadDumps($dumps); $classes = $this->getTestClassesList(); - foreach ($classes as $class) { - if (is_subclass_of($class, '\Drupal\migrate\Tests\MigrateDumpAlterInterface')) { - $class::migrateDumpAlter($this); - } - } // Run every migration in the order specified by the storage controller. foreach (entity_load_multiple('migration', static::$migrations) as $migration) { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php index 33835a7..a644a99 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php @@ -158,6 +158,9 @@ protected function setUp() { $config->set('default', 'bartik'); $config->set('admin', 'seven'); $config->save(); + + // We need a temp file for testing the MigrateFileTest. + file_put_contents('/tmp/some-temp-file.jpg', ''); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php index 91560a4..342c077 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php @@ -7,26 +7,16 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\Component\Utility\Random; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate\Tests\MigrateDumpAlterInterface; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; -use Drupal\simpletest\TestBase; /** * file migration. * * @group migrate_drupal */ -class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlterInterface { - - /** - * The filename of a file used to test temporary file migration. - * - * @var string - */ - protected static $tempFilename; +class MigrateFileTest extends MigrateDrupal6TestBase { /** * Modules to enable. @@ -39,6 +29,9 @@ class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlter * {@inheritdoc} */ protected function setUp() { + // Set the temp file of the site to the same as the D6 site, this allows us + // to test files which start and finish in the same place. + $this->tempFilesDirectory = '/tmp'; parent::setUp(); $dumps = array( $this->getDumpDirectory() . '/Files.php', @@ -52,6 +45,7 @@ protected function setUp() { $executable = new MigrateExecutable($migration, $this); $executable->import(); $this->standalone = TRUE; + file_put_contents('/tmp/some-temp-file.jpg', ''); } /** @@ -85,7 +79,7 @@ public function testFiles() { ->execute(); Database::getConnection('default', 'migrate') ->update('variable') - ->fields(array('value' => serialize($this->getTempFilesDirectory()))) + ->fields(array('value' => serialize('/tmp'))) ->condition('name', 'file_directory_temp') ->execute(); $executable = new MigrateExecutable($migration, $this); @@ -96,37 +90,7 @@ public function testFiles() { // Ensure that a temporary file has been migrated. $file = entity_load('file', 6); - $this->assertIdentical('temporary://' . static::getUniqueFilename(), $file->getFileUri()); - } - - /** - * @return string - * A filename based upon the test. - */ - public static function getUniqueFilename() { - return static::$tempFilename; - } - - /** - * {@inheritdoc} - */ - public static function migrateDumpAlter(TestBase $test) { - // Creates a random filename and updates the source database. - $random = new Random(); - $temp_directory = $test->getTempFilesDirectory(); - static::$tempFilename = $test->getDatabasePrefix() . $random->name() . '.jpg'; - $file_path = $temp_directory . '/' . static::$tempFilename; - file_put_contents($file_path, ''); - Database::getConnection('default', 'migrate') - ->update('files') - ->condition('fid', 6) - ->fields(array( - 'filename' => static::$tempFilename, - 'filepath' => $file_path, - )) - ->execute(); - - return static::$tempFilename; + $this->assertIdentical('temporary://some-temp-file.jpg', $file->getFileUri()); } } diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index f179ec8..4772d00 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -17,7 +17,7 @@ function rdf_help($route_name, RouteMatchInterface $route_match) { case 'help.page.rdf': $output = ''; $output .= '

' . t('About') . '

'; - $output .= '

' . t('The RDF module enriches your content with metadata to let other applications (e.g., search engines, aggregators, and so on) better understand its relationships and attributes. This semantically enriched, machine-readable output for your website uses the RDFa specification, which allows RDF data to be embedded in HTML markup. Other modules can define mappings of their data to RDF terms, and the RDF module makes this RDF data available to the theme. The core modules define RDF mappings for their data model, and the core themes output this RDF metadata information along with the human-readable visual information. For more information, see the online documentation for the RDF module.', array('!rdfa' => 'http://www.w3.org/TR/xhtml-rdfa-primer/', '!rdf' => 'https://drupal.org/documentation/modules/rdf')) . '

'; + $output .= '

' . t('The RDF module enriches your content with metadata to let other applications (e.g., search engines, aggregators, and so on) better understand its relationships and attributes. This semantically enriched, machine-readable output for Drupal sites uses the RDFa specification, which allows RDF data to be embedded in HTML markup. Other modules can define mappings of their data to RDF terms, and the RDF module makes this RDF data available to the theme. The core Drupal modules define RDF mappings for their data model, and the core Drupal themes output this RDF metadata information along with the human-readable visual information. For more information, see the online documentation for the RDF module.', array('!rdfa' => 'http://www.w3.org/TR/xhtml-rdfa-primer/', '!rdf' => 'https://drupal.org/documentation/modules/rdf')) . '

'; return $output; } } diff --git a/core/modules/rdf/src/Tests/ImageFieldAttributesTest.php b/core/modules/rdf/src/Tests/ImageFieldAttributesTest.php index 4ae8f0b..c58b3bb 100644 --- a/core/modules/rdf/src/Tests/ImageFieldAttributesTest.php +++ b/core/modules/rdf/src/Tests/ImageFieldAttributesTest.php @@ -7,7 +7,6 @@ namespace Drupal\rdf\Tests; -use Drupal\image\Entity\ImageStyle; use Drupal\image\Tests\ImageFieldTestBase; use Drupal\node\Entity\Node; @@ -97,7 +96,7 @@ function testNodeTeaser() { // Construct the node and image URIs for testing. $node_uri = $this->node->url('canonical', ['absolute' => TRUE]); - $image_uri = ImageStyle::load('medium')->buildUrl($this->file->getFileUri()); + $image_uri = entity_load('image_style', 'medium')->buildUrl($this->file->getFileUri()); // Test relations from node to image. $expected_value = array( diff --git a/core/modules/rdf/src/Tests/StandardProfileTest.php b/core/modules/rdf/src/Tests/StandardProfileTest.php index d9a31f0..78c08fc 100644 --- a/core/modules/rdf/src/Tests/StandardProfileTest.php +++ b/core/modules/rdf/src/Tests/StandardProfileTest.php @@ -8,10 +8,9 @@ namespace Drupal\rdf\Tests; use Drupal\Core\Url; -use Drupal\image\Entity\ImageStyle; -use Drupal\node\Entity\NodeType; use Drupal\node\NodeInterface; use Drupal\simpletest\WebTestBase; +use Drupal\node\Entity\NodeType; /** * Tests the RDF mappings and RDFa markup of the standard profile. @@ -166,7 +165,7 @@ protected function setUp() { // Set URIs. // Image. $image_file = $this->article->get('field_image')->entity; - $this->imageUri = ImageStyle::load('large')->buildUrl($image_file->getFileUri()); + $this->imageUri = entity_load('image_style', 'large')->buildUrl($image_file->getFileUri()); // Term. $this->termUri = $this->term->url('canonical', array('absolute' => TRUE)); // Article. @@ -225,7 +224,7 @@ protected function doFrontPageRdfaTests() { // @todo Once the image points to the original instead of the processed // image, move this to testArticleProperties(). $image_file = $this->article->get('field_image')->entity; - $image_uri = ImageStyle::load('medium')->buildUrl($image_file->getFileUri()); + $image_uri = entity_load('image_style', 'medium')->buildUrl($image_file->getFileUri()); $expected_value = array( 'type' => 'uri', 'value' => $image_uri, diff --git a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php index b3500fe..bc8cb93 100644 --- a/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php +++ b/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php @@ -16,6 +16,7 @@ use Drupal\Core\Url; use Drupal\image\Plugin\Field\FieldFormatter\ImageFormatterBase; use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\image\Entity\ImageStyle; /** * Plugin for responsive image formatter. @@ -35,13 +36,6 @@ class ResponsiveImageFormatter extends ImageFormatterBase implements ContainerFa */ protected $responsiveImageStyleStorage; - /* - * The image style entity storage. - * - * @var \Drupal\Core\Entity\EntityStorageInterface - */ - protected $imageStyleStorage; - /** * Constructs a ResponsiveImageFormatter object. * @@ -61,14 +55,11 @@ class ResponsiveImageFormatter extends ImageFormatterBase implements ContainerFa * Any third party settings. * @param \Drupal\Core\Entity\EntityStorageInterface $responsive_image_style_storage * The responsive image style storage. - * @param \Drupal\Core\Entity\EntityStorageInterface $image_style_storage - * The image style storage. */ - public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $responsive_image_style_storage, EntityStorageInterface $image_style_storage) { + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $responsive_image_style_storage) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings); $this->responsiveImageStyleStorage = $responsive_image_style_storage; - $this->imageStyleStorage = $image_style_storage; } /** @@ -83,8 +74,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration['label'], $configuration['view_mode'], $configuration['third_party_settings'], - $container->get('entity.manager')->getStorage('responsive_image_style'), - $container->get('entity.manager')->getStorage('image_style') + $container->get('entity.manager')->getStorage('responsive_image_style') ); } @@ -232,7 +222,7 @@ public function viewElements(FieldItemListInterface $items) { // selected for the smallest screen. $fallback_image_style = end($image_styles_to_load); } - $image_styles = $this->imageStyleStorage->loadMultiple($image_styles_to_load); + $image_styles = ImageStyle::loadMultiple($image_styles_to_load); foreach ($image_styles as $image_style) { $cache_tags = Cache::mergeTags($cache_tags, $image_style->getCacheTags()); } diff --git a/core/modules/simpletest/src/BrowserTestBase.php b/core/modules/simpletest/src/BrowserTestBase.php index 6cba2e0..e531b65 100644 --- a/core/modules/simpletest/src/BrowserTestBase.php +++ b/core/modules/simpletest/src/BrowserTestBase.php @@ -29,26 +29,14 @@ use Symfony\Component\HttpFoundation\Request; /** - * Provides a test case for functional Drupal tests. + * Test case for functional Drupal tests. * - * Note that this class does not yet have feature parity with WebTestBase, so - * WebTestBase should be used where possible. In particular, this class does - * not yet have the following features: - * - verbose output - see https://www.drupal.org/node/2469721 - * - ajax form emulation - see https://www.drupal.org/node/2469713 - * - * Tests extending BrowserTestBase must exist in the - * Drupal\Tests\yourmodule\Functional namespace and live in the - * modules/yourmodule/Tests/Functional directory. + * @ingroup testing * * All BrowserTestBase tests must have two annotations to ensure process * isolation: * - @runTestsInSeparateProcesses * - @preserveGlobalState disabled - * - * @ingroup testing - * - * @see \Drupal\simpletest\WebTestBase */ abstract class BrowserTestBase extends \PHPUnit_Framework_TestCase { diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 9a38774..a95bade 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -1652,24 +1652,4 @@ protected function config($name) { return \Drupal::configFactory()->getEditable($name); } - /** - * Gets the database prefix. - * - * @return string - * The database prefix - */ - public function getDatabasePrefix() { - return $this->databasePrefix; - } - - /** - * Gets the temporary files directory. - * - * @return string - * The temporary files directory. - */ - public function getTempFilesDirectory() { - return $this->tempFilesDirectory; - } - } diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 8e29d46..1ae8e58 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1542,7 +1542,7 @@ protected function drupalGetJSON($path, array $options = array(), array $headers /** * Requests a Drupal path in drupal_ajax format and JSON-decodes the response. */ - protected function drupalGetAjax($path, array $options = array(), array $headers = array()) { + protected function drupalGetAJAX($path, array $options = array(), array $headers = array()) { $headers[] = 'Accept: application/vnd.drupal-ajax'; return Json::decode($this->drupalGet($path, $options, $headers)); } diff --git a/core/modules/system/core.api.php b/core/modules/system/core.api.php index 14c894a..778cdb3 100644 --- a/core/modules/system/core.api.php +++ b/core/modules/system/core.api.php @@ -1866,112 +1866,6 @@ function hook_display_variant_plugin_alter(array &$definitions) { } /** - * Flush all persistent and static caches. - * - * This hook asks your module to clear all of its static caches, - * in order to ensure a clean environment for subsequently - * invoked data rebuilds. - * - * Do NOT use this hook for rebuilding information. Only use it to flush custom - * caches. - * - * Static caches using drupal_static() do not need to be reset manually. - * However, all other static variables that do not use drupal_static() must be - * manually reset. - * - * This hook is invoked by drupal_flush_all_caches(). It runs before module data - * is updated and before hook_rebuild(). - * - * @see drupal_flush_all_caches() - * @see hook_rebuild() - */ -function hook_cache_flush() { - if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') { - _update_cache_clear(); - } -} - -/** - * Rebuild data based upon refreshed caches. - * - * This hook allows your module to rebuild its data based on the latest/current - * module data. It runs after hook_cache_flush() and after all module data has - * been updated. - * - * This hook is only invoked after the system has been completely cleared; - * i.e., all previously cached data is known to be gone and every API in the - * system is known to return current information, so your module can safely rely - * on all available data to rebuild its own. - * - * @see hook_cache_flush() - * @see drupal_flush_all_caches() - */ -function hook_rebuild() { - $themes = \Drupal::service('theme_handler')->listInfo(); - foreach ($themes as $theme) { - _block_rehash($theme->getName()); - } -} - -/** - * Alter the configuration synchronization steps. - * - * @param array $sync_steps - * A one-dimensional array of \Drupal\Core\Config\ConfigImporter method names - * or callables that are invoked to complete the import, in the order that - * they will be processed. Each callable item defined in $sync_steps should - * either be a global function or a public static method. The callable should - * accept a $context array by reference. For example: - * - * function _additional_configuration_step(&$context) { - * // Do stuff. - * // If finished set $context['finished'] = 1. - * } - * - * For more information on creating batches, see the - * @link batch Batch operations @endlink documentation. - * - * @see callback_batch_operation() - * @see \Drupal\Core\Config\ConfigImporter::initialize() - */ -function hook_config_import_steps_alter(&$sync_steps, \Drupal\Core\Config\ConfigImporter $config_importer) { - $deletes = $config_importer->getUnprocessedConfiguration('delete'); - if (isset($deletes['field.storage.node.body'])) { - $sync_steps[] = '_additional_configuration_step'; - } -} - -/** - * Alter config typed data definitions. - * - * For example you can alter the typed data types representing each - * configuration schema type to change default labels or form element renderers - * used for configuration translation. - * - * If implementations of this hook add or remove configuration schema a - * ConfigSchemaAlterException will be thrown. Keep in mind that there are tools - * that may use the configuration schema for static analysis of configuration - * files, like the string extractor for the localization system. Such systems - * won't work with dynamically defined configuration schemas. - * - * For adding new data types use configuration schema YAML files instead. - * - * @param $definitions - * Associative array of configuration type definitions keyed by schema type - * names. The elements are themselves array with information about the type. - * - * @see \Drupal\Core\Config\TypedConfigManager - * @see \Drupal\Core\Config\Schema\ConfigSchemaAlterException - */ -function hook_config_schema_info_alter(&$definitions) { - // Enhance the text and date type definitions with classes to generate proper - // form elements in ConfigTranslationFormBase. Other translatable types will - // appear as a one line textfield. - $definitions['text']['form_element_class'] = '\Drupal\config_translation\FormElement\Textarea'; - $definitions['date_format']['form_element_class'] = '\Drupal\config_translation\FormElement\DateFormat'; -} - -/** * @} End of "addtogroup hooks". */ diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index d188375..e69a92a 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -2,7 +2,7 @@ /** * @file - * Hooks and documentation related to entities. + * Hooks provided the Entity module. */ use Drupal\Core\Entity\FieldableEntityInterface; diff --git a/core/modules/system/menu.api.php b/core/modules/system/menu.api.php index 95be071..f30f708 100644 --- a/core/modules/system/menu.api.php +++ b/core/modules/system/menu.api.php @@ -2,7 +2,7 @@ /** * @file - * Hooks and documentation related to the menu system, routing, and links. + * Hooks related to the Menu system. */ /** @@ -555,49 +555,5 @@ function hook_system_breadcrumb_alter(array &$breadcrumb, \Drupal\Core\Routing\R } /** - * Alter the parameters for links. - * - * @param array $variables - * An associative array of variables defining a link. The link may be either a - * "route link" using \Drupal\Core\Utility\LinkGenerator::link(), which is - * exposed as the 'link_generator' service or a link generated by _l(). If the - * link is a "route link", 'route_name' will be set, otherwise 'path' will be - * set. The following keys can be altered: - * - text: The link text for the anchor tag as a translated string. - * - url_is_active: Whether or not the link points to the currently active - * URL. - * - url: The \Drupal\Core\Url object. - * - options: An associative array of additional options that will be passed - * to either \Drupal\Core\Routing\UrlGenerator::generateFromPath() or - * \Drupal\Core\Routing\UrlGenerator::generateFromRoute() to generate the - * href attribute for this link, and also used when generating the link. - * Defaults to an empty array. It may contain the following elements: - * - 'query': An array of query key/value-pairs (without any URL-encoding) to - * append to the URL. - * - absolute: Whether to force the output to be an absolute link (beginning - * with http:). Useful for links that will be displayed outside the site, - * such as in an RSS feed. Defaults to FALSE. - * - language: An optional language object. May affect the rendering of - * the anchor tag, such as by adding a language prefix to the path. - * - attributes: An associative array of HTML attributes to apply to the - * anchor tag. If element 'class' is included, it must be an array; 'title' - * must be a string; other elements are more flexible, as they just need - * to work as an argument for the constructor of the class - * Drupal\Core\Template\Attribute($options['attributes']). - * - html: Whether or not HTML should be allowed as the link text. If FALSE, - * the text will be run through - * \Drupal\Component\Utility\SafeMarkup::checkPlain() before being output. - * - * @see \Drupal\Core\Routing\UrlGenerator::generateFromPath() - * @see \Drupal\Core\Routing\UrlGenerator::generateFromRoute() - */ -function hook_link_alter(&$variables) { - // Add a warning to the end of route links to the admin section. - if (isset($variables['route_name']) && strpos($variables['route_name'], 'admin') !== FALSE) { - $variables['text'] .= ' (Warning!)'; - } -} - -/** * @} End of "addtogroup hooks". */ diff --git a/core/modules/system/module.api.php b/core/modules/system/module.api.php index 9d5005e..52b77af 100644 --- a/core/modules/system/module.api.php +++ b/core/modules/system/module.api.php @@ -1,8 +1,7 @@ 'submit', '#value' => $this->t('Save configuration'), - '#button_type' => 'primary', ); return $form; diff --git a/core/modules/system/src/Form/ThemeAdminForm.php b/core/modules/system/src/Form/ThemeAdminForm.php index 27f8098..9aa7123 100644 --- a/core/modules/system/src/Form/ThemeAdminForm.php +++ b/core/modules/system/src/Form/ThemeAdminForm.php @@ -49,7 +49,6 @@ public function buildForm(array $form, FormStateInterface $form_state, array $th $form['admin_theme']['actions']['submit'] = array( '#type' => 'submit', '#value' => $this->t('Save configuration'), - '#button_type' => 'primary', ); return $form; } diff --git a/core/modules/system/src/Tests/Ajax/DialogTest.php b/core/modules/system/src/Tests/Ajax/DialogTest.php index 482e025..37bf06c 100644 --- a/core/modules/system/src/Tests/Ajax/DialogTest.php +++ b/core/modules/system/src/Tests/Ajax/DialogTest.php @@ -93,7 +93,7 @@ public function testDialog() { $this->assertRaw($dialog_contents, 'Non-JS modal dialog page present.'); // Emulate going to the JS version of the page and check the JSON response. - $ajax_result = $this->drupalGetAjax('ajax-test/dialog-contents', array(), array('Accept: application/vnd.drupal-modal')); + $ajax_result = $this->drupalGetAJAX('ajax-test/dialog-contents', array(), array('Accept: application/vnd.drupal-modal')); $this->assertEqual($modal_expected_response, $ajax_result[3], 'Modal dialog JSON response matches.'); // Check that requesting a "normal" dialog without JS goes to a page. @@ -127,7 +127,7 @@ public function testDialog() { // Emulate closing the dialog via an AJAX request. There is no non-JS // version of this test. - $ajax_result = $this->drupalGetAjax('ajax-test/dialog-close'); + $ajax_result = $this->drupalGetAJAX('ajax-test/dialog-close'); $this->assertEqual($close_expected_response, $ajax_result[0], 'Close dialog JSON response matches.'); // Test submitting via a POST request through the button for modals. This @@ -159,7 +159,7 @@ public function testDialog() { $this->assertTrue(!empty($form), 'Non-JS form page present.'); // Emulate going to the JS version of the form and check the JSON response. - $ajax_result = $this->drupalGetAjax('ajax-test/dialog-form', array(), array('Accept: application/vnd.drupal-modal')); + $ajax_result = $this->drupalGetAJAX('ajax-test/dialog-form', array(), array('Accept: application/vnd.drupal-modal')); $expected_ajax_settings = [ 'edit-preview' => [ 'callback' => '::preview', @@ -188,7 +188,7 @@ public function testDialog() { $this->assertTrue(!empty($form), 'Non-JS entity form page present.'); // Emulate going to the JS version of the form and check the JSON response. - $ajax_result = $this->drupalGetAjax('admin/structure/contact/add', array(), array('Accept: application/vnd.drupal-modal')); + $ajax_result = $this->drupalGetAJAX('admin/structure/contact/add', array(), array('Accept: application/vnd.drupal-modal')); $this->setRawContent($ajax_result[3]['data']); // Remove the data, the form build id and token will never match. unset($ajax_result[3]['data']); diff --git a/core/modules/system/src/Tests/Ajax/FrameworkTest.php b/core/modules/system/src/Tests/Ajax/FrameworkTest.php index 52787c9..85e9d8f 100644 --- a/core/modules/system/src/Tests/Ajax/FrameworkTest.php +++ b/core/modules/system/src/Tests/Ajax/FrameworkTest.php @@ -26,7 +26,7 @@ class FrameworkTest extends AjaxTestBase { */ public function testAJAXRender() { // Verify that settings command is generated if JavaScript settings exist. - $commands = $this->drupalGetAjax('ajax-test/render'); + $commands = $this->drupalGetAJAX('ajax-test/render'); $expected = new SettingsCommand(array('ajax' => 'test'), TRUE); $this->assertCommand($commands, $expected->render(), '\Drupal\Core\Ajax\AjaxResponse::ajaxRender() loads JavaScript settings.'); } @@ -86,7 +86,7 @@ public function testAJAXRenderError() { $edit = array( 'message' => 'Custom error message.', ); - $commands = $this->drupalGetAjax('ajax-test/render-error', array('query' => $edit)); + $commands = $this->drupalGetAJAX('ajax-test/render-error', array('query' => $edit)); $expected = new AlertCommand($edit['message']); $this->assertCommand($commands, $expected->render(), 'Custom error message is output.'); } diff --git a/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php index 4256c16..610c9b1 100644 --- a/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php +++ b/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php @@ -236,12 +236,6 @@ function testPageCache() { $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, post-check=0, pre-check=0, private', 'Cache-Control header was sent.'); $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.'); $this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.'); - - // Until bubbling of max-age up to the response is supported, verify that - // a custom #cache max-age set on an element does not affect page max-age. - $this->drupalLogout(); - $this->drupalGet('system-test/cache_maxage_page'); - $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public'); } /** diff --git a/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php b/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php index 57a97c2..f7036d3 100644 --- a/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php +++ b/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php @@ -8,7 +8,6 @@ namespace Drupal\system\Tests\Entity; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; -use Drupal\image\Entity\ImageStyle; use Drupal\simpletest\WebTestBase; /** @@ -124,7 +123,7 @@ protected function doImageStyleUpdate() { $name = 'image.style.thumbnail'; /** @var $entity \Drupal\image\Entity\ImageStyle */ - $entity = ImageStyle::load('thumbnail'); + $entity = entity_load('image_style', 'thumbnail'); $plugin_collection = $entity->getPluginCollections()['effects']; $effects = $entity->get('effects'); diff --git a/core/modules/system/src/Tests/Form/StorageTest.php b/core/modules/system/src/Tests/Form/StorageTest.php index 64a9983..f77c567 100644 --- a/core/modules/system/src/Tests/Form/StorageTest.php +++ b/core/modules/system/src/Tests/Form/StorageTest.php @@ -219,7 +219,7 @@ public function testImmutableFormLegacyProtection() { $build_id = (string) $build_id_fields[0]['value']; // Try to poison the form cache. - $original = $this->drupalGetAjax('form-test/form-storage-legacy/' . $build_id); + $original = $this->drupalGetAJAX('form-test/form-storage-legacy/' . $build_id); $this->assertEqual($original['form']['#build_id_old'], $build_id, 'Original build_id was recorded'); $this->assertNotEqual($original['form']['#build_id'], $build_id, 'New build_id was generated'); @@ -229,7 +229,7 @@ public function testImmutableFormLegacyProtection() { $this->assert($status, 'A watchdog message was logged by \Drupal::formBuilder()->setCache'); // Ensure that the form state was not poisoned by the preceding call. - $original = $this->drupalGetAjax('form-test/form-storage-legacy/' . $build_id); + $original = $this->drupalGetAJAX('form-test/form-storage-legacy/' . $build_id); $this->assertEqual($original['form']['#build_id_old'], $build_id, 'Original build_id was recorded'); $this->assertNotEqual($original['form']['#build_id'], $build_id, 'New build_id was generated'); $this->assert(empty($original['form']['#poisoned']), 'Original form structure was preserved'); diff --git a/core/modules/system/src/Tests/Routing/RouterTest.php b/core/modules/system/src/Tests/Routing/RouterTest.php index e0a4f34..b03b194 100644 --- a/core/modules/system/src/Tests/Routing/RouterTest.php +++ b/core/modules/system/src/Tests/Routing/RouterTest.php @@ -212,7 +212,7 @@ public function testUserAccount() { public function testControllerResolutionAjax() { // This will fail with a JSON parse error if the request is not routed to // The correct controller. - $this->drupalGetAjax('/router_test/test10'); + $this->drupalGetAJAX('/router_test/test10'); $this->assertEqual($this->drupalGetHeader('Content-Type'), 'application/json', 'Correct mime content type was returned'); diff --git a/core/modules/system/src/Tests/Session/SessionTest.php b/core/modules/system/src/Tests/Session/SessionTest.php index 4e67192..75b194a 100644 --- a/core/modules/system/src/Tests/Session/SessionTest.php +++ b/core/modules/system/src/Tests/Session/SessionTest.php @@ -138,18 +138,6 @@ function testDataPersistence() { } /** - * Tests storing data in Session() object. - */ - public function testSessionPersistenceOnLogin() { - // Store information via hook_user_login(). - $user = $this->drupalCreateUser(); - $this->drupalLogin($user); - // Test property added to session object form hook_user_login(). - $this->drupalGet('session-test/get-from-session-object'); - $this->assertText('foobar', 'Session data is saved in Session() object.', 'Session'); - } - - /** * Test that empty anonymous sessions are destroyed. */ function testEmptyAnonymousSession() { diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index bd391ed..34fb4a8 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -2,7 +2,7 @@ /** * @file - * Hooks provided by the System module. + * Hooks provided by Drupal core and the System module. */ use Drupal\Component\Utility\SafeMarkup; @@ -16,6 +16,54 @@ */ /** + * Flush all persistent and static caches. + * + * This hook asks your module to clear all of its static caches, + * in order to ensure a clean environment for subsequently + * invoked data rebuilds. + * + * Do NOT use this hook for rebuilding information. Only use it to flush custom + * caches. + * + * Static caches using drupal_static() do not need to be reset manually. + * However, all other static variables that do not use drupal_static() must be + * manually reset. + * + * This hook is invoked by drupal_flush_all_caches(). It runs before module data + * is updated and before hook_rebuild(). + * + * @see drupal_flush_all_caches() + * @see hook_rebuild() + */ +function hook_cache_flush() { + if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') { + _update_cache_clear(); + } +} + +/** + * Rebuild data based upon refreshed caches. + * + * This hook allows your module to rebuild its data based on the latest/current + * module data. It runs after hook_cache_flush() and after all module data has + * been updated. + * + * This hook is only invoked after the system has been completely cleared; + * i.e., all previously cached data is known to be gone and every API in the + * system is known to return current information, so your module can safely rely + * on all available data to rebuild its own. + * + * @see hook_cache_flush() + * @see drupal_flush_all_caches() + */ +function hook_rebuild() { + $themes = \Drupal::service('theme_handler')->listInfo(); + foreach ($themes as $theme) { + _block_rehash($theme->getName()); + } +} + +/** * Alters theme operation links. * * @param $theme_groups @@ -280,5 +328,107 @@ function hook_token_info_alter(&$data) { } /** + * Alter the parameters for links. + * + * @param array $variables + * An associative array of variables defining a link. The link may be either a + * "route link" using \Drupal\Core\Utility\LinkGenerator::link(), which is + * exposed as the 'link_generator' service or a link generated by _l(). If the + * link is a "route link", 'route_name' will be set, otherwise 'path' will be + * set. The following keys can be altered: + * - text: The link text for the anchor tag as a translated string. + * - url_is_active: Whether or not the link points to the currently active + * URL. + * - url: The \Drupal\Core\Url object. + * - options: An associative array of additional options that will be passed + * to either \Drupal\Core\Routing\UrlGenerator::generateFromPath() or + * \Drupal\Core\Routing\UrlGenerator::generateFromRoute() to generate the + * href attribute for this link, and also used when generating the link. + * Defaults to an empty array. It may contain the following elements: + * - 'query': An array of query key/value-pairs (without any URL-encoding) to + * append to the URL. + * - absolute: Whether to force the output to be an absolute link (beginning + * with http:). Useful for links that will be displayed outside the site, + * such as in an RSS feed. Defaults to FALSE. + * - language: An optional language object. May affect the rendering of + * the anchor tag, such as by adding a language prefix to the path. + * - attributes: An associative array of HTML attributes to apply to the + * anchor tag. If element 'class' is included, it must be an array; 'title' + * must be a string; other elements are more flexible, as they just need + * to work as an argument for the constructor of the class + * Drupal\Core\Template\Attribute($options['attributes']). + * - html: Whether or not HTML should be allowed as the link text. If FALSE, + * the text will be run through + * \Drupal\Component\Utility\SafeMarkup::checkPlain() before being output. + * + * @see \Drupal\Core\Routing\UrlGenerator::generateFromPath() + * @see \Drupal\Core\Routing\UrlGenerator::generateFromRoute() + */ +function hook_link_alter(&$variables) { + // Add a warning to the end of route links to the admin section. + if (isset($variables['route_name']) && strpos($variables['route_name'], 'admin') !== FALSE) { + $variables['text'] .= ' (Warning!)'; + } +} + +/** + * Alter the configuration synchronization steps. + * + * @param array $sync_steps + * A one-dimensional array of \Drupal\Core\Config\ConfigImporter method names + * or callables that are invoked to complete the import, in the order that + * they will be processed. Each callable item defined in $sync_steps should + * either be a global function or a public static method. The callable should + * accept a $context array by reference. For example: + * + * function _additional_configuration_step(&$context) { + * // Do stuff. + * // If finished set $context['finished'] = 1. + * } + * + * For more information on creating batches, see the + * @link batch Batch operations @endlink documentation. + * + * @see callback_batch_operation() + * @see \Drupal\Core\Config\ConfigImporter::initialize() + */ +function hook_config_import_steps_alter(&$sync_steps, \Drupal\Core\Config\ConfigImporter $config_importer) { + $deletes = $config_importer->getUnprocessedConfiguration('delete'); + if (isset($deletes['field.storage.node.body'])) { + $sync_steps[] = '_additional_configuration_step'; + } +} + +/** + * Alter config typed data definitions. + * + * For example you can alter the typed data types representing each + * configuration schema type to change default labels or form element renderers + * used for configuration translation. + * + * If implementations of this hook add or remove configuration schema a + * ConfigSchemaAlterException will be thrown. Keep in mind that there are tools + * that may use the configuration schema for static analysis of configuration + * files, like the string extractor for the localization system. Such systems + * won't work with dynamically defined configuration schemas. + * + * For adding new data types use configuration schema YAML files instead. + * + * @param $definitions + * Associative array of configuration type definitions keyed by schema type + * names. The elements are themselves array with information about the type. + * + * @see \Drupal\Core\Config\TypedConfigManager + * @see \Drupal\Core\Config\Schema\ConfigSchemaAlterException + */ +function hook_config_schema_info_alter(&$definitions) { + // Enhance the text and date type definitions with classes to generate proper + // form elements in ConfigTranslationFormBase. Other translatable types will + // appear as a one line textfield. + $definitions['text']['form_element_class'] = '\Drupal\config_translation\FormElement\Textarea'; + $definitions['date_format']['form_element_class'] = '\Drupal\config_translation\FormElement\DateFormat'; +} + +/** * @} End of "addtogroup hooks". */ diff --git a/core/modules/system/tests/modules/session_test/session_test.module b/core/modules/system/tests/modules/session_test/session_test.module index 6a08211..0fb2ae4 100644 --- a/core/modules/system/tests/modules/session_test/session_test.module +++ b/core/modules/system/tests/modules/session_test/session_test.module @@ -9,6 +9,4 @@ function session_test_user_login($account) { // before hook_user_login() was called. exit; } - // Add some data in the session for retrieval testing purpose. - \Drupal::request()->getSession()->set("session_test_key", "foobar"); } diff --git a/core/modules/system/tests/modules/session_test/session_test.routing.yml b/core/modules/system/tests/modules/session_test/session_test.routing.yml index fce0fc9..8b9393e 100644 --- a/core/modules/system/tests/modules/session_test/session_test.routing.yml +++ b/core/modules/system/tests/modules/session_test/session_test.routing.yml @@ -5,13 +5,7 @@ session_test.get: _controller: '\Drupal\session_test\Controller\SessionTestController::get' requirements: _access: 'TRUE' -session_test.get_from_session_object: - path: '/session-test/get-from-session-object' - defaults: - _title: 'Session value' - _controller: '\Drupal\session_test\Controller\SessionTestController::getFromSessionObject' - requirements: - _access: 'TRUE' + session_test.id: path: '/session-test/id' defaults: diff --git a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php index 4437743..1ae9a79 100644 --- a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php +++ b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php @@ -31,19 +31,6 @@ public function get() { } /** - * Prints the stored session value to the screen. - * - * @return string - * A notification message. - */ - public function getFromSessionObject() { - $value = \Drupal::request()->getSession()->get("session_test_key"); - return empty($value) - ? [] - : ['#markup' => $this->t('The current value of the stored session variable is: %val', array('%val' => $value))]; - } - - /** * Print the current session ID. * * @return string diff --git a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php index 87d813d..5738087 100644 --- a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php +++ b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php @@ -205,19 +205,6 @@ public function system_test_cache_tags_page() { } /** - * Set cache max-age on the returned render array. - */ - public function system_test_cache_maxage_page() { - $build['main'] = array( - '#cache' => array('max-age' => 90), - 'message' => array( - '#markup' => 'Cache max-age page example', - ), - ); - return $build; - } - - /** * Sets a cache tag on an element to help test #pre_render and cache tags. */ public static function preRenderCacheTags($elements) { diff --git a/core/modules/system/tests/modules/system_test/system_test.routing.yml b/core/modules/system/tests/modules/system_test/system_test.routing.yml index ecb9921..0ceda63 100644 --- a/core/modules/system/tests/modules/system_test/system_test.routing.yml +++ b/core/modules/system/tests/modules/system_test/system_test.routing.yml @@ -66,13 +66,6 @@ system_test.cache_tags_page: requirements: _access: 'TRUE' -system_test.cache_maxage_page: - path: '/system-test/cache_maxage_page' - defaults: - _controller: '\Drupal\system_test\Controller\SystemTestController::system_test_cache_maxage_page' - requirements: - _access: 'TRUE' - system_test.authorize_init: path: '/system-test/authorize-init/{page_title}' defaults: diff --git a/core/modules/system/theme.api.php b/core/modules/system/theme.api.php index 9e08b87..a9a6f61 100644 --- a/core/modules/system/theme.api.php +++ b/core/modules/system/theme.api.php @@ -1,11 +1,6 @@ 'block-content-add-list', - * 'path' => 'core/themes/seven/templates', - * 'type' => 'theme_engine', - * 'theme path' => 'core/themes/seven', - * 'includes' => array ( - * 0 => 'core/modules/block_content/block_content.pages.inc', - * ), - * 'variables' => array ( - * 'content' => NULL, + * $theme_registry['user'] = array( + * 'variables' => array( + * 'account' => NULL, * ), - * 'preprocess functions' => array ( + * 'template' => 'core/modules/user/user', + * 'file' => 'core/modules/user/user.pages.inc', + * 'type' => 'module', + * 'theme path' => 'core/modules/user', + * 'preprocess functions' => array( * 0 => 'template_preprocess', - * 1 => 'template_preprocess_block_content_add_list', - * 2 => 'contextual_preprocess', - * 3 => 'seven_preprocess_block_content_add_list', + * 1 => 'template_preprocess_user_profile', * ), * ); * @endcode diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php index d46ea0f..eee3a75 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php @@ -70,8 +70,12 @@ public function query() { $this->tableAlias = $this->relationship; } // If no relationship, then use the alias of the base table. + elseif (isset($this->query->table_queue[$this->view->storage->get('base_table')]['alias'])) { + $this->tableAlias = $this->query->table_queue[$this->view->storage->get('base_table')]['alias']; + } + // This should never happen, but if it does, we fail quietly. else { - $this->tableAlias = $this->query->ensureTable($this->view->storage->get('base_table')); + return; } // Now build the subqueries. diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php deleted file mode 100644 index 2704c9f..0000000 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermFilterDepthTest.php +++ /dev/null @@ -1,141 +0,0 @@ -createTerm(['name' => 'First']); - $second = $this->createTerm(['name' => 'Second', 'parent' => $first->id()]); - $third = $this->createTerm(['name' => 'Third', 'parent' => $second->id()]); - - // Create a node w/o any terms. - $settings = ['type' => 'article']; - $this->nodes[] = $this->drupalCreateNode($settings); - - // Create a node with only the top level term. - $settings['field_views_testing_tags'][0]['target_id'] = $first->id(); - $this->nodes[] = $this->drupalCreateNode($settings); - - // Create a node with only the third level term. - $settings['field_views_testing_tags'][0]['target_id'] = $third->id(); - $this->nodes[] = $this->drupalCreateNode($settings); - - $this->terms[0] = $first; - $this->terms[1] = $second; - $this->terms[2] = $third; - - $this->view = Views::getView('test_filter_taxonomy_index_tid_depth'); - } - - /** - * Tests the terms with depth filter. - */ - public function testTermWithDepthFilter() { - $column_map = ['nid' => 'nid']; - $assert_method = 'assertIdentical'; - - // Default view has an empty value for this filter, so all nodes should be - // returned. - $expected = [ - ['nid' => 1], - ['nid' => 2], - ['nid' => 3], - ['nid' => 4], - ['nid' => 5], - ]; - $this->executeView($this->view); - $this->assertIdenticalResultsetHelper($this->view, $expected, $column_map, $assert_method); - - // Set filter to search on top-level term, with depth 0. - $expected = [['nid' => 4]]; - $this->assertTermWithDepthResult($this->terms[0]->id(), 0, $expected); - - // Top-level term, depth 1. - $expected = [['nid' => 4]]; - $this->assertTermWithDepthResult($this->terms[0]->id(), 0, $expected); - - // Top-level term, depth 2. - $expected = [['nid' => 4], ['nid' => 5]]; - $this->assertTermWithDepthResult($this->terms[0]->id(), 2, $expected); - - // Second-level term, depth 1. - $expected = [['nid' => 5]]; - $this->assertTermWithDepthResult($this->terms[1]->id(), 1, $expected); - - // Third-level term, depth 0. - $expected = [['nid' => 5]]; - $this->assertTermWithDepthResult($this->terms[2]->id(), 0, $expected); - - // Third-level term, depth 1. - $expected = [['nid' => 5]]; - $this->assertTermWithDepthResult($this->terms[2]->id(), 1, $expected); - - // Third-level term, depth -2. - $expected = [['nid' => 4], ['nid' => 5]]; - $this->assertTermWithDepthResult($this->terms[2]->id(), -2, $expected); - } - - /** - * Changes the tid filter to given term and depth. - * - * @param integer $tid - * The term ID to filter on. - * @param integer $depth - * The depth to search. - * @param array $expected - * The expected views result. - */ - protected function assertTermWithDepthResult($tid, $depth, array $expected) { - $this->view->destroy(); - $this->view->initDisplay(); - $filters = $this->view->displayHandlers->get('default') - ->getOption('filters'); - $filters['tid_depth']['depth'] = $depth; - $filters['tid_depth']['value'] = [$tid]; - $this->view->displayHandlers->get('default') - ->setOption('filters', $filters); - $this->executeView($this->view); - $this->assertIdenticalResultsetHelper($this->view, $expected, ['nid' => 'nid'], 'assertIdentical'); - } - -} diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php index ebe47dc..78f0d8c 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php @@ -81,7 +81,7 @@ protected function setUp() { */ public function testTaxonomyTermView() { // Create terms in the vocabulary. - $term = $this->createTerm(); + $term = $this->createTerm($this->vocabulary); // Post an article. $edit = array(); diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php index d4479f1..9fa56bc 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php @@ -121,24 +121,20 @@ protected function mockStandardInstall() { /** * Returns a new term with random properties in vocabulary $vid. * - * @param array $settings - * (Optional) An associative array of settings to pass to `entity_create`. - * - * @return \Drupal\taxonomy\Entity\Term + * @return \Drupal\taxonomy\Term * The created taxonomy term. */ - protected function createTerm(array $settings = []) { + protected function createTerm() { $filter_formats = filter_formats(); $format = array_pop($filter_formats); - $settings += [ + $term = entity_create('taxonomy_term', array( 'name' => $this->randomMachineName(), 'description' => $this->randomMachineName(), // Use the first available text format. 'format' => $format->id(), 'vid' => $this->vocabulary->id(), 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - ]; - $term = entity_create('taxonomy_term', $settings); + )); $term->save(); return $term; } diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid_depth.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid_depth.yml deleted file mode 100644 index 500e8b9..0000000 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid_depth.yml +++ /dev/null @@ -1,178 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node - - taxonomy - - user -id: test_filter_taxonomy_index_tid_depth -label: test_filter_taxonomy_index_tid_depth -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: 8.x -display: - default: - display_plugin: default - id: default - display_title: Master - position: 1 - display_options: - access: - type: perm - options: - perm: 'access content' - cache: - type: none - options: { } - query: - type: views_query - options: - disable_sql_rewrite: false - distinct: false - replica: false - query_comment: '' - query_tags: { } - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - pager: - type: full - options: - items_per_page: 10 - offset: 0 - id: 0 - total_pages: null - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - tags: - previous: '‹ previous' - next: 'next ›' - first: '« first' - last: 'last »' - quantity: 9 - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: fields - options: - inline: { } - separator: '' - hide_empty: false - default_field_elements: true - fields: - title: - id: title - table: node_field_data - field: title - label: '' - alter: - alter_text: false - make_link: false - absolute: false - trim: false - word_boundary: false - ellipsis: false - strip_tags: false - html: false - hide_empty: false - empty_zero: false - relationship: none - group_type: group - admin_label: '' - exclude: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_alter_empty: true - plugin_id: field - entity_type: node - entity_field: title - filters: - status: - value: true - table: node_field_data - field: status - id: status - expose: - operator: '0' - group: 1 - plugin_id: boolean - entity_type: node - entity_field: status - tid_depth: - id: tid_depth - table: node_field_data - field: term_node_tid_depth - relationship: none - group_type: group - admin_label: '' - operator: or - value: { } - group: 1 - exposed: false - expose: - operator_id: '0' - label: '' - description: '' - use_operator: false - operator: '' - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - reduce_duplicates: false - type: select - limit: true - vid: views_testing_tags - hierarchy: true - depth: -2 - error_message: true - plugin_id: taxonomy_index_tid_depth - sorts: { } - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } diff --git a/core/modules/text/text.js b/core/modules/text/text.js index 2ab1d0a..0895415 100644 --- a/core/modules/text/text.js +++ b/core/modules/text/text.js @@ -11,9 +11,9 @@ var $widget = $(this).closest('.text-format-wrapper'); var $summary = $widget.find('.text-summary-wrapper'); - var $summaryLabel = $summary.find('label').eq(0); + var $summaryLabel = $summary.find('label').first(); var $full = $widget.find('.text-full').closest('.form-item'); - var $fullLabel = $full.find('label').eq(0); + var $fullLabel = $full.find('label').first(); // Create a placeholder label when the field cardinality is greater // than 1. diff --git a/core/modules/tour/js/tour.js b/core/modules/tour/js/tour.js index 8d85e10..f8bc85f 100644 --- a/core/modules/tour/js/tour.js +++ b/core/modules/tour/js/tour.js @@ -206,7 +206,7 @@ $(this).find('.tour-progress').text(progress); }) // Update the last item to have "End tour" as the button. - .eq(-1) + .last() .attr('data-text', Drupal.t('End tour')); } } diff --git a/core/modules/update/config/install/update.settings.yml b/core/modules/update/config/install/update.settings.yml index 912a5b8..ded8c9d 100644 --- a/core/modules/update/config/install/update.settings.yml +++ b/core/modules/update/config/install/update.settings.yml @@ -1,4 +1,5 @@ check: + disabled_extensions: false interval_days: 1 fetch: url: '' diff --git a/core/modules/update/config/schema/update.schema.yml b/core/modules/update/config/schema/update.schema.yml index a390c6b..b827c56 100644 --- a/core/modules/update/config/schema/update.schema.yml +++ b/core/modules/update/config/schema/update.schema.yml @@ -8,6 +8,9 @@ update.settings: type: mapping label: 'Check settings' mapping: + disabled_extensions: + type: boolean + label: 'Check for updates of disabled modules and themes' interval_days: type: integer label: 'Days since last check' diff --git a/core/modules/update/src/Form/UpdateManagerInstall.php b/core/modules/update/src/Form/UpdateManagerInstall.php index 43d1f62..b3e2deb 100644 --- a/core/modules/update/src/Form/UpdateManagerInstall.php +++ b/core/modules/update/src/Form/UpdateManagerInstall.php @@ -104,7 +104,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array( '#type' => 'submit', - '#button_type' => 'primary', '#value' => $this->t('Install'), ); diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php index b4ff5e4..dde3e52 100644 --- a/core/modules/update/src/Tests/UpdateContribTest.php +++ b/core/modules/update/src/Tests/UpdateContribTest.php @@ -250,6 +250,23 @@ function testUpdateShowDisabledThemes() { ); $base_theme_project_link = \Drupal::l(t('Update test base theme'), Url::fromUri('http://example.com/project/update_test_basetheme')); $sub_theme_project_link = \Drupal::l(t('Update test subtheme'), Url::fromUri('http://example.com/project/update_test_subtheme')); + foreach (array(TRUE, FALSE) as $check_disabled) { + $update_settings->set('check.disabled_extensions', $check_disabled)->save(); + $this->refreshUpdateStatus($xml_mapping); + // In neither case should we see the "Themes" heading for installed + // themes. + $this->assertNoText(t('Themes')); + if ($check_disabled) { + $this->assertText(t('Disabled themes')); + $this->assertRaw($base_theme_project_link, 'Link to the Update test base theme project appears.'); + $this->assertRaw($sub_theme_project_link, 'Link to the Update test subtheme project appears.'); + } + else { + $this->assertNoText(t('Disabled themes')); + $this->assertNoRaw($base_theme_project_link, 'Link to the Update test base theme project does not appear.'); + $this->assertNoRaw($sub_theme_project_link, 'Link to the Update test subtheme project does not appear.'); + } + } } /** diff --git a/core/modules/update/src/UpdateManager.php b/core/modules/update/src/UpdateManager.php index 3b052af..b92251b 100644 --- a/core/modules/update/src/UpdateManager.php +++ b/core/modules/update/src/UpdateManager.php @@ -138,6 +138,10 @@ public function getProjects() { $project_info = new ProjectInfo(); $project_info->processInfoList($this->projects, $module_data, 'module', TRUE); $project_info->processInfoList($this->projects, $theme_data, 'theme', TRUE); + if ($this->updateSettings->get('check.disabled_extensions')) { + $project_info->processInfoList($this->projects, $module_data, 'module', FALSE); + $project_info->processInfoList($this->projects, $theme_data, 'theme', FALSE); + } // Allow other modules to alter projects before fetching and comparing. $this->moduleHandler->alter('update_projects', $this->projects); // Store the site's project data for at most 1 hour. diff --git a/core/modules/update/src/UpdateSettingsForm.php b/core/modules/update/src/UpdateSettingsForm.php index a824c9b..7b29880 100644 --- a/core/modules/update/src/UpdateSettingsForm.php +++ b/core/modules/update/src/UpdateSettingsForm.php @@ -75,6 +75,12 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#description' => t('Select how frequently you want to automatically check for new releases of your currently installed modules and themes.'), ); + $form['update_check_disabled'] = array( + '#type' => 'checkbox', + '#title' => t('Check for updates of disabled modules and themes'), + '#default_value' => $config->get('check.disabled_extensions'), + ); + $notification_emails = $config->get('notification.emails'); $form['update_notify_emails'] = array( '#type' => 'textarea', @@ -136,8 +142,14 @@ public function validateForm(array &$form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $config = $this->config('update.settings'); + // See if the update_check_disabled setting is being changed, and if so, + // invalidate all update status data. + if ($form_state->getValue('update_check_disabled') != $config->get('check.disabled_extensions')) { + update_storage_clear(); + } $config + ->set('check.disabled_extensions', $form_state->getValue('update_check_disabled')) ->set('check.interval_days', $form_state->getValue('update_check_frequency')) ->set('notification.emails', $form_state->get('notify_emails')) ->set('notification.threshold', $form_state->getValue('update_notification_threshold')) diff --git a/core/modules/user/src/Tests/UserSaveStatusTest.php b/core/modules/user/src/Tests/UserSaveStatusTest.php deleted file mode 100644 index d1410a1..0000000 --- a/core/modules/user/src/Tests/UserSaveStatusTest.php +++ /dev/null @@ -1,53 +0,0 @@ -installEntitySchema('user'); - } - - /** - * Test SAVED_NEW and SAVED_UPDATED statuses for user entity type. - */ - function testUserSaveStatus() { - // Create a new user. - $values = array( - 'uid' => 1, - 'name' => $this->randomMachineName(), - ); - $user = User::create($values); - - // Test SAVED_NEW. - $return = $user->save(); - $this->assertEqual($return, SAVED_NEW, "User was saved with SAVED_NEW status."); - - // Test SAVED_UPDATED. - $user->name = $this->randomMachineName(); - $return = $user->save(); - $this->assertEqual($return, SAVED_UPDATED, "User was saved with SAVED_UPDATED status."); - } - -} diff --git a/core/modules/user/src/UserStorage.php b/core/modules/user/src/UserStorage.php index 4aad5c5..f404b8d 100644 --- a/core/modules/user/src/UserStorage.php +++ b/core/modules/user/src/UserStorage.php @@ -79,7 +79,7 @@ public function save(EntityInterface $entity) { $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {users}')->fetchField()); $entity->enforceIsNew(); } - return parent::save($entity); + parent::save($entity); } /** diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php index 9c0f49b..e648cb6 100644 --- a/core/modules/views/src/Plugin/views/PluginBase.php +++ b/core/modules/views/src/Plugin/views/PluginBase.php @@ -507,14 +507,17 @@ public function getProvider() { * - \Drupal\views\Plugin\views\PluginBase::INCLUDE_ENTITY: Add * entity row language types. Note that these are only supported for * display options, not substituted in queries. + * @param array|null $current_values + * The list of current values if available. * * @return array * An array of language names, keyed by the language code. Negotiated and * special languages have special codes that are substituted in queries by * PluginBase::queryLanguageSubstitutions(). */ - protected function listLanguages($flags = LanguageInterface::STATE_ALL) { + protected function listLanguages($flags = LanguageInterface::STATE_ALL, array $current_values = NULL) { $manager = \Drupal::languageManager(); + $languages = $manager->getLanguages($flags); $list = array(); // The entity languages should come first, if requested. @@ -523,32 +526,46 @@ protected function listLanguages($flags = LanguageInterface::STATE_ALL) { $list['***LANGUAGE_entity_default***'] = $this->t('Original language of content in view row'); } - // The Language Manager class takes care of the STATE_SITE_DEFAULT case. - // It comes in with ID set to LanguageInterface::LANGCODE_SITE_DEFAULT. + // STATE_SITE_DEFAULT comes in with ID set to LanguageInterface::LANGCODE_SITE_DEFAULT. // Since this is not a real language, surround it by '***LANGUAGE_...***', // like the negotiated languages below. - $languages = $manager->getLanguages($flags); - foreach ($languages as $id => $language) { - if ($id == LanguageInterface::LANGCODE_SITE_DEFAULT) { - $id = PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT; - } - $list[$id] = $this->t($language->getName()); + if ($flags & LanguageInterface::STATE_SITE_DEFAULT) { + $list[PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT] = $this->t($languages[LanguageInterface::LANGCODE_SITE_DEFAULT]->getName()); + // Remove site's default from the languages' array so it's not added + // with the real languages below. + unset($languages[LanguageInterface::LANGCODE_SITE_DEFAULT]); } // Add in negotiated languages, if requested. if ($flags & PluginBase::INCLUDE_NEGOTIATED) { - $types = $manager->getDefinedLanguageTypesInfo(); - foreach ($types as $id => $type) { - // Omit unnamed types. These are things like language_url, which are - // not configurable and do not need to be in this list. And surround - // IDs by '***LANGUAGE_...***', to avoid query collisions. - if (isset($type['name'])) { + $types_info = $manager->getDefinedLanguageTypesInfo(); + $types = $manager->getLanguageTypes(); + foreach ($types as $id) { + if (isset($types_info[$id]['name'])) { + $name = $types_info[$id]['name']; + // Surround IDs by '***LANGUAGE_...***', to avoid query collisions. + $id = '***LANGUAGE_' . $id . '***'; + $list[$id] = $this->t('!type language selected for page', array('!type' => $name)); + } + } + if (!empty($current_values)) { + foreach ($types_info as $id => $type) { $id = '***LANGUAGE_' . $id . '***'; - $list[$id] = $this->t('!type language selected for page', array('!type' => $type['name'])); + // If this (non-configurable) type is among the current values, + // add that option too, so it is not lost. If not among the current + // values, skip displaying it to avoid user confusion. + if (isset($type['name']) && !isset($list[$id]) && in_array($id, $current_values)) { + $list[$id] = $this->t('!type language selected for page', array('!type' => $type['name'])); + } } } } + // Add real languages. + foreach ($languages as $id => $language) { + $list[$id] = $this->t($language->getName()); + } + return $list; } diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 290d1a7..b66cdce 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2609,7 +2609,9 @@ public function getExtenders() { */ protected function buildRenderingLanguageOptions() { // @todo Consider making these plugins. See https://drupal.org/node/2173811. - return $this->listLanguages(LanguageInterface::STATE_CONFIGURABLE | LanguageInterface::STATE_SITE_DEFAULT | PluginBase::INCLUDE_NEGOTIATED | PluginBase::INCLUDE_ENTITY); + // Pass the current rendering language so is not lost when there is language + // configuration changes. + return $this->listLanguages(LanguageInterface::STATE_CONFIGURABLE | LanguageInterface::STATE_SITE_DEFAULT | PluginBase::INCLUDE_NEGOTIATED | PluginBase::INCLUDE_ENTITY, array($this->getOption('rendering_language'))); } /** diff --git a/core/modules/views/src/Plugin/views/filter/LanguageFilter.php b/core/modules/views/src/Plugin/views/filter/LanguageFilter.php index 9826998..acf59e7 100644 --- a/core/modules/views/src/Plugin/views/filter/LanguageFilter.php +++ b/core/modules/views/src/Plugin/views/filter/LanguageFilter.php @@ -65,7 +65,9 @@ public static function create(ContainerInterface $container, array $configuratio public function getValueOptions() { if (!isset($this->valueOptions)) { $this->valueTitle = $this->t('Language'); - $this->valueOptions = $this->listLanguages(LanguageInterface::STATE_ALL |LanguageInterface::STATE_SITE_DEFAULT | PluginBase::INCLUDE_NEGOTIATED); + // Pass the current values so options that are already selected do not get + // lost when there is changes in the language configuration. + $this->valueOptions = $this->listLanguages(LanguageInterface::STATE_ALL | LanguageInterface::STATE_SITE_DEFAULT | PluginBase::INCLUDE_NEGOTIATED, array_keys($this->value)); } } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml index 7b8490a..9a0b910 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml @@ -39,6 +39,46 @@ display: plugin_id: boolean entity_type: node entity_field: status + langcode: + id: langcode + table: node_field_data + field: langcode + relationship: none + group_type: group + admin_label: '' + operator: in + value: + '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + plugin_id: language + entity_type: node + entity_field: langcode pager: options: items_per_page: 10 diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 7f217dc..236b746 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -241,7 +241,7 @@ var $addDisplayDropdown = $('
  • ' + Drupal.t('Add') + '
  • '); var $displayButtons = $menu.nextAll('input.add-display').detach(); $displayButtons.appendTo($addDisplayDropdown.find('.action-list')).wrap('
  • ') - .parent().eq(0).addClass('first').end().eq(-1).addClass('last'); + .parent().first().addClass('first').end().last().addClass('last'); // Remove the 'Add ' prefix from the button labels since they're being palced // in an 'Add' dropdown. // @todo This assumes English, but so does $addDisplayDropdown above. Add @@ -701,7 +701,7 @@ // Within the row, the operator labels are displayed inside the first table // cell (next to the filter name). var $draggableRow = $(this.draggableRows[i]); - var $firstCell = $draggableRow.find('td').eq(0); + var $firstCell = $draggableRow.find('td:first'); if ($firstCell.length) { // The value of the operator label ("And" or "Or") is taken from the // first operator dropdown we encounter, going backwards from the current diff --git a/core/modules/views_ui/src/Tests/ViewEditTest.php b/core/modules/views_ui/src/Tests/ViewEditTest.php index d9cd747..ed552d1 100644 --- a/core/modules/views_ui/src/Tests/ViewEditTest.php +++ b/core/modules/views_ui/src/Tests/ViewEditTest.php @@ -138,6 +138,42 @@ public function testEditFormLanguageOptions() { } else { $this->assertFieldByName('rendering_language', '***LANGUAGE_entity_translation***'); + // Check that the order is consistent with other language selectors like + // in admin/config/regional/content-language. + $expected_elements = array( + '***LANGUAGE_entity_translation***', + '***LANGUAGE_entity_default***', + '***LANGUAGE_site_default***', + '***LANGUAGE_language_interface***', + 'en', + 'hu', + ); + $elements = $this->xpath('//select[@id="edit-rendering-language"]/option'); + // Compare values inside the option elements with expected values. + for ($i = 0; $i < count($elements); $i++) { + $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + } + + // Check the order for the langcode filter. + $langcode_url = 'admin/structure/views/nojs/handler/' . $view_name . '/' . $display . '/filter/langcode'; + $this->drupalGet($langcode_url); + $this->assertResponse(200); + + $expected_elements = array( + 'all', + '***LANGUAGE_site_default***', + '***LANGUAGE_language_interface***', + '***LANGUAGE_language_content***', + 'en', + 'hu', + 'und', + 'zxx', + ); + $elements = $this->xpath('//div[@id="edit-options-value"]//input'); + // Compare values inside the option elements with expected values. + for ($i = 0; $i < count($elements); $i++) { + $this->assertEqual($elements[$i]->attributes()->{'value'}, $expected_elements[$i]); + } } } } diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php index e704538..1ffdfe0 100644 --- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php @@ -489,37 +489,6 @@ public function testQuestionSign() { } /** - * Check that strings in HTML attributes are are correctly processed. - * - * @covers ::attributes - * @dataProvider providerTestAttributes - */ - public function testAttribute($value, $expected, $message, $allowed_tags = NULL) { - $value = Xss::filter($value, $allowed_tags); - $this->assertEquals($expected, $value, $message); - } - - /** - * Data provider for testFilterXssAdminNotNormalized(). - */ - public function providerTestAttributes() { - return array( - array( - 'Example: alt', - 'Example: alt', - 'Image tag with alt and title attribute', - array('img') - ), - array( - '', - '', - 'Image tag with data attribute', - array('img') - ), - ); - } - - /** * Checks that \Drupal\Component\Utility\Xss::filterAdmin() correctly strips unallowed tags. */ public function testFilterXSSAdmin() { diff --git a/core/themes/seven/css/base/print.css b/core/themes/seven/css/base/print.css index 653e511..bb87d92 100644 --- a/core/themes/seven/css/base/print.css +++ b/core/themes/seven/css/base/print.css @@ -47,7 +47,7 @@ } .messages { border-width: 1px; - border-color: #999; + border-left-color: #999; } .is-collapse-enabled .tabs { max-height: 999em; diff --git a/core/themes/seven/css/components/buttons.css b/core/themes/seven/css/components/buttons.css index d0c24fb..c6e0d3d 100644 --- a/core/themes/seven/css/components/buttons.css +++ b/core/themes/seven/css/components/buttons.css @@ -110,19 +110,13 @@ * Overrides styling from system.theme. */ .button-action:before { - margin-left: -0.2em; /* LTR */ - padding-right: 0.2em; /* LTR */ + margin-left: -0.2em; + padding-right: 0.2em; font-size: 14px; font-size: 0.875rem; line-height: 16px; -webkit-font-smoothing: auto; } -[dir="rtl"] .button-action:before { - margin-right: -0.2em; - margin-left: 0; - padding-right: 0; - padding-left: 0.2em; -} /** * 1. Use px units to ensure button text is centered vertically. diff --git a/core/themes/seven/css/components/dialog.theme.css b/core/themes/seven/css/components/dialog.theme.css index e7096b5..7dfd9cc 100644 --- a/core/themes/seven/css/components/dialog.theme.css +++ b/core/themes/seven/css/components/dialog.theme.css @@ -33,17 +33,13 @@ .ui-dialog .ui-dialog-titlebar-close { border: 0; background: none; - right: 20px; /* LTR */ + right: 20px; top: 20px; margin: 0; height: 16px; width: 16px; position: absolute; } -[dir="rtl"] .ui-dialog .ui-dialog-titlebar-close { - right: auto; - left: 20px; -} .ui-dialog .ui-icon.ui-icon-closethick { background: url(../../../../misc/icons/ffffff/ex.svg) 0 0 no-repeat; margin-top: -12px; @@ -83,7 +79,7 @@ } .ui-dialog .ajax-progress-throbber { /* Can't do center:50% middle: 50%, so approximate it for a typical window size. */ - left: 49%; /* LTR */ + left: 49%; position: fixed; top: 48.5%; z-index: 1000; @@ -97,10 +93,6 @@ padding: 4px; width: 24px; } -[dir="rtl"] .ui-dialog .ajax-progress-throbber { - left: auto; - right: 49%; -} .ui-dialog .ajax-progress-throbber .throbber, .ui-dialog .ajax-progress-throbber .message { display: none; diff --git a/core/themes/seven/css/components/dropbutton.component.css b/core/themes/seven/css/components/dropbutton.component.css index 6f08502..9c6db04 100644 --- a/core/themes/seven/css/components/dropbutton.component.css +++ b/core/themes/seven/css/components/dropbutton.component.css @@ -16,18 +16,10 @@ font-weight: 600; line-height: normal; -webkit-font-smoothing: antialiased; - text-align: left; /* LTR */ -} -[dir="rtl"] .js .dropbutton .dropbutton-action > input, -[dir="rtl"] .js .dropbutton .dropbutton-action > a, -[dir="rtl"] .js .dropbutton .dropbutton-action > button { - text-align: right; + text-align: left; } .js .dropbutton-action.last { - border-radius: 0 0 0 1em; /* LTR */ -} -[dir="rtl"] .js .dropbutton-action.last { - border-radius: 0 0 1em 0; + border-radius: 0 0 0 1em; } /** @@ -244,13 +236,9 @@ } .dropbutton-arrow { border-top-color: #333; - right: 35%; /* LTR */ + right: 35%; top: 54%; } -[dir="rtl"] .dropbutton-arrow { - left: 35%; - right: auto; -} .dropbutton-multiple.open .dropbutton-arrow { border-bottom: 0.3333em solid #333; border-top-color: transparent; diff --git a/core/themes/seven/css/components/form.css b/core/themes/seven/css/components/form.css index d1c517f..17d75a4 100644 --- a/core/themes/seven/css/components/form.css +++ b/core/themes/seven/css/components/form.css @@ -130,8 +130,8 @@ input.form-file, input.form-date, input.form-time, textarea.form-textarea { - box-sizing: border-box; - padding: .3em .4em .3em .5em; /* LTR */ + box-sizing: border-box; + padding: .3em .4em .3em .5em; max-width: 100%; border: 1px solid #b8b8b8; border-top-color: #999; @@ -145,9 +145,6 @@ textarea.form-textarea { -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; } -[dir="rtl"] textarea.form-textarea { - padding: .3em .5em .3em .4em; -} .form-text:focus, .form-tel:focus, .form-email:focus, @@ -173,12 +170,11 @@ textarea.form-textarea { .form-item .password-suggestions { float: left; /* LTR */ - clear: left; /* LTR */ + clear: left; width: 100%; } [dir="rtl"] .form-item .password-suggestions { float: right; - clear: right; } .form-item-pass .description { clear: both; diff --git a/core/themes/seven/css/components/jquery.ui/theme.css b/core/themes/seven/css/components/jquery.ui/theme.css index 6732809..12d36ed 100644 --- a/core/themes/seven/css/components/jquery.ui/theme.css +++ b/core/themes/seven/css/components/jquery.ui/theme.css @@ -86,12 +86,9 @@ background-image: url(../../../images/ui-icons-ffffff-256x240.png); } .ui-widget p .ui-icon { - margin: 2px 3px 0 0; /* LTR */ + margin: 2px 3px 0 0; } -[dir="rtl"] .ui-widget p .ui-icon { - margin: 2px 0 0 3px; -} /* positioning */ .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } @@ -310,13 +307,10 @@ border-bottom-right-radius: 0; } .ui-tabs .ui-tabs-nav li { - padding: 0 1em 0 10px; /* LTR */ + padding: 0 1em 0 10px; margin: 0; list-style: none; } -[dir="rtl"] .ui-tabs .ui-tabs-nav li { - padding: 0 10px 0 1em; -} .ui-tabs .ui-tabs-nav li a { float: none; padding: 0 10px; diff --git a/core/themes/seven/css/components/pager.css b/core/themes/seven/css/components/pager.css index 6a84de3..9984437 100644 --- a/core/themes/seven/css/components/pager.css +++ b/core/themes/seven/css/components/pager.css @@ -3,12 +3,9 @@ * Styles for Seven's Pagination. */ .pager__items { - margin: 0.25em 0 0.25em 1.5em; /* LTR */ + margin: 0.25em 0 0.25em 1.5em; padding: 0; } -[dir="rtl"] .pager__items { - margin: 0.25em 1.5em 0.25em 0; -} .pager__item { display: inline-block; color: #8c8c8c; diff --git a/core/themes/seven/css/components/tour.theme.css b/core/themes/seven/css/components/tour.theme.css index d2ac534..a5e0cc4 100644 --- a/core/themes/seven/css/components/tour.theme.css +++ b/core/themes/seven/css/components/tour.theme.css @@ -34,22 +34,14 @@ } .joyride-tip-guide .joyride-nub.right { border-top-color: transparent; - border-right-color: transparent; /* LTR */ + border-right-color: transparent; border-bottom-color: transparent; } -[dir="rtl"] .joyride-tip-guide .joyride-nub.right { - border-left-color: transparent; - border-right-color: rgba(0,0,0, 0.8); -} .joyride-tip-guide .joyride-nub.left { border-top-color: transparent; - border-left-color: transparent; /* LTR */ + border-left-color: transparent; border-bottom-color: transparent; } -[dir="rtl"] .joyride-tip-guide .joyride-nub.left { - border-left-color: rgba(0,0,0, 0.8); - border-right-color: transparent; -} .joyride-tip-guide .joyride-nub.top-right { border-top-color: transparent; border-left-color: transparent; diff --git a/core/themes/seven/css/components/vertical-tabs.css b/core/themes/seven/css/components/vertical-tabs.css index e3bd0eb..dc300f1 100644 --- a/core/themes/seven/css/components/vertical-tabs.css +++ b/core/themes/seven/css/components/vertical-tabs.css @@ -32,10 +32,6 @@ width: 100%; border-right: 1px solid #fcfcfa; /* LTR */ box-shadow: 0 5px 5px -5px hsla(0, 0%, 0%, 0.3); - border-bottom: 1px solid #b3b2ad; -} -.vertical-tabs__menu-item.last { - border-bottom: none; } [dir="rtl"] .vertical-tabs__menu-item.is-selected { border-left: 1px solid #fcfcfa; @@ -45,9 +41,6 @@ .vertical-tabs__menu-item:active { z-index: 2; } -.vertical-tabs__menu-item.is-selected:focus { - outline: none; -} .vertical-tabs__menu-item a { display: block; padding: 10px 15px 15px; @@ -67,18 +60,8 @@ text-decoration: none; } .vertical-tabs__menu-item.is-selected a { + border-bottom-color: #b3b2ad; color: #004f80; - border-left: 4px solid #0074bd; /* LTR */ - padding-left: 11px; /* LTR */ - border-bottom: none; - outline: none; - text-decoration: none; -} -[dir=rtl] .vertical-tabs__menu-item.is-selected a { - border-left: 0; - border-right: 4px solid #0074bd; - padding-left: 15px; - padding-right: 11px; } .vertical-tabs__menu-item.is-selected a:hover, .vertical-tabs__menu-item.is-selected a:focus { diff --git a/core/themes/seven/css/components/views-ui.css b/core/themes/seven/css/components/views-ui.css index 960d008..837ae32 100644 --- a/core/themes/seven/css/components/views-ui.css +++ b/core/themes/seven/css/components/views-ui.css @@ -242,11 +242,7 @@ details.fieldset-no-legend { } .views-ui-rearrange-filter-form tr td:last-child { - border-right: medium none; /* LTR */ -} -[dir="rtl"] .views-ui-rearrange-filter-form tr td:last-child { - border-left: medium none; - border-right: initial; + border-right: medium none; } .views-ui-rearrange-filter-form .filter-group-operator-row { @@ -281,11 +277,7 @@ details.fieldset-no-legend { .views-query-info table tr td:last-child { /* Fixes a Seven style that bleeds down into this table unnecessarily */ - border-right: 0 none; /* LTR */ -} -[dir="rtl"] .views-query-info table tr td:last-child { - border-left: 0 none; - border-right: initial; + border-right: 0 none; } /* @end */ diff --git a/core/themes/seven/css/theme/install-page.css b/core/themes/seven/css/theme/install-page.css index 3a2f217..c43b42e 100644 --- a/core/themes/seven/css/theme/install-page.css +++ b/core/themes/seven/css/theme/install-page.css @@ -14,12 +14,9 @@ url(../../images/noise-low.png), radial-gradient(hsl(203, 80%, 45%), hsl(203, 80%, 32%)); background-repeat: repeat; - background-position: left top, 50% 50%; /* LTR */ + background-position: left top, 50% 50%; min-height: 100%; } -[dir="rtl"] .install-page { - background-position: right top, 50% 50%; -} /** * Password widget diff --git a/core/themes/seven/css/theme/maintenance-page.css b/core/themes/seven/css/theme/maintenance-page.css index 2d9c30d..f6b93a0 100644 --- a/core/themes/seven/css/theme/maintenance-page.css +++ b/core/themes/seven/css/theme/maintenance-page.css @@ -7,12 +7,9 @@ background-image: -webkit-radial-gradient(hsl(203, 2%, 90%), hsl(203, 2%, 95%)); background-image: radial-gradient(hsl(203, 2%, 90%), hsl(203, 2%, 95%)); background-repeat: repeat; - background-position: left top, 50% 50%; /* LTR */ + background-position: left top, 50% 50%; min-height: 100%; } -[dir="rtl"] .maintenance-page { - background-position: right top, 50% 50%; -} .page-title { font-size: 2em;