updated core to 7.73

This commit is contained in:
2020-09-24 17:04:08 +02:00
parent 084d28842a
commit 7d87153100
524 changed files with 25194 additions and 7745 deletions
+3 -4
View File
@@ -4,8 +4,7 @@ package = Testing
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
+3 -4
View File
@@ -4,8 +4,7 @@ package = Testing
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
+3 -4
View File
@@ -4,8 +4,7 @@ package = Testing
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
@@ -0,0 +1,9 @@
name = Update test admin theme
description = Test theme which is used as admin theme.
core = 7.x
hidden = TRUE
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1600272641"
@@ -3,8 +3,7 @@ description = Test theme which acts as a base theme for other test subthemes.
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
@@ -4,8 +4,7 @@ core = 7.x
base theme = update_test_basetheme
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
+3 -4
View File
@@ -5,8 +5,7 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
+1
View File
@@ -11,6 +11,7 @@
function update_test_system_theme_info() {
$themes['update_test_basetheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_basetheme/update_test_basetheme.info';
$themes['update_test_subtheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_subtheme/update_test_subtheme.info';
$themes['update_test_admintheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_admintheme/update_test_admintheme.info';
return $themes;
}
+9 -3
View File
@@ -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
+10 -3
View File
@@ -104,7 +104,13 @@ function update_get_projects() {
* @see update_get_projects()
*/
function _update_process_info_list(&$projects, $list, $project_type, $status) {
$admin_theme = variable_get('admin_theme', 'seven');
foreach ($list as $file) {
// The admin theme is a special case. It should always be considered enabled
// for the purposes of update checking.
if ($file->name === $admin_theme) {
$file->status = TRUE;
}
// A disabled base theme of an enabled sub-theme still has all of its code
// run by the sub-theme, so we include it in our "enabled" projects list.
if ($status && !$file->status && !empty($file->sub_themes)) {
@@ -417,14 +423,15 @@ function update_calculate_project_data($available) {
* version (e.g., 5.x-1.5-beta1, 5.x-1.5-beta2, and 5.x-1.5). Development
* snapshots for a given major version are always listed last.
*
* @param $project
* An array containing information about a specific project.
* @param $unused
* Input is not being used, but remains in function for API compatibility
* reasons.
* @param $project_data
* An array containing information about a specific project.
* @param $available
* Data about available project releases of a specific project.
*/
function update_calculate_project_update_status($project, &$project_data, $available) {
function update_calculate_project_update_status($unused, &$project_data, $available) {
foreach (array('title', 'link') as $attribute) {
if (!isset($project_data[$attribute]) && isset($available[$attribute])) {
$project_data[$attribute] = $available[$attribute];
+7 -3
View File
@@ -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.
@@ -289,7 +293,7 @@ function _update_build_fetch_url($project, $site_key = '') {
$url = _update_get_fetch_url_base($project);
$url .= '/' . $name . '/' . DRUPAL_CORE_COMPATIBILITY;
// Only append usage infomation if we have a site key and the project is
// Only append usage information if we have a site key and the project is
// enabled. We do not want to record usage statistics for disabled projects.
if (!empty($site_key) && (strpos($project['project_type'], 'disabled') === FALSE)) {
// Append the site key.
+3 -4
View File
@@ -6,8 +6,7 @@ core = 7.x
files[] = update.test
configure = admin/reports/updates/settings
; Information added by drupal.org packaging script on 2013-04-03
version = "7.22"
; Information added by Drupal.org packaging script on 2020-09-16
version = "7.73"
project = "drupal"
datestamp = "1365027012"
datestamp = "1600272641"
+6 -2
View File
@@ -59,7 +59,7 @@
* @see update_menu()
* @ingroup forms
*/
function update_manager_update_form($form, $form_state = array(), $context) {
function update_manager_update_form($form, $form_state, $context) {
if (!_update_manager_check_backends($form, 'update')) {
return $form;
}
@@ -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
+4 -1
View File
@@ -71,7 +71,7 @@ define('UPDATE_MAX_FETCH_ATTEMPTS', 2);
/**
* Maximum number of seconds to try fetching available update data at a time.
*/
define('UPDATE_MAX_FETCH_TIME', 5);
define('UPDATE_MAX_FETCH_TIME', 30);
/**
* Implements hook_help().
@@ -278,12 +278,15 @@ function update_theme() {
),
'update_report' => array(
'variables' => array('data' => NULL),
'file' => 'update.report.inc',
),
'update_version' => array(
'variables' => array('version' => NULL, 'tag' => NULL, 'class' => array()),
'file' => 'update.report.inc',
),
'update_status_label' => array(
'variables' => array('status' => NULL),
'file' => 'update.report.inc',
),
);
}
+6 -5
View File
@@ -26,7 +26,7 @@ function update_settings($form) {
$form['update_check_disabled'] = array(
'#type' => 'checkbox',
'#title' => t('Check for updates of disabled modules and themes'),
'#title' => t('Check for updates of disabled and uninstalled modules and themes'),
'#default_value' => variable_get('update_check_disabled', FALSE),
);
@@ -98,10 +98,11 @@ function update_settings_validate($form, &$form_state) {
* Form submission handler for update_settings().
*
* Also invalidates the cache of available updates if the "Check for updates of
* disabled modules and themes" setting is being changed. The available updates
* report needs to refetch available update data after this setting changes or
* it would show misleading things (e.g., listing the disabled projects on the
* site with the "No available releases found" warning).
* disabled and uninstalled modules and themes" setting is being changed. The
* available updates report needs to refetch available update data after this
* setting changes or it would show misleading things (e.g., listing the
* disabled projects on the site with the "No available releases found"
* warning).
*
* @see update_settings_validate()
*/
+73 -24
View File
@@ -51,7 +51,7 @@ class UpdateTestHelper extends DrupalWebTestCase {
*/
protected function standardTests() {
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(l(t('Drupal'), 'http://example.com/project/drupal'), t('Link to the Drupal project appears.'));
$this->assertRaw(l(t('Drupal'), 'http://example.com/project/drupal'), 'Link to the Drupal project appears.');
$this->assertNoText(t('No available releases found'));
}
@@ -98,9 +98,9 @@ class UpdateCoreTestCase extends UpdateTestHelper {
$this->assertNoText(t('Up to date'));
$this->assertText(t('Update available'));
$this->assertNoText(t('Security update required!'));
$this->assertRaw(l('7.1', 'http://example.com/drupal-7-1-release'), t('Link to release appears.'));
$this->assertRaw(l(t('Download'), 'http://example.com/drupal-7-1.tar.gz'), t('Link to download appears.'));
$this->assertRaw(l(t('Release notes'), 'http://example.com/drupal-7-1-release'), t('Link to release notes appears.'));
$this->assertRaw(l('7.1', 'http://example.com/drupal-7-1-release'), 'Link to release appears.');
$this->assertRaw(l(t('Download'), 'http://example.com/drupal-7-1.tar.gz'), 'Link to download appears.');
$this->assertRaw(l(t('Release notes'), 'http://example.com/drupal-7-1-release'), 'Link to release notes appears.');
}
/**
@@ -113,9 +113,9 @@ class UpdateCoreTestCase extends UpdateTestHelper {
$this->assertNoText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertText(t('Security update required!'));
$this->assertRaw(l('7.2', 'http://example.com/drupal-7-2-release'), t('Link to release appears.'));
$this->assertRaw(l(t('Download'), 'http://example.com/drupal-7-2.tar.gz'), t('Link to download appears.'));
$this->assertRaw(l(t('Release notes'), 'http://example.com/drupal-7-2-release'), t('Link to release notes appears.'));
$this->assertRaw(l('7.2', 'http://example.com/drupal-7-2-release'), 'Link to release appears.');
$this->assertRaw(l(t('Download'), 'http://example.com/drupal-7-2.tar.gz'), 'Link to download appears.');
$this->assertRaw(l(t('Release notes'), 'http://example.com/drupal-7-2-release'), 'Link to release notes appears.');
}
/**
@@ -346,7 +346,7 @@ class UpdateTestContribCase extends UpdateTestHelper {
$this->assertText(t('Up to date'));
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Update available'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), t('Link to aaa_update_test project appears.'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
}
/**
@@ -407,10 +407,10 @@ class UpdateTestContribCase extends UpdateTestHelper {
$this->assertText(t('CCC Update test'));
// We want aaa_update_test included in the ccc_update_test project, not as
// its own project on the report.
$this->assertNoRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), t('Link to aaa_update_test project does not appear.'));
$this->assertNoRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project does not appear.');
// The other two should be listed as projects.
$this->assertRaw(l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), t('Link to bbb_update_test project appears.'));
$this->assertRaw(l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), t('Link to bbb_update_test project appears.'));
$this->assertRaw(l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), 'Link to bbb_update_test project appears.');
$this->assertRaw(l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), 'Link to bbb_update_test project appears.');
// We want to make sure we see the BBB project before the CCC project.
// Instead of just searching for 'BBB Update test' or something, we want
@@ -459,7 +459,56 @@ class UpdateTestContribCase extends UpdateTestHelper {
);
$this->refreshUpdateStatus($xml_mapping);
$this->assertText(t('Security update required!'));
$this->assertRaw(l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme'), t('Link to the Update test base theme project appears.'));
$this->assertRaw(l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme'), 'Link to the Update test base theme project appears.');
}
/**
* Tests that the admin theme is always notified about security updates.
*/
function testUpdateAdminThemeSecurityUpdate() {
// Disable the admin theme.
db_update('system')
->fields(array('status' => 0))
->condition('type', 'theme')
->condition('name', 'update_test_%', 'LIKE')
->execute();
variable_set('admin_theme', 'update_test_admintheme');
// Define the initial state for core and the themes.
$system_info = array(
'#all' => array(
'version' => '7.0',
),
'update_test_admintheme' => array(
'project' => 'update_test_admintheme',
'version' => '7.x-1.0',
'hidden' => FALSE,
),
'update_test_basetheme' => array(
'project' => 'update_test_basetheme',
'version' => '7.x-1.1',
'hidden' => FALSE,
),
'update_test_subtheme' => array(
'project' => 'update_test_subtheme',
'version' => '7.x-1.0',
'hidden' => FALSE,
),
);
variable_set('update_test_system_info', $system_info);
variable_set('update_check_disabled', FALSE);
$xml_mapping = array(
// This is enough because we don't check the update status of the admin
// theme. We want to check that the admin theme is included in the list.
'drupal' => '0',
);
$this->refreshUpdateStatus($xml_mapping);
// The admin theme is displayed even if it's disabled.
$this->assertText('update_test_admintheme', "The admin theme is checked for update even if it's disabled");
// The other disabled themes are not displayed.
$this->assertNoText('update_test_basetheme', 'Disabled theme is not checked for update in the list.');
$this->assertNoText('update_test_subtheme', 'Disabled theme is not checked for update in the list.');
}
/**
@@ -512,13 +561,13 @@ class UpdateTestContribCase extends UpdateTestHelper {
$this->assertNoText(t('Themes'));
if ($check_disabled) {
$this->assertText(t('Disabled themes'));
$this->assertRaw($base_theme_project_link, t('Link to the Update test base theme project appears.'));
$this->assertRaw($sub_theme_project_link, t('Link to the Update test subtheme project appears.'));
$this->assertRaw($base_theme_project_link, 'Link to the Update test base theme project appears.');
$this->assertRaw($sub_theme_project_link, 'Link to the Update test subtheme project appears.');
}
else {
$this->assertNoText(t('Disabled themes'));
$this->assertNoRaw($base_theme_project_link, t('Link to the Update test base theme project does not appear.'));
$this->assertNoRaw($sub_theme_project_link, t('Link to the Update test subtheme project does not appear.'));
$this->assertNoRaw($base_theme_project_link, 'Link to the Update test base theme project does not appear.');
$this->assertNoRaw($sub_theme_project_link, 'Link to the Update test subtheme project does not appear.');
}
}
}
@@ -574,9 +623,9 @@ class UpdateTestContribCase extends UpdateTestHelper {
$this->assertUniqueText(t('Failed to get available update data for one project.'));
// The other two should be listed as projects.
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), t('Link to aaa_update_test project appears.'));
$this->assertNoRaw(l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), t('Link to bbb_update_test project does not appear.'));
$this->assertRaw(l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), t('Link to bbb_update_test project appears.'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
$this->assertNoRaw(l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), 'Link to bbb_update_test project does not appear.');
$this->assertRaw(l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), 'Link to bbb_update_test project appears.');
}
/**
@@ -618,7 +667,7 @@ class UpdateTestContribCase extends UpdateTestHelper {
$this->drupalGet('admin/reports/updates');
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertText(t('Security update required!'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), t('Link to aaa_update_test project appears.'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
// Visit the reports page again without the altering and make sure the
// status is back to normal.
@@ -626,7 +675,7 @@ class UpdateTestContribCase extends UpdateTestHelper {
$this->drupalGet('admin/reports/updates');
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Security update required!'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), t('Link to aaa_update_test project appears.'));
$this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
// Turn the altering back on and visit the Update manager UI.
variable_set('update_test_update_status', $update_status);
@@ -695,9 +744,9 @@ class UpdateTestUploadCase extends UpdateTestHelper {
function testFileNameExtensionMerging() {
$this->drupalGet('admin/modules/install');
// Make sure the bogus extension supported by update_test.module is there.
$this->assertPattern('/file extensions are supported:.*update-test-extension/', t("Found 'update-test-extension' extension"));
$this->assertPattern('/file extensions are supported:.*update-test-extension/', "Found 'update-test-extension' extension");
// Make sure it didn't clobber the first option from core.
$this->assertPattern('/file extensions are supported:.*tar/', t("Found 'tar' extension"));
$this->assertPattern('/file extensions are supported:.*tar/', "Found 'tar' extension");
}
/**
@@ -800,4 +849,4 @@ class UpdateCoreUnitTestCase extends DrupalUnitTestCase {
$this->assertEqual($url, $expected, "When ? is present, '$url' should be '$expected'.");
}
}
}