Drupal: update drupal core 7.81

This commit is contained in:
Robert 2021-06-10 14:28:05 +02:00
parent 64899a36e8
commit 90a5b8bd49
165 changed files with 1225 additions and 503 deletions

View File

@ -141,9 +141,9 @@ RewriteRule ^(.*)$ /d/index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME}\.gz -s RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA] RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
# Serve correct content types, and prevent mod_deflate double gzip. # Serve correct content types, and prevent double compression.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1] RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1] RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$"> <FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type. # Serve correct encoding type.
@ -154,8 +154,10 @@ RewriteRule ^(.*)$ /d/index.php?q=$1 [L,QSA]
</IfModule> </IfModule>
</IfModule> </IfModule>
# Add headers to all responses. # Various header fixes.
<IfModule mod_headers.c> <IfModule mod_headers.c>
# Disable content sniffing, since it's an attack vector. # Disable content sniffing, since it's an attack vector.
Header always set X-Content-Type-Options nosniff Header always set X-Content-Type-Options nosniff
# Disable Proxy header, since it's an attack vector.
RequestHeader unset Proxy
</IfModule> </IfModule>

View File

@ -1,3 +1,9 @@
Drupal 7.81, 2021-06-02
-----------------------
- Block Google FLoC by default
- Testing and accessibility enhancements
- Various bug fixes, optimizations and improvements
Drupal 7.80, 2021-04-20 Drupal 7.80, 2021-04-20
----------------------- -----------------------
- Fixed security issues: - Fixed security issues:

View File

