From 94c8cf583d3c4c9785621c2237d24677703bc8b0 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Thu, 7 May 2015 00:15:00 -0400 Subject: [PATCH 01/77] Back to 7.x-dev --- CHANGELOG.txt | 3 +++ includes/bootstrap.inc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dbe104f9e6c..8548c81791b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,7 @@ +Drupal 7.38, xxxx-xx-xx (development version) +----------------------- + Drupal 7.37, 2015-05-07 ----------------------- - Fixed a regression in Drupal 7.36 which caused certain kinds of content types diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index b572cde9294..847bfc3a25d 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -8,7 +8,7 @@ /** * The current system version. */ -define('VERSION', '7.37'); +define('VERSION', '7.38-dev'); /** * Core API compatibility. From 98bd1123eae143d97e5274544fc03abd6d289f20 Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Thu, 14 May 2015 08:31:38 -0700 Subject: [PATCH 02/77] Issue #2425325 by cleaver, JacobSanford: Batch API example code has wrong finished callback --- includes/form.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/form.inc b/includes/form.inc index 306747bae8c..88ef304150a 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -4409,7 +4409,7 @@ function element_validate_number($element, &$form_state) { * * Sample callback_batch_finished(): * @code - * function batch_test_finished($success, $results, $operations) { + * function my_finished_callback($success, $results, $operations) { * // The 'success' parameter means no fatal PHP errors were detected. All * // other error management should be handled using 'results'. * if ($success) { From 49908edcf7742f6807d72b3b42a9413d95dd1c31 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 1 Jun 2015 18:30:21 -0400 Subject: [PATCH 03/77] Issue #667058 followup by TwoD: Fix "JavaScript" typo in sites/all/libraries/README.txt. --- sites/all/libraries/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/all/libraries/README.txt b/sites/all/libraries/README.txt index d027ec24f9a..de5d585731f 100644 --- a/sites/all/libraries/README.txt +++ b/sites/all/libraries/README.txt @@ -1,2 +1,2 @@ This directory should be used to place downloaded and custom libraries (such as -Javascript libraries) which are used by contributed or custom modules. +JavaScript libraries) which are used by contributed or custom modules. From dc84091add715ca4abe4aa80fc32d27fe155ad4c Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Thu, 4 Jun 2015 07:31:10 -0700 Subject: [PATCH 04/77] Issue #2500101 by David_Rothstein: sites/all/modules/README.txt should not imply that clearing caches always works after moving a module to a new subdirectory --- sites/all/modules/README.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sites/all/modules/README.txt b/sites/all/modules/README.txt index c72b43e4fb8..6d019e762ae 100644 --- a/sites/all/modules/README.txt +++ b/sites/all/modules/README.txt @@ -6,7 +6,8 @@ Drupal community may be downloaded at http://drupal.org/project/modules. It is safe to organize modules into subdirectories, such as "contrib" for contributed modules, and "custom" for custom modules. Note that if you move a module to a subdirectory after it has been enabled, you may need to clear the -Drupal cache so that it can be found. +Drupal cache so that it can be found. (Alternatively, you can disable the +module before moving it and then re-enable it after the move.) In multisite configuration, modules found in this directory are available to all sites. Alternatively, the sites/your_site_name/modules directory pattern may From 4cc037d4dd9b52ee59eecb3bbf1795c75c0ead5a Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 8 Sep 2015 00:53:36 -0400 Subject: [PATCH 05/77] Issue #1260938 by dawehner, David_Rothstein, flaviovs, Fabianx, pfrenssen, boran, jelo, neclimdul, scorchio, Berdir, vijaycs85: D6 to D7 update can fail on duplicate files in system update #7061 --- CHANGELOG.txt | 2 + .../upgrade/drupal-6.upload.database.php | 99 ++++++++++++++++++- .../tests/upgrade/upgrade.upload.test | 23 +++++ modules/system/system.install | 20 ++++ 4 files changed, 142 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ddb62c75c61..2b8f30c5b84 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused the upgrade + to fail when there were multiple file records pointing to the same file. Drupal 7.39, 2015-08-19 ----------------------- diff --git a/modules/simpletest/tests/upgrade/drupal-6.upload.database.php b/modules/simpletest/tests/upgrade/drupal-6.upload.database.php index 46ebe2cb0ab..3fd602aff60 100644 --- a/modules/simpletest/tests/upgrade/drupal-6.upload.database.php +++ b/modules/simpletest/tests/upgrade/drupal-6.upload.database.php @@ -127,6 +127,38 @@ 'status' => '1', 'timestamp' => '1285708958', )) +// On some Drupal 6 sites, more than one file can have the same filepath. See +// https://www.drupal.org/node/1260938. +->values(array( + 'fid' => '12', + 'uid' => '1', + 'filename' => 'duplicate-name.png', + 'filepath' => 'sites/default/files/duplicate-name.png', + 'filemime' => 'image/png', + 'filesize' => '314', + 'status' => '1', + 'timestamp' => '1285708958', +)) +->values(array( + 'fid' => '13', + 'uid' => '1', + 'filename' => 'duplicate-name.png', + 'filepath' => 'sites/default/files/duplicate-name.png', + 'filemime' => 'image/png', + 'filesize' => '315', + 'status' => '1', + 'timestamp' => '1285708958', +)) +->values(array( + 'fid' => '14', + 'uid' => '1', + 'filename' => 'duplicate-name.png', + 'filepath' => 'sites/default/files/duplicate-name.png', + 'filemime' => 'image/png', + 'filesize' => '316', + 'status' => '1', + 'timestamp' => '1285708958', +)) ->execute(); db_insert('node')->fields(array( @@ -196,6 +228,23 @@ 'sticky' => '0', 'tnid' => '0', 'translate' => '0', +)) +->values(array( + 'nid' => '41', + 'vid' => '55', + 'type' => 'page', + 'language' => '', + 'title' => 'node title 41 revision 55', + 'uid' => '1', + 'status' => '1', + 'created' => '1285709012', + 'changed' => '1285709012', + 'comment' => '0', + 'promote' => '0', + 'moderate' => '0', + 'sticky' => '0', + 'tnid' => '0', + 'translate' => '0', )) ->execute(); @@ -253,6 +302,28 @@ 'log' => '', 'timestamp' => '1285709012', 'format' => '1', +)) +->values(array( + 'nid' => '41', + 'vid' => '54', + 'uid' => '1', + 'title' => 'node title 41 revision 54', + 'body' => "Attachments:\r\nduplicate-name.png", + 'teaser' => "Attachments:\r\nduplicate-name.png", + 'log' => '', + 'timestamp' => '1285709012', + 'format' => '1', +)) +->values(array( + 'nid' => '41', + 'vid' => '55', + 'uid' => '1', + 'title' => 'node title 41 revision 55', + 'body' => "Attachments:\r\nduplicate-name.png\r\nduplicate-name.png", + 'teaser' => "Attachments:\r\nduplicate-name.png\r\nduplicate-name.png", + 'log' => '', + 'timestamp' => '1285709012', + 'format' => '1', )) ->execute(); @@ -415,6 +486,30 @@ 'list' => '1', 'weight' => '0', )) +->values(array( + 'fid' => '12', + 'nid' => '41', + 'vid' => '54', + 'description' => 'duplicate-name.png', + 'list' => '1', + 'weight' => '0', +)) +->values(array( + 'fid' => '13', + 'nid' => '41', + 'vid' => '55', + 'description' => 'first description', + 'list' => '0', + 'weight' => '0', +)) +->values(array( + 'fid' => '14', + 'nid' => '41', + 'vid' => '55', + 'description' => 'second description', + 'list' => '1', + 'weight' => '0', +)) ->execute(); // Add series of entries for invalid node vids to the {upload} table. @@ -431,7 +526,7 @@ ->values(array( 'fid' => $i, 'nid' => '40', - 'vid' => 24 + $i, + 'vid' => 26 + $i, 'description' => 'crazy-basename.png', 'list' => '1', 'weight' => '0', @@ -440,7 +535,7 @@ ->values(array( 'fid' => 2, 'nid' => '40', - 'vid' => 24 + $i + 1, + 'vid' => 26 + $i + 1, 'description' => 'crazy-basename.png', 'list' => '1', 'weight' => '0', diff --git a/modules/simpletest/tests/upgrade/upgrade.upload.test b/modules/simpletest/tests/upgrade/upgrade.upload.test index be352bd4253..dfa94a008be 100644 --- a/modules/simpletest/tests/upgrade/upgrade.upload.test +++ b/modules/simpletest/tests/upgrade/upgrade.upload.test @@ -64,12 +64,35 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase { } $this->assertIdentical($filenames, $recorded_filenames, 'The uploaded files are present in the same order after the upgrade.'); } + // Test for the file with repeating basename to only have the streaming // path replaced. $node = node_load(40, 53); $repeated_basename_file = $node->upload[LANGUAGE_NONE][4]; $this->assertEqual($repeated_basename_file['uri'], 'private://drupal-6/file/directory/path/crazy-basename.png', "The file with the repeated basename path only had the stream portion replaced"); + // Ensure that filepaths are deduplicated. + $node0 = node_load(41, 54); + $node1 = node_load(41, 55); + // Ensure that both revisions point to the same file ID. + $items0 = field_get_items('node', $node0, 'upload'); + $this->assertEqual(count($items0), 1); + $items1 = field_get_items('node', $node1, 'upload'); + $this->assertEqual(count($items1), 2); + $this->assertEqual($items0[0]['fid'], $items1[0]['fid']); + $this->assertEqual($items0[0]['fid'], $items1[1]['fid']); + // The revision with more than one reference to the same file should retain + // the original settings for each reference. + $this->assertEqual($items1[0]['description'], 'first description'); + $this->assertEqual($items1[0]['display'], 0); + $this->assertEqual($items1[1]['description'], 'second description'); + $this->assertEqual($items1[1]['display'], 1); + // Ensure that the latest version of the files are used. + $this->assertEqual($items1[0]['filesize'], 316); + $this->assertEqual($items1[1]['filesize'], 316); + // No duplicate files should remain on the Drupal 7 site. + $this->assertEqual(0, db_query("SELECT COUNT(*) FROM {file_managed} GROUP BY uri HAVING COUNT(fid) > 1")->fetchField()); + // Make sure the file settings were properly migrated. $d6_file_directory_temp = '/drupal-6/file/directory/temp'; $d6_file_directory_path = '/drupal-6/file/directory/path'; diff --git a/modules/system/system.install b/modules/system/system.install index 64c989a61aa..dde8469690e 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2803,6 +2803,16 @@ function system_update_7061(&$sandbox) { ->from($query) ->execute(); + // Retrieve a list of duplicate files with the same filepath. Only the + // most-recently uploaded of these will be moved to the new {file_managed} + // table (and all references will be updated to point to it), since + // duplicate file URIs are not allowed in Drupal 7. + // Since the Drupal 6 to 7 upgrade path leaves the {files} table behind + // after it's done, custom or contributed modules which need to migrate + // file references of their own can use a similar query to determine the + // file IDs that duplicate filepaths were mapped to. + $sandbox['duplicate_filepath_fids_to_use'] = db_query("SELECT filepath, MAX(fid) FROM {files} GROUP BY filepath HAVING COUNT(*) > 1")->fetchAllKeyed(); + // Initialize batch update information. $sandbox['progress'] = 0; $sandbox['last_vid_processed'] = -1; @@ -2832,6 +2842,16 @@ function system_update_7061(&$sandbox) { continue; } + // If this file has a duplicate filepath, replace it with the + // most-recently uploaded file that has the same filepath. + if (isset($sandbox['duplicate_filepath_fids_to_use'][$file['filepath']]) && $record->fid != $sandbox['duplicate_filepath_fids_to_use'][$file['filepath']]) { + $file = db_select('files', 'f') + ->fields('f', array('fid', 'uid', 'filename', 'filepath', 'filemime', 'filesize', 'status', 'timestamp')) + ->condition('f.fid', $sandbox['duplicate_filepath_fids_to_use'][$file['filepath']]) + ->execute() + ->fetchAssoc(); + } + // Add in the file information from the upload table. $file['description'] = $record->description; $file['display'] = $record->list; From e575b47da2f00016ee62d169ecdfaf09e8cb4cd5 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 3 Oct 2015 14:37:59 -0400 Subject: [PATCH 06/77] Issue #2388255 by dawehner, pwolanin, hussainweb, greggles: Limit PDO MySQL to executing single statements if PHP supports it --- CHANGELOG.txt | 3 +++ includes/database/mysql/database.inc | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2b8f30c5b84..23b66697d64 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Prevented the database API from executing multiple queries at once on MySQL, + if the site's PHP version is new enough to do so. This is a secondary defense + against SQL injection attacks. - Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused the upgrade to fail when there were multiple file records pointing to the same file. diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc index 0b84f2719dc..fdf9271be97 100644 --- a/includes/database/mysql/database.inc +++ b/includes/database/mysql/database.inc @@ -51,6 +51,11 @@ class DatabaseConnection_mysql extends DatabaseConnection { // Because MySQL's prepared statements skip the query cache, because it's dumb. PDO::ATTR_EMULATE_PREPARES => TRUE, ); + if (defined('PDO::MYSQL_ATTR_MULTI_STATEMENTS')) { + // An added connection option in PHP 5.5.21+ to optionally limit SQL to a + // single statement like mysqli. + $connection_options['pdo'] += array(PDO::MYSQL_ATTR_MULTI_STATEMENTS => FALSE); + } parent::__construct($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']); @@ -78,8 +83,10 @@ class DatabaseConnection_mysql extends DatabaseConnection { $connection_options['init_commands'] += array( 'sql_mode' => "SET sql_mode = 'ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER'", ); - // Set connection options. - $this->exec(implode('; ', $connection_options['init_commands'])); + // Execute initial commands. + foreach ($connection_options['init_commands'] as $sql) { + $this->exec($sql); + } } public function __destruct() { From 47d24ed171bcb4c6aca409ce8af0844a06520f5c Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 3 Oct 2015 14:53:43 -0400 Subject: [PATCH 07/77] Issue #2364629 by gaurav.goyal, cilefen, dcam: After deletion of built-in administrator role the default admin role is not shown as disabled --- modules/user/user.module | 5 +++++ modules/user/user.test | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/user/user.module b/modules/user/user.module index 9637a7165db..21a41d56fb1 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -3039,6 +3039,11 @@ function user_role_delete($role) { $role = user_role_load_by_name($role); } + // If this is the administrator role, delete the user_admin_role variable. + if ($role->rid == variable_get('user_admin_role')) { + variable_del('user_admin_role'); + } + db_delete('role') ->condition('rid', $role->rid) ->execute(); diff --git a/modules/user/user.test b/modules/user/user.test index 07be4c2c412..97d23b44cd0 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -2095,12 +2095,16 @@ class UserRoleAdminTestCase extends DrupalWebTestCase { $this->assertFalse(user_role_load_by_name($old_name), 'The role can no longer be retrieved from the database using its old name.'); $this->assertTrue(is_object(user_role_load_by_name($role_name)), 'The role can be retrieved from the database using its new name.'); - // Test deleting a role. + // Test deleting the default administrator role. + $role_name = 'administrator'; + $role = user_role_load_by_name($role_name); $this->drupalPost("admin/people/permissions/roles/edit/{$role->rid}", NULL, t('Delete role')); $this->drupalPost(NULL, NULL, t('Delete')); $this->assertText(t('The role has been deleted.'), 'The role has been deleted'); $this->assertNoLinkByHref("admin/people/permissions/roles/edit/{$role->rid}", 'Role edit link removed.'); $this->assertFalse(user_role_load_by_name($role_name), 'A deleted role can no longer be loaded.'); + // Make sure this role is no longer configured as the administrator role. + $this->assertNull(variable_get('user_admin_role'), 'The administrator role is no longer configured as the administrator role.'); // Make sure that the system-defined roles cannot be edited via the user // interface. From c9d188950508f104a8115ec7a78335607d9b6037 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 3 Oct 2015 15:13:35 -0400 Subject: [PATCH 08/77] Issue #462950 by pwolanin, Pere Orga: Mitigate the security risks that come from IE, Chrome and other browsers trying to sniff the mime type --- .htaccess | 6 ++++++ CHANGELOG.txt | 2 ++ includes/bootstrap.inc | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.htaccess b/.htaccess index 7ccb6a2f629..151239c1195 100644 --- a/.htaccess +++ b/.htaccess @@ -141,3 +141,9 @@ DirectoryIndex index.php index.html index.htm + +# Add headers to all responses. + + # Disable content sniffing, since it's an attack vector. + Header always set X-Content-Type-Options nosniff + diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 23b66697d64..06959504635 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Set the X-Content-Type-Options header to "nosniff" when possible, to prevent + certain web browsers from picking an unsafe MIME type. - Prevented the database API from executing multiple queries at once on MySQL, if the site's PHP version is new enough to do so. This is a secondary defense against SQL injection attacks. diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index efddf006a9b..b2f2b042e02 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1262,6 +1262,10 @@ function drupal_page_header() { $default_headers = array( 'Expires' => 'Sun, 19 Nov 1978 05:00:00 GMT', 'Cache-Control' => 'no-cache, must-revalidate, post-check=0, pre-check=0', + // Prevent browsers from sniffing a response and picking a MIME type + // different from the declared content-type, since that can lead to + // XSS and other vulnerabilities. + 'X-Content-Type-Options' => 'nosniff', ); drupal_send_headers($default_headers); } From 3c8b182b79850c497b24c79c1c3e56999b3da12a Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 5 Oct 2015 15:59:32 -0400 Subject: [PATCH 09/77] Issue #2263365 by donquixote, smccabe, longwave, alexpott, joelpittet, Fabianx, mikeytown2, joseph.olstad, sun: Second loop in module_implements() was being repeated for no reason (performance improvement) --- includes/module.inc | 44 ++++++++++++++++--- modules/simpletest/tests/module.test | 42 ++++++++++++++++++ .../tests/module_test.implementations.inc | 10 +++++ modules/simpletest/tests/module_test.module | 11 +++++ 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 modules/simpletest/tests/module_test.implementations.inc diff --git a/includes/module.inc b/includes/module.inc index 494924f5395..076992ca942 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -676,12 +676,16 @@ function module_hook($module, $hook) { /** * Determines which modules are implementing a hook. * - * @param $hook + * Lazy-loaded include files specified with "group" via hook_hook_info() or + * hook_module_implements_alter() will be automatically included by this + * function when necessary. + * + * @param string $hook * The name of the hook (e.g. "help" or "menu"). - * @param $sort + * @param bool $sort * By default, modules are ordered by weight and filename, settings this option * to TRUE, module list will be ordered by module name. - * @param $reset + * @param bool $reset * For internal use only: Whether to force the stored list of hook * implementations to be regenerated (such as after enabling a new module, * before processing hook_enable). @@ -696,8 +700,10 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { static $drupal_static_fast; if (!isset($drupal_static_fast)) { $drupal_static_fast['implementations'] = &drupal_static(__FUNCTION__); + $drupal_static_fast['verified'] = &drupal_static(__FUNCTION__ . ':verified'); } $implementations = &$drupal_static_fast['implementations']; + $verified = &$drupal_static_fast['verified']; // We maintain a persistent cache of hook implementations in addition to the // static cache to avoid looping through every module and every hook on each @@ -711,6 +717,7 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { // per request. if ($reset) { $implementations = array(); + $verified = array(); cache_set('module_implements', array(), 'cache_bootstrap'); drupal_static_reset('module_hook_info'); drupal_static_reset('drupal_alter'); @@ -719,6 +726,9 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { } // Fetch implementations from cache. + // This happens on the first call to module_implements(*, *, FALSE) during a + // request, but also when $implementations have been reset, e.g. after + // module_enable(). if (empty($implementations)) { $implementations = cache_get('module_implements', 'cache_bootstrap'); if ($implementations === FALSE) { @@ -727,12 +737,17 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { else { $implementations = $implementations->data; } + // Forget all previously "verified" hooks, in case that $implementations + // were cleared via drupal_static_reset('module_implements') instead of + // module_implements(*, *, TRUE). + $verified = array(); } if (!isset($implementations[$hook])) { // The hook is not cached, so ensure that whether or not it has // implementations, that the cache is updated at the end of the request. $implementations['#write_cache'] = TRUE; + // Discover implementations for this hook. $hook_info = module_hook_info(); $implementations[$hook] = array(); $list = module_list(FALSE, FALSE, $sort); @@ -744,13 +759,31 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { $implementations[$hook][$module] = $include_file ? $hook_info[$hook]['group'] : FALSE; } } - // Allow modules to change the weight of specific implementations but avoid + // Allow modules to change the weight of specific implementations, but avoid // an infinite loop. if ($hook != 'module_implements_alter') { + // Remember the implementations before hook_module_implements_alter(). + $implementations_before = $implementations[$hook]; drupal_alter('module_implements', $implementations[$hook], $hook); + // Verify implementations that were added or modified. + foreach (array_diff_assoc($implementations[$hook], $implementations_before) as $module => $group) { + // If drupal_alter('module_implements') changed or added a $group, the + // respective file needs to be included. + if ($group) { + module_load_include('inc', $module, "$module.$group"); + } + // If a new implementation was added, verify that the function exists. + if (!function_exists($module . '_' . $hook)) { + unset($implementations[$hook][$module]); + } + } } + // Implementations for this hook are now "verified". + $verified[$hook] = TRUE; } - else { + elseif (!isset($verified[$hook])) { + // Implementations for this hook were in the cache, but they are not + // "verified" yet. foreach ($implementations[$hook] as $module => $group) { // If this hook implementation is stored in a lazy-loaded file, so include // that file first. @@ -769,6 +802,7 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) { $implementations['#write_cache'] = TRUE; } } + $verified[$hook] = TRUE; } return array_keys($implementations[$hook]); diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test index 371339f3c3f..eea3b51e9c2 100644 --- a/modules/simpletest/tests/module.test +++ b/modules/simpletest/tests/module.test @@ -302,3 +302,45 @@ class ModuleUninstallTestCase extends DrupalWebTestCase { $this->assertEqual(0, $count, 'Permissions were all removed.'); } } + +class ModuleImplementsAlterTestCase extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Module implements alter', + 'description' => 'Tests hook_module_implements_alter().', + 'group' => 'Module', + ); + } + + /** + * Tests hook_module_implements_alter() adding an implementation. + */ + function testModuleImplementsAlter() { + module_enable(array('module_test'), FALSE); + $this->assertTrue(module_exists('module_test'), 'Test module is enabled.'); + + // Assert that module_test.module is now included. + $this->assertTrue(function_exists('module_test_permission'), + 'The file module_test.module was successfully included.'); + + $modules = module_implements('permission'); + $this->assertTrue(in_array('module_test', $modules), 'module_test implements hook_permission.'); + + $modules = module_implements('module_implements_alter'); + $this->assertTrue(in_array('module_test', $modules), 'module_test implements hook_module_implements_alter().'); + + // Assert that module_test.implementations.inc is not included yet. + $this->assertFalse(function_exists('module_test_altered_test_hook'), + 'The file module_test.implementations.inc is not included yet.'); + + // Assert that module_test_module_implements_alter(*, 'altered_test_hook') + // has added an implementation + $this->assertTrue(in_array('module_test', module_implements('altered_test_hook')), + 'module_test implements hook_altered_test_hook().'); + + // Assert that module_test.implementations.inc was included as part of the process. + $this->assertTrue(function_exists('module_test_altered_test_hook'), + 'The file module_test.implementations.inc was included.'); + } + +} diff --git a/modules/simpletest/tests/module_test.implementations.inc b/modules/simpletest/tests/module_test.implementations.inc new file mode 100644 index 00000000000..63c866ea1b1 --- /dev/null +++ b/modules/simpletest/tests/module_test.implementations.inc @@ -0,0 +1,10 @@ + Date: Sat, 10 Oct 2015 11:40:33 -0400 Subject: [PATCH 10/77] Issue #496170 by stefan.r, chx, Fabianx, jbrauer, David_Rothstein, roderik, rwohleb, pounard, kenorb, Jose Reyero, joelpittet, catch: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion --- CHANGELOG.txt | 3 ++ includes/common.inc | 5 +++ includes/module.inc | 5 +++ modules/simpletest/simpletest.info | 1 + modules/simpletest/tests/boot.test | 38 +++++++++++++++++++++ modules/simpletest/tests/boot_test_1.info | 6 ++++ modules/simpletest/tests/boot_test_1.module | 21 ++++++++++++ modules/simpletest/tests/boot_test_2.info | 6 ++++ modules/simpletest/tests/boot_test_2.module | 13 +++++++ 9 files changed, 98 insertions(+) create mode 100644 modules/simpletest/tests/boot.test create mode 100644 modules/simpletest/tests/boot_test_1.info create mode 100644 modules/simpletest/tests/boot_test_1.module create mode 100644 modules/simpletest/tests/boot_test_2.info create mode 100644 modules/simpletest/tests/boot_test_2.module diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 06959504635..4e9e4f0da12 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Fixed various bugs that occurred after hooks were invoked early in the Drupal + bootstrap and that caused module_implements() and drupal_alter() to cache an + incomplete set of hook implementations for later use. - Set the X-Content-Type-Options header to "nosniff" when possible, to prevent certain web browsers from picking an unsafe MIME type. - Prevented the database API from executing multiple queries at once on MySQL, diff --git a/includes/common.inc b/includes/common.inc index ceac115a520..ef71ee8b6a7 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5212,6 +5212,11 @@ function _drupal_bootstrap_full() { fix_gpc_magic(); // Load all enabled modules module_load_all(); + // Reset drupal_alter() and module_implements() static caches as these + // include implementations for vital modules only when called early on + // in the bootstrap. + drupal_static_reset('drupal_alter'); + drupal_static_reset('module_implements'); // Make sure all stream wrappers are registered. file_get_stream_wrappers(); // Ensure mt_rand is reseeded, to prevent random values from one page load diff --git a/includes/module.inc b/includes/module.inc index 076992ca942..7bf619b4797 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -867,6 +867,11 @@ function module_hook_info() { * @see module_implements() */ function module_implements_write_cache() { + // The list of implementations includes vital modules only before full + // bootstrap, so do not write cache if we are not fully bootstrapped yet. + if (drupal_get_bootstrap_phase() != DRUPAL_BOOTSTRAP_FULL) { + return; + } $implementations = &drupal_static('module_implements'); if (isset($implementations['#write_cache'])) { unset($implementations['#write_cache']); diff --git a/modules/simpletest/simpletest.info b/modules/simpletest/simpletest.info index 7b139ba3d2f..1aec619f5b6 100644 --- a/modules/simpletest/simpletest.info +++ b/modules/simpletest/simpletest.info @@ -11,6 +11,7 @@ configure = admin/config/development/testing/settings files[] = tests/actions.test files[] = tests/ajax.test files[] = tests/batch.test +files[] = tests/boot.test files[] = tests/bootstrap.test files[] = tests/cache.test files[] = tests/common.test diff --git a/modules/simpletest/tests/boot.test b/modules/simpletest/tests/boot.test new file mode 100644 index 00000000000..562b082e8e7 --- /dev/null +++ b/modules/simpletest/tests/boot.test @@ -0,0 +1,38 @@ + 'Early bootstrap test', + 'description' => 'Confirm that calling module_implements() during early bootstrap does not pollute the module_implements() cache.', + 'group' => 'System', + ); + } + + function setUp() { + parent::setUp('boot_test_1', 'boot_test_2'); + } + + /** + * Test hook_boot() on both regular and "early exit" pages. + */ + public function testHookBoot() { + $paths = array('', 'early_exit'); + foreach ($paths as $path) { + // Empty the module_implements() caches. + module_implements(NULL, FALSE, TRUE); + // Do a request to the front page, which will call module_implements() + // during hook_boot(). + $this->drupalGet($path); + // Reset the static cache so we get implementation data from the persistent + // cache. + drupal_static_reset(); + // Make sure we get a full list of all modules implementing hook_help(). + $modules = module_implements('help'); + $this->assertTrue(in_array('boot_test_2', $modules)); + } + } +} diff --git a/modules/simpletest/tests/boot_test_1.info b/modules/simpletest/tests/boot_test_1.info new file mode 100644 index 00000000000..a6f2ffb6064 --- /dev/null +++ b/modules/simpletest/tests/boot_test_1.info @@ -0,0 +1,6 @@ +name = Early bootstrap tests +description = A support module for hook_boot testing. +core = 7.x +package = Testing +version = VERSION +hidden = TRUE diff --git a/modules/simpletest/tests/boot_test_1.module b/modules/simpletest/tests/boot_test_1.module new file mode 100644 index 00000000000..a452e289745 --- /dev/null +++ b/modules/simpletest/tests/boot_test_1.module @@ -0,0 +1,21 @@ + Date: Sat, 10 Oct 2015 13:11:24 -0400 Subject: [PATCH 11/77] Issue #2017433 by LinL, BarisW, coredumperror: The documentation for hook_ranking() is wrong --- modules/node/node.api.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 9a4d0959171..95c77f3f43c 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -950,7 +950,7 @@ function hook_node_info() { * 'recent', or 'comments'. The values should be arrays themselves, with the * following keys available: * - title: (required) The human readable name of the ranking mechanism. - * - join: (optional) The part of a query string to join to any additional + * - join: (optional) An array with information to join any additional * necessary table. This is not necessary if the table required is already * joined to by the base query, such as for the {node} table. Other tables * should use the full table name as an alias to avoid naming collisions. @@ -974,7 +974,12 @@ function hook_ranking() { 'title' => t('Average vote'), // Note that we use i.sid, the search index's search item id, rather than // n.nid. - 'join' => 'LEFT JOIN {vote_node_data} vote_node_data ON vote_node_data.nid = i.sid', + 'join' => array( + 'type' => 'LEFT', + 'table' => 'vote_node_data', + 'alias' => 'vote_node_data', + 'on' => 'vote_node_data.nid = i.sid', + ), // The highest possible score should be 1, and the lowest possible score, // always 0, should be 0. 'score' => 'vote_node_data.average / CAST(%f AS DECIMAL)', From c60d7b098a9db9abd9a8de3b6f125df3a2bfda24 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 10 Oct 2015 13:26:16 -0400 Subject: [PATCH 12/77] Issue #2205271 by trobey, jhedstrom, hass, alexpott, chx, joachim, jhodgdon: Add an optional project namespace for dependencies --- CHANGELOG.txt | 2 ++ includes/common.inc | 25 ++++++++++++++++--- .../tests/system_project_namespace_test.info | 7 ++++++ .../system_project_namespace_test.module | 1 + modules/simpletest/tests/system_test.module | 3 +++ modules/system/system.test | 12 +++++++++ 6 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 modules/simpletest/tests/system_project_namespace_test.info create mode 100644 modules/simpletest/tests/system_project_namespace_test.module diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4e9e4f0da12..699318087d7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Added an optional 'project:' prefix that can be added to dependencies in a + module's .info file to indicate which project the dependency resides in. - Fixed various bugs that occurred after hooks were invoked early in the Drupal bootstrap and that caused module_implements() and drupal_alter() to cache an incomplete set of hook implementations for later use. diff --git a/includes/common.inc b/includes/common.inc index ef71ee8b6a7..acef70afb02 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7368,7 +7368,16 @@ function drupal_write_record($table, &$record, $primary_keys = array()) { * Information stored in a module .info file: * - name: The real name of the module for display purposes. * - description: A brief description of the module. - * - dependencies: An array of shortnames of other modules this module requires. + * - dependencies: An array of dependency strings. Each is in the form + * 'project:module (versions)'; with the following meanings: + * - project: (optional) Project shortname, recommended to ensure uniqueness, + * if the module is part of a project hosted on drupal.org. If omitted, + * also omit the : that follows. The project name is currently ignored by + * Drupal core but is used for automated testing. + * - module: (required) Module shortname within the project. + * - (versions): Optional version information, consisting of one or more + * comma-separated operator/value pairs or simply version numbers, which + * can contain "x" as a wildcard. Examples: (>=7.22, <7.28), (7.x-3.x). * - package: The name of the package of modules this module belongs to. * * See forum.info for an example of a module .info file. @@ -7653,7 +7662,12 @@ function debug($data, $label = NULL, $print_r = FALSE) { * Parses a dependency for comparison by drupal_check_incompatibility(). * * @param $dependency - * A dependency string, for example 'foo (>=7.x-4.5-beta5, 3.x)'. + * A dependency string, which specifies a module dependency, and optionally + * the project it comes from and versions that are supported. Supported + * formats include: + * - 'module' + * - 'project:module' + * - 'project:module (>=version, version)' * * @return * An associative array with three keys: @@ -7668,6 +7682,12 @@ function debug($data, $label = NULL, $print_r = FALSE) { * @see drupal_check_incompatibility() */ function drupal_parse_dependency($dependency) { + $value = array(); + // Split out the optional project name. + if (strpos($dependency, ':')) { + list($project_name, $dependency) = explode(':', $dependency); + $value['project'] = $project_name; + } // We use named subpatterns and support every op that version_compare // supports. Also, op is optional and defaults to equals. $p_op = '(?P!=|==|=|<|<=|>|>=|<>)?'; @@ -7676,7 +7696,6 @@ function drupal_parse_dependency($dependency) { $p_major = '(?P\d+)'; // By setting the minor version to x, branches can be matched. $p_minor = '(?P(?:\d+|x)(?:-[A-Za-z]+\d+)?)'; - $value = array(); $parts = explode('(', $dependency, 2); $value['name'] = trim($parts[0]); if (isset($parts[1])) { diff --git a/modules/simpletest/tests/system_project_namespace_test.info b/modules/simpletest/tests/system_project_namespace_test.info new file mode 100644 index 00000000000..98d33afdd1d --- /dev/null +++ b/modules/simpletest/tests/system_project_namespace_test.info @@ -0,0 +1,7 @@ +name = "System project namespace test" +description = "Support module for testing project namespace dependencies." +package = Testing +version = VERSION +core = 7.x +hidden = TRUE +dependencies[] = drupal:filter diff --git a/modules/simpletest/tests/system_project_namespace_test.module b/modules/simpletest/tests/system_project_namespace_test.module new file mode 100644 index 00000000000..b3d9bbc7f37 --- /dev/null +++ b/modules/simpletest/tests/system_project_namespace_test.module @@ -0,0 +1 @@ +name == 'system_project_namespace_test') { + $info['hidden'] = FALSE; + } // Make the system_dependencies_test visible by default. if ($file->name == 'system_dependencies_test') { $info['hidden'] = FALSE; diff --git a/modules/system/system.test b/modules/system/system.test index d4c98f0a743..6e5f2b358d0 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -389,6 +389,18 @@ class ModuleDependencyTestCase extends ModuleTestCase { ); } + /** + * Checks functionality of project namespaces for dependencies. + */ + function testProjectNamespaceForDependencies() { + // Enable module with project namespace to ensure nothing breaks. + $edit = array( + 'modules[Testing][system_project_namespace_test][enable]' => TRUE, + ); + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertModules(array('system_project_namespace_test'), TRUE); + } + /** * Attempt to enable translation module without locale enabled. */ From ab4064e9ae9071a01f3e65446608f17d1f565daf Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 10 Oct 2015 14:00:35 -0400 Subject: [PATCH 13/77] Issue #2470525 by berenddeboer, osman: statistics_node_view overwrites #attached JavaScript --- CHANGELOG.txt | 2 ++ modules/statistics/statistics.module | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 699318087d7..b988a1e2aed 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Fixed a bug in the Statistics module that caused JavaScript files attached to + a node while it is being viewed to be omitted from the page. - Added an optional 'project:' prefix that can be added to dependencies in a module's .info file to indicate which project the dependency resides in. - Fixed various bugs that occurred after hooks were invoked early in the Drupal diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index f665a14f241..b2561d24b5c 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -118,10 +118,9 @@ function statistics_node_view($node, $view_mode) { // Attach Ajax node count statistics if configured. if (variable_get('statistics_count_content_views', 0) && variable_get('statistics_count_content_views_ajax', 0)) { if (!empty($node->nid) && $view_mode == 'full' && node_is_page($node) && empty($node->in_preview)) { - $node->content['#attached']['js'] = array( - drupal_get_path('module', 'statistics') . '/statistics.js' => array( - 'scope' => 'footer' - ), + $statistics = drupal_get_path('module', 'statistics') . '/statistics.js'; + $node->content['#attached']['js'][$statistics] = array( + 'scope' => 'footer', ); $settings = array('data' => array('nid' => $node->nid), 'url' => url(drupal_get_path('module', 'statistics') . '/statistics.php')); $node->content['#attached']['js'][] = array( From d488eb129f4d65334ed999d12012ea8380992248 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 10 Oct 2015 19:43:59 -0400 Subject: [PATCH 14/77] Issue #2376239 by david_garcia, dobe: "format" field in table "date_format_locale" should be case sensitive --- CHANGELOG.txt | 2 ++ modules/system/system.install | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b988a1e2aed..d3cf02b8935 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Made the format column in the {date_format_locale} database table + case-sensitive, to match the equivalent column in the {date_formats} table. - Fixed a bug in the Statistics module that caused JavaScript files attached to a node while it is being viewed to be omitted from the page. - Added an optional 'project:' prefix that can be added to dependencies in a diff --git a/modules/system/system.install b/modules/system/system.install index dde8469690e..323b7b356ec 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -800,6 +800,7 @@ function system_schema() { 'type' => 'varchar', 'length' => 100, 'not null' => TRUE, + 'binary' => TRUE, ), 'type' => array( 'description' => 'The date format type, e.g. medium.', @@ -3177,6 +3178,20 @@ function system_update_7079() { db_change_field('file_managed', 'filesize', 'filesize', $spec); } +/** + * Convert the 'format' column in {date_format_locale} to case sensitive varchar. + */ +function system_update_7080() { + $spec = array( + 'description' => 'The date format string.', + 'type' => 'varchar', + 'length' => 100, + 'not null' => TRUE, + 'binary' => TRUE, + ); + db_change_field('date_format_locale', 'format', 'format', $spec); +} + /** * @} End of "defgroup updates-7.x-extra". * The next series of updates should start at 8000. From f7548361a664b6cb2fffc4e23a2a1a6620addd80 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sat, 10 Oct 2015 19:52:22 -0400 Subject: [PATCH 15/77] Issue #1973262 by cilefen, Matt V., David_Rothstein, Anybody, Rob230: User pages display incorrect title instead of "Menu link title" when link paths are added to a default menus --- includes/menu.inc | 24 ++++++++++++++++++++++-- modules/menu/menu.test | 11 +++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/includes/menu.inc b/includes/menu.inc index 0e9c977c6a9..eb623a93661 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2613,10 +2613,30 @@ function menu_get_active_breadcrumb() { */ function menu_get_active_title() { $active_trail = menu_get_active_trail(); + $local_task_title = NULL; foreach (array_reverse($active_trail) as $item) { - if (!(bool) ($item['type'] & MENU_IS_LOCAL_TASK)) { - return $item['title']; + // Local task titles are displayed as tabs and therefore should not be + // repeated as the page title. However, if the local task appears in a + // top-level menu, it is no longer a "local task" anymore (the front page + // of the site does not have tabs) so it is better to use the local task + // title in that case than to fall back on the front page link in the + // active trail (which is usually "Home" and would not make sense in this + // context). + if ((bool) ($item['type'] & MENU_IS_LOCAL_TASK)) { + // A local task title is being skipped; track it in case it needs to be + // used later. + $local_task_title = $item['title']; + } + else { + // This is not a local task, so use it for the page title (unless the + // conditions described above are met). + if (isset($local_task_title) && isset($item['href']) && $item['href'] == '') { + return $local_task_title; + } + else { + return $item['title']; + } } } } diff --git a/modules/menu/menu.test b/modules/menu/menu.test index a9bdb5f2746..8e69efe5562 100644 --- a/modules/menu/menu.test +++ b/modules/menu/menu.test @@ -72,6 +72,17 @@ class MenuTestCase extends DrupalWebTestCase { $saved_item = menu_link_load($item['mlid']); $this->assertEqual($description, $saved_item['options']['attributes']['title'], 'Saving an existing link updates the description (title attribute)'); $this->resetMenuLink($item, $old_title); + + // Test that the page title is correct when a local task appears in a + // top-level menu item. See https://www.drupal.org/node/1973262. + $item = $this->addMenuLink(0, 'user/register', 'user-menu'); + $this->drupalGet('user/password'); + $this->assertNoTitle('Home | Drupal'); + $this->drupalLogout(); + $this->drupalGet('user/register'); + $this->assertTitle($item['link_title'] . ' | Drupal'); + $this->drupalGet('user'); + $this->assertNoTitle('Home | Drupal'); } /** From 6379101933142e2eeaea2f4eb41f4d32a9e47531 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 11 Oct 2015 15:22:24 -0400 Subject: [PATCH 16/77] Issue #2511306 by ElusiveMind, JeroenT, leolando.tan, cilefen, charginghawk: Error: Call to a member function getElementsByTagName() in filter.module when filter_dom_serialize() is passed an empty document. --- modules/filter/filter.module | 23 ++++++++++++++--------- modules/filter/filter.test | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/modules/filter/filter.module b/modules/filter/filter.module index f4bab9e6b6b..83876808b2b 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -1119,18 +1119,23 @@ function filter_dom_serialize($dom_document) { $body_node = $dom_document->getElementsByTagName('body')->item(0); $body_content = ''; - foreach ($body_node->getElementsByTagName('script') as $node) { - filter_dom_serialize_escape_cdata_element($dom_document, $node); - } + if ($body_node !== NULL) { + foreach ($body_node->getElementsByTagName('script') as $node) { + filter_dom_serialize_escape_cdata_element($dom_document, $node); + } - foreach ($body_node->getElementsByTagName('style') as $node) { - filter_dom_serialize_escape_cdata_element($dom_document, $node, '/*', '*/'); - } + foreach ($body_node->getElementsByTagName('style') as $node) { + filter_dom_serialize_escape_cdata_element($dom_document, $node, '/*', '*/'); + } - foreach ($body_node->childNodes as $child_node) { - $body_content .= $dom_document->saveXML($child_node); + foreach ($body_node->childNodes as $child_node) { + $body_content .= $dom_document->saveXML($child_node); + } + return preg_replace('|<([^> ]*)/>|i', '<$1 />', $body_content); + } + else { + return $body_content; } - return preg_replace('|<([^> ]*)/>|i', '<$1 />', $body_content); } /** diff --git a/modules/filter/filter.test b/modules/filter/filter.test index ddea6afb579..547118515c6 100644 --- a/modules/filter/filter.test +++ b/modules/filter/filter.test @@ -1983,3 +1983,26 @@ class FilterSettingsTestCase extends DrupalWebTestCase { } } } + +/** + * Tests DOMDocument serialization. + */ +class FilterDOMSerializeTestCase extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Serialization', + 'description' => 'Test serialization of DOMDocument objects.', + 'group' => 'Filter', + ); + } + + /** + * Tests empty DOMDocument object. + */ + function testFilterEmptyDOMSerialization() { + $document = new DOMDocument(); + $result = filter_dom_serialize($document); + $this->assertEqual('', $result); + } +} From e88bbeaa083c9d8309b6879259c460ca977410f3 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 11 Oct 2015 16:30:18 -0400 Subject: [PATCH 17/77] Issue #619542 by dcrocks, bfroehle, catch, amontero, jayeshanandani, malcomio, JohnAlbin, olamaekle: Malformed theme .info files break menu_router generation --- CHANGELOG.txt | 4 ++++ modules/system/system.module | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d3cf02b8935..8dc7d1d40c5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,10 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Prevented malformed theme .info files (without a "name" key) from causing + exceptions during menu rebuilds. If an .info file without a "name" key is + found in a module or theme directory, Drupal will now use the module or + theme's machine name as the display name instead. - Made the format column in the {date_format_locale} database table case-sensitive, to match the equivalent column in the {date_formats} table. - Fixed a bug in the Statistics module that caused JavaScript files attached to diff --git a/modules/system/system.module b/modules/system/system.module index c2aa9e07bf3..d0dda18dc33 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2411,6 +2411,10 @@ function _system_rebuild_module_data() { // Merge in defaults and save. $modules[$key]->info = $module->info + $defaults; + // The "name" key is required, but to avoid a fatal error in the menu system + // we set a reasonable default if it is not provided. + $modules[$key]->info += array('name' => $key); + // Prefix stylesheets and scripts with module path. $path = dirname($module->uri); if (isset($module->info['stylesheets'])) { @@ -2546,6 +2550,10 @@ function _system_rebuild_theme_data() { $themes[$key]->filename = $theme->uri; $themes[$key]->info = drupal_parse_info_file($theme->uri) + $defaults; + // The "name" key is required, but to avoid a fatal error in the menu system + // we set a reasonable default if it is not provided. + $themes[$key]->info += array('name' => $key); + // Add the info file modification time, so it becomes available for // contributed modules to use for ordering theme lists. $themes[$key]->info['mtime'] = filemtime($theme->uri); From 692440692862d42f6ec4b2c4fec6e06c9b72e169 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 11 Oct 2015 22:42:25 -0400 Subject: [PATCH 18/77] Issue #1275978 by pillarsdotnet, Zgear, cck, dcam: The thousand_separator for numeric fields should default to '' (nothing) instead of ' ' (space) --- CHANGELOG.txt | 2 ++ modules/field/modules/number/number.module | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8dc7d1d40c5..c857dfde7f9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Changed the default thousand marker for numeric fields from a space ("1 000") + to nothing ("1000"). - Prevented malformed theme .info files (without a "name" key) from causing exceptions during menu rebuilds. If an .info file without a "name" key is found in a module or theme directory, Drupal will now use the module or diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module index 60465442f79..d00c55f07f1 100644 --- a/modules/field/modules/number/number.module +++ b/modules/field/modules/number/number.module @@ -188,7 +188,7 @@ function number_field_formatter_info() { 'label' => t('Default'), 'field types' => array('number_integer'), 'settings' => array( - 'thousand_separator' => ' ', + 'thousand_separator' => '', // The 'decimal_separator' and 'scale' settings are not configurable // through the UI, and will therefore keep their default values. They // are only present so that the 'number_integer' and 'number_decimal' @@ -202,7 +202,7 @@ function number_field_formatter_info() { 'label' => t('Default'), 'field types' => array('number_decimal', 'number_float'), 'settings' => array( - 'thousand_separator' => ' ', + 'thousand_separator' => '', 'decimal_separator' => '.', 'scale' => 2, 'prefix_suffix' => TRUE, From dc264c53d9d63103b35e6a2edfb6b0128d2e2480 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 11 Oct 2015 22:55:54 -0400 Subject: [PATCH 19/77] Issue #2233929 by alexpott, Dave Reid, Berdir, YesCT: drupal_set_time_limit should not be able to change the time limit if it's already unlimited --- CHANGELOG.txt | 2 ++ includes/common.inc | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c857dfde7f9..c0b63c8618f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Prevented drupal_set_time_limit() from decreasing the time limit in the case + where the PHP maximum execution time is already unlimited. - Changed the default thousand marker for numeric fields from a space ("1 000") to nothing ("1000"). - Prevented malformed theme .info files (without a "name" key) from causing diff --git a/includes/common.inc b/includes/common.inc index acef70afb02..e863f411f5c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2812,11 +2812,11 @@ function drupal_map_assoc($array, $function = NULL) { * into script execution a call such as set_time_limit(20) is made, the * script will run for a total of 45 seconds before timing out. * - * It also means that it is possible to decrease the total time limit if - * the sum of the new time limit and the current time spent running the - * script is inferior to the original time limit. It is inherent to the way - * set_time_limit() works, it should rather be called with an appropriate - * value every time you need to allocate a certain amount of time + * If the current time limit is not unlimited it is possible to decrease the + * total time limit if the sum of the new time limit and the current time spent + * running the script is inferior to the original time limit. It is inherent to + * the way set_time_limit() works, it should rather be called with an + * appropriate value every time you need to allocate a certain amount of time * to execute a task than only once at the beginning of the script. * * Before calling set_time_limit(), we check if this function is available @@ -2833,7 +2833,11 @@ function drupal_map_assoc($array, $function = NULL) { */ function drupal_set_time_limit($time_limit) { if (function_exists('set_time_limit')) { - @set_time_limit($time_limit); + $current = ini_get('max_execution_time'); + // Do not set time limit if it is currently unlimited. + if ($current != 0) { + @set_time_limit($time_limit); + } } } From 890d98ac96b578206733236ecc23acaf57585454 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 11 Oct 2015 22:59:03 -0400 Subject: [PATCH 20/77] Issue #2483025 by joshi.rohit100, dcam: Remove 'has_body' and 'body_label' from drupalCreateContentType() --- modules/simpletest/drupal_web_test_case.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index b67c478aa61..d7350698c98 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1015,9 +1015,7 @@ protected function drupalCreateContentType($settings = array()) { 'description' => '', 'help' => '', 'title_label' => 'Title', - 'body_label' => 'Body', 'has_title' => 1, - 'has_body' => 1, ); // Imposed values for a custom type. $forced = array( From 3d1be9b5ca8cf7baadeb2e86665c080526d805cf Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 00:54:08 -0400 Subject: [PATCH 21/77] Issue #2342667 by claudiu.cristea, Dave Reid, ndobromirov: Cron and batch processing of queues are not accepting callables --- CHANGELOG.txt | 3 +++ includes/batch.inc | 4 ++-- includes/common.inc | 4 ++-- modules/system/system.test | 19 ++++++++++++++++++- modules/system/tests/cron_queue_test.module | 12 ++++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c0b63c8618f..ce450178287 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- The "worker callback" provided in hook_cron_queue_info() and the "finished" + callback specified during batch processing can now be any PHP callable + instead of just functions. - Prevented drupal_set_time_limit() from decreasing the time limit in the case where the PHP maximum execution time is already unlimited. - Changed the default thousand marker for numeric fields from a space ("1 000") diff --git a/includes/batch.inc b/includes/batch.inc index 061acd4c60a..e89ab8dec93 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -460,10 +460,10 @@ function _batch_finished() { if (isset($batch_set['file']) && is_file($batch_set['file'])) { include_once DRUPAL_ROOT . '/' . $batch_set['file']; } - if (function_exists($batch_set['finished'])) { + if (is_callable($batch_set['finished'])) { $queue = _batch_queue($batch_set); $operations = $queue->getAllItems(); - $batch_set['finished']($batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000)); + call_user_func($batch_set['finished'], $batch_set['success'], $batch_set['results'], $operations, format_interval($batch_set['elapsed'] / 1000)); } } } diff --git a/includes/common.inc b/includes/common.inc index e863f411f5c..5268fd8305d 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5380,12 +5380,12 @@ function drupal_cron_run() { // Do not run if queue wants to skip. continue; } - $function = $info['worker callback']; + $callback = $info['worker callback']; $end = time() + (isset($info['time']) ? $info['time'] : 15); $queue = DrupalQueue::get($queue_name); while (time() < $end && ($item = $queue->claimItem())) { try { - $function($item->data); + call_user_func($callback, $item->data); $queue->deleteItem($item); } catch (Exception $e) { diff --git a/modules/system/system.test b/modules/system/system.test index 6e5f2b358d0..2865bbb2526 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -923,7 +923,7 @@ class CronQueueTestCase extends DrupalWebTestCase { } function setUp() { - parent::setUp(array('common_test', 'common_test_cron_helper')); + parent::setUp(array('common_test', 'common_test_cron_helper', 'cron_queue_test')); } /** @@ -943,6 +943,23 @@ class CronQueueTestCase extends DrupalWebTestCase { $this->assertEqual($queue->numberOfItems(), 1, 'Failing item still in the queue after throwing an exception.'); } + /** + * Tests worker defined as a class method callable. + */ + function testCallable() { + $queue = DrupalQueue::get('cron_queue_test_callback'); + + // Enqueue an item for processing. + $queue->createItem(array($this->randomName() => $this->randomName())); + + // Run cron; the worker should perform the task and delete the item from the + // queue. + $this->cronRun(); + + // The queue should be empty. + $this->assertEqual($queue->numberOfItems(), 0); + } + } class AdminMetaTagTestCase extends DrupalWebTestCase { diff --git a/modules/system/tests/cron_queue_test.module b/modules/system/tests/cron_queue_test.module index e95c6b6af85..0df6396a65d 100644 --- a/modules/system/tests/cron_queue_test.module +++ b/modules/system/tests/cron_queue_test.module @@ -7,9 +7,21 @@ function cron_queue_test_cron_queue_info() { $queues['cron_queue_test_exception'] = array( 'worker callback' => 'cron_queue_test_exception', ); + $queues['cron_queue_test_callback'] = array( + 'worker callback' => array('CronQueueTestCallbackClass', 'foo'), + ); + return $queues; } function cron_queue_test_exception($item) { throw new Exception('That is not supposed to happen.'); } + +class CronQueueTestCallbackClass { + + static public function foo() { + // Do nothing. + } + +} From a70cff3ed4a9cb2ff11164314bcad74e22b45ce7 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 01:02:13 -0400 Subject: [PATCH 22/77] Issue #890934 by sandipmkhairnar, reglogge: Garland uses $vars instead of $variables --- themes/garland/template.php | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/themes/garland/template.php b/themes/garland/template.php index 416a43a8d92..ef7d4771d17 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -19,22 +19,22 @@ function garland_breadcrumb($variables) { /** * Override or insert variables into the maintenance page template. */ -function garland_preprocess_maintenance_page(&$vars) { +function garland_preprocess_maintenance_page(&$variables) { // While markup for normal pages is split into page.tpl.php and html.tpl.php, // the markup for the maintenance page is all in the single // maintenance-page.tpl.php template. So, to have what's done in // garland_preprocess_html() also happen on the maintenance page, it has to be // called here. - garland_preprocess_html($vars); + garland_preprocess_html($variables); } /** * Override or insert variables into the html template. */ -function garland_preprocess_html(&$vars) { +function garland_preprocess_html(&$variables) { // Toggle fixed or fluid width. if (theme_get_setting('garland_width') == 'fluid') { - $vars['classes_array'][] = 'fluid-width'; + $variables['classes_array'][] = 'fluid-width'; } // Add conditional CSS for IE6. drupal_add_css(path_to_theme() . '/fix-ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE)); @@ -43,27 +43,27 @@ function garland_preprocess_html(&$vars) { /** * Override or insert variables into the html template. */ -function garland_process_html(&$vars) { +function garland_process_html(&$variables) { // Hook into color.module if (module_exists('color')) { - _color_html_alter($vars); + _color_html_alter($variables); } } /** * Override or insert variables into the page template. */ -function garland_preprocess_page(&$vars) { +function garland_preprocess_page(&$variables) { // Move secondary tabs into a separate variable. - $vars['tabs2'] = array( + $variables['tabs2'] = array( '#theme' => 'menu_local_tasks', - '#secondary' => $vars['tabs']['#secondary'], + '#secondary' => $variables['tabs']['#secondary'], ); - unset($vars['tabs']['#secondary']); + unset($variables['tabs']['#secondary']); - if (isset($vars['main_menu'])) { - $vars['primary_nav'] = theme('links__system_main_menu', array( - 'links' => $vars['main_menu'], + if (isset($variables['main_menu'])) { + $variables['primary_nav'] = theme('links__system_main_menu', array( + 'links' => $variables['main_menu'], 'attributes' => array( 'class' => array('links', 'inline', 'main-menu'), ), @@ -75,11 +75,11 @@ function garland_preprocess_page(&$vars) { )); } else { - $vars['primary_nav'] = FALSE; + $variables['primary_nav'] = FALSE; } - if (isset($vars['secondary_menu'])) { - $vars['secondary_nav'] = theme('links__system_secondary_menu', array( - 'links' => $vars['secondary_menu'], + if (isset($variables['secondary_menu'])) { + $variables['secondary_nav'] = theme('links__system_secondary_menu', array( + 'links' => $variables['secondary_menu'], 'attributes' => array( 'class' => array('links', 'inline', 'secondary-menu'), ), @@ -91,66 +91,66 @@ function garland_preprocess_page(&$vars) { )); } else { - $vars['secondary_nav'] = FALSE; + $variables['secondary_nav'] = FALSE; } // Prepare header. $site_fields = array(); - if (!empty($vars['site_name'])) { - $site_fields[] = $vars['site_name']; + if (!empty($variables['site_name'])) { + $site_fields[] = $variables['site_name']; } - if (!empty($vars['site_slogan'])) { - $site_fields[] = $vars['site_slogan']; + if (!empty($variables['site_slogan'])) { + $site_fields[] = $variables['site_slogan']; } - $vars['site_title'] = implode(' ', $site_fields); + $variables['site_title'] = implode(' ', $site_fields); if (!empty($site_fields)) { $site_fields[0] = '' . $site_fields[0] . ''; } - $vars['site_html'] = implode(' ', $site_fields); + $variables['site_html'] = implode(' ', $site_fields); // Set a variable for the site name title and logo alt attributes text. - $slogan_text = $vars['site_slogan']; - $site_name_text = $vars['site_name']; - $vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text; + $slogan_text = $variables['site_slogan']; + $site_name_text = $variables['site_name']; + $variables['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text; } /** * Override or insert variables into the node template. */ -function garland_preprocess_node(&$vars) { - $vars['submitted'] = $vars['date'] . ' — ' . $vars['name']; +function garland_preprocess_node(&$variables) { + $variables['submitted'] = $variables['date'] . ' — ' . $variables['name']; } /** * Override or insert variables into the comment template. */ -function garland_preprocess_comment(&$vars) { - $vars['submitted'] = $vars['created'] . ' — ' . $vars['author']; +function garland_preprocess_comment(&$variables) { + $variables['submitted'] = $variables['created'] . ' — ' . $variables['author']; } /** * Override or insert variables into the block template. */ -function garland_preprocess_block(&$vars) { - $vars['title_attributes_array']['class'][] = 'title'; - $vars['classes_array'][] = 'clearfix'; +function garland_preprocess_block(&$variables) { + $variables['title_attributes_array']['class'][] = 'title'; + $variables['classes_array'][] = 'clearfix'; } /** * Override or insert variables into the page template. */ -function garland_process_page(&$vars) { +function garland_process_page(&$variables) { // Hook into color.module if (module_exists('color')) { - _color_page_alter($vars); + _color_page_alter($variables); } } /** * Override or insert variables into the region template. */ -function garland_preprocess_region(&$vars) { - if ($vars['region'] == 'header') { - $vars['classes_array'][] = 'clearfix'; +function garland_preprocess_region(&$variables) { + if ($variables['region'] == 'header') { + $variables['classes_array'][] = 'clearfix'; } } From e344d465b2e8c7dd4e812dbecfd29a10c6f2066e Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 01:14:45 -0400 Subject: [PATCH 23/77] Issue #1737714 by legovaer, rlhawk: Help text does not display when editing an image effect --- modules/image/image.module | 2 +- modules/image/image.test | 70 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/modules/image/image.module b/modules/image/image.module index fac8de955f8..dd71253d53d 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -64,7 +64,7 @@ function image_help($path, $arg) { $effect = image_effect_definition_load($arg[7]); return isset($effect['help']) ? ('

' . $effect['help'] . '

') : NULL; case 'admin/config/media/image-styles/edit/%/effects/%': - $effect = ($arg[5] == 'add') ? image_effect_definition_load($arg[6]) : image_effect_load($arg[6], $arg[4]); + $effect = ($arg[5] == 'add') ? image_effect_definition_load($arg[6]) : image_effect_load($arg[7], $arg[5]); return isset($effect['help']) ? ('

' . $effect['help'] . '

') : NULL; } } diff --git a/modules/image/image.test b/modules/image/image.test index 3591979482d..87d803a532d 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -77,6 +77,24 @@ class ImageFieldTestCase extends DrupalWebTestCase { return field_create_instance($instance); } + /** + * Create a random style. + * + * @return array + * A list containing the details of the generated image style. + */ + function createRandomStyle() { + $style_name = strtolower($this->randomName(10)); + $style_label = $this->randomString(); + image_style_save(array('name' => $style_name, 'label' => $style_label)); + $style_path = 'admin/config/media/image-styles/edit/' . $style_name; + return array( + 'name' => $style_name, + 'label' => $style_label, + 'path' => $style_path, + ); + } + /** * Upload an image to a node. * @@ -469,6 +487,58 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase { } } +/** + * Tests the administrative user interface. + */ +class ImageAdminUiTestCase extends ImageFieldTestCase { + public static function getInfo() { + return array( + 'name' => 'Administrative user interface', + 'description' => 'Tests the forms used in the administrative user interface.', + 'group' => 'Image', + ); + } + + function setUp() { + parent::setUp(array('image')); + } + + /** + * Test if the help text is available on the add effect form. + */ + function testAddEffectHelpText() { + // Create a random image style. + $style = $this->createRandomStyle(); + + // Open the add effect form and check for the help text. + $this->drupalGet($style['path'] . '/add/image_crop'); + $this->assertText(t('Cropping will remove portions of an image to make it the specified dimensions.'), 'The image style effect help text was displayed on the add effect page.'); + } + + /** + * Test if the help text is available on the edit effect form. + */ + function testEditEffectHelpText() { + // Create a random image style. + $random_style = $this->createRandomStyle(); + + // Add the crop effect to the image style. + $edit = array(); + $edit['data[width]'] = 20; + $edit['data[height]'] = 20; + $this->drupalPost($random_style['path'] . '/add/image_crop', $edit, t('Add effect')); + + // Open the edit effect form and check for the help text. + drupal_static_reset('image_styles'); + $style = image_style_load($random_style['name']); + + foreach ($style['effects'] as $ieid => $effect) { + $this->drupalGet($random_style['path'] . '/effects/' . $ieid); + $this->assertText(t('Cropping will remove portions of an image to make it the specified dimensions.'), 'The image style effect help text was displayed on the edit effect page.'); + } + } +} + /** * Tests creation, deletion, and editing of image styles and effects. */ From 6901ef70aa6466cbd30e8633b88b91c678b0f825 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 01:27:36 -0400 Subject: [PATCH 24/77] Issue #2486643 by AlexKirienko: Undefined index: nid in main() in statistics.php --- modules/statistics/statistics.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/statistics/statistics.php b/modules/statistics/statistics.php index f00e0397679..48340c89e2d 100644 --- a/modules/statistics/statistics.php +++ b/modules/statistics/statistics.php @@ -15,17 +15,19 @@ include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES); if (variable_get('statistics_count_content_views', 0) && variable_get('statistics_count_content_views_ajax', 0)) { - $nid = $_POST['nid']; - if (is_numeric($nid)) { - db_merge('node_counter') - ->key(array('nid' => $nid)) - ->fields(array( - 'daycount' => 1, - 'totalcount' => 1, - 'timestamp' => REQUEST_TIME, - )) - ->expression('daycount', 'daycount + 1') - ->expression('totalcount', 'totalcount + 1') - ->execute(); + if (isset($_POST['nid'])) { + $nid = $_POST['nid']; + if (is_numeric($nid)) { + db_merge('node_counter') + ->key(array('nid' => $nid)) + ->fields(array( + 'daycount' => 1, + 'totalcount' => 1, + 'timestamp' => REQUEST_TIME, + )) + ->expression('daycount', 'daycount + 1') + ->expression('totalcount', 'totalcount + 1') + ->execute(); + } } } From 8ee4f5accb4571020fdc86f952388810301a8d9c Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 01:30:39 -0400 Subject: [PATCH 25/77] Issue #1514088 by DamienMcKenna: Minor comment formatting inconsistencies in cache.inc --- includes/cache.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/cache.inc b/includes/cache.inc index 207bf6615c0..4c2bed32135 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -14,6 +14,7 @@ * * @param $bin * The cache bin for which the cache object should be returned. + * * @return DrupalCacheInterface * The cache object associated with the specified bin. * From 69b1ff814b49cb6bb8c0108df77e3ef18852ec81 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 01:48:44 -0400 Subject: [PATCH 26/77] Issue #1719280 by GuyPaddock, Robin Millette: Undefined index warning in user_menu_link_alter() when manually adding a "user" path as a shortcut --- modules/user/user.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/user/user.module b/modules/user/user.module index 21a41d56fb1..6a742c8e67b 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1911,13 +1911,13 @@ function user_menu_link_alter(&$link) { // for authenticated users. Authenticated users should see "My account", but // anonymous users should not see it at all. Therefore, invoke // user_translated_menu_link_alter() to conditionally hide the link. - if ($link['link_path'] == 'user' && $link['module'] == 'system') { + if ($link['link_path'] == 'user' && isset($link['module']) && $link['module'] == 'system') { $link['options']['alter'] = TRUE; } // Force the Logout link to appear on the top-level of 'user-menu' menu by // default (i.e., unless it has been customized). - if ($link['link_path'] == 'user/logout' && $link['module'] == 'system' && empty($link['customized'])) { + if ($link['link_path'] == 'user/logout' && isset($link['module']) && $link['module'] == 'system' && empty($link['customized'])) { $link['plid'] = 0; } } From f33147e9b49facc6c6fc93c25a6f9fab992843b6 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 01:55:33 -0400 Subject: [PATCH 27/77] Issue #2254235 by AohRveTPV, mahtoranjeet, er.pushpinderrana, yogen.prasad, ashutoshsngh, Manjit.Singh, Charles Belov, nod_, droplet: Don't include leading and trailing spaces in password strength --- modules/user/user.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/user/user.js b/modules/user/user.js index d182066ad82..4cf981611e9 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -93,6 +93,8 @@ Drupal.behaviors.password = { * Returns the estimated strength and the relevant output message. */ Drupal.evaluatePasswordStrength = function (password, translate) { + password = $.trim(password); + var weaknesses = 0, strength = 100, msg = []; var hasLowercase = /[a-z]+/.test(password); From c515c14dadab747b7fb02af04723be2435dff6b8 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 02:08:50 -0400 Subject: [PATCH 28/77] Issue #1520716 by lokapujya, djdevin, David Lesieur, cwells, jhedstrom: "Files displayed by default" not respected --- CHANGELOG.txt | 1 + modules/file/file.field.inc | 2 +- modules/file/tests/file.test | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ce450178287..4d4b4c4d976 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,7 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Fixed non-functional "Files displayed by default" setting on file fields. - The "worker callback" provided in hook_cron_queue_info() and the "finished" callback specified during batch processing can now be any PHP callable instead of just functions. diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc index 794f16e676d..d592381bd56 100644 --- a/modules/file/file.field.inc +++ b/modules/file/file.field.inc @@ -632,7 +632,7 @@ function file_field_widget_process($element, &$form_state, $form) { $element['#theme'] = 'file_widget'; // Add the display field if enabled. - if (!empty($field['settings']['display_field']) && $item['fid']) { + if (!empty($field['settings']['display_field'])) { $element['display'] = array( '#type' => empty($item['fid']) ? 'hidden' : 'checkbox', '#title' => t('Include file in display'), diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test index 5c19d001fab..80433954b6b 100644 --- a/modules/file/tests/file.test +++ b/modules/file/tests/file.test @@ -951,6 +951,34 @@ class FileFieldDisplayTestCase extends FileFieldTestCase { $this->assertRaw($field_name . '[' . LANGUAGE_NONE . '][0][display]', 'First file appears as expected.'); $this->assertRaw($field_name . '[' . LANGUAGE_NONE . '][1][display]', 'Second file appears as expected.'); } + + /** + * Tests default display of File Field. + */ + function testDefaultFileFieldDisplay() { + $field_name = strtolower($this->randomName()); + $type_name = 'article'; + $field_settings = array( + 'display_field' => '1', + 'display_default' => '0', + ); + $instance_settings = array( + 'description_field' => '1', + ); + $widget_settings = array(); + $this->createFileField($field_name, $type_name, $field_settings, $instance_settings, $widget_settings); + $field = field_info_field($field_name); + $instance = field_info_instance('node', $field_name, $type_name); + + $test_file = $this->getTestFile('text'); + + // Create a new node with the uploaded file. + $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); + + $this->drupalGet('node/' . $nid . '/edit'); + $this->assertFieldByXPath('//input[@type="checkbox" and @name="' . $field_name . '[und][0][display]"]', NULL, 'Default file display checkbox field exists.'); + $this->assertFieldByXPath('//input[@type="checkbox" and @name="' . $field_name . '[und][0][display]" and not(@checked)]', NULL, 'Default file display is off.'); + } } /** From e67dfa572cde8575162c03594c168183efda0849 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 02:23:36 -0400 Subject: [PATCH 29/77] Issue #2060553 by jhodgdon, sivaji@knackforge.com, manningpete: Test that searching for HTML entities works as expected --- modules/search/search.test | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/search/search.test b/modules/search/search.test index 5f16db3f8b2..5ee5870d4fc 100644 --- a/modules/search/search.test +++ b/modules/search/search.test @@ -2029,10 +2029,11 @@ class SearchNodeAccessTest extends DrupalWebTestCase { } /** - * Tests that search returns results with punctuation in the search phrase. + * Tests that search works with punctuation and HTML entities. */ function testPhraseSearchPunctuation() { $node = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => "The bunny's ears were fuzzy."))))); + $node2 = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => 'Dignissim Aliquam & Quieligo meus natu quae quia te. Damnum© erat— neo pneum. Facilisi feugiat ibidem ratis.'))))); // Update the search index. module_invoke_all('update_index'); @@ -2045,6 +2046,17 @@ class SearchNodeAccessTest extends DrupalWebTestCase { $edit = array('keys' => '"bunny\'s"'); $this->drupalPost('search/node', $edit, t('Search')); $this->assertText($node->title); + + // Search for "&" and verify entities are not broken up in the output. + $edit = array('keys' => '&'); + $this->drupalPost('search/node', $edit, t('Search')); + $this->assertNoRaw('&amp;'); + $this->assertText('You must include at least one positive keyword'); + + $edit = array('keys' => '&'); + $this->drupalPost('search/node', $edit, t('Search')); + $this->assertNoRaw('&amp;'); + $this->assertText('You must include at least one positive keyword'); } } From 6c6088e492d93b1475eb629430cc33af62dc5d70 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 02:28:25 -0400 Subject: [PATCH 30/77] Issue #2494403 by tonystar: $field_types is not initialized in drupal_schema_field_types() --- includes/common.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/common.inc b/includes/common.inc index 5268fd8305d..bf187dbb995 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7165,6 +7165,7 @@ function _drupal_schema_initialize(&$schema, $module, $remove_descriptions = TRU */ function drupal_schema_field_types($table) { $table_schema = drupal_get_schema($table); + $field_types = array(); foreach ($table_schema['fields'] as $field_name => $field_info) { $field_types[$field_name] = isset($field_info['type']) ? $field_info['type'] : NULL; } From f09fb9ec7c506f12d7f2498faa1a3f3d51d16547 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 02:34:48 -0400 Subject: [PATCH 31/77] Issue #1845104 by dcam, longwave, thehong, er.pushpinderrana, martin_q, David_Rothstein: drupal_set_message('0') results in no output rather than outputting "0" --- CHANGELOG.txt | 2 ++ includes/bootstrap.inc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4d4b4c4d976..98f4bca253b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Made drupal_set_message() display and return messages when "0" is passed in + as the message to set. - Fixed non-functional "Files displayed by default" setting on file fields. - The "worker callback" provided in hook_cron_queue_info() and the "finished" callback specified during batch processing can now be any PHP callable diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index b2f2b042e02..086cef0a90e 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1780,7 +1780,7 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO * @see theme_status_messages() */ function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) { - if ($message) { + if ($message || $message === '0' || $message === 0) { if (!isset($_SESSION['messages'][$type])) { $_SESSION['messages'][$type] = array(); } From d2900abc52256190275b1ed7c3d75e88d14c48c4 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 14:19:06 -0400 Subject: [PATCH 32/77] Issue #1534490 by msonnabaum, bigjim, David_Rothstein, pounard, Dave Reid: Make block cache cids alterable --- CHANGELOG.txt | 2 ++ modules/block/block.api.php | 25 +++++++++++++++++++++++++ modules/block/block.module | 1 + 3 files changed, 28 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 98f4bca253b..dfdfdd76583 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Added a new hook, hook_block_cid_parts_alter(), to allow modules to alter the + cache keys used for caching a particular block. - Made drupal_set_message() display and return messages when "0" is passed in as the message to set. - Fixed non-functional "Files displayed by default" setting on file fields. diff --git a/modules/block/block.api.php b/modules/block/block.api.php index d7453b24b32..e38f7d6ee8c 100644 --- a/modules/block/block.api.php +++ b/modules/block/block.api.php @@ -363,6 +363,31 @@ function hook_block_list_alter(&$blocks) { } } +/** + * Act on block cache ID (cid) parts before the cid is generated. + * + * This hook allows you to add, remove or modify the custom keys used to + * generate a block cache ID (by default, these keys are set to the block + * module and delta). These keys will be combined with the standard ones + * provided by drupal_render_cid_parts() to generate the final block cache ID. + * + * To change the cache granularity used by drupal_render_cid_parts(), this hook + * cannot be used; instead, set the 'cache' key in the block's definition in + * hook_block_info(). + * + * @params $cid_parts + * An array of elements used to build the cid. + * @param $block + * The block object being acted on. + * + * @see _block_get_cache_id() + */ +function hook_block_cid_parts_alter(&$cid_parts, $block) { + global $user; + // This example shows how to cache a block based on the user's timezone. + $cid_parts[] = $user->timezone; +} + /** * @} End of "addtogroup hooks". */ diff --git a/modules/block/block.module b/modules/block/block.module index 48c80d766c9..fe04e990289 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -967,6 +967,7 @@ function _block_get_cache_id($block) { // Start with common sub-patterns: block identification, theme, language. $cid_parts[] = $block->module; $cid_parts[] = $block->delta; + drupal_alter('block_cid_parts', $cid_parts, $block); $cid_parts = array_merge($cid_parts, drupal_render_cid_parts($block->cache)); return implode(':', $cid_parts); From 00206a4d7f87981b3b1212942ce65f371c0cb3ae Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 15:23:37 -0400 Subject: [PATCH 33/77] Issue #1647440 by chrisrockwell, Dave Reid, greggles: Fix PHP notice if invalid format ID requested at filter/tips/format-id --- CHANGELOG.txt | 5 +++++ modules/filter/filter.module | 8 ++++++++ modules/filter/filter.pages.inc | 7 +++---- modules/filter/filter.test | 21 +++++++++++++++++++++ 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dfdfdd76583..ec87eb020b5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,11 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Changed the page that displays filter tips for a particular text format, for + example filter/tips/full_html, to return "page not found" or "access denied" + if the format does not exist or the user does not have access to it. This + change adds a new menu item to the Filter module's hook_menu() entry (minor + data structure change). - Added a new hook, hook_block_cid_parts_alter(), to allow modules to alter the cache keys used for caching a particular block. - Made drupal_set_message() display and return messages when "0" is passed in diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 83876808b2b..edf7aa98b64 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -93,6 +93,14 @@ function filter_menu() { 'type' => MENU_SUGGESTED_ITEM, 'file' => 'filter.pages.inc', ); + $items['filter/tips/%filter_format'] = array( + 'title' => 'Compose tips', + 'page callback' => 'filter_tips_long', + 'page arguments' => array(2), + 'access callback' => 'filter_access', + 'access arguments' => array(2), + 'file' => 'filter.pages.inc', + ); $items['admin/config/content/formats'] = array( 'title' => 'Text formats', 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', diff --git a/modules/filter/filter.pages.inc b/modules/filter/filter.pages.inc index e602bcef08c..0f13da84273 100644 --- a/modules/filter/filter.pages.inc +++ b/modules/filter/filter.pages.inc @@ -14,10 +14,9 @@ * @see filter_menu() * @see theme_filter_tips() */ -function filter_tips_long() { - $format_id = arg(2); - if ($format_id) { - $output = theme('filter_tips', array('tips' => _filter_tips($format_id, TRUE), 'long' => TRUE)); +function filter_tips_long($format = NULL) { + if (!empty($format)) { + $output = theme('filter_tips', array('tips' => _filter_tips($format->format, TRUE), 'long' => TRUE)); } else { $output = theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE)); diff --git a/modules/filter/filter.test b/modules/filter/filter.test index 547118515c6..1565c0c57f1 100644 --- a/modules/filter/filter.test +++ b/modules/filter/filter.test @@ -555,6 +555,27 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase { $this->assertTrue(isset($options[$this->allowed_format->format]), 'The allowed text format appears as an option when adding a new node.'); $this->assertFalse(isset($options[$this->disallowed_format->format]), 'The disallowed text format does not appear as an option when adding a new node.'); $this->assertTrue(isset($options[filter_fallback_format()]), 'The fallback format appears as an option when adding a new node.'); + + // Check regular user access to the filter tips pages. + $this->drupalGet('filter/tips/' . $this->allowed_format->format); + $this->assertResponse(200); + $this->drupalGet('filter/tips/' . $this->disallowed_format->format); + $this->assertResponse(403); + $this->drupalGet('filter/tips/' . filter_fallback_format()); + $this->assertResponse(200); + $this->drupalGet('filter/tips/invalid-format'); + $this->assertResponse(404); + + // Check admin user access to the filter tips pages. + $this->drupalLogin($this->admin_user); + $this->drupalGet('filter/tips/' . $this->allowed_format->format); + $this->assertResponse(200); + $this->drupalGet('filter/tips/' . $this->disallowed_format->format); + $this->assertResponse(200); + $this->drupalGet('filter/tips/' . filter_fallback_format()); + $this->assertResponse(200); + $this->drupalGet('filter/tips/invalid-format'); + $this->assertResponse(404); } /** From 6e6c3dba67cda8b218befae00422d361b3990942 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 17:53:46 -0400 Subject: [PATCH 34/77] Issue #2455057 by michaellenahan, jhodgdon, jelo: Fix fast 404 settings for private image files --- CHANGELOG.txt | 2 ++ sites/default/default.settings.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ec87eb020b5..51bd4ac0db2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Changed the default settings.php configuration to exclude private files from + the "404_fast_paths" behavior. - Changed the page that displays filter tips for a particular text format, for example filter/tips/full_html, to return "page not found" or "access denied" if the format does not exist or the user does not have access to it. This diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 562f99855e3..214e9395714 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -494,6 +494,7 @@ * specific pattern: * - 404_fast_paths_exclude: A regular expression to match paths to exclude, * such as images generated by image styles, or dynamically-resized images. + * The default pattern provided below also excludes the private file system. * If you need to add more paths, you can add '|path' to the expression. * - 404_fast_paths: A regular expression to match paths that should return a * simple 404 page, rather than the fully themed 404 page. If you don't have @@ -502,7 +503,7 @@ * * Add leading hash signs if you would like to disable this functionality. */ -$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//'; +$conf['404_fast_paths_exclude'] = '/\/(?:styles)|(?:system\/files)\//'; $conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; $conf['404_fast_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; From 21932a5f8a7ea90cd9251b9db7196b495c6842c3 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 18:19:34 -0400 Subject: [PATCH 35/77] Issue #2477641 by opdavies, markpavlitski, pguillard, sivaji@knackforge.com, kaypro4, gyuhyon, edutrul, yoroy: One-time login link failure messages are misleading because they are not marked as errors --- CHANGELOG.txt | 3 +++ modules/user/user.pages.inc | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 51bd4ac0db2..125c620fa62 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Changed one-time login link failure messages to be displayed as errors or + warnings as appropriate, rather than as regular status messages (minor UI + change and data structure change). - Changed the default settings.php configuration to exclude private files from the "404_fast_paths" behavior. - Changed the page that displays filter tips for a particular text format, for diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index f21bd134d88..2d3c13d00b2 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -105,10 +105,10 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a $reset_link_account = user_load($uid); if (!empty($reset_link_account)) { drupal_set_message(t('Another user (%other_user) is already logged into the site on this computer, but you tried to use a one-time link for user %resetting_user. Please logout and try using the link again.', - array('%other_user' => $user->name, '%resetting_user' => $reset_link_account->name, '!logout' => url('user/logout')))); + array('%other_user' => $user->name, '%resetting_user' => $reset_link_account->name, '!logout' => url('user/logout'))), 'warning'); } else { // Invalid one-time link specifies an unknown user. - drupal_set_message(t('The one-time login link you clicked is invalid.')); + drupal_set_message(t('The one-time login link you clicked is invalid.'), 'error'); } } drupal_goto(); @@ -123,7 +123,7 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a if ($timestamp <= $current && $account = reset($users)) { // No time out for first time login. if ($account->login && $current - $timestamp > $timeout) { - drupal_set_message(t('You have tried to use a one-time login link that has expired. Please request a new one using the form below.')); + drupal_set_message(t('You have tried to use a one-time login link that has expired. Please request a new one using the form below.'), 'error'); drupal_goto('user/password'); } elseif ($account->uid && $timestamp >= $account->login && $timestamp <= $current && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid)) { @@ -151,7 +151,7 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a } } else { - drupal_set_message(t('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.')); + drupal_set_message(t('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.'), 'error'); drupal_goto('user/password'); } } @@ -533,7 +533,7 @@ function user_cancel_confirm($account, $timestamp = 0, $hashed_pass = '') { batch_process(''); } else { - drupal_set_message(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.')); + drupal_set_message(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), 'error'); drupal_goto("user/$account->uid/cancel"); } } From c2d06db1234580248b9b6475113f3ee1cc0b08ab Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 18:32:44 -0400 Subject: [PATCH 36/77] Issue #2538640 by rrrob, dawehner: Add theme_debug to default.settings.php --- sites/default/default.settings.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 214e9395714..7e36a4ab54e 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -566,3 +566,21 @@ * Remove the leading hash signs to disable. */ # $conf['allow_authorize_operations'] = FALSE; + +/** + * Theme debugging: + * + * When debugging is enabled: + * - The markup of each template is surrounded by HTML comments that contain + * theming information, such as template file name suggestions. + * - Note that this debugging markup will cause automated tests that directly + * check rendered HTML to fail. + * + * For more information about debugging theme templates, see + * https://www.drupal.org/node/223440#theme-debug. + * + * Not recommended in production environments. + * + * Remove the leading hash sign to enable. + */ +# $conf['theme_debug'] = TRUE; From 186368f1c98ef0bba70473aabf135026c7e722de Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 18:36:35 -0400 Subject: [PATCH 37/77] Issue #2500717 by afi13, cilefen, evilfurryone: Sort entries in the site status report page alphabetically, BUT case-insensitively --- modules/system/system.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/system.module b/modules/system/system.module index d0dda18dc33..39de758edba 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2815,7 +2815,7 @@ function system_settings_form_submit($form, &$form_state) { function _system_sort_requirements($a, $b) { if (!isset($a['weight'])) { if (!isset($b['weight'])) { - return strcmp($a['title'], $b['title']); + return strcasecmp($a['title'], $b['title']); } return -$b['weight']; } From 566312388ac7fdfd24bfa3c98e85d5c26eb4776c Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 18:40:10 -0400 Subject: [PATCH 38/77] Issue #2559335 by epophoto, cilefen, andrewmk: password-hash.sh is hardcoded to use "/usr/bin/php" --- scripts/password-hash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/password-hash.sh b/scripts/password-hash.sh index 004421a896c..1afe4387a1c 100755 --- a/scripts/password-hash.sh +++ b/scripts/password-hash.sh @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php Date: Mon, 12 Oct 2015 19:46:01 -0400 Subject: [PATCH 39/77] Issue #2163209 by mgifford, David_Rothstein, andrewmacpherson, talhaparacha, dcam, Charles Belov, davidhernandez, jwhitsit: Add alternate text to file icon --- CHANGELOG.txt | 2 ++ modules/file/file.module | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 125c620fa62..1be8283ad16 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Added alternate text to file icons displayed by the File module, to improve + accessibility (minor API addition to theme_file_icon()). - Changed one-time login link failure messages to be displayed as errors or warnings as appropriate, rather than as regular status messages (minor UI change and data structure change). diff --git a/modules/file/file.module b/modules/file/file.module index ae452a68325..fbf8b81ecf1 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -92,7 +92,7 @@ function file_theme() { 'variables' => array('file' => NULL, 'icon_directory' => NULL), ), 'file_icon' => array( - 'variables' => array('file' => NULL, 'icon_directory' => NULL), + 'variables' => array('file' => NULL, 'icon_directory' => NULL, 'alt' => ''), ), 'file_managed_file' => array( 'render element' => 'element', @@ -749,7 +749,32 @@ function theme_file_link($variables) { $icon_directory = $variables['icon_directory']; $url = file_create_url($file->uri); - $icon = theme('file_icon', array('file' => $file, 'icon_directory' => $icon_directory)); + + // Human-readable names, for use as text-alternatives to icons. + $mime_name = array( + 'application/msword' => t('Microsoft Office document icon'), + 'application/vnd.ms-excel' => t('Office spreadsheet icon'), + 'application/vnd.ms-powerpoint' => t('Office presentation icon'), + 'application/pdf' => t('PDF icon'), + 'video/quicktime' => t('Movie icon'), + 'audio/mpeg' => t('Audio icon'), + 'audio/wav' => t('Audio icon'), + 'image/jpeg' => t('Image icon'), + 'image/png' => t('Image icon'), + 'image/gif' => t('Image icon'), + 'application/zip' => t('Package icon'), + 'text/html' => t('HTML icon'), + 'text/plain' => t('Plain text icon'), + 'application/octet-stream' => t('Binary Data'), + ); + + $mimetype = file_get_mimetype($file->uri); + + $icon = theme('file_icon', array( + 'file' => $file, + 'icon_directory' => $icon_directory, + 'alt' => !empty($mime_name[$mimetype]) ? $mime_name[$mimetype] : t('File'), + )); // Set options as per anchor format described at // http://microformats.org/wiki/file-format-examples @@ -779,16 +804,19 @@ function theme_file_link($variables) { * - file: A file object for which to make an icon. * - icon_directory: (optional) A path to a directory of icons to be used for * files. Defaults to the value of the "file_icon_directory" variable. + * - alt: (optional) The alternative text to represent the icon in text-based + * browsers. Defaults to an empty string. * * @ingroup themeable */ function theme_file_icon($variables) { $file = $variables['file']; + $alt = $variables['alt']; $icon_directory = $variables['icon_directory']; $mime = check_plain($file->filemime); $icon_url = file_icon_url($file, $icon_directory); - return ''; + return '' . check_plain($alt) . ''; } /** From 7f638a8c8ffb97af9e6507800788bd182eee2744 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 19:55:34 -0400 Subject: [PATCH 40/77] Update CHANGELOG.txt with additional details about issue #2163209. --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1be8283ad16..064d007d24c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,7 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- - Added alternate text to file icons displayed by the File module, to improve - accessibility (minor API addition to theme_file_icon()). + accessibility (string change, and minor API addition to theme_file_icon()). - Changed one-time login link failure messages to be displayed as errors or warnings as appropriate, rather than as regular status messages (minor UI change and data structure change). From 792aca6823966f0d464ed05388dbf813d103285d Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 20:58:13 -0400 Subject: [PATCH 41/77] Issue #2392109 by jacob.embree, sumitmadan, ByronNorris, dcmul, ckaotik, jhedstrom: Filter: Allow plus sign in email addresses --- CHANGELOG.txt | 2 ++ modules/filter/filter.module | 2 +- modules/filter/filter.test | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 064d007d24c..c2e0bf389ba 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Fixed the URL text filter to convert e-mail addresses with plus signs into + mailto: links. - Added alternate text to file icons displayed by the File module, to improve accessibility (string change, and minor API addition to theme_file_icon()). - Changed one-time login link failure messages to be displayed as errors or diff --git a/modules/filter/filter.module b/modules/filter/filter.module index edf7aa98b64..c710ee700bb 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -1497,7 +1497,7 @@ function _filter_url($text, $filter) { $tasks['_filter_url_parse_full_links'] = $pattern; // Match e-mail addresses. - $url_pattern = "[A-Za-z0-9._-]{1,254}@(?:$domain)"; + $url_pattern = "[A-Za-z0-9._+-]{1,254}@(?:$domain)"; $pattern = "`($url_pattern)`"; $tasks['_filter_url_parse_email_links'] = $pattern; diff --git a/modules/filter/filter.test b/modules/filter/filter.test index 1565c0c57f1..d558fa3bedc 100644 --- a/modules/filter/filter.test +++ b/modules/filter/filter.test @@ -1294,6 +1294,7 @@ class FilterUnitTestCase extends DrupalUnitTestCase { // Create a e-mail that is too long. $long_email = str_repeat('a', 254) . '@example.com'; $too_long_email = str_repeat('b', 255) . '@example.com'; + $email_with_plus_sign = 'one+two@example.com'; // Filter selection/pattern matching. @@ -1307,12 +1308,13 @@ http://example.com or www.example.com ), // MAILTO URLs. ' -person@example.com or mailto:person2@example.com or ' . $long_email . ' but not ' . $too_long_email . ' +person@example.com or mailto:person2@example.com or ' . $email_with_plus_sign . ' or ' . $long_email . ' but not ' . $too_long_email . ' ' => array( 'person@example.com' => TRUE, 'mailto:person2@example.com' => TRUE, '' . $long_email . '' => TRUE, '' . $too_long_email . '' => FALSE, + '' . $email_with_plus_sign . '' => TRUE, ), // URI parts and special characters. ' From ab86fe4810a2ec33386ec702e16f257feef3f45e Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 21:29:08 -0400 Subject: [PATCH 42/77] Issue #2313085 by tkuldeep17: Can't add class to user picture by template_preprocess_user_picture as class attribute has hard coded in user picture tpl file --- CHANGELOG.txt | 2 ++ modules/user/user-picture.tpl.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c2e0bf389ba..8602daa6fde 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Allowed the user-picture.tpl.php theme template to have HTML classes besides + the default "user-picture" class printed in it (markup change). - Fixed the URL text filter to convert e-mail addresses with plus signs into mailto: links. - Added alternate text to file icons displayed by the File module, to improve diff --git a/modules/user/user-picture.tpl.php b/modules/user/user-picture.tpl.php index ee821878602..11d92cc512b 100644 --- a/modules/user/user-picture.tpl.php +++ b/modules/user/user-picture.tpl.php @@ -17,7 +17,7 @@ */ ?> -
+
From f12effc70c835e77bfdea394214df9247533d319 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 23:17:31 -0400 Subject: [PATCH 43/77] Issue #1592688 by jgtrescazes, tstoeckler, eric.chenchao, fietserwin, Heine, stefan.r, Dmitriy.trt, lachezar.valchev, bogdan khrupa: #states can cause the form "required" mark to appear more than once on the same element --- misc/states.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/states.js b/misc/states.js index 6d98da81b9e..5aac65d20c8 100644 --- a/misc/states.js +++ b/misc/states.js @@ -493,7 +493,11 @@ $(document).bind('state:disabled', function(e) { $(document).bind('state:required', function(e) { if (e.trigger) { if (e.value) { - $(e.target).closest('.form-item, .form-wrapper').find('label').append('*'); + var $label = $(e.target).closest('.form-item, .form-wrapper').find('label'); + // Avoids duplicate required markers on initialization. + if (!$label.find('.form-required').length) { + $label.append('*'); + } } else { $(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove(); From 183a425c551969d4f56b04766fca82819a2a7b15 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 23:32:29 -0400 Subject: [PATCH 44/77] Issue #2508055 by Dave Reid, David_Rothstein, hussainweb: Add support for autoloading Traits --- CHANGELOG.txt | 2 ++ includes/bootstrap.inc | 21 ++++++++++++++++++- includes/registry.inc | 2 +- modules/simpletest/tests/bootstrap.test | 4 ++++ .../drupal_autoload_test.module | 16 ++++++++++++++ .../drupal_autoload_test_trait.sh | 16 ++++++++++++++ 6 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_trait.sh diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8602daa6fde..6101a1e3cab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Added support for autoloading traits via the registry on sites running PHP + 5.4 or higher. - Allowed the user-picture.tpl.php theme template to have HTML classes besides the default "user-picture" class printed in it (markup change). - Fixed the URL text filter to convert e-mail addresses with plus signs into diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 086cef0a90e..70d426b4ae1 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -2468,6 +2468,9 @@ function _drupal_bootstrap_database() { // the install or upgrade process. spl_autoload_register('drupal_autoload_class'); spl_autoload_register('drupal_autoload_interface'); + if (version_compare(PHP_VERSION, '5.4') >= 0) { + spl_autoload_register('drupal_autoload_trait'); + } } /** @@ -3111,6 +3114,22 @@ function drupal_autoload_class($class) { return _registry_check_code('class', $class); } +/** + * Confirms that a trait is available. + * + * This function is rarely called directly. Instead, it is registered as an + * spl_autoload() handler, and PHP calls it for us when necessary. + * + * @param string $trait + * The name of the trait to check or load. + * + * @return bool + * TRUE if the trait is currently available, FALSE otherwise. + */ +function drupal_autoload_trait($trait) { + return _registry_check_code('trait', $trait); +} + /** * Checks for a resource in the registry. * @@ -3129,7 +3148,7 @@ function drupal_autoload_class($class) { function _registry_check_code($type, $name = NULL) { static $lookup_cache, $cache_update_needed; - if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) { + if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name) || $type == 'trait' && trait_exists($name)) { return TRUE; } diff --git a/includes/registry.inc b/includes/registry.inc index 5fc767487d9..29a1fca8cc5 100644 --- a/includes/registry.inc +++ b/includes/registry.inc @@ -164,7 +164,7 @@ function _registry_parse_files($files) { * (optional) Weight of the module. */ function _registry_parse_file($filename, $contents, $module = '', $weight = 0) { - if (preg_match_all('/^\s*(?:abstract|final)?\s*(class|interface)\s+([a-zA-Z0-9_]+)/m', $contents, $matches)) { + if (preg_match_all('/^\s*(?:abstract|final)?\s*(class|interface|trait)\s+([a-zA-Z0-9_]+)/m', $contents, $matches)) { foreach ($matches[2] as $key => $name) { db_merge('registry') ->key(array( diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test index ece1cd9e900..d46c6ec8fcb 100644 --- a/modules/simpletest/tests/bootstrap.test +++ b/modules/simpletest/tests/bootstrap.test @@ -313,6 +313,10 @@ class BootstrapAutoloadTestCase extends DrupalWebTestCase { $this->assertTrue(drupal_autoload_interface('drupalautoloadtestinterface'), 'drupal_autoload_interface() recognizes DrupalAutoloadTestInterface in lower case.'); // Test class autoloader. $this->assertTrue(drupal_autoload_class('drupalautoloadtestclass'), 'drupal_autoload_class() recognizes DrupalAutoloadTestClass in lower case.'); + // Test trait autoloader. + if (version_compare(PHP_VERSION, '5.4') >= 0) { + $this->assertTrue(drupal_autoload_trait('drupalautoloadtesttrait'), 'drupal_autoload_trait() recognizes DrupalAutoloadTestTrait in lower case.'); + } } } diff --git a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module index 37aa94eb83b..edd5d77cb79 100644 --- a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module +++ b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module @@ -4,3 +4,19 @@ * @file * Test module to check code registry. */ + +/** + * Implements hook_registry_files_alter(). + */ +function drupal_autoload_test_registry_files_alter(&$files, $modules) { + foreach ($modules as $module) { + // Add the drupal_autoload_test_trait.sh file to the registry when PHP 5.4+ + // is being used. + if ($module->name == 'drupal_autoload_test' && version_compare(PHP_VERSION, '5.4') >= 0) { + $files["$module->dir/drupal_autoload_test_trait.sh"] = array( + 'module' => $module->name, + 'weight' => $module->weight, + ); + } + } +} diff --git a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_trait.sh b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_trait.sh new file mode 100644 index 00000000000..69ce9ec08b5 --- /dev/null +++ b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_trait.sh @@ -0,0 +1,16 @@ + Date: Mon, 12 Oct 2015 23:39:43 -0400 Subject: [PATCH 45/77] Issue #2512210 by trgreen17, naveenvalecha, David_Rothstein, jhodgdon, liberatr: SimpleTest - WebTestBase method creates binary-text files when the intention was to create text files, and text file creation is broken --- modules/simpletest/drupal_web_test_case.php | 2 +- modules/simpletest/simpletest.module | 32 ++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index d7350698c98..bf1e9c31c77 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1065,7 +1065,7 @@ protected function drupalGetTestFiles($type, $size = NULL) { $lines = array(16, 256, 1024, 2048, 20480); $count = 0; foreach ($lines as $line) { - simpletest_generate_file('text-' . $count++, 64, $line); + simpletest_generate_file('text-' . $count++, 64, $line, 'text'); } // Copy other test files from simpletest. diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index 91f0f9065e8..a98e5cfbe19 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -509,25 +509,25 @@ function simpletest_registry_files_alter(&$files, $modules) { * Generate test file. */ function simpletest_generate_file($filename, $width, $lines, $type = 'binary-text') { - $size = $width * $lines - $lines; - - // Generate random text $text = ''; - for ($i = 0; $i < $size; $i++) { - switch ($type) { - case 'text': - $text .= chr(rand(32, 126)); - break; - case 'binary': - $text .= chr(rand(0, 31)); - break; - case 'binary-text': - default: - $text .= rand(0, 1); - break; + for ($i = 0; $i < $lines; $i++) { + // Generate $width - 1 characters to leave space for the "\n" character. + for ($j = 0; $j < $width - 1; $j++) { + switch ($type) { + case 'text': + $text .= chr(rand(32, 126)); + break; + case 'binary': + $text .= chr(rand(0, 31)); + break; + case 'binary-text': + default: + $text .= rand(0, 1); + break; + } } + $text .= "\n"; } - $text = wordwrap($text, $width - 1, "\n", TRUE) . "\n"; // Add \n for symmetrical file. // Create filename. file_put_contents('public://' . $filename . '.txt', $text); From 21598ba65ef45a088204278f96ee61d443f0bb17 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 12 Oct 2015 23:59:26 -0400 Subject: [PATCH 46/77] Issue #2581743 by carstenG: Missing space in block module --- modules/block/block.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/block/block.module b/modules/block/block.module index fe04e990289..405a9537aa9 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -350,7 +350,7 @@ function _block_get_renderable_array($list = array()) { '#block' => $block, '#weight' => ++$weight, ); - $build[$key]['#theme_wrappers'][] ='block'; + $build[$key]['#theme_wrappers'][] = 'block'; } $build['#sorted'] = TRUE; return $build; From e719d5cfe23d9b319bdb064f15dcd53eb6fc2070 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 00:00:49 -0400 Subject: [PATCH 47/77] Issue #1576552 by jhedstrom, jcisio, markie: Prevent PHP notices in path_node_insert/update if $node->path is defined but $node->path['alias'] is not --- modules/path/path.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/path/path.module b/modules/path/path.module index 81c7bb2c59c..4614b0fa222 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -185,7 +185,7 @@ function path_form_element_validate($element, &$form_state, $complete_form) { * Implements hook_node_insert(). */ function path_node_insert($node) { - if (isset($node->path)) { + if (isset($node->path) && isset($node->path['alias'])) { $path = $node->path; $path['alias'] = trim($path['alias']); // Only save a non-empty alias. @@ -205,9 +205,9 @@ function path_node_insert($node) { function path_node_update($node) { if (isset($node->path)) { $path = $node->path; - $path['alias'] = trim($path['alias']); + $path['alias'] = isset($path['alias']) ? trim($path['alias']) : ''; // Delete old alias if user erased it. - if (!empty($path['pid']) && empty($path['alias'])) { + if (!empty($path['pid']) && !$path['alias']) { path_delete($path['pid']); } path_node_insert($node); From 2fd22bd09f6be148c6b5f7ec888c15f910c940ed Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 00:18:03 -0400 Subject: [PATCH 48/77] Issue #955658 by Refineo, dswier, steinmb, emorency, filijonka, yched, Bevan: Undefined index: module in FieldInfo::prepareInstanceDisplay() --- modules/field/field.info.class.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/field/field.info.class.inc b/modules/field/field.info.class.inc index f4f1f6300a6..772cd451f37 100644 --- a/modules/field/field.info.class.inc +++ b/modules/field/field.info.class.inc @@ -612,10 +612,12 @@ class FieldInfo { // Fill in default values. $display += array( 'label' => 'above', - 'type' => $field_type_info['default_formatter'], 'settings' => array(), 'weight' => 0, ); + if (empty($display['type'])) { + $display['type'] = $field_type_info['default_formatter']; + } if ($display['type'] != 'hidden') { $formatter_type_info = field_info_formatter_types($display['type']); // Fall back to default formatter if formatter type is not available. From 63358dff31f8ecdd9eb00a61de1122123ff6f1d7 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 00:31:22 -0400 Subject: [PATCH 49/77] Issue #2350033 by murrayw, kenorb: drupal_http_request thinks 201 through 206 status codes are an error --- CHANGELOG.txt | 2 ++ includes/common.inc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6101a1e3cab..f23b9c9930e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Prevented drupal_http_request() from returning an error when it receives a + 201 through 206 HTTP status code. - Added support for autoloading traits via the registry on sites running PHP 5.4 or higher. - Allowed the user-picture.tpl.php theme template to have HTML classes besides diff --git a/includes/common.inc b/includes/common.inc index bf187dbb995..ab763bad7fe 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1057,6 +1057,12 @@ function drupal_http_request($url, array $options = array()) { switch ($code) { case 200: // OK + case 201: // Created + case 202: // Accepted + case 203: // Non-Authoritative Information + case 204: // No Content + case 205: // Reset Content + case 206: // Partial Content case 304: // Not modified break; case 301: // Moved permanently From d3e02219e85bc9335aef13ad7cb668025a7cba11 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 00:33:01 -0400 Subject: [PATCH 50/77] Issue #2513646 by pwolanin, naveenvalecha, alexpott: Role name is unescaped on block admin via JS --- modules/block/block.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/block/block.js b/modules/block/block.js index acd3f5ae240..721dedf123b 100644 --- a/modules/block/block.js +++ b/modules/block/block.js @@ -24,7 +24,7 @@ Drupal.behaviors.blockSettingsSummary = { $('fieldset#edit-node-type', context).drupalSetSummary(function (context) { var vals = []; $('input[type="checkbox"]:checked', context).each(function () { - vals.push($.trim($(this).next('label').text())); + vals.push($.trim($(this).next('label').html())); }); if (!vals.length) { vals.push(Drupal.t('Not restricted')); @@ -35,7 +35,7 @@ Drupal.behaviors.blockSettingsSummary = { $('fieldset#edit-role', context).drupalSetSummary(function (context) { var vals = []; $('input[type="checkbox"]:checked', context).each(function () { - vals.push($.trim($(this).next('label').text())); + vals.push($.trim($(this).next('label').html())); }); if (!vals.length) { vals.push(Drupal.t('Not restricted')); @@ -49,7 +49,7 @@ Drupal.behaviors.blockSettingsSummary = { return Drupal.t('Not customizable'); } else { - return $radio.next('label').text(); + return $radio.next('label').html(); } }); } From ff246ebcc9b67f7a47ad52529ae81a60a3269305 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 01:01:46 -0400 Subject: [PATCH 51/77] Issue #2146643 by quicksketch: Speed up drupal_parse_info_format() 3x and reduce memory 95% --- CHANGELOG.txt | 2 ++ includes/common.inc | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f23b9c9930e..ed1dd62bde6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Made Drupal's code for parsing .info files run much faster and use much less + memory. - Prevented drupal_http_request() from returning an error when it receives a 201 through 206 HTTP status code. - Added support for autoloading traits via the registry on sites running PHP diff --git a/includes/common.inc b/includes/common.inc index ab763bad7fe..e5e8150dc52 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7468,7 +7468,6 @@ function drupal_parse_info_file($filename) { */ function drupal_parse_info_format($data) { $info = array(); - $constants = get_defined_constants(); if (preg_match_all(' @^\s* # Start at the beginning of a line, ignoring leading whitespace @@ -7508,8 +7507,8 @@ function drupal_parse_info_format($data) { } // Handle PHP constants. - if (isset($constants[$value])) { - $value = $constants[$value]; + if (preg_match('/^\w+$/i', $value) && defined($value)) { + $value = constant($value); } // Insert actual value. From 60114fe076ddc72b03ee7f4c25b1db607fbac51e Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 02:14:55 -0400 Subject: [PATCH 52/77] Various updates to CHANGELOG.txt in preparation for the 7.40 release. --- CHANGELOG.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ed1dd62bde6..6fc860bfeae 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -34,7 +34,7 @@ Drupal 7.40, xxxx-xx-xx (development version) - Prevented drupal_set_time_limit() from decreasing the time limit in the case where the PHP maximum execution time is already unlimited. - Changed the default thousand marker for numeric fields from a space ("1 000") - to nothing ("1000"). + to nothing ("1000") (minor UI change: https://www.drupal.org/node/1388376). - Prevented malformed theme .info files (without a "name" key) from causing exceptions during menu rebuilds. If an .info file without a "name" key is found in a module or theme directory, Drupal will now use the module or @@ -44,7 +44,8 @@ Drupal 7.40, xxxx-xx-xx (development version) - Fixed a bug in the Statistics module that caused JavaScript files attached to a node while it is being viewed to be omitted from the page. - Added an optional 'project:' prefix that can be added to dependencies in a - module's .info file to indicate which project the dependency resides in. + module's .info file to indicate which project the dependency resides in (API + addition: https://www.drupal.org/node/2299747). - Fixed various bugs that occurred after hooks were invoked early in the Drupal bootstrap and that caused module_implements() and drupal_alter() to cache an incomplete set of hook implementations for later use. @@ -52,9 +53,12 @@ Drupal 7.40, xxxx-xx-xx (development version) certain web browsers from picking an unsafe MIME type. - Prevented the database API from executing multiple queries at once on MySQL, if the site's PHP version is new enough to do so. This is a secondary defense - against SQL injection attacks. + against SQL injection (API change: https://www.drupal.org/node/2463973). - Fixed a bug in the Drupal 6 to Drupal 7 upgrade path which caused the upgrade to fail when there were multiple file records pointing to the same file. +- Numerous small bug fixes. +- Numerous API documentation improvements. +- Additional automated test coverage. Drupal 7.39, 2015-08-19 ----------------------- From 23a78fe1174f026e292cde4ec64517aaea168a45 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 12:59:26 -0400 Subject: [PATCH 53/77] Issue #2491333 by opdavies, Mac_Weber, jhodgdon: Update MAINTAINERS.txt to use human URLs --- MAINTAINERS.txt | 213 ++++++++++++++++++++++++------------------------ 1 file changed, 107 insertions(+), 106 deletions(-) diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt index f5cf6f893ab..28d1b3e968b 100644 --- a/MAINTAINERS.txt +++ b/MAINTAINERS.txt @@ -1,7 +1,8 @@ Drupal core is built and maintained by the Drupal project community. Everyone is encouraged to submit issues and changes (patches) to improve Drupal, and to -contribute in other ways -- see http://drupal.org/contribute to find out how. +contribute in other ways -- see https://www.drupal.org/contribute to find out +how. Branch maintainers ------------------ @@ -9,154 +10,154 @@ Branch maintainers The Drupal Core branch maintainers oversee the development of Drupal as a whole. The branch maintainers for Drupal 7 are: -- Dries Buytaert 'dries' http://drupal.org/user/1 -- Angela Byron 'webchick' http://drupal.org/user/24967 -- David Rothstein 'David_Rothstein' http://drupal.org/user/124982 +- Dries Buytaert 'dries' https://www.drupal.org/u/dries +- Angela Byron 'webchick' https://www.drupal.org/u/webchick +- David Rothstein 'David_Rothstein' https://www.drupal.org/u/david_rothstein Component maintainers --------------------- The Drupal Core component maintainers oversee the development of Drupal -subsystems. See http://drupal.org/contribute/core-maintainers for more +subsystems. See https://www.drupal.org/contribute/core-maintainers for more information on their responsibilities, and to find out how to become a component maintainer. Current component maintainers for Drupal 7: Ajax system -- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040 -- Earl Miles 'merlinofchaos' http://drupal.org/user/26979 +- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia +- Earl Miles 'merlinofchaos' https://www.drupal.org/u/merlinofchaos Base system -- Damien Tournoud 'DamZ' http://drupal.org/user/22211 -- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23 +- Damien Tournoud 'DamZ' https://www.drupal.org/u/damien-tournoud +- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman Batch system -- Yves Chedemois 'yched' http://drupal.org/user/39567 +- Yves Chedemois 'yched' https://www.drupal.org/u/yched Cache system -- Damien Tournoud 'DamZ' http://drupal.org/user/22211 -- Nathaniel Catchpole 'catch' http://drupal.org/user/35733 +- Damien Tournoud 'DamZ' https://www.drupal.org/u/damien-tournoud +- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch Cron system -- Derek Wright 'dww' http://drupal.org/user/46549 +- Derek Wright 'dww' https://www.drupal.org/u/dww Database system -- Larry Garfield 'Crell' http://drupal.org/user/26398 +- Larry Garfield 'Crell' https://www.drupal.org/u/crell - MySQL driver - - Larry Garfield 'Crell' http://drupal.org/user/26398 - - David Strauss 'David Strauss' http://drupal.org/user/93254 + - Larry Garfield 'Crell' https://www.drupal.org/u/crell + - David Strauss 'David Strauss' https://www.drupal.org/u/david-strauss - PostgreSQL driver - - Damien Tournoud 'DamZ' http://drupal.org/user/22211 - - Josh Waihi 'fiasco' http://drupal.org/user/188162 + - Damien Tournoud 'DamZ' https://www.drupal.org/u/damien-tournoud + - Josh Waihi 'fiasco' https://www.drupal.org/u/josh-waihi - Sqlite driver - - Damien Tournoud 'DamZ' http://drupal.org/user/22211 + - Damien Tournoud 'DamZ' https://www.drupal.org/u/damien-tournoud Database update system -- Ashok Modi 'BTMash' http://drupal.org/user/60422 +- Ashok Modi 'BTMash' https://www.drupal.org/u/btmash Entity system -- Wolfgang Ziegler 'fago' http://drupal.org/user/16747 -- Nathaniel Catchpole 'catch' http://drupal.org/user/35733 -- Franz Heinzmann 'Frando' http://drupal.org/user/21850 +- Wolfgang Ziegler 'fago' https://www.drupal.org/u/fago +- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch +- Franz Heinzmann 'Frando' https://www.drupal.org/u/frando File system -- Andrew Morton 'drewish' http://drupal.org/user/34869 -- Aaron Winborn 'aaron' http://drupal.org/user/33420 +- Andrew Morton 'drewish' https://www.drupal.org/u/drewish +- Aaron Winborn 'aaron' https://www.drupal.org/u/aaron Form system -- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040 -- Wolfgang Ziegler 'fago' http://drupal.org/user/16747 -- Daniel F. Kudwien 'sun' http://drupal.org/user/54136 -- Franz Heinzmann 'Frando' http://drupal.org/user/21850 +- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia +- Wolfgang Ziegler 'fago' https://www.drupal.org/u/fago +- Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun +- Franz Heinzmann 'Frando' https://www.drupal.org/u/frando Image system -- Andrew Morton 'drewish' http://drupal.org/user/34869 -- Nathan Haug 'quicksketch' http://drupal.org/user/35821 +- Andrew Morton 'drewish' https://www.drupal.org/u/drewish +- Nathan Haug 'quicksketch' https://www.drupal.org/u/quicksketch Install system -- David Rothstein 'David_Rothstein' http://drupal.org/user/124982 +- David Rothstein 'David_Rothstein' https://www.drupal.org/u/david_rothstein JavaScript -- Théodore Biadala 'nod_' http://drupal.org/user/598310 -- Steve De Jonghe 'seutje' http://drupal.org/user/264148 -- Jesse Renée Beach 'jessebeach' http://drupal.org/user/748566 +- Théodore Biadala 'nod_' https://www.drupal.org/u/nod_ +- Steve De Jonghe 'seutje' https://www.drupal.org/u/seutje +- Jesse Renée Beach 'jessebeach' https://www.drupal.org/u/jessebeach Language system -- Francesco Placella 'plach' http://drupal.org/user/183211 -- Daniel F. Kudwien 'sun' http://drupal.org/user/54136 +- Francesco Placella 'plach' https://www.drupal.org/u/plach +- Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun Lock system -- Damien Tournoud 'DamZ' http://drupal.org/user/22211 +- Damien Tournoud 'DamZ' https://www.drupal.org/u/damien-tournoud Mail system - ? Markup -- Jacine Luisi 'Jacine' http://drupal.org/user/88931 -- Daniel F. Kudwien 'sun' http://drupal.org/user/54136 +- Jacine Luisi 'Jacine' https://www.drupal.org/u/jacine +- Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun Menu system -- Peter Wolanin 'pwolanin' http://drupal.org/user/49851 +- Peter Wolanin 'pwolanin' https://www.drupal.org/u/pwolanin Path system -- Dave Reid 'davereid' http://drupal.org/user/53892 -- Nathaniel Catchpole 'catch' http://drupal.org/user/35733 +- Dave Reid 'davereid' https://www.drupal.org/u/dave-reid +- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch Render system -- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23 -- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040 -- Franz Heinzmann 'Frando' http://drupal.org/user/21850 +- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman +- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia +- Franz Heinzmann 'Frando' https://www.drupal.org/u/frando Theme system -- Earl Miles 'merlinofchaos' http://drupal.org/user/26979 -- Alex Bronstein 'effulgentsia' http://drupal.org/user/78040 -- Joon Park 'dvessel' http://drupal.org/user/56782 -- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095 +- Earl Miles 'merlinofchaos' https://www.drupal.org/u/merlinofchaos +- Alex Bronstein 'effulgentsia' https://www.drupal.org/u/effulgentsia +- Joon Park 'dvessel' https://www.drupal.org/u/dvessel +- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin Token system -- Dave Reid 'davereid' http://drupal.org/user/53892 +- Dave Reid 'davereid' https://www.drupal.org/u/dave-reid XML-RPC system -- Frederic G. Marand 'fgm' http://drupal.org/user/27985 +- Frederic G. Marand 'fgm' https://www.drupal.org/u/fgm Topic coordinators ------------------ Accessibility -- Everett Zufelt 'Everett Zufelt' http://drupal.org/user/406552 -- Brandon Bowersox-Johnson 'bowersox' http://drupal.org/user/186415 +- Everett Zufelt 'Everett Zufelt' https://www.drupal.org/u/everett-zufelt +- Brandon Bowersox-Johnson 'bowersox' https://www.drupal.org/u/bowersox Documentation -- Jennifer Hodgdon 'jhodgdon' http://drupal.org/user/155601 +- Jennifer Hodgdon 'jhodgdon' https://www.drupal.org/u/jhodgdon Translations -- Gerhard Killesreiter 'killes' http://drupal.org/user/83 +- Gerhard Killesreiter 'killes' https://www.drupal.org/u/gerhard-killesreiter User experience and usability -- Roy Scholten 'yoroy' http://drupal.org/user/41502 -- Bojhan Somers 'Bojhan' http://drupal.org/user/87969 +- Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy +- Bojhan Somers 'Bojhan' https://www.drupal.org/u/bojhan Node Access -- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23 -- Ken Rickard 'agentrickard' http://drupal.org/user/20975 -- Jess Myrbo 'xjm' http://drupal.org/user/65776 +- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman +- Ken Rickard 'agentrickard' https://www.drupal.org/u/agentrickard +- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm Security team ----------------- -To report a security issue, see: https://drupal.org/security-team/report-issue +To report a security issue, see: https://www.drupal.org/security-team/report-issue The Drupal security team provides Security Advisories for vulnerabilities, assists developers in resolving security issues, and provides security -documentation. See http://drupal.org/security-team for more information. The -security team lead is: +documentation. See https://www.drupal.org/security-team for more information. +The security team lead is: -- Michael Hess 'mlhess' https://drupal.org/user/102818 +- Michael Hess 'mlhess' https://www.drupal.org/u/mlhess Module maintainers @@ -166,142 +167,142 @@ Aggregator module - ? Block module -- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095 +- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin Blog module - ? Book module -- Peter Wolanin 'pwolanin' http://drupal.org/user/49851 +- Peter Wolanin 'pwolanin' https://www.drupal.org/u/pwolanin Color module - ? Comment module -- Nathaniel Catchpole 'catch' http://drupal.org/user/35733 +- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch Contact module -- Dave Reid 'davereid' http://drupal.org/user/53892 +- Dave Reid 'davereid' https://www.drupal.org/u/dave-reid Contextual module -- Daniel F. Kudwien 'sun' http://drupal.org/user/54136 +- Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun Dashboard module - ? Database logging module -- Khalid Baheyeldin 'kbahey' http://drupal.org/user/4063 +- Khalid Baheyeldin 'kbahey' https://www.drupal.org/u/kbahey Field module -- Yves Chedemois 'yched' http://drupal.org/user/39567 -- Barry Jaspan 'bjaspan' http://drupal.org/user/46413 +- Yves Chedemois 'yched' https://www.drupal.org/u/yched +- Barry Jaspan 'bjaspan' https://www.drupal.org/u/bjaspan Field UI module -- Yves Chedemois 'yched' http://drupal.org/user/39567 +- Yves Chedemois 'yched' https://www.drupal.org/u/yched File module -- Aaron Winborn 'aaron' http://drupal.org/user/33420 +- Aaron Winborn 'aaron' https://www.drupal.org/u/aaron Filter module -- Daniel F. Kudwien 'sun' http://drupal.org/user/54136 +- Daniel F. Kudwien 'sun' https://www.drupal.org/u/sun Forum module -- Lee Rowlands 'larowlan' http://drupal.org/user/395439 +- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan Help module - ? Image module -- Nathan Haug 'quicksketch' http://drupal.org/user/35821 +- Nathan Haug 'quicksketch' https://www.drupal.org/u/quicksketch Locale module -- Gábor Hojtsy 'Gábor Hojtsy' http://drupal.org/user/4166 +- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy Menu module - ? Node module -- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23 -- David Strauss 'David Strauss' http://drupal.org/user/93254 +- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman +- David Strauss 'David Strauss' https://www.drupal.org/u/david-strauss OpenID module -- Vojtech Kusy 'wojtha' http://drupal.org/user/56154 -- Christian Schmidt 'c960657' http://drupal.org/user/216078 -- Damien Tournoud 'DamZ' http://drupal.org/user/22211 +- Vojtech Kusy 'wojtha' https://www.drupal.org/u/wojtha +- Christian Schmidt 'c960657' https://www.drupal.org/u/c960657 +- Damien Tournoud 'DamZ' https://www.drupal.org/u/damien-tournoud Overlay module -- Katherine Senzee 'ksenzee' http://drupal.org/user/139855 +- Katherine Senzee 'ksenzee' https://www.drupal.org/u/ksenzee Path module -- Dave Reid 'davereid' http://drupal.org/user/53892 +- Dave Reid 'davereid' https://www.drupal.org/u/dave-reid PHP module - ? Poll module -- Andrei Mateescu 'amateescu' http://drupal.org/user/729614 +- Andrei Mateescu 'amateescu' https://www.drupal.org/u/amateescu Profile module - ? RDF module -- Stéphane Corlosquet 'scor' http://drupal.org/user/52142 +- Stéphane Corlosquet 'scor' https://www.drupal.org/u/scor Search module -- Doug Green 'douggreen' http://drupal.org/user/29191 +- Doug Green 'douggreen' https://www.drupal.org/u/douggreen Shortcut module -- David Rothstein 'David_Rothstein' http://drupal.org/user/124982 +- David Rothstein 'David_Rothstein' https://www.drupal.org/u/david_rothstein Simpletest module -- Jimmy Berry 'boombatower' http://drupal.org/user/214218 +- Jimmy Berry 'boombatower' https://www.drupal.org/u/boombatower Statistics module -- Tim Millwood 'timmillwood' http://drupal.org/user/227849 +- Tim Millwood 'timmillwood' https://www.drupal.org/u/timmillwood Syslog module -- Khalid Baheyeldin 'kbahey' http://drupal.org/user/4063 +- Khalid Baheyeldin 'kbahey' https://www.drupal.org/u/kbahey System module - ? Taxonomy module -- Jess Myrbo 'xjm' http://drupal.org/user/65776 -- Nathaniel Catchpole 'catch' http://drupal.org/user/35733 -- Benjamin Doherty 'bangpound' http://drupal.org/user/100456 +- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm +- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch +- Benjamin Doherty 'bangpound' https://www.drupal.org/u/bangpound Toolbar module - ? Tracker module -- David Strauss 'David Strauss' http://drupal.org/user/93254 +- David Strauss 'David Strauss' https://www.drupal.org/u/david-strauss Translation module -- Francesco Placella 'plach' http://drupal.org/user/183211 +- Francesco Placella 'plach' https://www.drupal.org/u/plach Trigger module - ? Update module -- Derek Wright 'dww' http://drupal.org/user/46549 +- Derek Wright 'dww' https://www.drupal.org/u/dww User module -- Moshe Weitzman 'moshe weitzman' http://drupal.org/user/23 -- David Strauss 'David Strauss' http://drupal.org/user/93254 +- Moshe Weitzman 'moshe weitzman' https://www.drupal.org/u/moshe-weitzman +- David Strauss 'David Strauss' https://www.drupal.org/u/david-strauss Theme maintainers ----------------- Bartik theme -- Jen Simmons 'jensimmons' http://drupal.org/user/140882 -- Jeff Burns 'Jeff Burnz' http://drupal.org/user/61393 +- Jen Simmons 'jensimmons' https://www.drupal.org/u/jensimmons +- Jeff Burns 'Jeff Burnz' https://www.drupal.org/u/jeff-burnz Garland theme -- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095 +- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin Seven theme -- Jeff Burns 'Jeff Burnz' http://drupal.org/user/61393 +- Jeff Burns 'Jeff Burnz' https://www.drupal.org/u/jeff-burnz Stark theme -- John Albin Wilkins 'JohnAlbin' http://drupal.org/user/32095 +- John Albin Wilkins 'JohnAlbin' https://www.drupal.org/u/johnalbin From ac39ceaf5191c5848f8ad2bdf46d3e468d3f9758 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 13:01:42 -0400 Subject: [PATCH 54/77] Issue #2462681 by jessebeach, klausi, Manjit.Singh: Remove jessebeach from MAINTAINERS.txt --- MAINTAINERS.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt index 28d1b3e968b..0d1e0d0ce0d 100644 --- a/MAINTAINERS.txt +++ b/MAINTAINERS.txt @@ -83,7 +83,6 @@ Install system JavaScript - Théodore Biadala 'nod_' https://www.drupal.org/u/nod_ - Steve De Jonghe 'seutje' https://www.drupal.org/u/seutje -- Jesse Renée Beach 'jessebeach' https://www.drupal.org/u/jessebeach Language system - Francesco Placella 'plach' https://www.drupal.org/u/plach From 793788fc2539211a539ffd8f1868c13932153353 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 15:25:59 -0400 Subject: [PATCH 55/77] Issue #2369675 by FMB, pstewart, jhodgdon: Document that SearchQuery does not support orderBy in queries outside of addScore --- modules/search/search.extender.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/search/search.extender.inc b/modules/search/search.extender.inc index 72cea647289..407425696cb 100644 --- a/modules/search/search.extender.inc +++ b/modules/search/search.extender.inc @@ -409,10 +409,10 @@ class SearchQuery extends SelectQueryExtender { * used. However, if at least one call to addScore() has taken place, the * keyword relevance score is not automatically added. * - * Also note that if you call orderBy() directly on the query, search scores - * will not automatically be used to order search results. Your orderBy() - * expression can reference 'calculated_score', which will be the total - * calculated score value. + * Note that you must use this method to add ordering to your searches, and + * not call orderBy() directly, when using the SearchQuery extender. This is + * because of the two-pass system the SearchQuery class uses to normalize + * scores. * * @param $score * The score expression, which should evaluate to a number between 0 and 1. From e8353656924be31725e6293f411d5413c5966eb1 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 15:28:45 -0400 Subject: [PATCH 56/77] Issue #2480805 by JacobSanford, eiriksm, jhodgdon: The function doc block for image_style_deliver is missing a parameter --- modules/image/image.module | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/image/image.module b/modules/image/image.module index dd71253d53d..526330c67ed 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -801,6 +801,8 @@ function image_style_options($include_empty = TRUE, $output = CHECK_PLAIN) { * * @param $style * The image style + * @param $scheme + * The file scheme, for example 'public' for public files. */ function image_style_deliver($style, $scheme) { $args = func_get_args(); From 7933ac459dd752a07896aa7f8b8073020df7e0fc Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 15:30:14 -0400 Subject: [PATCH 57/77] Issue #2488750 by lalweil: Typo in DatabaseConnection::query --- includes/database/database.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/database/database.inc b/includes/database/database.inc index 3d776b57358..90a3f743458 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -656,7 +656,7 @@ abstract class DatabaseConnection extends PDO { * @return DatabaseStatementInterface * This method will return one of: the executed statement, the number of * rows affected by the query (not the number matched), or the generated - * insert IT of the last query, depending on the value of + * insert ID of the last query, depending on the value of * $options['return']. Typically that value will be set by default or a * query builder and should not be set by a user. If there is an error, * this method will return NULL and may throw an exception if From 6df765676a35f8f7ed471ef29394d44233f6d61f Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 15:37:30 -0400 Subject: [PATCH 58/77] Issue #2195183 by cleaver, zopa, elgordogrande, sandykadam, jhodgdon, joachim, Eda: document Batch API callbacks as callback implementations --- includes/install.core.inc | 6 ++++- includes/locale.inc | 6 +++++ includes/update.inc | 4 ++++ modules/node/node.admin.inc | 6 ++++- modules/node/node.module | 4 ++++ modules/simpletest/simpletest.module | 5 ++++- .../simpletest/tests/batch_test.callbacks.inc | 22 +++++++++++++++++++ modules/update/update.authorize.inc | 12 +++++++--- modules/update/update.fetch.inc | 8 +++++-- modules/update/update.manager.inc | 6 ++++- modules/user/user.module | 6 ++++- 11 files changed, 75 insertions(+), 10 deletions(-) diff --git a/includes/install.core.inc b/includes/install.core.inc index e5a65865c81..ad43b42af59 100644 --- a/includes/install.core.inc +++ b/includes/install.core.inc @@ -1590,7 +1590,9 @@ function install_finished(&$install_state) { } /** - * Batch callback for batch installation of modules. + * Implements callback_batch_operation(). + * + * Performs batch installation of modules. */ function _install_module_batch($module, $module_name, &$context) { // Install and enable the module right away, so that the module will be @@ -1603,6 +1605,8 @@ function _install_module_batch($module, $module_name, &$context) { } /** + * Implements callback_batch_finished(). + * * 'Finished' callback for module installation batch. */ function _install_profile_modules_finished($success, $results, $operations) { diff --git a/includes/locale.inc b/includes/locale.inc index c7f95838556..82c55e5c7a1 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -2306,6 +2306,8 @@ function _locale_batch_build($files, $finished = NULL, $components = array()) { } /** + * Implements callback_batch_operation(). + * * Perform interface translation import as a batch step. * * @param $filepath @@ -2324,6 +2326,8 @@ function _locale_batch_import($filepath, &$context) { } /** + * Implements callback_batch_finished(). + * * Finished callback of system page locale import batch. * Inform the user of translation files imported. */ @@ -2334,6 +2338,8 @@ function _locale_batch_system_finished($success, $results) { } /** + * Implements callback_batch_finished(). + * * Finished callback of language addition locale import batch. * Inform the user of translation files imported. */ diff --git a/includes/update.inc b/includes/update.inc index a17161c9e40..35a73c337ea 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -908,6 +908,8 @@ function update_get_d6_session_name() { } /** + * Implements callback_batch_operation(). + * * Performs one update and stores the results for display on the results page. * * If an update function completes successfully, it should return a message @@ -1078,6 +1080,8 @@ function update_batch($start, $redirect = NULL, $url = NULL, $batch = array(), $ } /** + * Implements callback_batch_finished(). + * * Finishes the update process and stores the results for eventual display. * * After the updates run, all caches are flushed. The update results are diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 35f4c1d5b52..145be7ad9a6 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -329,6 +329,8 @@ function _node_mass_update_helper($nid, $updates) { } /** + * Implements callback_batch_operation(). + * * Executes a batch operation for node_mass_update(). * * @param array $nodes @@ -367,7 +369,9 @@ function _node_mass_update_batch_process($nodes, $updates, &$context) { } /** - * Menu callback: Reports the status of batch operation for node_mass_update(). + * Implements callback_batch_finished(). + * + * Reports the status of batch operation for node_mass_update(). * * @param bool $success * A boolean indicating whether the batch mass update operation successfully diff --git a/modules/node/node.module b/modules/node/node.module index 7a6246d5ab9..f892d1c2c99 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -3669,6 +3669,8 @@ function node_access_rebuild($batch_mode = FALSE) { } /** + * Implements callback_batch_operation(). + * * Performs batch operation for node_access_rebuild(). * * This is a multistep operation: we go through all nodes by packs of 20. The @@ -3707,6 +3709,8 @@ function _node_access_rebuild_batch_operation(&$context) { } /** + * Implements callback_batch_finished(). + * * Performs post-processing for node_access_rebuild(). * * @param bool $success diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index a98e5cfbe19..29a20bb4caa 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -154,7 +154,7 @@ function simpletest_run_tests($test_list, $reporter = 'drupal') { } /** - * Batch operation callback. + * Implements callback_batch_operation(). */ function _simpletest_batch_operation($test_list_init, $test_id, &$context) { simpletest_classloader_register(); @@ -205,6 +205,9 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) { $context['finished'] = 1 - $size / $max; } +/** + * Implements callback_batch_finished(). + */ function _simpletest_batch_finished($success, $results, $operations, $elapsed) { if ($success) { drupal_set_message(t('The test run finished in @elapsed.', array('@elapsed' => $elapsed))); diff --git a/modules/simpletest/tests/batch_test.callbacks.inc b/modules/simpletest/tests/batch_test.callbacks.inc index 75e665533e9..6564413ddb7 100644 --- a/modules/simpletest/tests/batch_test.callbacks.inc +++ b/modules/simpletest/tests/batch_test.callbacks.inc @@ -7,6 +7,8 @@ */ /** + * Implements callback_batch_operation(). + * * Simple batch operation. */ function _batch_test_callback_1($id, $sleep, &$context) { @@ -20,6 +22,8 @@ function _batch_test_callback_1($id, $sleep, &$context) { } /** + * Implements callback_batch_operation(). + * * Multistep batch operation. */ function _batch_test_callback_2($start, $total, $sleep, &$context) { @@ -53,6 +57,8 @@ function _batch_test_callback_2($start, $total, $sleep, &$context) { } /** + * Implements callback_batch_operation(). + * * Simple batch operation. */ function _batch_test_callback_5($id, $sleep, &$context) { @@ -68,6 +74,8 @@ function _batch_test_callback_5($id, $sleep, &$context) { } /** + * Implements callback_batch_operation(). + * * Batch operation setting up its own batch. */ function _batch_test_nested_batch_callback() { @@ -76,6 +84,8 @@ function _batch_test_nested_batch_callback() { } /** + * Implements callback_batch_finished(). + * * Common 'finished' callbacks for batches 1 to 4. */ function _batch_test_finished_helper($batch_id, $success, $results, $operations) { @@ -99,6 +109,8 @@ function _batch_test_finished_helper($batch_id, $success, $results, $operations) } /** + * Implements callback_batch_finished(). + * * 'finished' callback for batch 0. */ function _batch_test_finished_0($success, $results, $operations) { @@ -106,6 +118,8 @@ function _batch_test_finished_0($success, $results, $operations) { } /** + * Implements callback_batch_finished(). + * * 'finished' callback for batch 1. */ function _batch_test_finished_1($success, $results, $operations) { @@ -113,6 +127,8 @@ function _batch_test_finished_1($success, $results, $operations) { } /** + * Implements callback_batch_finished(). + * * 'finished' callback for batch 2. */ function _batch_test_finished_2($success, $results, $operations) { @@ -120,6 +136,8 @@ function _batch_test_finished_2($success, $results, $operations) { } /** + * Implements callback_batch_finished(). + * * 'finished' callback for batch 3. */ function _batch_test_finished_3($success, $results, $operations) { @@ -127,6 +145,8 @@ function _batch_test_finished_3($success, $results, $operations) { } /** + * Implements callback_batch_finished(). + * * 'finished' callback for batch 4. */ function _batch_test_finished_4($success, $results, $operations) { @@ -134,6 +154,8 @@ function _batch_test_finished_4($success, $results, $operations) { } /** + * Implements callback_batch_finished(). + * * 'finished' callback for batch 5. */ function _batch_test_finished_5($success, $results, $operations) { diff --git a/modules/update/update.authorize.inc b/modules/update/update.authorize.inc index 6ddd2c53a32..03d370494f8 100644 --- a/modules/update/update.authorize.inc +++ b/modules/update/update.authorize.inc @@ -97,7 +97,9 @@ function update_authorize_run_install($filetransfer, $project, $updater_name, $l } /** - * Batch callback: Copies project to its proper place when authorized to do so. + * Implements callback_batch_operation(). + * + * Copies project to its proper place when authorized to do so. * * @param string $project * The canonical short name of the project being installed. @@ -168,7 +170,9 @@ function update_authorize_batch_copy_project($project, $updater_name, $local_url } /** - * Batch callback: Performs actions when the authorized update batch is done. + * Implements callback_batch_finished(). + * + * Performs actions when the authorized update batch is done. * * This processes the results and stashes them into SESSION such that * authorize.php will render a report. Also responsible for putting the site @@ -235,7 +239,9 @@ function update_authorize_update_batch_finished($success, $results) { } /** - * Batch callback: Performs actions when the authorized install batch is done. + * Implements callback_batch_finished(). + * + * Performs actions when the authorized install batch is done. * * This processes the results and stashes them into SESSION such that * authorize.php will render a report. Also responsible for putting the site diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc index 9dd2f0ba4ea..428cace6b02 100644 --- a/modules/update/update.fetch.inc +++ b/modules/update/update.fetch.inc @@ -29,7 +29,9 @@ function update_manual_status() { } /** - * Batch callback: Processes a step in batch for fetching available update data. + * Implements callback_batch_operation(). + * + * Processes a step in batch for fetching available update data. * * @param $context * Reference to an array used for Batch API storage. @@ -77,7 +79,9 @@ function update_fetch_data_batch(&$context) { } /** - * Batch callback: Performs actions when all fetch tasks have been completed. + * Implements callback_batch_finished(). + * + * Performs actions when all fetch tasks have been completed. * * @param $success * TRUE if the batch operation was successful; FALSE if there were errors. diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc index 85b587de219..0b33a5f72a3 100644 --- a/modules/update/update.manager.inc +++ b/modules/update/update.manager.inc @@ -335,6 +335,8 @@ function update_manager_update_form_submit($form, &$form_state) { } /** + * Implements callback_batch_finished(). + * * Batch callback: Performs actions when the download batch is completed. * * @param $success @@ -847,7 +849,9 @@ function update_manager_file_get($url) { } /** - * Batch callback: Downloads, unpacks, and verifies a project. + * Implements callback_batch_operation(). + * + * Downloads, unpacks, and verifies a project. * * This function assumes that the provided URL points to a file archive of some * sort. The URL can have any scheme that we have a file stream wrapper to diff --git a/modules/user/user.module b/modules/user/user.module index 6a742c8e67b..afb41199879 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -2488,7 +2488,9 @@ function user_cancel($edit, $uid, $method) { } /** - * Last batch processing step for cancelling a user account. + * Implements callback_batch_operation(). + * + * Last step for cancelling a user account. * * Since batch and session API require a valid user account, the actual * cancellation of a user account needs to happen last. @@ -2536,6 +2538,8 @@ function _user_cancel($edit, $account, $method) { } /** + * Implements callback_batch_finished(). + * * Finished batch processing callback for cancelling a user account. * * @see user_cancel() From cb7888f53db00c184dfd947ffae210f9bb737ba1 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 15:47:32 -0400 Subject: [PATCH 59/77] Issue #2325055 by darol100, joshi.rohit100, jhodgdon, Bevan: hook_prepare() example is not useful --- modules/node/node.api.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 95c77f3f43c..c8176a7d329 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -1084,19 +1084,9 @@ function hook_delete($node) { * @ingroup node_api_hooks */ function hook_prepare($node) { - $file = file_save_upload($field_name, _image_filename($file->filename, NULL, TRUE)); - if ($file) { - if (!image_get_info($file->uri)) { - form_set_error($field_name, t('Uploaded file is not a valid image')); - return; - } - } - else { - return; + if (!isset($node->mymodule_value)) { + $node->mymodule_value = 'foo'; } - $node->images['_original'] = $file->uri; - _image_build_derivatives($node, TRUE); - $node->new_file = TRUE; } /** From 5530045aead48c14218d92102903e9cbdc89bb8b Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 16:11:58 -0400 Subject: [PATCH 60/77] Issue #2499823 by dylanf, ryanissamson: Minor CHANGELOG.txt formatting --- CHANGELOG.txt | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6fc860bfeae..b4713c6310d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -147,11 +147,11 @@ Drupal 7.36, 2015-04-01 - Additional automated test coverage. Drupal 7.35, 2015-03-18 ----------------------- +----------------------- - Fixed security issues (multiple vulnerabilities). See SA-CORE-2015-001. Drupal 7.34, 2014-11-19 ----------------------- +----------------------- - Fixed security issues (multiple vulnerabilities). See SA-CORE-2014-006. Drupal 7.33, 2014-11-07 @@ -220,11 +220,11 @@ Drupal 7.33, 2014-11-07 - Additional automated test coverage. Drupal 7.32, 2014-10-15 ----------------------- +----------------------- - Fixed security issues (SQL injection). See SA-CORE-2014-005. Drupal 7.31, 2014-08-06 ----------------------- +----------------------- - Fixed security issues (denial of service). See SA-CORE-2014-004. Drupal 7.30, 2014-07-24 @@ -239,7 +239,7 @@ Drupal 7.30, 2014-07-24 - Additional automated test coverage. Drupal 7.29, 2014-07-16 ----------------------- +----------------------- - Fixed security issues (multiple vulnerabilities). See SA-CORE-2014-003. Drupal 7.28, 2014-05-08 @@ -285,11 +285,11 @@ Drupal 7.28, 2014-05-08 - Additional automated test coverage. Drupal 7.27, 2014-04-16 ----------------------- +----------------------- - Fixed security issues (information disclosure). See SA-CORE-2014-002. Drupal 7.26, 2014-01-15 ----------------------- +----------------------- - Fixed security issues (multiple vulnerabilities). See SA-CORE-2014-001. Drupal 7.25, 2014-01-02 @@ -355,7 +355,7 @@ Drupal 7.25, 2014-01-02 - Additional automated test coverage. Drupal 7.24, 2013-11-20 ----------------------- +----------------------- - Fixed security issues (multiple vulnerabilities), see SA-CORE-2013-003. Drupal 7.23, 2013-08-07 @@ -609,8 +609,8 @@ Drupal 7.15, 2012-08-01 - Numerous API documentation improvements. - Additional automated test coverage. -Drupal 7.14 2012-05-02 ----------------------- +Drupal 7.14, 2012-05-02 +----------------------- - Fixed "integrity constraint" fatal errors when rebuilding registry. - Fixed custom logo and favicon functionality referencing incorrect paths. - Fixed DB Case Sensitivity: Allow BINARY attribute in MySQL. @@ -658,12 +658,12 @@ Drupal 7.14 2012-05-02 - system_update_7061() converts filepaths too aggressively. - Trigger upgrade path: Node triggers removed when upgrading to 7-x from 6.25. -Drupal 7.13 2012-05-02 ----------------------- +Drupal 7.13, 2012-05-02 +----------------------- - Fixed security issues (Multiple vulnerabilities), see SA-CORE-2012-002. Drupal 7.12, 2012-02-01 ----------------------- +----------------------- - Fixed bug preventing custom menus from receiving an active trail. - Fixed hook_field_delete() no longer invoked during field_purge_data(). - Fixed bug causing entity info cache to not be cleared with the rest of caches. @@ -697,11 +697,11 @@ Drupal 7.12, 2012-02-01 cache. Drupal 7.11, 2012-02-01 ----------------------- +----------------------- - Fixed security issues (Multiple vulnerabilities), see SA-CORE-2012-001. Drupal 7.10, 2011-12-05 ----------------------- +----------------------- - Fixed Content-Language HTTP header to not cause issues with Drush 5.x. - Reduce memory usage of theme registry (performance). - Fixed PECL upload progress bar for FileField @@ -1054,7 +1054,7 @@ Drupal 7.0, 2011-01-05 requests. Drupal 6.23-dev, xxxx-xx-xx (development release) ------------------------ +--------------------------- Drupal 6.22, 2011-05-25 ----------------------- @@ -1064,25 +1064,25 @@ Drupal 6.22, 2011-05-25 - Fixed a variety of other bugs. Drupal 6.21, 2011-05-25 ----------------------- +----------------------- - Fixed security issues (Cross site scripting), see SA-CORE-2011-001. Drupal 6.20, 2010-12-15 ----------------------- +----------------------- - Fixed a variety of small bugs, improved code documentation. Drupal 6.19, 2010-08-11 ----------------------- +----------------------- - Fixed a variety of small bugs, improved code documentation. Drupal 6.18, 2010-08-11 ----------------------- +----------------------- - Fixed security issues (OpenID authentication bypass, File download access bypass, Comment unpublishing bypass, Actions cross site scripting), see SA-CORE-2010-002. Drupal 6.17, 2010-06-02 ----------------------- +----------------------- - Improved PostgreSQL compatibility - Better PHP 5.3 and PHP 4 compatibility - Better browser compatibility of CSS and JS aggregation @@ -1091,7 +1091,7 @@ Drupal 6.17, 2010-06-02 - Fixed a variety of other bugs. Drupal 6.16, 2010-03-03 ----------------------- +----------------------- - Fixed security issues (Installation cross site scripting, Open redirection, Locale module cross site scripting, Blocked user session regeneration), see SA-CORE-2010-001. @@ -1103,12 +1103,12 @@ Drupal 6.16, 2010-03-03 - Fixed a variety of other bugs. Drupal 6.15, 2009-12-16 ----------------------- +----------------------- - Fixed security issues (Cross site scripting), see SA-CORE-2009-009. - Fixed a variety of other bugs. Drupal 6.14, 2009-09-16 ----------------------- +----------------------- - Fixed security issues (OpenID association cross site request forgeries, OpenID impersonation and File upload), see SA-CORE-2009-008. - Changed the system modules page to not run all cache rebuilds; use the @@ -1117,18 +1117,18 @@ Drupal 6.14, 2009-09-16 - Fixed a variety of small bugs. Drupal 6.13, 2009-07-01 ----------------------- +----------------------- - Fixed security issues (Cross site scripting, Input format access bypass and Password leakage in URL), see SA-CORE-2009-007. - Fixed a variety of small bugs. Drupal 6.12, 2009-05-13 ----------------------- +----------------------- - Fixed security issues (Cross site scripting), see SA-CORE-2009-006. - Fixed a variety of small bugs. Drupal 6.11, 2009-04-29 ----------------------- +----------------------- - Fixed security issues (Cross site scripting and limited information disclosure), see SA-CORE-2009-005 - Fixed performance issues with the menu router cache, the update @@ -1136,7 +1136,7 @@ Drupal 6.11, 2009-04-29 - Fixed a variety of small bugs. Drupal 6.10, 2009-02-25 ----------------------- +----------------------- - Fixed a security issue, (Local file inclusion on Windows), see SA-CORE-2009-003 - Fixed node_feed() so custom fields can show up in RSS feeds. @@ -1532,7 +1532,7 @@ Drupal 4.7.9, 2007-12-05 - fixed a security issue (SQL injection), see SA-2007-031 Drupal 4.7.8, 2007-10-17 ----------------------- +------------------------ - fixed a security issue (HTTP response splitting), see SA-2007-024 - fixed a security issue (Cross site scripting via uploads), see SA-2007-026 - fixed a security issue (API handling of unpublished comment), see SA-2007-030 @@ -1645,7 +1645,7 @@ Drupal 4.6.11, 2007-01-05 - Fixed security issue (DoS), see SA-2007-002 Drupal 4.6.10, 2006-10-18 ------------------------- +------------------------- - Fixed security issue (XSS), see SA-2006-024 - Fixed security issue (CSRF), see SA-2006-025 - Fixed security issue (Form action attribute injection), see SA-2006-026 From c053db68bfbd0278caef0681010d5b3655e260fb Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 16:13:59 -0400 Subject: [PATCH 61/77] Issue #2510674 by er.pushpinderrana, joachim, cilefen: menu_get_item() should say that $path is optional and what the default is --- includes/menu.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/menu.inc b/includes/menu.inc index eb623a93661..140e67e71fd 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -431,7 +431,7 @@ function menu_set_item($path, $router_item) { * * @param $path * The path; for example, 'node/5'. The function will find the corresponding - * node/% item and return that. + * node/% item and return that. Defaults to the current path. * @param $router_item * Internal use only. * From e2050b5758785d78684f3692900475b2e6553888 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 16:17:23 -0400 Subject: [PATCH 62/77] Issue #2507911 by naveenvalecha, mikebell_, dylanf, deepakaryan1988, kfitz, jhodgdon, webchick, Charles Belov: Mention location of settings.php in UPGRADE.txt --- UPGRADE.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UPGRADE.txt b/UPGRADE.txt index e870ff0f0ec..ca767ddaf43 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -64,6 +64,9 @@ following the instructions in the INTRODUCTION section at the top of this file: Sometimes an update includes changes to default.settings.php (this will be noted in the release notes). If that's the case, follow these steps: + - Locate your settings.php file in the /sites/* directory. (Typically + sites/default.) + - Make a backup copy of your settings.php file, with a different file name. - Make a copy of the new default.settings.php file, and name the copy From 9c5cd0c6064ff569b750277248832405e61f931e Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 16:24:06 -0400 Subject: [PATCH 63/77] Issue #2530872 by orbmantell, TravisCarden: Improve documentation of drupal_get_schema() and drupal_get_schema_unprocessed() --- includes/bootstrap.inc | 4 +++- includes/common.inc | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 70d426b4ae1..ea768930c22 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -2959,7 +2959,9 @@ function ip_address() { * Gets the schema definition of a table, or the whole database schema. * * The returned schema will include any modifications made by any - * module that implements hook_schema_alter(). + * module that implements hook_schema_alter(). To get the schema without + * modifications, use drupal_get_schema_unprocessed(). + * * * @param $table * The name of the table. If not given, the schema of all tables is returned. diff --git a/includes/common.inc b/includes/common.inc index e5e8150dc52..bb27d391e8b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7098,7 +7098,8 @@ function drupal_uninstall_schema($module) { * specification of a schema, as it was defined in a module's * hook_schema(). No additional default values will be set, * hook_schema_alter() is not invoked and these unprocessed - * definitions won't be cached. + * definitions won't be cached. To retrieve the schema after + * hook_schema_alter() has been invoked use drupal_get_schema(). * * This function can be used to retrieve a schema specification in * hook_schema(), so it allows you to derive your tables from existing From 7a18687e5c840a0a1b20acee45c52620aeff1d35 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:11:06 -0400 Subject: [PATCH 64/77] Issue #2512582 by dorficus, jhodgdon, joachim: theme_link() parameters missing detail --- includes/theme.inc | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/includes/theme.inc b/includes/theme.inc index 8d5348dfcd3..1accdceaf05 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1710,11 +1710,29 @@ function theme_status_messages($variables) { * copy if none of the enabled modules or the active theme implement any * preprocess or process functions or override this theme implementation. * - * @param $variables - * An associative array containing the keys 'text', 'path', and 'options'. - * See the l() function for information about these variables. + * @param array $variables + * An associative array containing the keys: + * - text: The text of the link. + * - path: The internal path or external URL being linked to. It is used as + * the $path parameter of the url() function. + * - options: (optional) An array that defaults to empty, but can contain: + * - attributes: Can contain optional attributes: + * - class: must be declared in an array. Example: 'class' => + * array('class_name1','class_name2'). + * - title: must be a string. Example: 'title' => 'Example title' + * - Others are more flexible as long as they work with + * drupal_attributes($variables['options']['attributes]). + * - html: Boolean flag that tells whether text contains HTML or plain + * text. If set to TRUE, the text value will not be sanitized so the + calling function must ensure that it already contains safe HTML. + * The elements $variables['options']['attributes'] and + * $variables['options']['html'] are used in this function similarly to the + * way that $options['attributes'] and $options['html'] are used in l(). + * The link itself is built by the url() function, which takes + * $variables['path'] and $variables['options'] as arguments. * * @see l() + * @see url() */ function theme_link($variables) { return '' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . ''; From 29c287b54b307dc80993069a9c1bcd96389861c2 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:18:24 -0400 Subject: [PATCH 65/77] Issue #2140157 by rbp, jhodgdon, joachim: menu return constants not properly explained - MENU_NOT_FOUND, MENU_ACCESS_DENIED --- includes/menu.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/menu.inc b/includes/menu.inc index 140e67e71fd..1fe5a64700f 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -229,12 +229,20 @@ define('MENU_CONTEXT_INLINE', 0x0002); define('MENU_FOUND', 1); /** - * Internal menu status code -- Menu item was not found. + * Menu status code -- Not found. + * + * This can be used as the return value from a page callback, although it is + * preferable to use a load function to accomplish this; see the hook_menu() + * documentation for details. */ define('MENU_NOT_FOUND', 2); /** - * Internal menu status code -- Menu item access is denied. + * Menu status code -- Access denied. + * + * This can be used as the return value from a page callback, although it is + * preferable to use an access callback to accomplish this; see the hook_menu() + * documentation for details. */ define('MENU_ACCESS_DENIED', 3); From d1bef535d728de708795b0469f62358f65b4fa42 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:21:29 -0400 Subject: [PATCH 66/77] Issue #2538158 by joyceg: Clarify in which file hook_modules_installed should be implemented --- modules/system/system.api.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/system/system.api.php b/modules/system/system.api.php index d6cbc76976d..806b618a25a 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2632,6 +2632,8 @@ function hook_flush_caches() { * module_enable() for a detailed description of the order in which install and * enable hooks are invoked. * + * This hook should be implemented in a .module file, not in an .install file. + * * @param $modules * An array of the modules that were installed. * From 35d6361b0890a9b6ae6ba17e6f1816aaab981773 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:48:37 -0400 Subject: [PATCH 67/77] Issue #2550219 by Pravin Ajaaz, jhodgdon, Anybody: hook_user_cancel_methods_alter() should say 'access' rather than '#access' --- modules/user/user.api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/user/user.api.php b/modules/user/user.api.php index edc61bd3cd1..e732c146ae3 100644 --- a/modules/user/user.api.php +++ b/modules/user/user.api.php @@ -123,8 +123,8 @@ function hook_user_cancel($edit, $account, $method) { * description is NOT used for the radio button, but instead should provide * additional explanation to the user seeking to cancel their account. * - access: (optional) A boolean value indicating whether the user can access - * a method. If #access is defined, the method cannot be configured as default - * method. + * a method. If access is defined, the method cannot be configured as the + * default method. * * @param $methods * An array containing user account cancellation methods, keyed by method id. From eea00f936e9f7360f2490da6633a396395e817c1 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:51:43 -0400 Subject: [PATCH 68/77] Issue #1842528 by cferthorney, owenpm3, jhodgdon: description of hook_user_categories() is incorrect --- modules/user/user.api.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/user/user.api.php b/modules/user/user.api.php index e732c146ae3..f205a85b58f 100644 --- a/modules/user/user.api.php +++ b/modules/user/user.api.php @@ -183,7 +183,23 @@ function hook_user_operations() { } /** - * Retrieve a list of user setting or profile information categories. + * Define a list of user settings or profile information categories. + * + * There are two steps to using hook_user_categories(): + * - Create the category with hook_user_categories(). + * - Display that category on the form ID of "user_profile_form" with + * hook_form_FORM_ID_alter(). + * + * Step one builds out the category but it won't be visible on your form until + * you explicitly tell it to do so. + * + * The function in step two should contain the following code in order to + * display your new category: + * @code + * if ($form['#user_category'] == 'mycategory') { + * // Return your form here. + * } + * @endcode * * @return * An array of associative arrays. Each inner array has elements: From e7d67c7258c8b3b5e14d81371b3285002c28e643 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:53:32 -0400 Subject: [PATCH 69/77] Issue #2549879 by cbiggins, cilefen: Small grammatical error in bootstrap.inc --- includes/bootstrap.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index ea768930c22..c87b089e52f 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1055,7 +1055,7 @@ function drupal_page_get_cache($check_only = FALSE) { * Determines the cacheability of the current page. * * @param $allow_caching - * Set to FALSE if you want to prevent this page to get cached. + * Set to FALSE if you want to prevent this page from being cached. * * @return * TRUE if the current page can be cached, FALSE otherwise. From d2dd30fba61d4a17831ca85b22a5e006bb161281 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 17:59:52 -0400 Subject: [PATCH 70/77] Issue #2516842 by er.pushpinderrana, thejacer87, jhodgdon: UPGRADE.txt should explain where to find release notes --- UPGRADE.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPGRADE.txt b/UPGRADE.txt index ca767ddaf43..ae733ca1099 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -77,6 +77,13 @@ following the instructions in the INTRODUCTION section at the top of this file: database information, and you will also want to copy in any other customizations you have added. + You can find the release notes for your version at + https://www.drupal.org/project/drupal. At bottom of the project page under + "Downloads" use the link for your version of Drupal to view the release + notes. If your version is not listed, use the 'View all releases' link. From + this page you can scroll down or use the filter to find your version and its + release notes. + 4. Download the latest Drupal 7.x release from http://drupal.org to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory. From 8b0f1c71c519acc70617faf836336014af925cb7 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 18:12:49 -0400 Subject: [PATCH 71/77] Issue #2115737 by darol100, owenpm3, rhuffstedtler, andythomnz, jemandy, ijf8090, zealfire, er.pushpinderrana, jhodgdon, corbacho, spitcher, abenamer, holingpoon, ay1n: Make the text in modules, themes, and profiles README.txt files more user-friendly --- profiles/README.txt | 28 +++++++++++++++++++++++++ sites/all/modules/README.txt | 40 +++++++++++++++++++++++++++--------- sites/all/themes/README.txt | 37 +++++++++++++++++++++++---------- 3 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 profiles/README.txt diff --git a/profiles/README.txt b/profiles/README.txt new file mode 100644 index 00000000000..91d012ba2aa --- /dev/null +++ b/profiles/README.txt @@ -0,0 +1,28 @@ +Installation profiles define additional steps that run after the base +installation provided by Drupal core when Drupal is first installed. + +WHAT TO PLACE IN THIS DIRECTORY? +-------------------------------- + +Place downloaded and custom installation profiles in this directory. +Installation profiles are generally provided as part of a Drupal distribution. +They only impact the installation of your site. They do not have any effect on +an already running site. + +DOWNLOAD ADDITIONAL DISTRIBUTIONS +--------------------------------- + +Contributed distributions from the Drupal community may be downloaded at +https://www.drupal.org/project/project_distribution. + +MULTISITE CONFIGURATION +----------------------- + +In multisite configurations, installation profiles found in this directory are +available to all sites during their initial site installation. + +MORE INFORMATION +---------------- + +Refer to the "Installation profiles" section of the README.txt in the Drupal +root directory for further information on extending Drupal with custom profiles. diff --git a/sites/all/modules/README.txt b/sites/all/modules/README.txt index 6d019e762ae..b19849bb3ac 100644 --- a/sites/all/modules/README.txt +++ b/sites/all/modules/README.txt @@ -1,17 +1,37 @@ -Place downloaded and custom modules that extend your site functionality beyond -Drupal core in this directory to ensure clean separation from core modules and -to facilitate safe, self-contained code updates. Contributed modules from the -Drupal community may be downloaded at http://drupal.org/project/modules. +Modules extend your site functionality beyond Drupal core. -It is safe to organize modules into subdirectories, such as "contrib" for +WHAT TO PLACE IN THIS DIRECTORY? +-------------------------------- + +Placing downloaded and custom modules in this directory separates downloaded and +custom modules from Drupal core's modules. This allows Drupal core to be updated +without overwriting these files. + +DOWNLOAD ADDITIONAL MODULES +--------------------------- + +Contributed modules from the Drupal community may be downloaded at +https://www.drupal.org/project/project_module. + +ORGANIZING MODULES IN THIS DIRECTORY +------------------------------------ + +You may create subdirectories in this directory, to organize your added modules, +without breaking the site. Some common subdirectories include "contrib" for contributed modules, and "custom" for custom modules. Note that if you move a module to a subdirectory after it has been enabled, you may need to clear the -Drupal cache so that it can be found. (Alternatively, you can disable the -module before moving it and then re-enable it after the move.) +Drupal cache so it can be found. (Alternatively, you can disable the module +before moving it and then re-enable it after the move.) + +MULTISITE CONFIGURATION +----------------------- + +In multisite configurations, modules found in this directory are available to +all sites. Alternatively, the sites/your_site_name/modules directory pattern +may be used to restrict modules to a specific site instance. -In multisite configuration, modules found in this directory are available to -all sites. Alternatively, the sites/your_site_name/modules directory pattern may -be used to restrict modules to a specific site instance. +MORE INFORMATION +---------------- Refer to the "Developing for Drupal" section of the README.txt in the Drupal root directory for further information on extending Drupal with custom modules. diff --git a/sites/all/themes/README.txt b/sites/all/themes/README.txt index e308af205e2..54f9cdc8ab9 100644 --- a/sites/all/themes/README.txt +++ b/sites/all/themes/README.txt @@ -1,14 +1,29 @@ -Place downloaded and custom themes that modify your site's appearance in this -directory to ensure clean separation from Drupal core and to facilitate safe, -self-contained code updates. Contributed themes from the Drupal community may -be downloaded at http://drupal.org/project/themes. +Themes allow you to change the look and feel of your Drupal site. You can use +themes contributed by others or create your own. -It is safe to organize themes into subdirectories and is recommended to use -Drupal's sub-theme functionality to ensure easy maintenance and upgrades. +WHAT TO PLACE IN THIS DIRECTORY? +-------------------------------- -In multisite configuration, themes found in this directory are available to -all sites. Alternatively, the sites/your_site_name/themes directory pattern may -be used to restrict themes to a specific site instance. +Placing downloaded and custom themes in this directory separates downloaded and +custom themes from Drupal core's themes. This allows Drupal core to be updated +without overwriting these files. -Refer to the "Appearance" section of the README.txt in the Drupal root -directory for further information on theming. +DOWNLOAD ADDITIONAL THEMES +-------------------------- + +Contributed themes from the Drupal community may be downloaded at +https://www.drupal.org/project/project_theme. + +MULTISITE CONFIGURATION +----------------------- + +In multisite configurations, themes found in this directory are available to +all sites. Alternatively, the sites/your_site_name/themes directory pattern +may be used to restrict themes to a specific site instance. + +MORE INFORMATION +----------------- + +Refer to the "Appearance" section of the README.txt in the Drupal root directory +for further information on customizing the appearance of Drupal with custom +themes. From 7ec991628cec7dfd56e162bf5ca65ae214c46c38 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 18:17:45 -0400 Subject: [PATCH 72/77] Issue #2393569 by talhaparacha, vbouchet: document which of hook_entity_info() 'entity keys' get filled in and what the defaults are --- modules/system/system.api.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 806b618a25a..3f61cc0e864 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -113,21 +113,21 @@ function hook_hook_info_alter(&$hooks) { * translation handlers. Array keys are the module names, array values * can be any data structure the module uses to provide field translation. * Any empty value disallows the module to appear as a translation handler. - * - entity keys: An array describing how the Field API can extract the - * information it needs from the objects of the type. Elements: + * - entity keys: (optional) An array describing how the Field API can extract + * the information it needs from the objects of the type. Elements: * - id: The name of the property that contains the primary id of the * entity. Every entity object passed to the Field API must have this * property and its value must be numeric. * - revision: The name of the property that contains the revision id of * the entity. The Field API assumes that all revision ids are unique * across all entities of a type. This entry can be omitted if the - * entities of this type are not versionable. + * entities of this type are not versionable. Defaults to an empty string. * - bundle: The name of the property that contains the bundle name for the * entity. The bundle name defines which set of fields are attached to * the entity (e.g. what nodes call "content type"). This entry can be * omitted if this entity type exposes a single bundle (all entities have * the same collection of fields). The name of this single bundle will be - * the same as the entity type. + * the same as the entity type. Defaults to an empty string. * - label: The name of the property that contains the entity label. For * example, if the entity's label is located in $entity->subject, then * 'subject' should be specified here. If complex logic is required to From 5d6340b7e3e9b8e4038da4ddc13e92b01a165ba0 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 18:29:54 -0400 Subject: [PATCH 73/77] Issue #911352 by Liam Morland, Sylvain Lecoy, Joe Murray, Crell: Document that foreign keys may not be used by all drivers --- includes/database/schema.inc | 5 ++++- modules/system/system.api.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/database/schema.inc b/includes/database/schema.inc index 1fc92954a58..d8344c62696 100644 --- a/includes/database/schema.inc +++ b/includes/database/schema.inc @@ -92,7 +92,8 @@ require_once dirname(__FILE__) . '/query.inc'; * specification). Each specification is an array containing the name of * the referenced table ('table'), and an array of column mappings * ('columns'). Column mappings are defined by key pairs ('source_column' => - * 'referenced_column'). + * 'referenced_column'). This key is for documentation purposes only; foreign + * keys are not created in the database, nor are they enforced by Drupal. * - 'indexes': An associative array of indexes ('indexname' => * specification). Each specification is an array of one or more * key column specifiers (see below) that form an index on the @@ -144,6 +145,8 @@ require_once dirname(__FILE__) . '/query.inc'; * 'unique keys' => array( * 'vid' => array('vid'), * ), + * // For documentation purposes only; foreign keys are not created in the + * // database. * 'foreign keys' => array( * 'node_revision' => array( * 'table' => 'node_revision', diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 3f61cc0e864..4576f8197f2 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -3175,7 +3175,9 @@ function hook_requirements($phase) { * creation and alteration of the supported database engines. * * See the Schema API Handbook at http://drupal.org/node/146843 for details on - * schema definition structures. + * schema definition structures. Note that foreign key definitions are for + * documentation purposes only; foreign keys are not created in the database, + * nor are they enforced by Drupal. * * @return array * A schema definition structure array. For each element of the @@ -3227,6 +3229,8 @@ function hook_schema() { 'nid_vid' => array('nid', 'vid'), 'vid' => array('vid'), ), + // For documentation purposes only; foreign keys are not created in the + // database. 'foreign keys' => array( 'node_revision' => array( 'table' => 'node_revision', From bc9cd7d58181d0fb6c63680ec7fca05a1ec42962 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 18:33:20 -0400 Subject: [PATCH 74/77] Issue #2583743 by jcnventura: Correct required version of SQLite in INSTALL.txt --- INSTALL.txt | 2 +- includes/database/sqlite/install.inc | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index 6f02c05ae6d..e00c8bad3e9 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -23,7 +23,7 @@ Drupal requires: - Percona Server 5.1.70 (or greater) (http://www.percona.com/). Percona Server is a backwards-compatible replacement for MySQL. - PostgreSQL 8.3 (or greater) (http://www.postgresql.org/). - - SQLite 3.4.2 (or greater) (http://www.sqlite.org/). + - SQLite 3.3.7 (or greater) (http://www.sqlite.org/). For more detailed information about Drupal requirements, including a list of PHP extensions and configurations that are required, see "System requirements" diff --git a/includes/database/sqlite/install.inc b/includes/database/sqlite/install.inc index 62cbac381f1..10884e2f180 100644 --- a/includes/database/sqlite/install.inc +++ b/includes/database/sqlite/install.inc @@ -14,8 +14,6 @@ class DatabaseTasks_sqlite extends DatabaseTasks { /** * Minimum engine version. - * - * @todo: consider upping to 3.6.8 in Drupal 8 to get SAVEPOINT support. */ public function minimumVersion() { return '3.3.7'; From 29035c844a54cb894fc24b84be65065b2a41c85a Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 18:40:23 -0400 Subject: [PATCH 75/77] Issue #1816008 by Kuldip Gohil, cam8001, jhodgdon, peterx: drupal_cron_run() @return parameter documentation incorrect, should specify that the function returns TRUE or FALSE --- includes/common.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index bb27d391e8b..34fa9b9620c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5323,8 +5323,8 @@ function drupal_page_set_cache() { * * Do not call this function from a test. Use $this->cronRun() instead. * - * @return - * TRUE if cron ran successfully. + * @return bool + * TRUE if cron ran successfully and FALSE if cron is already running. */ function drupal_cron_run() { // Allow execution to continue even if the request gets canceled. From 36e272668176d98460c0ca572fcf14c173015500 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 18:42:40 -0400 Subject: [PATCH 76/77] Issue #2579625 by laurencemercer: Typo in file_validate_image_resolution() doc --- includes/file.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/file.inc b/includes/file.inc index d3ac87ea0ee..ba3da064894 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -1785,7 +1785,7 @@ function file_validate_is_image(stdClass $file) { /** * Verifies that image dimensions are within the specified maximum and minimum. * - * Non-image files will be ignored. If a image toolkit is available the image + * Non-image files will be ignored. If an image toolkit is available the image * will be scaled to fit within the desired maximum dimensions. * * @param $file From 9d16792580c241b42e6192b480f65cf0bdd07bc9 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 14 Oct 2015 19:31:41 -0400 Subject: [PATCH 77/77] Drupal 7.40 --- CHANGELOG.txt | 2 +- includes/bootstrap.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b4713c6310d..f75354e603c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ -Drupal 7.40, xxxx-xx-xx (development version) +Drupal 7.40, 2015-10-14 ----------------------- - Made Drupal's code for parsing .info files run much faster and use much less memory. diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index c87b089e52f..3768a10a779 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -8,7 +8,7 @@ /** * The current system version. */ -define('VERSION', '7.40-dev'); +define('VERSION', '7.40'); /** * Core API compatibility.