@ -8,7 +8,7 @@
/** /**
* The current system version. * The current system version.
*/ */
define('VERSION', '7.80'); define('VERSION', '7.81');
/** /**
* Core API compatibility. * Core API compatibility.

View File

@ -2696,6 +2696,19 @@ function drupal_deliver_html_page($page_callback_result) {
drupal_add_http_header('X-Frame-Options', $frame_options); drupal_add_http_header('X-Frame-Options', $frame_options);
} }
if (variable_get('block_interest_cohort', TRUE)) {
$permissions_policy = drupal_get_http_header('Permissions-Policy');
if (is_null($permissions_policy)) {
drupal_add_http_header('Permissions-Policy', 'interest-cohort=()');
}
else {
// Only add interest-cohort if the header does not contain it already.
if (strpos($permissions_policy, 'interest-cohort') === FALSE) {
drupal_add_http_header('Permissions-Policy', 'interest-cohort=()', TRUE);
}
}
}
// Menu status constants are integers; page content is a string or array. // Menu status constants are integers; page content is a string or array.
if (is_int($page_callback_result)) { if (is_int($page_callback_result)) {
// @todo: Break these up into separate functions? // @todo: Break these up into separate functions?
@ -3392,7 +3405,7 @@ function drupal_group_css($css) {
* @see system_element_info() * @see system_element_info()
*/ */
function drupal_aggregate_css(&$css_groups) { function drupal_aggregate_css(&$css_groups) {
$preprocess_css = (variable_get('preprocess_css', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')); $preprocess_css = (variable_get('preprocess_css', FALSE) && !defined('MAINTENANCE_MODE'));
// For each group that needs aggregation, aggregate its items. // For each group that needs aggregation, aggregate its items.
foreach ($css_groups as $key => $group) { foreach ($css_groups as $key => $group) {
@ -3851,8 +3864,10 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
// whitespace. // whitespace.
// @see http://php.net/manual/regexp.reference.subpatterns.php // @see http://php.net/manual/regexp.reference.subpatterns.php
$contents = preg_replace('< $contents = preg_replace('<
# Do not strip any space from within single or double quotes
(' . $double_quot . '|' . $single_quot . ')
# Strip leading and trailing whitespace. # Strip leading and trailing whitespace.
\s*([@{};,])\s* | \s*([@{};,])\s*
# Strip only leading whitespace from: # Strip only leading whitespace from:
# - Closing parenthesis: Retain "@media (bar) and foo". # - Closing parenthesis: Retain "@media (bar) and foo".
| \s+([\)]) | \s+([\)])
@ -3860,11 +3875,11 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
# - Opening parenthesis: Retain "@media (bar) and foo". # - Opening parenthesis: Retain "@media (bar) and foo".
# - Colon: Retain :pseudo-selectors. # - Colon: Retain :pseudo-selectors.
| ([\(:])\s+ | ([\(:])\s+
>xS', >xSs',
// Only one of the three capturing groups will match, so its reference // Only one of the four capturing groups will match, so its reference
// will contain the wanted value and the references for the // will contain the wanted value and the references for the
// two non-matching groups will be replaced with empty strings. // two non-matching groups will be replaced with empty strings.
'$1$2$3', '$1$2$3$4',
$contents $contents
); );
// End the file with a new line. // End the file with a new line.
@ -4505,7 +4520,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
* @see drupal_add_js() * @see drupal_add_js()
*/ */
function drupal_pre_render_scripts(array $elements) { function drupal_pre_render_scripts(array $elements) {
$preprocess_js = (variable_get('preprocess_js', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')); $preprocess_js = (variable_get('preprocess_js', FALSE) && !defined('MAINTENANCE_MODE'));
// A dummy query-string is added to filenames, to gain control over // A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache // browser-caching. The string changes on every update or full cache
@ -6924,7 +6939,7 @@ function drupal_array_set_nested_value(array &$array, array $parents, $value, $f
function &drupal_array_get_nested_value(array &$array, array $parents, &$key_exists = NULL) { function &drupal_array_get_nested_value(array &$array, array $parents, &$key_exists = NULL) {
$ref = &$array; $ref = &$array;
foreach ($parents as $parent) { foreach ($parents as $parent) {
if (is_array($ref) && array_key_exists($parent, $ref)) { if (is_array($ref) && (isset($ref[$parent]) || array_key_exists($parent, $ref))) {
$ref = &$ref[$parent]; $ref = &$ref[$parent];
} }
else { else {

View File

@ -3924,6 +3924,11 @@ function theme_button($variables) {
$element['#attributes']['type'] = 'submit'; $element['#attributes']['type'] = 'submit';
element_set_attributes($element, array('id', 'name', 'value')); element_set_attributes($element, array('id', 'name', 'value'));
// Remove name attribute, if empty, for W3C compliance.
if (isset($element['#attributes']['name']) && $element['#attributes']['name'] === '') {
unset($element['#attributes']['name']);
}
$element['#attributes']['class'][] = 'form-' . $element['#button_type']; $element['#attributes']['class'][] = 'form-' . $element['#button_type'];
if (!empty($element['#attributes']['disabled'])) { if (!empty($element['#attributes']['disabled'])) {
$element['#attributes']['class'][] = 'form-button-disabled'; $element['#attributes']['class'][] = 'form-button-disabled';

View File

@ -1500,13 +1500,25 @@ function menu_tree_check_access(&$tree, $node_links = array()) {
$nids = array_keys($node_links); $nids = array_keys($node_links);
$select = db_select('node', 'n'); $select = db_select('node', 'n');
$select->addField('n', 'nid'); $select->addField('n', 'nid');
$select->condition('n.status', 1); // When a menu administrator who we know has permission to see unpublished
// nodes is administering the menu, included the unpublished nodes in the
// tree, with a special flag so that the Menu module can label them.
// Otherwise, exclude these nodes from the tree.
if (!empty($GLOBALS['menu_admin']) && user_access('bypass node access')) {
$select->addField('n', 'status');
}
else {
$select->condition('n.status', 1);
}
$select->condition('n.nid', $nids, 'IN'); $select->condition('n.nid', $nids, 'IN');
$select->addTag('node_access'); $select->addTag('node_access');
$nids = $select->execute()->fetchCol(); $node_objects = $select->execute()->fetchAll();
foreach ($nids as $nid) { foreach ($node_objects as $node_object) {
foreach ($node_links[$nid] as $mlid => $link) { foreach ($node_links[$node_object->nid] as $mlid => $link) {
$node_links[$nid][$mlid]['access'] = TRUE; $node_links[$node_object->nid][$mlid]['access'] = TRUE;
if (isset($node_object->status)) {
$node_links[$node_object->nid][$mlid]['node_unpublished'] = !$node_object->status;
}
} }
} }
} }
@ -1868,7 +1880,7 @@ function menu_navigation_links($menu_name, $level = 0) {
$router_item = menu_get_item(); $router_item = menu_get_item();
$links = array(); $links = array();
foreach ($tree as $item) { foreach ($tree as $item) {
if (!$item['link']['hidden']) { if ($item['link']['access'] && !$item['link']['hidden']) {
$class = ''; $class = '';
$l = $item['link']['localized_options']; $l = $item['link']['localized_options'];
$l['href'] = $item['link']['href']; $l['href'] = $item['link']['href'];

View File

@ -418,7 +418,7 @@ class ThemeRegistry Extends DrupalCacheArray {
// are not registered, just check the existence of the key in the registry. // are not registered, just check the existence of the key in the registry.
// Use array_key_exists() here since a NULL value indicates that the theme // Use array_key_exists() here since a NULL value indicates that the theme
// hook exists but has not yet been requested. // hook exists but has not yet been requested.
return array_key_exists($offset, $this->storage); return isset($this->storage[$offset]) || array_key_exists($offset, $this->storage);
} }
public function offsetGet($offset) { public function offsetGet($offset) {

View File

@ -17,7 +17,7 @@ Drupal.behaviors.autocomplete = {
$($input[0].form).submit(Drupal.autocompleteSubmit); $($input[0].form).submit(Drupal.autocompleteSubmit);
$input.parent() $input.parent()
.attr('role', 'application') .attr('role', 'application')
.append($('<span class="element-invisible" aria-live="assertive"></span>') .append($('<span class="element-invisible" aria-live="assertive" aria-atomic="true"></span>')
.attr('id', $input.attr('id') + '-autocomplete-aria-live') .attr('id', $input.attr('id') + '-autocomplete-aria-live')
); );
new Drupal.jsAC($input, acdb[uri]); new Drupal.jsAC($input, acdb[uri]);

View File

@ -7,7 +7,7 @@ files[] = aggregator.test
configure = admin/config/services/aggregator/settings configure = admin/config/services/aggregator/settings
stylesheets[all][] = aggregator.css stylesheets[all][] = aggregator.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = block.test files[] = block.test
configure = admin/structure/block configure = admin/structure/block
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -13,7 +13,7 @@ regions[footer] = Footer
regions[highlighted] = Highlighted regions[highlighted] = Highlighted
regions[help] = Help regions[help] = Help
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = blog.test files[] = blog.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ files[] = book.test
configure = admin/content/book/settings configure = admin/content/book/settings
stylesheets[all][] = book.css stylesheets[all][] = book.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = color.test files[] = color.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -9,7 +9,7 @@ files[] = comment.test
configure = admin/content/comment configure = admin/content/comment
stylesheets[all][] = comment.css stylesheets[all][] = comment.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = contact.test files[] = contact.test
configure = admin/structure/contact configure = admin/structure/contact
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = contextual.test files[] = contextual.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ files[] = dashboard.test
dependencies[] = block dependencies[] = block
configure = admin/dashboard/customize configure = admin/dashboard/customize
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = dblog.test files[] = dblog.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -213,14 +213,25 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form,
'#language' => $langcode, '#language' => $langcode,
'#field_parents' => $parents, '#field_parents' => $parents,
'#columns' => array_keys($field['columns']), '#columns' => array_keys($field['columns']),
// For multiple fields, title and description are handled by the wrapping table. '#title' => $title,
'#title' => $multiple ? '' : $title, '#description' => $description,
'#description' => $multiple ? '' : $description,
// Only the first widget should be required. // Only the first widget should be required.
'#required' => $delta == 0 && $instance['required'], '#required' => $delta == 0 && $instance['required'],
'#delta' => $delta, '#delta' => $delta,
'#weight' => $delta, '#weight' => $delta,
); );
// For multiple fields, title and description are handled by the wrapping
// table.
if ($multiple) {
if ($delta == 0) {
$element['#title'] = $title;
}
else {
$element['#title'] = t('!title (value @number)', array('@number' => $delta + 1, '!title' => $title));
}
$element['#title_display'] = 'invisible';
$element['#description'] = '';
}
if ($element = $function($form, $form_state, $field, $instance, $langcode, $items, $delta, $element)) { if ($element = $function($form, $form_state, $field, $instance, $langcode, $items, $delta, $element)) {
// Input field for the delta (drag-n-drop reordering). // Input field for the delta (drag-n-drop reordering).
if ($multiple) { if ($multiple) {

View File

@ -11,7 +11,7 @@ dependencies[] = field_sql_storage
required = TRUE required = TRUE
stylesheets[all][] = theme/field.css stylesheets[all][] = theme/field.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ dependencies[] = field
files[] = field_sql_storage.test files[] = field_sql_storage.test
required = TRUE required = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ dependencies[] = field
dependencies[] = options dependencies[] = options
files[] = tests/list.test files[] = tests/list.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = number.test files[] = number.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = options.test files[] = options.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ dependencies[] = field
files[] = text.test files[] = text.test
required = TRUE required = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -1810,6 +1810,27 @@ class FieldFormTestCase extends FieldTestCase {
// Test with several multiple fields in a form // Test with several multiple fields in a form
} }
/**
* Tests the position of the required label.
*/
public function testFieldFormUnlimitedRequired() {
$this->field = $this->field_unlimited;
$this->field_name = $this->field['field_name'];
$this->instance['field_name'] = $this->field_name;
$this->instance['required'] = TRUE;
field_create_field($this->field);
field_create_instance($this->instance);
// Display creation form -> 1 widget.
$this->drupalGet('test-entity/add/test-bundle');
$result = $this->xpath("//label[not(contains(@class, 'element-invisible')) and contains(text(), :label)]/span/text()", array(':label' => $this->instance['label']));
$this->assertEqual($result[0], '*', 'Required symbol added to field label.');
// Check that the label of the field input is visually hidden and contains
// the field title and an indication of the delta for a11y.
$result = $this->xpath("//label[contains(@class, 'element-invisible') and contains(text(), :label)]/span/text()", array(':label' => $this->instance['label']));
$this->assertEqual($result[0], '*', 'Required symbol and field label are visually hidden.');
}
/** /**
* Tests widget handling of multiple required radios. * Tests widget handling of multiple required radios.
*/ */

View File

@ -6,7 +6,7 @@ files[] = field_test.entity.inc
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = field_ui.test files[] = field_ui.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = tests/file.test files[] = tests/file.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ files[] = filter.test
required = TRUE required = TRUE
configure = admin/config/content/formats configure = admin/config/content/formats
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -9,7 +9,7 @@ files[] = forum.test
configure = admin/structure/forum configure = admin/structure/forum
stylesheets[all][] = forum.css stylesheets[all][] = forum.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = help.test files[] = help.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ dependencies[] = file
files[] = image.test files[] = image.test
configure = admin/config/media/image-styles configure = admin/config/media/image-styles
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = image_module_test.module files[] = image_module_test.module
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = locale.test files[] = locale.test
configure = admin/config/regional/language configure = admin/config/regional/language
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = menu.test files[] = menu.test
configure = admin/structure/menu configure = admin/structure/menu
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -222,6 +222,14 @@ class MenuTestCase extends DrupalWebTestCase {
$this->assertMenuLink($item2['mlid'], array('depth' => 2, 'has_children' => 1, 'p1' => $item1['mlid'], 'p2' => $item2['mlid'], 'p3' => 0)); $this->assertMenuLink($item2['mlid'], array('depth' => 2, 'has_children' => 1, 'p1' => $item1['mlid'], 'p2' => $item2['mlid'], 'p3' => 0));
$this->assertMenuLink($item3['mlid'], array('depth' => 3, 'has_children' => 0, 'p1' => $item1['mlid'], 'p2' => $item2['mlid'], 'p3' => $item3['mlid'], 'p4' => 0)); $this->assertMenuLink($item3['mlid'], array('depth' => 3, 'has_children' => 0, 'p1' => $item1['mlid'], 'p2' => $item2['mlid'], 'p3' => $item3['mlid'], 'p4' => 0));
// Add 102 menu links with increasing weights, then make sure the last-added
// item's weight doesn't get changed because of the old hardcoded delta = 50
$items = array();
for ($i = -50; $i <= 51; $i++) {
$items[$i] = $this->addMenuLink(0, 'node/' . $node1->nid, $menu_name, TRUE, strval($i));
}
$this->assertMenuLink($items[51]['mlid'], array('weight' => '51'));
// Verify menu links. // Verify menu links.
$this->verifyMenuLink($item1, $node1); $this->verifyMenuLink($item1, $node1);
$this->verifyMenuLink($item2, $node2, $item1, $node1); $this->verifyMenuLink($item2, $node2, $item1, $node1);
@ -286,15 +294,37 @@ class MenuTestCase extends DrupalWebTestCase {
$this->assertFieldByName('link_path', $path, 'Path no longer has query or fragment.'); $this->assertFieldByName('link_path', $path, 'Path no longer has query or fragment.');
} }
/**
* Tries to use the navigation menu as the source for secondary links.
*/
function testNavigationAsSecondaryMenu() {
$this->drupalLogin($this->big_user);
// Go to the menu settings page and make the navigation the source for the
// secondary menu.
$edit = array(
'menu_main_links_source' => 'main-menu',
'menu_secondary_links_source' => 'navigation',
);
$this->drupalGet('admin/structure/menu/settings');
$this->drupalPost(NULL, $edit, t('Save configuration'));
// Now visit the user page. There should be an 'Add content' link in the
// navigation block and one in the secondary menu.
$this->drupalGet('user');
$this->assertNoUniqueText(t('Add content'));
}
/** /**
* Add a menu link using the menu module UI. * Add a menu link using the menu module UI.
* *
* @param integer $plid Parent menu link id. * @param integer $plid Parent menu link id.
* @param string $link Link path. * @param string $link Link path.
* @param string $menu_name Menu name. * @param string $menu_name Menu name.
* @param string $weight Menu link weight
* @return array Menu link created. * @return array Menu link created.
*/ */
function addMenuLink($plid = 0, $link = '<front>', $menu_name = 'navigation', $expanded = TRUE) { function addMenuLink($plid = 0, $link = '<front>', $menu_name = 'navigation', $expanded = TRUE, $weight = '0') {
// View add menu link page. // View add menu link page.
$this->drupalGet("admin/structure/menu/manage/$menu_name/add"); $this->drupalGet("admin/structure/menu/manage/$menu_name/add");
$this->assertResponse(200); $this->assertResponse(200);
@ -307,7 +337,7 @@ class MenuTestCase extends DrupalWebTestCase {
'enabled' => TRUE, // Use this to disable the menu and test. 'enabled' => TRUE, // Use this to disable the menu and test.
'expanded' => $expanded, // Setting this to true should test whether it works when we do the std_user tests. 'expanded' => $expanded, // Setting this to true should test whether it works when we do the std_user tests.
'parent' => $menu_name . ':' . $plid, 'parent' => $menu_name . ':' . $plid,
'weight' => '0', 'weight' => $weight,
); );
// Add menu link. // Add menu link.
@ -604,6 +634,50 @@ class MenuTestCase extends DrupalWebTestCase {
$this->assertText(t('Menus'), 'Add menu node was displayed'); $this->assertText(t('Menus'), 'Add menu node was displayed');
} }
} }
/**
* Tests that menu admin lists can include menu items for unpublished nodes.
*/
function testUnpublishedNodeMenuItem() {
// Log in as an administrator who can view unpublished nodes.
$menu_and_node_admin_user = $this->drupalCreateUser(array(
'bypass node access',
'administer menu',
));
$this->drupalLogin($menu_and_node_admin_user);
// Create an unpublished node with a menu link.
$title = $this->randomName();
$node = $this->drupalCreateNode(array(
'type' => 'article',
'title' => $title,
'status' => NODE_NOT_PUBLISHED,
));
$edit = array(
'link_path' => 'node/' . $node->nid,
'link_title' => $title,
'description' => '',
'enabled' => TRUE,
'expanded' => TRUE,
'parent' => 'navigation:0',
'weight' => '0',
);
$this->drupalPost('admin/structure/menu/manage/navigation/add', $edit, t('Save'));
// Verify that the administrator can see the menu link (with a label
// indicating that it is unpublished) on the menu management page.
$this->drupalGet('admin/structure/menu/manage/navigation');
$this->assertText($title . ' (unpublished)', 'Menu link to unpublished node is visible to users with "bypass node access" permission.');
// Verify that a user who cannot view unpublished nodes does not see the
// menu link on the menu management page.
$menu_admin_user = $this->drupalCreateUser(array('administer menu'));
$this->drupalLogin($menu_admin_user);
$this->drupalGet('admin/structure/menu/manage/navigation');
$this->assertResponse(200);
$this->assertNoText($title, 'Menu link to unpublished node is not visible to users without the "bypass node access" permission.');
}
} }
/** /**
@ -758,4 +832,5 @@ class MenuNodeTestCase extends DrupalWebTestCase {
$options = $this->xpath('//select[@id=:id]//option[@value=:option]', array(':id' => $id, ':option' => $option)); $options = $this->xpath('//select[@id=:id]//option[@value=:option]', array(':id' => $id, ':option' => $option));
return $this->assertTrue(isset($selects[0]) && !isset($options[0]), $message ? $message : t('Option @option for field @id does not exist.', array('@option' => $option, '@id' => $id)), t('Browser')); return $this->assertTrue(isset($selects[0]) && !isset($options[0]), $message ? $message : t('Option @option for field @id does not exist.', array('@option' => $option, '@id' => $id)), t('Browser'));
} }
} }

View File

@ -417,14 +417,16 @@ function node_type_delete_confirm($form, &$form_state, $type) {
$form['name'] = array('#type' => 'value', '#value' => $type->name); $form['name'] = array('#type' => 'value', '#value' => $type->name);
$message = t('Are you sure you want to delete the content type %type?', array('%type' => $type->name)); $message = t('Are you sure you want to delete the content type %type?', array('%type' => $type->name));
$caption = '';
$num_nodes = db_query("SELECT COUNT(*) FROM {node} WHERE type = :type", array(':type' => $type->type))->fetchField(); $num_nodes = db_query("SELECT COUNT(*) FROM {node} WHERE type = :type", array(':type' => $type->type))->fetchField();
if ($num_nodes) { if ($num_nodes) {
$caption .= '<p>' . format_plural($num_nodes, '%type is used by 1 piece of content on your site. If you remove this content type, you will not be able to edit the %type content and it may not display correctly.', '%type is used by @count pieces of content on your site. If you remove %type, you will not be able to edit the %type content and it may not display correctly.', array('%type' => $type->name)) . '</p>'; drupal_set_title($message, PASS_THROUGH);
$caption = '<p>' . format_plural($num_nodes, '%type is used by 1 piece of content on your site. You cannot remove this content type until you have removed all of the %type content.', '%type is used by @count pieces of content on your site. You cannot remove this content type until you have removed all of the %type content.', array('%type' => $type->name)) . '</p>';
$form['description'] = array('#markup' => $caption);
return $form;
} }
$caption .= '<p>' . t('This action cannot be undone.') . '</p>'; $caption = '<p>' . t('This action cannot be undone.') . '</p>';
return confirm_form($form, $message, 'admin/structure/types', $caption, t('Delete')); return confirm_form($form, $message, 'admin/structure/types', $caption, t('Delete'));
} }

View File

@ -9,7 +9,7 @@ required = TRUE
configure = admin/structure/types configure = admin/structure/types
stylesheets[all][] = node.css stylesheets[all][] = node.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -3055,18 +3055,12 @@ function node_access($op, $node, $account = NULL) {
$query->condition($nids); $query->condition($nids);
$query->range(0, 1); $query->range(0, 1);
$grants = db_or(); $grants = node_add_node_grants_to_query(node_access_grants($op, $account));
foreach (node_access_grants($op, $account) as $realm => $gids) {
foreach ($gids as $gid) {
$grants->condition(db_and()
->condition('gid', $gid)
->condition('realm', $realm)
);
}
}
if (count($grants) > 0) { if (count($grants) > 0) {
$query->condition($grants); $query->condition($grants);
} }
$result = (bool) $query $result = (bool) $query
->execute() ->execute()
->fetchField(); ->fetchField();
@ -3084,6 +3078,31 @@ function node_access($op, $node, $account = NULL) {
return FALSE; return FALSE;
} }
/**
* Helper function to create the or condition for a node grants check.
*
* @param $account
* The grants to add to the query, usually gotten via node_access_grants().
* @param $table_alias
* Optional, the alias to the node access table.
*
* @return
* TRUE if the operation may be performed, FALSE otherwise.
*/
function node_add_node_grants_to_query($node_access_grants, $table_alias = '') {
$grants = db_or();
$prefix = $table_alias ? $table_alias . '.' : '';
foreach ($node_access_grants as $realm => $gids) {
if (!empty($gids)) {
$grants->condition(db_and()
->condition($prefix . 'gid', $gids, 'IN')
->condition($prefix . 'realm', $realm)
);
}
}
return $grants;
}
/** /**
* Implements hook_node_access(). * Implements hook_node_access().
*/ */
@ -3252,15 +3271,8 @@ function node_access_view_all_nodes($account = NULL) {
->condition('nid', 0) ->condition('nid', 0)
->condition('grant_view', 1, '>='); ->condition('grant_view', 1, '>=');
$grants = db_or(); $grants = node_add_node_grants_to_query(node_access_grants('view', $account));
foreach (node_access_grants('view', $account) as $realm => $gids) {
foreach ($gids as $gid) {
$grants->condition(db_and()
->condition('gid', $gid)
->condition('realm', $realm)
);
}
}
if (count($grants) > 0 ) { if (count($grants) > 0 ) {
$query->condition($grants); $query->condition($grants);
} }
@ -3422,17 +3434,7 @@ function _node_query_node_access_alter($query, $type) {
$subquery = db_select('node_access', 'na') $subquery = db_select('node_access', 'na')
->fields('na', array('nid')); ->fields('na', array('nid'));
$grant_conditions = db_or(); $grant_conditions = node_add_node_grants_to_query($grants, 'na');
// If any grant exists for the specified user, then user has access
// to the node for the specified operation.
foreach ($grants as $realm => $gids) {
foreach ($gids as $gid) {
$grant_conditions->condition(db_and()
->condition('na.gid', $gid)
->condition('na.realm', $realm)
);
}
}
// Attach conditions to the subquery for nodes. // Attach conditions to the subquery for nodes.
if (count($grant_conditions->conditions())) { if (count($grant_conditions->conditions())) {

View File

@ -1614,6 +1614,48 @@ class NodeTypeTestCase extends DrupalWebTestCase {
$this->assertTrue(isset($types[$type]->disabled) && empty($types[$type]->disabled), format_string('%type type is enabled.', array('%type' => $type))); $this->assertTrue(isset($types[$type]->disabled) && empty($types[$type]->disabled), format_string('%type type is enabled.', array('%type' => $type)));
} }
} }
/**
* Tests deleting a content type that still has content.
*/
function testNodeTypeDeletion() {
// Create a content type programmatically.
$type = $this->drupalCreateContentType();
// Log in a test user.
$web_user = $this->drupalCreateUser(array(
'bypass node access',
'administer content types',
));
$this->drupalLogin($web_user);
// Add a new node of this type.
$node = $this->drupalCreateNode(array('type' => $type->type));
// Attempt to delete the content type, which should not be allowed.
$this->drupalGet('admin/structure/types/manage/' . $type->name . '/delete');
$this->assertRaw(
t(
'%type is used by 1 piece of content on your site. You cannot remove this content type until you have removed all of the %type content.',
array('%type' => $type->name)
),
'The content type will not be deleted until all nodes of that type are removed.'
);
$this->assertNoText(t('This action cannot be undone.'), 'The node type deletion confirmation form is not available.');
// Delete the node.
node_delete($node->nid);
// Attempt to delete the content type, which should now be allowed.
$this->drupalGet('admin/structure/types/manage/' . $type->name . '/delete');
$this->assertRaw(
t(
'Are you sure you want to delete the content type %type?',
array('%type' => $type->name)
),
'The content type is available for deletion.'
);
$this->assertText(t('This action cannot be undone.'), 'The node type deletion confirmation form is available.');
}
} }
/** /**

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Core
core = 7.x core = 7.x
files[] = openid.test files[] = openid.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
dependencies[] = openid dependencies[] = openid
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -4,7 +4,7 @@ package = Core
version = VERSION version = VERSION
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -11,7 +11,11 @@
* When filter key passed, perform a standard search on the given key, * When filter key passed, perform a standard search on the given key,
* and return the list of matching URL aliases. * and return the list of matching URL aliases.
*/ */
function path_admin_overview($keys = NULL) { function path_admin_overview() {
// Get search keys.
$args = func_get_args();
$keys = implode('/', $args);
// Add the filter form above the overview table. // Add the filter form above the overview table.
$build['path_admin_filter_form'] = drupal_get_form('path_admin_filter_form', $keys); $build['path_admin_filter_form'] = drupal_get_form('path_admin_filter_form', $keys);
// Enable language column if locale is enabled or if we have any alias with language // Enable language column if locale is enabled or if we have any alias with language

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = path.test files[] = path.test
configure = admin/config/search/path configure = admin/config/search/path
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -107,6 +107,55 @@ class PathTestCase extends DrupalWebTestCase {
$this->drupalGet($edit['alias']); $this->drupalGet($edit['alias']);
$this->assertNoText($node1->title, 'Alias was successfully deleted.'); $this->assertNoText($node1->title, 'Alias was successfully deleted.');
$this->assertResponse(404); $this->assertResponse(404);
// Create third and fourth test node.
$node3 = $this->drupalCreateNode();
$node4 = $this->drupalCreateNode();
// Give the node aliases a common first part.
$name = $this->randomName(4);
// Create aliases containing a slash.
$edit = array();
$edit['source'] = 'node/' . $node3->nid;
$alias3 = $name . '/' . $this->randomName(5);
$edit['alias'] = $alias3;
$this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
$edit['source'] = 'node/' . $node4->nid;
$alias4 = $name . '/' . $this->randomName(4);
$edit['alias'] = $alias4;
$this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
// Confirm that the aliases work.
$this->drupalGet($alias3);
$this->assertText($node3->title, 'Alias works.');
$this->assertResponse(200);
$this->drupalGet($alias4);
$this->assertText($node4->title, 'Alias works.');
$this->assertResponse(200);
// Confirm that filters containing slashes work.
$this->drupalGet('admin/config/search/path/list/' . $alias3);
$this->assertFieldByName('filter', $alias3);
$this->assertText($alias3, 'Searched-for alias with slash found.');
$this->assertNoText($alias4, 'Different alias with slash not found.');
$this->assertResponse(200);
// Delete aliases.
$pid = $this->getPID($alias3);
$this->drupalPost('admin/config/search/path/edit/' . $pid, array(), t('Delete'));
$this->drupalPost(NULL, array(), t('Confirm'));
$pid = $this->getPID($alias4);
$this->drupalPost('admin/config/search/path/edit/' . $pid, array(), t('Delete'));
$this->drupalPost(NULL, array(), t('Confirm'));
// Confirm that the aliases no longer work.
$this->drupalGet($alias3);
$this->assertNoText($node3->title, 'Alias was successfully deleted.');
$this->assertResponse(404);
$this->drupalGet($alias4);
$this->assertNoText($node4->title, 'Alias was successfully deleted.');
$this->assertResponse(404);
} }
/** /**

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = php.test files[] = php.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = poll.test files[] = poll.test
stylesheets[all][] = poll.css stylesheets[all][] = poll.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -11,7 +11,7 @@ configure = admin/config/people/profile
; See user_system_info_alter(). ; See user_system_info_alter().
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
files[] = rdf.test files[] = rdf.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
hidden = TRUE hidden = TRUE
dependencies[] = blog dependencies[] = blog
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -8,7 +8,7 @@ files[] = search.test
configure = admin/config/search/settings configure = admin/config/search/settings
stylesheets[all][] = search.css stylesheets[all][] = search.css
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = shortcut.test files[] = shortcut.test
configure = admin/config/user-interface/shortcut configure = admin/config/user-interface/shortcut
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -51,6 +51,20 @@ abstract class DrupalTestCase {
*/ */
protected $timeLimit = 500; protected $timeLimit = 500;
/**
* Whether to cache the installation part of the setUp() method.
*
* @var bool
*/
public $useSetupInstallationCache = FALSE;
/**
* Whether to cache the modules installation part of the setUp() method.
*
* @var bool
*/
public $useSetupModulesCache = FALSE;
/** /**
* Current results of this test case. * Current results of this test case.
* *
@ -1448,6 +1462,159 @@ class DrupalWebTestCase extends DrupalTestCase {
$this->setupEnvironment = TRUE; $this->setupEnvironment = TRUE;
} }
/**
* Copies the cached tables and files for a cached installation setup.
*
* @param string $cache_key_prefix
* (optional) Additional prefix for the cache key.
*
* @return bool
* TRUE when the cache was usable and loaded, FALSE when cache was not
* available.
*
* @see DrupalWebTestCase::setUp()
*/
protected function loadSetupCache($cache_key_prefix = '') {
$cache_key = $this->getSetupCacheKey($cache_key_prefix);
$cache_file = $this->originalFileDirectory . '/simpletest/' . $cache_key . '/simpletest-cache-setup';
if (file_exists($cache_file)) {
return $this->copySetupCache($cache_key, substr($this->databasePrefix, 10));
}
return FALSE;
}
/**
* Returns the cache key used for the setup caching.
*
* @param string $cache_key_prefix
* (optional) Additional prefix for the cache key.
*
* @return string
* The cache key to use, by default only based on the profile used by the
* test.
*/
protected function getSetupCacheKey($cache_key_prefix = '') {
// The cache key needs to start with a numeric character, so that the cached
// installation gets cleaned up properly.
$cache_key_prefix = hash('crc32b', $cache_key_prefix . $this->profile);
return '1c' . $cache_key_prefix;
}
/**
* Store the installation setup to a cache.
*
* @param string $cache_key_prefix
* (optional) Additional prefix for the cache key.
*
* @return bool
* TRUE if the installation was stored in the cache, FALSE otherwise.
*/
protected function storeSetupCache($cache_key_prefix = '') {
$cache_key = $this->getSetupCacheKey($cache_key_prefix);
$lock_key = 'simpletest_store_cache_' . $cache_key . '_' . $this->testId;
// All concurrent tests share the same test id. Therefore it is possible to
// use the lock to ensure that only one process will store the cache. This
// is important as else DB tables created by one process could be deleted
// by another as the cache copying is idempotent.
if (! lock_acquire($lock_key)) {
return FALSE;
}
// Try to copy the installation to the setup cache - now that we have a
// lock to do so.
if (!$this->copySetupCache(substr($this->databasePrefix, 10), $cache_key)) {
// It is non-fatal if the cache cannot be copied as the next test run
// will try it again.
$this->assert('debug', t('Storing cache with key @key failed', array('@key' => $cache_key)), 'storeSetupCache');
lock_release($lock_key);
return FALSE;
}
// Inform others that this cache is usable now.
$cache_file = $this->originalFileDirectory . '/simpletest/' . $cache_key . '/simpletest-cache-setup';
file_put_contents($cache_file, time(NULL));
lock_release($lock_key);
return TRUE;
}
/**
* Copy the setup cache from/to another table and files directory.
*
* @param string $from
* The prefix_id / cache_key from where to copy.
* @param string $to
* The prefix_id / cache_key to where to copy.
*
* @return bool
* TRUE if the setup cache was copied to the current installation, FALSE
* otherwise.
*/
protected function copySetupCache($from, $to) {
$from_prefix = 'simpletest' . $from;
$to_prefix = 'simpletest' . $to;
try {
$tables = db_query("SHOW TABLES LIKE :prefix", array(':prefix' => db_like($from_prefix) . '%' ))->fetchCol();
if (count($tables) == 0) {
return FALSE;
}
foreach ($tables as $from_table) {
$table = substr($from_table, strlen($from_prefix));
$to_table = $to_prefix . $table;
// Remove the table in case the copying process was interrupted.
db_query('DROP TABLE IF EXISTS ' . $to_table);
db_query('CREATE TABLE ' . $to_table . ' LIKE ' . $from_table);
db_query('ALTER TABLE ' . $to_table . ' DISABLE KEYS');
db_query('INSERT ' . $to_table . ' SELECT * FROM ' . $from_table);
db_query('ALTER TABLE ' . $to_table . ' ENABLE KEYS');
}
}
catch (Exception $e) {
return FALSE;
}
$from_dir = $this->originalFileDirectory . '/simpletest/' . $from;
$to_dir = $this->originalFileDirectory . '/simpletest/' . $to;
$this->recursiveDirectoryCopy($from_dir, $to_dir);
return TRUE;
}
/**
* Recursively copy one directory to another.
*
* @param $src
* The source directory.
* @param $dest
* The destination directory.
*/
protected function recursiveDirectoryCopy($src, $dst) {
$dir = opendir($src);
if (!file_exists($dst)){
mkdir($dst);
}
while (($file = readdir($dir)) !== FALSE) {
if ($file != '.' && $file != '..') {
if (is_dir($src . '/' . $file)) {
$this->recursiveDirectoryCopy($src . '/' . $file, $dst . '/' . $file);
}
else {
copy($src . '/' . $file, $dst . '/' . $file);
}
}
}
closedir($dir);
}
/** /**
* Sets up a Drupal site for running functional and integration tests. * Sets up a Drupal site for running functional and integration tests.
* *
@ -1501,57 +1668,108 @@ class DrupalWebTestCase extends DrupalTestCase {
// profile's hook_install() and other hook implementations are never invoked. // profile's hook_install() and other hook implementations are never invoked.
$conf['install_profile'] = $this->profile; $conf['install_profile'] = $this->profile;
// Perform the actual Drupal installation. $has_installation_cache = FALSE;
include_once DRUPAL_ROOT . '/includes/install.inc'; $has_modules_cache = FALSE;
drupal_install_system();
$this->preloadRegistry(); if ($this->useSetupModulesCache) {
$modules = func_get_args();
// Modules can be either one parameter or multiple.
if (isset($modules[0]) && is_array($modules[0])) {
$modules = $modules[0];
}
$modules = array_unique($modules);
sort($modules);
// Set path variables. $modules_cache_key_prefix = hash('crc32b', serialize($modules)) . '_';
variable_set('file_public_path', $this->public_files_directory); $has_modules_cache = $this->loadSetupCache($modules_cache_key_prefix);
variable_set('file_private_path', $this->private_files_directory);
variable_set('file_temporary_path', $this->temp_files_directory);
// Set the 'simpletest_parent_profile' variable to add the parent profile's
// search path to the child site's search paths.
// @see drupal_system_listing()
// @todo This may need to be primed like 'install_profile' above.
variable_set('simpletest_parent_profile', $this->originalProfile);
// Include the testing profile.
variable_set('install_profile', $this->profile);
$profile_details = install_profile_info($this->profile, 'en');
// Install the modules specified by the testing profile.
module_enable($profile_details['dependencies'], FALSE);
// Install modules needed for this test. This could have been passed in as
// either a single array argument or a variable number of string arguments.
// @todo Remove this compatibility layer in Drupal 8, and only accept
// $modules as a single array argument.
$modules = func_get_args();
if (isset($modules[0]) && is_array($modules[0])) {
$modules = $modules[0];
}
if ($modules) {
$success = module_enable($modules, TRUE);
$this->assertTrue($success, t('Enabled modules: %modules', array('%modules' => implode(', ', $modules))));
} }
// Run the profile tasks. if (!$has_modules_cache && $this->useSetupInstallationCache) {
$install_profile_module_exists = db_query("SELECT 1 FROM {system} WHERE type = 'module' AND name = :name", array( $has_installation_cache = $this->loadSetupCache();
':name' => $this->profile,
))->fetchField();
if ($install_profile_module_exists) {
module_enable(array($this->profile), FALSE);
} }
// Reset/rebuild all data structures after enabling the modules. if ($has_modules_cache || $has_installation_cache) {
$this->resetAll(); // Reset path variables.
variable_set('file_public_path', $this->public_files_directory);
variable_set('file_private_path', $this->private_files_directory);
variable_set('file_temporary_path', $this->temp_files_directory);
$this->refreshVariables();
// Run cron once in that environment, as install.php does at the end of // Load all enabled modules
// the installation process. module_load_all();
drupal_cron_run();
$this->pass(t('Using cache: @cache (@key)', array(
'@cache' => $has_modules_cache ? t('Modules Cache') : t('Installation Cache'),
'@key' => $this->getSetupCacheKey($has_modules_cache ? $modules_cache_key_prefix : ''),
)));
}
else {
// Perform the actual Drupal installation.
include_once DRUPAL_ROOT . '/includes/install.inc';
drupal_install_system();
$this->preloadRegistry();
// Set path variables.
variable_set('file_public_path', $this->public_files_directory);
variable_set('file_private_path', $this->private_files_directory);
variable_set('file_temporary_path', $this->temp_files_directory);
// Set the 'simpletest_parent_profile' variable to add the parent profile's
// search path to the child site's search paths.
// @see drupal_system_listing()
// @todo This may need to be primed like 'install_profile' above.
variable_set('simpletest_parent_profile', $this->originalProfile);
// Include the testing profile.
variable_set('install_profile', $this->profile);
$profile_details = install_profile_info($this->profile, 'en');
// Install the modules specified by the testing profile.
module_enable($profile_details['dependencies'], FALSE);
if ($this->useSetupInstallationCache) {
$this->storeSetupCache();
}
}
if (!$has_modules_cache) {
// Install modules needed for this test. This could have been passed in as
// either a single array argument or a variable number of string arguments.
// @todo Remove this compatibility layer in Drupal 8, and only accept
// $modules as a single array argument.
$modules = func_get_args();
if (isset($modules[0]) && is_array($modules[0])) {
$modules = $modules[0];
}
if ($modules) {
$success = module_enable($modules, TRUE);
$this->assertTrue($success, t('Enabled modules: %modules', array('%modules' => implode(', ', $modules))));
}
// Run the profile tasks.
$install_profile_module_exists = db_query("SELECT 1 FROM {system} WHERE type = 'module' AND name = :name", array(
':name' => $this->profile,
))->fetchField();
if ($install_profile_module_exists) {
module_enable(array($this->profile), FALSE);
}
// Reset/rebuild all data structures after enabling the modules.
$this->resetAll();
// Run cron once in that environment, as install.php does at the end of
// the installation process.
drupal_cron_run();
if ($this->useSetupModulesCache) {
$this->storeSetupCache($modules_cache_key_prefix);
}
}
else {
// Reset/rebuild all data structures after enabling the modules.
$this->resetAll();
}
// Ensure that the session is not written to the new environment and replace // Ensure that the session is not written to the new environment and replace
// the global $user session with uid 1 from the new test site. // the global $user session with uid 1 from the new test site.

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.test1{display:block;}html .clear-block{height:1%;}.clear-block{display:block;font:italic bold 12px/30px Georgia,serif;}.test2{display:block;}.bkslshv1{background-color:#C00;}.test3{display:block;}.test4{display:block;}.comment-in-double-quotes:before{content:"/* ";}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-double-quotes:after{content:" */";}.comment-in-single-quotes:before{content:'/*';}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-single-quotes:after{content:'*/';}.comment-in-mixed-quotes:before{content:'"/*"';}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-mixed-quotes:after{content:"'*/'";}.comment-in-quotes-with-escaped:before{content:'/* \" \' */';}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-quotes-with-escaped:after{content:"*/ \" \ '";} .test1{display:block;}img[style*="float: right"]{padding-left:5px;}html .clear-block{height:1%;}.clear-block{display:block;font:italic bold 12px/30px Georgia,serif;}.test2{display:block;}.bkslshv1{background-color:#C00;}.test3{display:block;}.test4{display:block;}.comment-in-double-quotes:before{content:"/* ";}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-double-quotes:after{content:" */";}.comment-in-single-quotes:before{content:'/*';}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-single-quotes:after{content:'*/';}.comment-in-mixed-quotes:before{content:'"/*"';}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-mixed-quotes:after{content:"'*/'";}.comment-in-quotes-with-escaped:before{content:'/* \" \' */';}.this_rule_must_stay{color:#F00;background-color:#FFF;}.comment-in-quotes-with-escaped:after{content:"*/ \" \ '";}

View File

@ -1,4 +1,4 @@
body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this
.is .is
.a .a
.test{font:1em/100% Verdana,sans-serif;color:#494949;}some :pseudo .thing{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;filter:progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10');-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10')";}::-moz-selection{background:#000;color:#fff;}::selection{background:#000;color:#fff;}@media print{*{background:#000 !important;color:#fff !important;}@page{margin:0.5cm;}}@media screen and (max-device-width:480px){background:#000;color:#fff;}textarea,select{font:1em/160% Verdana,sans-serif;color:#494949;} .test{font:1em/100% Verdana,sans-serif;color:#494949;}some :pseudo .thing{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;filter:progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10');-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10')";}::-moz-selection{background:#000;color:#fff;}::selection{background:#000;color:#fff;}@media print{*{background:#000 !important;color:#fff !important;}@page{margin:0.5cm;}}@media screen and (max-device-width:480px){background:#000;color:#fff;}textarea,select{font:1em/160% Verdana,sans-serif;color:#494949;}

View File

@ -0,0 +1,31 @@
/* Example from https://www.w3.org/TR/CSS2/syndata.html#rule-sets */
q[example="public class foo\
{\
private int x;\
\
foo(int x) {\
this.x = x;\
}\
\
}"] { color: red }
/* A pseudo selector with essential whitespace wrapped in quotes. */
q[style*="quotes: none"] {
quotes: none;
}
q[style*='quotes: none'] {
quotes: none;
}
q:after {
content: ": colon & escaped double \" quotes \".";
}
q:after {
content: ' (brackets & escaped single \' quotes \') ';
}
q:after {
content: "I'm Quote";
}

View File

@ -0,0 +1,9 @@
q[example="public class foo\
{\
private int x;\
\
foo(int x) {\
this.x = x;\
}\
\
}"]{color:red}q[style*="quotes: none"]{quotes:none;}q[style*='quotes: none']{quotes:none;}q:after{content:": colon & escaped double \" quotes \".";}q:after{content:' (brackets & escaped single \' quotes \') ';}q:after{content:"I'm Quote";}

View File

@ -0,0 +1,31 @@
/* Example from https://www.w3.org/TR/CSS2/syndata.html#rule-sets */
q[example="public class foo\
{\
private int x;\
\
foo(int x) {\
this.x = x;\
}\
\
}"] { color: red }
/* A pseudo selector with essential whitespace wrapped in quotes. */
q[style*="quotes: none"] {
quotes: none;
}
q[style*='quotes: none'] {
quotes: none;
}
q:after {
content: ": colon & escaped double \" quotes \".";
}
q:after {
content: ' (brackets & escaped single \' quotes \') ';
}
q:after {
content: "I'm Quote";
}

View File

@ -58,7 +58,7 @@ files[] = tests/upgrade/update.trigger.test
files[] = tests/upgrade/update.field.test files[] = tests/upgrade/update.field.test
files[] = tests/upgrade/update.user.test files[] = tests/upgrade/update.user.test
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -592,7 +592,8 @@ function simpletest_clean_temporary_directories() {
$files = scandir('public://simpletest'); $files = scandir('public://simpletest');
foreach ($files as $file) { foreach ($files as $file) {
$path = 'public://simpletest/' . $file; $path = 'public://simpletest/' . $file;
if (is_dir($path) && is_numeric($file)) { // Ensure that cache directories are cleaned as well.
if (is_dir($path) && (is_numeric($file) || strpos($file, '1c') === 0)) {
file_unmanaged_delete_recursive($path); file_unmanaged_delete_recursive($path);
$count++; $count++;
} }

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -1069,7 +1069,8 @@ class CascadingStylesheetsUnitTest extends DrupalUnitTestCase {
'css_input_without_import.css', 'css_input_without_import.css',
'css_input_with_import.css', 'css_input_with_import.css',
'css_subfolder/css_input_with_import.css', 'css_subfolder/css_input_with_import.css',
'comment_hacks.css' 'comment_hacks.css',
'quotes.css',
); );
$path = drupal_get_path('module', 'simpletest') . '/files/css_test_files'; $path = drupal_get_path('module', 'simpletest') . '/files/css_test_files';
foreach ($testfiles as $file) { foreach ($testfiles as $file) {
@ -3244,3 +3245,55 @@ class DrupalGetQueryArrayTestCase extends DrupalWebTestCase {
} }
} }
/**
* Test for block_interest_cohort.
*/
class BlockInterestCohortTest extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Block Interest Cohort',
'description' => 'Check Permissions-Policy header to disable Google FLoC',
'group' => 'System',
);
}
function setUp() {
parent::setUp('common_test');
}
/**
* Tests that FLoC is blocked by default.
*/
function testDefaultBlocking() {
$this->drupalGet('node');
$this->assertEqual($this->drupalGetHeader('Permissions-Policy'), 'interest-cohort=()', 'FLoC is blocked by default.');
}
/**
* Tests that an existing interest-cohort policy is not overwritten.
*/
function testExistingInterestCohortPolicy() {
$this->drupalGet('common-test/existing_interest_cohort_policy');
$this->assertEqual($this->drupalGetHeader('Permissions-Policy'), 'interest-cohort=*', 'Existing interest-cohort policy is not overwritten.');
}
/**
* Tests that an existing header is appended to correctly.
*/
function testExistingPolicyHeader() {
$this->drupalGet('common-test/existing_permissions_policy_header');
$this->assertTrue((strpos($this->drupalGetHeader('Permissions-Policy'), 'geolocation=(),interest-cohort=()') !== FALSE), 'The existing header is appended to.');
}
/**
* Tests that FLoC blocking can be disabled.
*/
function testDisableBlocking() {
variable_set('block_interest_cohort', FALSE);
$this->drupalGet('node');
$this->assertFalse($this->drupalGetHeader('Permissions-Policy'), 'FLoC blocking can be disabled.');
}
}

View File

@ -7,7 +7,7 @@ stylesheets[all][] = common_test.css
stylesheets[print][] = common_test.print.css stylesheets[print][] = common_test.print.css
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -52,6 +52,18 @@ function common_test_menu() {
'access arguments' => array('access content'), 'access arguments' => array('access content'),
'type' => MENU_CALLBACK, 'type' => MENU_CALLBACK,
); );
$items['common-test/existing_interest_cohort_policy'] = array(
'title' => 'Test existing interest-cohort policy',
'page callback' => 'existing_interest_cohort_policy',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
$items['common-test/existing_permissions_policy_header'] = array(
'title' => 'Test existing Permissions-Policy header',
'page callback' => 'existing_permissions_policy_header',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items; return $items;
} }
@ -286,3 +298,19 @@ function common_test_js_and_css_querystring() {
function common_test_cron() { function common_test_cron() {
throw new Exception(t('Uncaught exception')); throw new Exception(t('Uncaught exception'));
} }
/**
* Page callback.
*/
function existing_interest_cohort_policy() {
drupal_add_http_header('Permissions-Policy', 'interest-cohort=*');
print __FUNCTION__;
}
/**
* Page callback.
*/
function existing_permissions_policy_header() {
drupal_add_http_header('Permissions-Policy', 'geolocation=()');
print __FUNCTION__;
}

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -7,7 +7,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
dependencies[] = entity_cache_test_dependency dependencies[] = entity_cache_test_dependency
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -6,7 +6,7 @@ core = 7.x
files[] = file_test.module files[] = file_test.module
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -852,6 +852,12 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase {
$this->assertEqual($elements[0]['title'], 'Checkboxes test' . ' (' . t('Required') . ')', 'Title attribute found.'); $this->assertEqual($elements[0]['title'], 'Checkboxes test' . ' (' . t('Required') . ')', 'Title attribute found.');
$elements = $this->xpath('//div[@id="edit-form-radios-title-attribute"]'); $elements = $this->xpath('//div[@id="edit-form-radios-title-attribute"]');
$this->assertEqual($elements[0]['title'], 'Radios test' . ' (' . t('Required') . ')', 'Title attribute found.'); $this->assertEqual($elements[0]['title'], 'Radios test' . ' (' . t('Required') . ')', 'Title attribute found.');
// Check that empty name attribute is not printed on buttons.
$elements = $this->xpath('//input[@id="edit-form-button-with-name"]');
$this->assertTrue($elements[0]['name'] == 'op', 'Name attribute found.');
$elements = $this->xpath('//input[@id="edit-form-button-without-name"]');
$this->assertFalse(isset($elements[0]['name']), 'No name attribute found.');
} }
} }

View File

@ -5,7 +5,7 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2021-04-21 ; Information added by Drupal.org packaging script on 2021-06-02
version = "7.80" version = "7.81"
project = "drupal" project = "drupal"
datestamp = "1619021862" datestamp = "1622633234"

View File

@ -1022,6 +1022,16 @@ function form_label_test_form() {
'#title_display' => 'attribute', '#title_display' => 'attribute',
'#required' => TRUE, '#required' => TRUE,
); );
// Button elements with and without name attribute.
$form['form_button_with_name'] = array(
'#type' => 'button',
'#value' => t('Button with name'),
);
$form['form_button_without_name'] = array(
'#type' => 'button',
'#value' => t('Button without name'),
'#name' => '',
);
return $form; return $form;
} }

Some files were not shown because too many files have changed in this diff Show More