Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -3,6 +3,7 @@ label: Update configuration
migration_tags:
- Drupal 6
- Drupal 7
- Configuration
source:
plugin: variable
variables:
@ -11,6 +12,7 @@ source:
- update_notification_threshold
- update_notify_emails
- update_check_frequency
source_module: update
process:
'fetch/max_attempts': update_max_fetch_attempts
'fetch/url': update_fetch_url

View file

@ -45,7 +45,7 @@ class UpdateController extends ControllerBase {
*/
public function updateStatus() {
$build = [
'#theme' => 'update_report'
'#theme' => 'update_report',
];
if ($available = update_get_available(TRUE)) {
$this->moduleHandler()->loadInclude('update', 'compare.inc');

View file

@ -12,6 +12,8 @@ use Symfony\Component\HttpFoundation\Response;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateManagerInstall extends FormBase {
@ -93,7 +95,7 @@ class UpdateManagerInstall extends FormBase {
$form['project_url'] = [
'#type' => 'url',
'#title' => $this->t('Install from a URL'),
'#description' => $this->t('For example: %url', ['%url' => 'http://ftp.drupal.org/files/projects/name.tar.gz']),
'#description' => $this->t('For example: %url', ['%url' => 'https://ftp.drupal.org/files/projects/name.tar.gz']),
];
$form['information'] = [
@ -133,18 +135,19 @@ class UpdateManagerInstall extends FormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$local_cache = NULL;
$all_files = $this->getRequest()->files->get('files', []);
if ($form_state->getValue('project_url')) {
$local_cache = update_manager_file_get($form_state->getValue('project_url'));
if (!$local_cache) {
drupal_set_message($this->t('Unable to retrieve Drupal project from %url.', ['%url' => $form_state->getValue('project_url')]), 'error');
$this->messenger()->addError($this->t('Unable to retrieve Drupal project from %url.', ['%url' => $form_state->getValue('project_url')]));
return;
}
}
elseif ($_FILES['files']['name']['project_upload']) {
elseif (!empty($all_files['project_upload'])) {
$validators = ['file_validate_extensions' => [archiver_get_extensions()]];
if (!($finfo = file_save_upload('project_upload', $validators, NULL, 0, FILE_EXISTS_REPLACE))) {
// Failed to upload the file. file_save_upload() calls
// drupal_set_message() on failure.
// \Drupal\Core\Messenger\MessengerInterface::addError() on failure.
return;
}
$local_cache = $finfo->getFileUri();
@ -155,13 +158,13 @@ class UpdateManagerInstall extends FormBase {
$archive = update_manager_archive_extract($local_cache, $directory);
}
catch (\Exception $e) {
drupal_set_message($e->getMessage(), 'error');
$this->messenger()->addError($e->getMessage());
return;
}
$files = $archive->listContents();
if (!$files) {
drupal_set_message($this->t('Provided archive contains no files.'), 'error');
$this->messenger()->addError($this->t('Provided archive contains no files.'));
return;
}
@ -172,12 +175,12 @@ class UpdateManagerInstall extends FormBase {
$archive_errors = $this->moduleHandler->invokeAll('verify_update_archive', [$project, $local_cache, $directory]);
if (!empty($archive_errors)) {
drupal_set_message(array_shift($archive_errors), 'error');
$this->messenger()->addError(array_shift($archive_errors));
// @todo: Fix me in D8: We need a way to set multiple errors on the same
// form element and have all of them appear!
if (!empty($archive_errors)) {
foreach ($archive_errors as $error) {
drupal_set_message($error, 'error');
$this->messenger()->addError($error);
}
}
return;
@ -191,7 +194,7 @@ class UpdateManagerInstall extends FormBase {
$updater = Updater::factory($project_location, $this->root);
}
catch (\Exception $e) {
drupal_set_message($e->getMessage(), 'error');
$this->messenger()->addError($e->getMessage());
return;
}
@ -199,20 +202,20 @@ class UpdateManagerInstall extends FormBase {
$project_title = Updater::getProjectTitle($project_location);
}
catch (\Exception $e) {
drupal_set_message($e->getMessage(), 'error');
$this->messenger()->addError($e->getMessage());
return;
}
if (!$project_title) {
drupal_set_message($this->t('Unable to determine %project name.', ['%project' => $project]), 'error');
$this->messenger()->addError($this->t('Unable to determine %project name.', ['%project' => $project]));
}
if ($updater->isInstalled()) {
drupal_set_message($this->t('%project is already installed.', ['%project' => $project_title]), 'error');
$this->messenger()->addError($this->t('%project is already installed.', ['%project' => $project_title]));
return;
}
$project_real_location = drupal_realpath($project_location);
$project_real_location = \Drupal::service('file_system')->realpath($project_location);
$arguments = [
'project' => $project,
'updater_name' => get_class($updater),

View file

@ -11,6 +11,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateManagerUpdate extends FormBase {
@ -69,7 +71,7 @@ class UpdateManagerUpdate extends FormBase {
'#last' => $this->state->get('update.last_check') ?: 0,
];
$form['last_check'] = [
'#markup' => drupal_render($last_markup),
'#markup' => \Drupal::service('renderer')->render($last_markup),
];
if (!_update_manager_check_backends($form, 'update')) {
@ -181,10 +183,12 @@ class UpdateManagerUpdate extends FormBase {
}
// Use the project title for the tableselect checkboxes.
$entry['title'] = ['data' => [
'#title' => $entry['title'],
'#markup' => $entry['title'],
]];
$entry['title'] = [
'data' => [
'#title' => $entry['title'],
'#markup' => $entry['title'],
],
];
$entry['#attributes'] = ['class' => ['update-' . $type]];
// Drupal core needs to be upgraded manually.
@ -278,7 +282,7 @@ class UpdateManagerUpdate extends FormBase {
if (!empty($projects['manual'])) {
$prefix = '<h2>' . $this->t('Manual updates required') . '</h2>';
$prefix .= '<p>' . $this->t('Updates of Drupal core are not supported at this time.') . '</p>';
$prefix .= '<p>' . $this->t('Automatic updates of Drupal core are not supported at this time.') . '</p>';
$form['manual_updates'] = [
'#type' => 'table',
'#header' => $headers,

View file

@ -13,6 +13,8 @@ use Symfony\Component\HttpFoundation\Response;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateReady extends FormBase {
@ -136,7 +138,7 @@ class UpdateReady extends FormBase {
foreach ($projects as $project => $url) {
$project_location = $directory . '/' . $project;
$updater = Updater::factory($project_location, $this->root);
$project_real_location = drupal_realpath($project_location);
$project_real_location = \Drupal::service('file_system')->realpath($project_location);
$updates[] = [
'project' => $project,
'updater_name' => get_class($updater),

View file

@ -2,6 +2,8 @@
namespace Drupal\update\Tests;
@trigger_error(__NAMESPACE__ . '\UpdateTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\update\Functional\UpdateTestBase', E_USER_DEPRECATED);
use Drupal\Core\DrupalKernel;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
@ -22,6 +24,9 @@ use Drupal\simpletest\WebTestBase;
* (via the 'update_test_xml_map' variable), and then performs a series of
* assertions that the report matches our expectations given the specific
* initial state and availability scenario.
*
* @deprecated Scheduled for removal in Drupal 9.0.0.
* Use \Drupal\Tests\update\Functional\UpdateTestBase instead.
*/
abstract class UpdateTestBase extends WebTestBase {
@ -58,7 +63,7 @@ abstract class UpdateTestBase extends WebTestBase {
* (optional) A string containing the URL to fetch update data from.
* Defaults to 'update-test'.
*
* @see Drupal\update_test\Controller\UpdateTestController::updateTest()
* @see \Drupal\update_test\Controller\UpdateTestController::updateTest()
*/
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
// Tell the Update Manager module to fetch from the URL provided by

View file

@ -2,7 +2,6 @@
namespace Drupal\update;
/**
* Processor of project update information.
*/

View file

@ -10,6 +10,8 @@ use Egulias\EmailValidator\EmailValidator;
/**
* Configure update settings for this site.
*
* @internal
*/
class UpdateSettingsForm extends ConfigFormBase implements ContainerInjectionInterface {
@ -93,7 +95,7 @@ class UpdateSettingsForm extends ConfigFormBase implements ContainerInjectionInt
'all' => t('All newer versions'),
'security' => t('Only security updates'),
],
'#description' => t('You can choose to send email only if a security update is available, or to be notified about all newer versions. If there are updates available of Drupal core or any of your installed modules and themes, your site will always print a message on the <a href=":status_report">status report</a> page, and will also display an error message on administration pages if there is a security update.', [':status_report' => $this->url('system.status')])
'#description' => t('You can choose to send email only if a security update is available, or to be notified about all newer versions. If there are updates available of Drupal core or any of your installed modules and themes, your site will always print a message on the <a href=":status_report">status report</a> page, and will also display an error message on administration pages if there is a security update.', [':status_report' => $this->url('system.status')]),
];
return parent::buildForm($form, $form_state);

View file

@ -1,6 +0,0 @@
name: 'AAA Update test'
type: module
description: 'Support module for update module testing.'
package: Testing
version: VERSION
core: 8.x

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<version_major>1</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<version_major>1</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>1</recommended_major>
<supported_majors>1</supported_majors>
<default_major>1</default_major>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<version_major>1</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<version_major>1</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>2</recommended_major>
<supported_majors>1,2</supported_majors>
<default_major>2</default_major>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-3.0-beta2</name>
<version>8.x-3.0-beta2</version>
<tag>8.x-3.0-beta2</tag>
<version_major>3</version_major>
<version_patch>0</version_patch>
<version_extra>beta2</version_extra>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-beta2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-3-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>aaa_update_test 8.x-3.0-beta1</name>
<version>8.x-3.0-beta1</version>
<tag>8.x-3.0-beta1</tag>
<version_major>3</version_major>
<version_patch>0</version_patch>
<version_extra>beta1</version_extra>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-3-0-beta1</release_link>
<download_link>http://example.com/aaa_update_test--8-x-3-0-beta1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>aaa_update_test 8.x-2.2</name>
<version>8.x-2.2</version>
<tag>DRUPAL-8--2-2</tag>
<version_major>2</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.1</name>
<version>8.x-2.1</version>
<tag>DRUPAL-8--2-1</tag>
<version_major>2</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>DRUPAL-8--2-0</tag>
<version_major>2</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<version_major>1</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<version_major>1</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>AAA Update test</title>
<short_name>aaa_update_test</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>2</recommended_major>
<supported_majors>1,2</supported_majors>
<default_major>2</default_major>
<project_status>published</project_status>
<link>http://example.com/project/aaa_update_test</link>
<terms>
<term><name>Projects</name><value>Modules</value></term>
</terms>
<releases>
<release>
<name>aaa_update_test 8.x-2.2</name>
<version>8.x-2.2</version>
<tag>DRUPAL-8--2-2</tag>
<version_major>2</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.1</name>
<version>8.x-2.1</version>
<tag>DRUPAL-8--2-1</tag>
<version_major>2</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-2.0</name>
<version>8.x-2.0</version>
<tag>DRUPAL-8--2-0</tag>
<version_major>2</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-2-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-2-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.2</name>
<version>8.x-1.2</version>
<tag>DRUPAL-8--1-2</tag>
<version_major>1</version_major>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-2-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-2.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.1</name>
<version>8.x-1.1</version>
<tag>DRUPAL-8--1-1</tag>
<version_major>1</version_major>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-1-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-1.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>aaa_update_test 8.x-1.0</name>
<version>8.x-1.0</version>
<tag>DRUPAL-8--1-0</tag>
<version_major>1</version_major>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/aaa_update_test-8-x-1-0-release</release_link>
<download_link>http://example.com/aaa_update_test-8-x-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -14,15 +14,15 @@
</terms>
<releases>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_minor>0</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
@ -33,39 +33,42 @@
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_minor>0</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_minor>0</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>

View file

@ -0,0 +1,263 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>drupal 8.2.0-rc2</name>
<version>8.2.0-rc2</version>
<tag>8.2.0-rc2</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>rc2</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-rc1</name>
<version>8.2.0-rc1</version>
<tag>8.2.0-rc1</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>rc1</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>beta2</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta1</name>
<version>8.2.0-beta1</version>
<tag>8.2.0-beta1</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>beta1</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha2</name>
<version>8.2.0-alpha2</version>
<tag>8.2.0-alpha2</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>alpha2</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-alpha2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha1</name>
<version>8.2.0-alpha1</version>
<tag>8.2.0-alpha1</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>alpha1</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8.2.0-alpha1</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424526</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424525</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424524</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424523</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424522</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,269 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>drupal 8.2.0-rc2</name>
<version>8.2.0-rc2</version>
<tag>8.2.0-rc2</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>rc2</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-rc1</name>
<version>8.2.0-rc1</version>
<tag>8.2.0-rc1</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>rc1</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-rc1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-rc1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
RC releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta2</name>
<version>8.2.0-beta2</version>
<tag>8.2.0-beta2</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>beta2</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-beta1</name>
<version>8.2.0-beta1</version>
<tag>8.2.0-beta1</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>beta1</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-beta1-release</release_link>
<download_link>http://example.com/drupal-8-2-0-beta1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Beta releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha2</name>
<version>8.2.0-alpha2</version>
<tag>8.2.0-alpha2</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>alpha2</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8-2-0-alpha2-release</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha2.tar.gz</download_link>
<date>1533298080</date>
<mdhash>2387284145e34a19fc45e03c258a2831</mdhash>
<filesize>16209911</filesize>
<terms>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>drupal 8.2.0-alpha1</name>
<version>8.2.0-alpha1</version>
<tag>8.2.0-alpha1</tag>
<version_major>8</version_major>
<version_minor>2</version_minor>
<version_patch>0</version_patch>
<version_extra>alpha1</version_extra>
<status>published</status>
<release_link>http://example.com/drupal-8.2.0-alpha1</release_link>
<download_link>http://example.com/drupal-8-2-0-alpha1.tar.gz</download_link>
<date>1533270485</date>
<mdhash>3d70ae568dd8f7100082b8c58bc8d1fe</mdhash>
<filesize>16209123</filesize>
<terms>
<term><name>Release type</name><value>Insecure</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>New features</value></term>
</terms>
<security>
Alpha releases are not covered by Drupal security advisories.
</security>
</release>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -48,6 +48,7 @@
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
@ -66,6 +67,7 @@
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>

View file

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Drupal</title>
<short_name>drupal</short_name>
<dc:creator>Drupal</dc:creator>
<api_version>8.x</api_version>
<recommended_major>8</recommended_major>
<supported_majors>8</supported_majors>
<default_major>8</default_major>
<project_status>published</project_status>
<link>http://example.com/project/drupal</link>
<terms>
<term><name>Projects</name><value>Drupal project</value></term>
</terms>
<releases>
<release>
<name>Drupal 8.1.2</name>
<version>8.1.2</version>
<tag>DRUPAL-8-1-2</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-2-release</release_link>
<download_link>http://example.com/drupal-8-1-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Security update</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.1</name>
<version>8.1.1</version>
<tag>DRUPAL-8-1-1</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-1-release</release_link>
<download_link>http://example.com/drupal-8-1-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.1.0</name>
<version>8.1.0</version>
<tag>DRUPAL-8-1-0</tag>
<version_major>8</version_major>
<version_minor>1</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-1-0-release</release_link>
<download_link>http://example.com/drupal-8-1-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.2</name>
<version>8.0.2</version>
<tag>DRUPAL-8-0-2</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>2</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-2-release</release_link>
<download_link>http://example.com/drupal-8-0-2.tar.gz</download_link>
<date>1250424641</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>4294967296</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.1</name>
<version>8.0.1</version>
<tag>DRUPAL-8-0-1</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>1</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-1-release</release_link>
<download_link>http://example.com/drupal-8-0-1.tar.gz</download_link>
<date>1250424581</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>2147483648</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
<release>
<name>Drupal 8.0.0</name>
<version>8.0.0</version>
<tag>DRUPAL-8-0-0</tag>
<version_major>8</version_major>
<version_minor>0</version_minor>
<version_patch>0</version_patch>
<status>published</status>
<release_link>http://example.com/drupal-8-0-0-release</release_link>
<download_link>http://example.com/drupal-8-0-0.tar.gz</download_link>
<date>1250424521</date>
<mdhash>b966255555d9c9b86d480ca08cfaa98e</mdhash>
<filesize>1073741824</filesize>
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>
</project>

View file

@ -41,7 +41,7 @@ class UpdateTestController extends ControllerBase {
* @param string $version
* The version of Drupal core.
*
* @return BinaryFileResponse|Response
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse|Response
* A BinaryFileResponse object containing the content of the XML release file
* for the specified project if one is available; a Response object with no
* content otherwise.

View file

@ -46,6 +46,7 @@
<terms>
<term><name>Release type</name><value>New features</value></term>
<term><name>Release type</name><value>Bug fixes</value></term>
<term><name>Release type</name><value>Insecure</value></term>
</terms>
</release>
</releases>

View file

@ -1,6 +1,6 @@
<?php
namespace Drupal\update\Tests;
namespace Drupal\Tests\update\Functional;
/**
* Tests the Update Manager module upload via authorize.php functionality.
@ -23,7 +23,7 @@ class FileTransferAuthorizeFormTest extends UpdateTestBase {
// Create a local cache so the module is not downloaded from drupal.org.
$cache_directory = _update_manager_cache_directory(TRUE);
$validArchiveFile = __DIR__ . '/../../tests/update_test_new_module/8.x-1.0/update_test_new_module.tar.gz';
$validArchiveFile = __DIR__ . '/../../update_test_new_module/8.x-1.0/update_test_new_module.tar.gz';
copy($validArchiveFile, $cache_directory . '/update_test_new_module.tar.gz');
}

View file

@ -1,6 +1,6 @@
<?php
namespace Drupal\update\Tests;
namespace Drupal\Tests\update\Functional;
use Drupal\Core\Url;
use Drupal\Core\Utility\ProjectInfo;
@ -178,7 +178,7 @@ class UpdateContribTest extends UpdateTestBase {
// we're really testing that the project listings are in the right order.
$bbb_project_link = '<div class="project-update__title"><a href="http://example.com/project/bbb_update_test">BBB Update test</a>';
$ccc_project_link = '<div class="project-update__title"><a href="http://example.com/project/ccc_update_test">CCC Update test</a>';
$this->assertTrue(strpos($this->getRawContent(), $bbb_project_link) < strpos($this->getRawContent(), $ccc_project_link), "'BBB Update test' project is listed before the 'CCC Update test' project");
$this->assertTrue(strpos($this->getSession()->getPage()->getContent(), $bbb_project_link) < strpos($this->getSession()->getPage()->getContent(), $ccc_project_link), "'BBB Update test' project is listed before the 'CCC Update test' project");
}
/**
@ -438,4 +438,130 @@ class UpdateContribTest extends UpdateTestBase {
$this->assertNoText(t('Security update'));
}
/**
* Tests update status of security releases.
*
* @param string $module_version
* The module version the site is using.
* @param string[] $expected_security_releases
* The security releases, if any, that the status report should recommend.
* @param string $expected_update_message_type
* The type of update message expected.
* @param string $fixture
* The fixture file to use.
*
* @dataProvider securityUpdateAvailabilityProvider
*/
public function testSecurityUpdateAvailability($module_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
$system_info = [
'#all' => [
'version' => '8.0.0',
],
'aaa_update_test' => [
'project' => 'aaa_update_test',
'version' => $module_version,
'hidden' => FALSE,
],
];
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(['drupal' => '0.0', 'aaa_update_test' => $fixture]);
$this->assertSecurityUpdates('aaa_update_test', $expected_security_releases, $expected_update_message_type, 'table.update:nth-of-type(2)');
}
/**
* Data provider method for testSecurityUpdateAvailability().
*
* These test cases rely on the following fixtures containing the following
* releases:
* - aaa_update_test.sec.8.x-1.2.xml
* - 8.x-1.2 Security update
* - 8.x-1.1 Insecure
* - 8.x-1.0 Insecure
* - aaa_update_test.sec.8.x-1.1_8.x-1.2.xml
* - 8.x-1.2 Security update
* - 8.x-1.1 Security update, Insecure
* - 8.x-1.0 Insecure
* - aaa_update_test.sec.8.x-1.2_8.x-2.2.xml
* - 8.x-3.0-beta2
* - 8.x-3.0-beta1 Insecure
* - 8.x-2.2 Security update
* - 8.x-2.1 Security update, Insecure
* - 8.x-2.0 Insecure
* - 8.x-1.2 Security update
* - 8.x-1.1 Insecure
* - 8.x-1.0 Insecure
* - aaa_update_test.sec.8.x-2.2_1.x_secure.xml
* - 8.x-2.2 Security update
* - 8.x-2.1 Security update, Insecure
* - 8.x-2.0 Insecure
* - 8.x-1.2
* - 8.x-1.1
* - 8.x-1.0
*/
public function securityUpdateAvailabilityProvider() {
return [
// Security releases available for module major release 1.
// No releases for next major.
'8.x-1.0, 8.x-1.2' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => ['8.x-1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.2',
],
// Two security releases available for module major release 1.
// 8.x-1.1 security release marked as insecure.
// No releases for next major.
'8.x-1.0, 8.x-1.1 8.x-1.2' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => ['8.x-1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.1_8.x-1.2',
],
// Security release available for module major release 2.
// No releases for next major.
'8.x-2.0, 8.x-2.2' => [
'module_patch_version' => '8.x-2.0',
'expected_security_releases' => ['8.x-2.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-2.2_1.x_secure',
],
'8.x-2.2, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-2.2',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
// Security release available for module major release 1.
// Security release also available for next major.
'8.x-1.0, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => ['8.x-1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
// No security release available for module major release 1 but 1.x
// releases are not marked as insecure.
// Security release available for next major.
'8.x-1.0, 8.x-2.2, not insecure' => [
'module_patch_version' => '8.x-1.0',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.8.x-2.2_1.x_secure',
],
// On latest security release for module major release 1.
// Security release also available for next major.
'8.x-1.2, 8.x-1.2 8.x-2.2' => [
'module_patch_version' => '8.x-1.2',
'expected_security_release' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.8.x-1.2_8.x-2.2',
],
// @todo In https://www.drupal.org/node/2865920 add test cases:
// - 8.x-2.0 using fixture 'sec.8.x-1.2_8.x-2.2' to ensure that 8.x-2.2
// is the only security update.
// - 8.x-3.0-beta1 using fixture 'sec.8.x-1.2_8.x-2.2' to ensure that
// 8.x-2.2 is the only security update.
];
}
}

View file

@ -1,8 +1,9 @@
<?php
namespace Drupal\update\Tests;
namespace Drupal\Tests\update\Functional;
use Drupal\Core\Url;
use Drupal\Tests\Traits\Core\CronRunTrait;
/**
* Tests the Update Manager module through a series of functional tests using
@ -12,6 +13,8 @@ use Drupal\Core\Url;
*/
class UpdateCoreTest extends UpdateTestBase {
use CronRunTrait;
/**
* Modules to enable.
*
@ -76,6 +79,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->standardTests();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertNoText(t('Security update required!'));
$this->assertRaw(\Drupal::l("8.$minor_version.1" . $extra_version, Url::fromUri("http://example.com/drupal-8-$minor_version-1$extra_version-release")), 'Link to release appears.');
$this->assertRaw(\Drupal::l(t('Download'), Url::fromUri("http://example.com/drupal-8-$minor_version-1$extra_version.tar.gz")), 'Link to download appears.');
@ -139,6 +143,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->standardTests();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertNoText(t('Security update required!'));
$this->assertRaw(\Drupal::l('9.0.0', Url::fromUri("http://example.com/drupal-9-0-0-release")), 'Link to release appears.');
$this->assertRaw(\Drupal::l(t('Download'), Url::fromUri("http://example.com/drupal-9-0-0.tar.gz")), 'Link to download appears.');
@ -155,20 +160,188 @@ class UpdateCoreTest extends UpdateTestBase {
/**
* Tests the Update Manager module when a security update is available.
*
* @param string $site_patch_version
* The patch version to set the site to for testing.
* @param string[] $expected_security_releases
* The security releases, if any, that the status report should recommend.
* @param string $expected_update_message_type
* The type of update message expected.
* @param string $fixture
* The test fixture that contains the test XML.
*
* @dataProvider securityUpdateAvailabilityProvider
*/
public function testSecurityUpdateAvailable() {
foreach ([0, 1] as $minor_version) {
$this->setSystemInfo("8.$minor_version.0");
$this->refreshUpdateStatus(['drupal' => "$minor_version.2-sec"]);
$this->standardTests();
$this->assertNoText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertText(t('Security update required!'));
$this->assertRaw(\Drupal::l("8.$minor_version.2", Url::fromUri("http://example.com/drupal-8-$minor_version-2-release")), 'Link to release appears.');
$this->assertRaw(\Drupal::l(t('Download'), Url::fromUri("http://example.com/drupal-8-$minor_version-2.tar.gz")), 'Link to download appears.');
$this->assertRaw(\Drupal::l(t('Release notes'), Url::fromUri("http://example.com/drupal-8-$minor_version-2-release")), 'Link to release notes appears.');
$this->assertRaw('error.svg', 'Error icon was found.');
public function testSecurityUpdateAvailability($site_patch_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
$this->setSystemInfo("8.$site_patch_version");
$this->refreshUpdateStatus(['drupal' => $fixture]);
$this->assertSecurityUpdates('drupal-8', $expected_security_releases, $expected_update_message_type, 'table.update');
}
/**
* Data provider method for testSecurityUpdateAvailability().
*
* These test cases rely on the following fixtures containing the following
* releases:
* - drupal.sec.0.1_0.2.xml
* - 8.0.2 Security update
* - 8.0.1 Security update, Insecure
* - 8.0.0 Insecure
* - drupal.sec.0.2.xml
* - 8.0.2 Security update
* - 8.0.1 Insecure
* - 8.0.0 Insecure
* - drupal.sec.0.2-rc2.xml
* - 8.2.0-rc2 Security update
* - 8.2.0-rc1 Insecure
* - 8.2.0-beta2 Insecure
* - 8.2.0-beta1 Insecure
* - 8.2.0-alpha2 Insecure
* - 8.2.0-alpha1 Insecure
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2 Security update
* - 8.0.1 Insecure
* - 8.0.0 Insecure
* - drupal.sec.1.2.xml
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2
* - 8.0.1
* - 8.0.0
* - drupal.sec.1.2_insecure.xml
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2 Insecure
* - 8.0.1 Insecure
* - 8.0.0 Insecure
* - drupal.sec.0.2-rc2-b.xml
* - 8.2.0-rc2
* - 8.2.0-rc1
* - 8.2.0-beta2
* - 8.2.0-beta1
* - 8.2.0-alpha2
* - 8.2.0-alpha1
* - 8.1.2 Security update
* - 8.1.1 Insecure
* - 8.1.0 Insecure
* - 8.0.2 Security update
* - 8.0.1 Insecure
* - 8.0.0 Insecure
*/
public function securityUpdateAvailabilityProvider() {
$test_cases = [
// Security release available for site minor release 0.
// No releases for next minor.
'0.0, 0.2' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['0.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.2',
],
// Site on latest security release available for site minor release 0.
// Minor release 1 also has a security release, and the current release
// is marked as insecure.
'0.2, 0.2' => [
'site_patch_version' => '0.2',
'expected_security_release' => ['1.2', '2.0-rc2'],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.0.2-rc2',
],
// Two security releases available for site minor release 0.
// 0.1 security release marked as insecure.
// No releases for next minor.
'0.0, 0.1 0.2' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['0.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.1_0.2',
],
// Security release available for site minor release 1.
// No releases for next minor.
'1.0, 1.2' => [
'site_patch_version' => '1.0',
'expected_security_releases' => ['1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.1.2',
],
// Security release available for site minor release 0.
// Security release also available for next minor.
'0.0, 0.2 1.2' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['0.2', '1.2', '2.0-rc2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.0.2-rc2',
],
// No newer security release for site minor 1.
// Previous minor has security release.
'1.2, 0.2 1.2' => [
'site_patch_version' => '1.2',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.0.2-rc2',
],
// No security release available for site minor release 0.
// Security release available for next minor.
'0.0, 1.2, insecure' => [
'site_patch_version' => '0.0',
'expected_security_releases' => ['1.2'],
'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED,
'fixture' => 'sec.1.2_insecure',
],
// All releases for minor 0 are secure.
// Security release available for next minor.
'0.0, 1.2, secure' => [
'site_patch_version' => '0.0',
'expected_security_release' => ['1.2'],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.1.2',
],
'0.2, 1.2, secure' => [
'site_patch_version' => '0.2',
'expected_security_release' => ['1.2'],
'expected_update_message_type' => static::UPDATE_AVAILABLE,
'fixture' => 'sec.1.2',
],
// Site on 2.0-rc2 which is a security release.
'2.0-rc2, 0.2 1.2' => [
'site_patch_version' => '2.0-rc2',
'expected_security_releases' => [],
'expected_update_message_type' => static::UPDATE_NONE,
'fixture' => 'sec.0.2-rc2',
],
];
$pre_releases = [
'2.0-alpha1',
'2.0-alpha2',
'2.0-beta1',
'2.0-beta2',
'2.0-rc1',
'2.0-rc2',
];
// If the site is on an alpha/beta/RC of an upcoming minor and none of the
// alpha/beta/RC versions are marked insecure, no security update should be
// required.
foreach ($pre_releases as $pre_release) {
$test_cases["Pre-release:$pre_release, no security update"] = [
'site_patch_version' => $pre_release,
'expected_security_releases' => [],
'expected_update_message_type' => $pre_release === '2.0-rc2' ? static::UPDATE_NONE : static::UPDATE_AVAILABLE,
'fixture' => 'sec.0.2-rc2-b',
];
}
// @todo In https://www.drupal.org/node/2865920 add test cases:
// - For all pre-releases for 8.2.0 except 8.2.0-rc2 using the
// 'sec.0.2-rc2' fixture to ensure that 8.2.0-rc2 is the only security
// update.
// - For 8.1.0 using fixture 'sec.0.2-rc2' to ensure that only security
// updates are 8.1.2 and 8.2.0-rc2.
return $test_cases;
}
/**
@ -226,6 +399,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
@ -247,6 +421,7 @@ class UpdateCoreTest extends UpdateTestBase {
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertText(t('There are updates available for your version of Drupal.'));
@ -263,11 +438,12 @@ class UpdateCoreTest extends UpdateTestBase {
->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
->save();
$this->config('update_test.settings')
->set('xml_map', ['drupal' => '0.2-sec'])
->set('xml_map', ['drupal' => 'sec.0.2'])
->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
$this->assertText(t('Checked available update data for one project.'));
$this->drupalGet('admin/modules');
$this->assertNoText(t('There are updates available for your version of Drupal.'));
@ -281,8 +457,9 @@ class UpdateCoreTest extends UpdateTestBase {
// Make sure duplicate messages don't appear on Update status pages.
$this->drupalGet('admin/reports/status');
// We're expecting "There is a security update..." inside the status report
// itself, but the drupal_set_message() appears as an li so we can prefix
// with that and search for the raw HTML.
// itself, but the message from
// \Drupal\Core\Messenger\MessengerInterface::addStatus() appears as an li
// so we can prefix with that and search for the raw HTML.
$this->assertNoRaw('<li>' . t('There is a security update available for your version of Drupal.'));
$this->drupalGet('admin/reports/updates');

View file

@ -1,6 +1,6 @@
<?php
namespace Drupal\update\Tests;
namespace Drupal\Tests\update\Functional;
/**
* Tests the update_delete_file_if_stale() function.
@ -38,7 +38,7 @@ class UpdateDeleteFileIfStaleTest extends UpdateTestBase {
->set('temporary_maximum_age', -100000)
->save();
$file_path = drupal_realpath($file_name);
$file_path = \Drupal::service('file_system')->realpath($file_name);
update_delete_file_if_stale($file_path);
$this->assertFalse(is_file($file_path));

View file

@ -0,0 +1,170 @@
<?php
namespace Drupal\Tests\update\Functional;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
/**
* Defines some shared functions used by all update tests.
*
* The overarching methodology of these tests is we need to compare a given
* state of installed modules and themes (e.g., version, project grouping,
* timestamps, etc) against a current state of what the release history XML
* files we fetch say is available. We have dummy XML files (in the
* core/modules/update/tests directory) that describe various scenarios of
* what's available for different test projects, and we have dummy .info file
* data (specified via hook_system_info_alter() in the update_test helper
* module) describing what's currently installed. Each test case defines a set
* of projects to install, their current state (via the
* 'update_test_system_info' variable) and the desired available update data
* (via the 'update_test_xml_map' variable), and then performs a series of
* assertions that the report matches our expectations given the specific
* initial state and availability scenario.
*/
abstract class UpdateTestBase extends BrowserTestBase {
/**
* Denotes a security update will be required in the test case.
*/
const SECURITY_UPDATE_REQUIRED = 'SECURITY_UPDATE_REQUIRED';
/**
* Denotes an update will be available in the test case.
*/
const UPDATE_AVAILABLE = 'UPDATE_AVAILABLE';
/**
* Denotes no update will be available in the test case.
*/
const UPDATE_NONE = 'UPDATE_NONE';
protected function setUp() {
parent::setUp();
// Change the root path which Update Manager uses to install and update
// projects to be inside the testing site directory. See
// \Drupal\update\UpdateRootFactory::get() for equivalent changes to the
// test child site.
$request = \Drupal::request();
$update_root = $this->container->get('update.root') . '/' . DrupalKernel::findSitePath($request);
$this->container->set('update.root', $update_root);
\Drupal::setContainer($this->container);
// Create the directories within the root path within which the Update
// Manager will install projects.
foreach (drupal_get_updaters() as $updater_info) {
$updater = $updater_info['class'];
$install_directory = $update_root . '/' . $updater::getRootDirectoryRelativePath();
if (!is_dir($install_directory)) {
mkdir($install_directory);
}
}
}
/**
* Refreshes the update status based on the desired available update scenario.
*
* @param $xml_map
* Array that maps project names to availability scenarios to fetch. The key
* '#all' is used if a project-specific mapping is not defined.
* @param $url
* (optional) A string containing the URL to fetch update data from.
* Defaults to 'update-test'.
*
* @see \Drupal\update_test\Controller\UpdateTestController::updateTest()
*/
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
// Tell the Update Manager module to fetch from the URL provided by
// update_test module.
$this->config('update.settings')->set('fetch.url', Url::fromUri('base:' . $url, ['absolute' => TRUE])->toString())->save();
// Save the map for UpdateTestController::updateTest() to use.
$this->config('update_test.settings')->set('xml_map', $xml_map)->save();
// Manually check the update status.
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
$this->checkForMetaRefresh();
}
/**
* Runs a series of assertions that are applicable to all update statuses.
*/
protected function standardTests() {
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(\Drupal::l(t('Drupal'), Url::fromUri('http://example.com/project/drupal')), 'Link to the Drupal project appears.');
$this->assertNoText(t('No available releases found'));
}
/**
* Asserts the expected security updates are displayed correctly on the page.
*
* @param string $project_path_part
* The project path part needed for the download and release links.
* @param string[] $expected_security_releases
* The security releases, if any, that the status report should recommend.
* @param string $expected_update_message_type
* The type of update message expected.
* @param string $update_element_css_locator
* The CSS locator for the page element that contains the security updates.
*/
protected function assertSecurityUpdates($project_path_part, array $expected_security_releases, $expected_update_message_type, $update_element_css_locator) {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$this->standardTests();
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Not supported');
$all_security_release_urls = array_map(function ($link) {
return $link->getAttribute('href');
}, $page->findAll('css', "$update_element_css_locator .version-security a[href$='-release']"));
$all_security_download_urls = array_map(function ($link) {
return $link->getAttribute('href');
}, $page->findAll('css', "$update_element_css_locator .version-security a[href$='.tar.gz']"));
if ($expected_security_releases) {
$expected_download_urls = [];
$expected_release_urls = [];
if ($expected_update_message_type === static::SECURITY_UPDATE_REQUIRED) {
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextContains('css', $update_element_css_locator, 'Security update required!');
$assert_session->responseContains('error.svg', 'Error icon was found.');
}
else {
$assert_session->elementTextContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Security update required!');
}
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Up to date');
foreach ($expected_security_releases as $expected_security_release) {
$expected_url_version = str_replace('.', '-', $expected_security_release);
$release_url = "http://example.com/$project_path_part-$expected_url_version-release";
$download_url = "http://example.com/$project_path_part-$expected_url_version.tar.gz";
$expected_release_urls[] = $release_url;
$expected_download_urls[] = $download_url;
// Ensure the expected links are security links.
$this->assertTrue(in_array($release_url, $all_security_release_urls), "Release $release_url is a security release link.");
$this->assertTrue(in_array($download_url, $all_security_download_urls), "Release $download_url is a security download link.");
$assert_session->linkByHrefExists($release_url);
$assert_session->linkByHrefExists($download_url);
}
// Ensure no other links are shown as security releases.
$this->assertEquals([], array_diff($all_security_release_urls, $expected_release_urls));
$this->assertEquals([], array_diff($all_security_download_urls, $expected_download_urls));
}
else {
// Ensure there were no security links.
$this->assertEquals([], $all_security_release_urls);
$this->assertEquals([], $all_security_download_urls);
$assert_session->pageTextNotContains('Security update required!');
if ($expected_update_message_type === static::UPDATE_AVAILABLE) {
$assert_session->elementTextContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Up to date');
}
elseif ($expected_update_message_type === static::UPDATE_NONE) {
$assert_session->elementTextNotContains('css', $update_element_css_locator, 'Update available');
$assert_session->elementTextContains('css', $update_element_css_locator, 'Up to date');
}
else {
$this->fail('Unexpected value for $expected_update_message_type: ' . $expected_update_message_type);
}
}
}
}

View file

@ -1,10 +1,11 @@
<?php
namespace Drupal\update\Tests;
namespace Drupal\Tests\update\Functional;
use Drupal\Core\Extension\InfoParserDynamic;
use Drupal\Core\Updater\Updater;
use Drupal\Core\Url;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests the Update Manager module's upload and extraction functionality.
@ -13,6 +14,10 @@ use Drupal\Core\Url;
*/
class UpdateUploadTest extends UpdateTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
}
/**
* Modules to enable.
*
@ -50,7 +55,7 @@ class UpdateUploadTest extends UpdateTestBase {
// Check to ensure an existing module can't be reinstalled. Also checks that
// the archive was extracted since we can't know if the module is already
// installed until after extraction.
$validArchiveFile = __DIR__ . '/../../tests/aaa_update_test.tar.gz';
$validArchiveFile = __DIR__ . '/../../aaa_update_test.tar.gz';
$edit = [
'files[project_upload]' => $validArchiveFile,
];
@ -63,7 +68,7 @@ class UpdateUploadTest extends UpdateTestBase {
$moduleUpdater = $updaters['module']['class'];
$installedInfoFilePath = $this->container->get('update.root') . '/' . $moduleUpdater::getRootDirectoryRelativePath() . '/update_test_new_module/update_test_new_module.info.yml';
$this->assertFalse(file_exists($installedInfoFilePath), 'The new module does not exist in the filesystem before it is installed with the Update Manager.');
$validArchiveFile = __DIR__ . '/../../tests/update_test_new_module/8.x-1.0/update_test_new_module.tar.gz';
$validArchiveFile = __DIR__ . '/../../update_test_new_module/8.x-1.0/update_test_new_module.tar.gz';
$edit = [
'files[project_upload]' => $validArchiveFile,
];
@ -185,10 +190,10 @@ class UpdateUploadTest extends UpdateTestBase {
* Tests only an *.info.yml file are detected without supporting files.
*/
public function testUpdateDirectory() {
$type = Updater::getUpdaterFromDirectory(\Drupal::root() . '/core/modules/update/tests/modules/aaa_update_test');
$type = Updater::getUpdaterFromDirectory($this->root . '/core/modules/update/tests/modules/aaa_update_test');
$this->assertEqual($type, 'Drupal\\Core\\Updater\\Module', 'Detected a Module');
$type = Updater::getUpdaterFromDirectory(\Drupal::root() . '/core/modules/update/tests/themes/update_test_basetheme');
$type = Updater::getUpdaterFromDirectory($this->root . '/core/modules/update/tests/themes/update_test_basetheme');
$this->assertEqual($type, 'Drupal\\Core\\Updater\\Theme', 'Detected a Theme.');
}

View file

@ -28,7 +28,7 @@ class UpdateFetcherTest extends UnitTestCase {
*/
protected function setUp() {
$config_factory = $this->getConfigFactoryStub(['update.settings' => ['fetch_url' => 'http://www.example.com']]);
$http_client_mock = $this->getMock('\GuzzleHttp\ClientInterface');
$http_client_mock = $this->createMock('\GuzzleHttp\ClientInterface');
$this->updateFetcher = new UpdateFetcher($config_factory, $http_client_mock);
}

View file

@ -253,7 +253,7 @@ function update_authorize_update_batch_finished($success, $results) {
'#type' => 'link',
'#url' => $url,
'#title' => t('Run database updates'),
// Since this is being called outsite of the primary front controller,
// Since this is being called outside of the primary front controller,
// the base_url needs to be set explicitly to ensure that links are
// relative to the site root.
// @todo Simplify with https://www.drupal.org/node/2548095
@ -261,7 +261,7 @@ function update_authorize_update_batch_finished($success, $results) {
'absolute' => TRUE,
'base_url' => $GLOBALS['base_url'],
],
'#access' => $url->access(\Drupal::currentUser())
'#access' => $url->access(\Drupal::currentUser()),
];
// Unset the variable since it is no longer needed.

View file

@ -425,15 +425,6 @@ function update_calculate_project_update_status(&$project_data, $available) {
$project_data['recommended'] = $project_data['latest_version'];
}
//
// Check to see if we need an update or not.
//
if (!empty($project_data['security updates'])) {
// If we found security updates, that always trumps any other status.
$project_data['status'] = UPDATE_NOT_SECURE;
}
if (isset($project_data['status'])) {
// If we already know the status, we're done.
return;

View file

@ -6,4 +6,4 @@ package: Core
core: 8.x
configure: update.settings
dependencies:
- file
- drupal:file

View file

@ -108,15 +108,17 @@ function _update_requirement_check($project, $type) {
if ($status != UPDATE_CURRENT) {
$requirement['reason'] = $status;
$requirement['severity'] = REQUIREMENT_ERROR;
// Append the available updates link to the message from
// _update_message_text(), and format the two translated strings together in
// a single paragraph.
// When updates are available, append the available updates link to the
// message from _update_message_text(), and format the two translated
// strings together in a single paragraph.
$requirement['description'][] = ['#markup' => _update_message_text($type, $status)];
if (_update_manager_access()) {
$requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the <a href=":available_updates">available updates</a> page for more information and to install your missing updates.', [':available_updates' => \Drupal::url('update.report_update')])];
}
else {
$requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the <a href=":available_updates">available updates</a> page for more information.', [':available_updates' => \Drupal::url('update.status')])];
if (!in_array($status, [UPDATE_UNKNOWN, UPDATE_NOT_CHECKED, UPDATE_NOT_FETCHED, UPDATE_FETCH_PENDING])) {
if (_update_manager_access()) {
$requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the <a href=":available_updates">available updates</a> page for more information and to install your missing updates.', [':available_updates' => \Drupal::url('update.report_update')])];
}
else {
$requirement['description'][] = ['#prefix' => ' ', '#markup' => t('See the <a href=":available_updates">available updates</a> page for more information.', [':available_updates' => \Drupal::url('update.status')])];
}
}
}
switch ($status) {
@ -136,6 +138,7 @@ function _update_requirement_check($project, $type) {
case UPDATE_UNKNOWN:
case UPDATE_NOT_CHECKED:
case UPDATE_NOT_FETCHED:
case UPDATE_FETCH_PENDING:
$requirement_label = isset($project['reason']) ? $project['reason'] : t('Can not determine status');
$requirement['severity'] = REQUIREMENT_WARNING;
break;
@ -155,4 +158,8 @@ function _update_requirement_check($project, $type) {
function update_update_8001() {
// Empty update forces a call to drupal_flush_all_caches() which rebuilds the
// router.
// Use hook_post_update_NAME() instead to clear the cache.The use
// of hook_update_N to clear the cache has been deprecated see
// https://www.drupal.org/node/2960601 for more details.
}

View file

@ -53,17 +53,17 @@ function update_manager_download_batch_finished($success, $results) {
'#title' => t('Downloading updates failed:'),
'#items' => $results['errors'],
];
drupal_set_message(drupal_render($item_list), 'error');
\Drupal::messenger()->addError(\Drupal::service('renderer')->render($item_list));
}
elseif ($success) {
drupal_set_message(t('Updates downloaded successfully.'));
\Drupal::messenger()->addStatus(t('Updates downloaded successfully.'));
$_SESSION['update_manager_update_projects'] = $results['projects'];
return new RedirectResponse(\Drupal::url('update.confirmation_page', [], ['absolute' => TRUE]));
}
else {
// Ideally we're catching all Exceptions, so they should never see this,
// but just in case, we have to tell them something.
drupal_set_message(t('Fatal error trying to download.'), 'error');
\Drupal::messenger()->addError(t('Fatal error trying to download.'));
}
}
@ -208,7 +208,7 @@ function update_manager_file_get($url) {
$remote_schemes = ['http', 'https', 'ftp', 'ftps', 'smb', 'nfs'];
if (!isset($parsed_url['scheme']) || !in_array($parsed_url['scheme'], $remote_schemes)) {
// This is a local file, just return the path.
return drupal_realpath($url);
return \Drupal::service('file_system')->realpath($url);
}
// Check the cache and download the file if needed.

View file

@ -23,6 +23,8 @@ use Drupal\Core\Site\Settings;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateManagerInterface::NOT_SECURE instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_SECURE = 1;
@ -31,6 +33,8 @@ const UPDATE_NOT_SECURE = 1;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateManagerInterface::REVOKED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_REVOKED = 2;
@ -39,6 +43,8 @@ const UPDATE_REVOKED = 2;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateManagerInterface::NOT_SUPPORTED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_SUPPORTED = 3;
@ -47,6 +53,8 @@ const UPDATE_NOT_SUPPORTED = 3;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateManagerInterface::NOT_CURRENT instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_CURRENT = 4;
@ -55,6 +63,8 @@ const UPDATE_NOT_CURRENT = 4;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateManagerInterface::CURRENT instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_CURRENT = 5;
@ -63,6 +73,8 @@ const UPDATE_CURRENT = 5;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::NOT_CHECKED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_CHECKED = -1;
@ -71,6 +83,8 @@ const UPDATE_NOT_CHECKED = -1;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::UNKNOWN instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_UNKNOWN = -2;
@ -79,6 +93,8 @@ const UPDATE_UNKNOWN = -2;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::NOT_FETCHED instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_NOT_FETCHED = -3;
@ -87,6 +103,8 @@ const UPDATE_NOT_FETCHED = -3;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\update\UpdateFetcherInterface::FETCH_PENDING instead.
*
* @see https://www.drupal.org/node/2831620
*/
const UPDATE_FETCH_PENDING = -4;
@ -167,17 +185,18 @@ function update_page_top() {
foreach (['core', 'contrib'] as $report_type) {
$type = 'update_' . $report_type;
// hook_requirements() supports render arrays therefore we need to render
// them before using drupal_set_message().
// them before using
// \Drupal\Core\Messenger\MessengerInterface::addStatus().
if (isset($status[$type]['description']) && is_array($status[$type]['description'])) {
$status[$type]['description'] = \Drupal::service('renderer')->renderPlain($status[$type]['description']);
}
if (!empty($verbose)) {
if (isset($status[$type]['severity'])) {
if ($status[$type]['severity'] == REQUIREMENT_ERROR) {
drupal_set_message($status[$type]['description'], 'error');
\Drupal::messenger()->addError($status[$type]['description']);
}
elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) {
drupal_set_message($status[$type]['description'], 'warning');
\Drupal::messenger()->addWarning($status[$type]['description']);
}
}
}
@ -187,7 +206,7 @@ function update_page_top() {
if (isset($status[$type])
&& isset($status[$type]['reason'])
&& $status[$type]['reason'] === UPDATE_NOT_SECURE) {
drupal_set_message($status[$type]['description'], 'error');
\Drupal::messenger()->addError($status[$type]['description']);
}
}
}
@ -349,7 +368,7 @@ function update_get_available($refresh = FALSE) {
foreach ($projects as $key => $project) {
// If there's no data at all, we clearly need to fetch some.
if (empty($available[$key])) {
//update_create_fetch_task($project);
// update_create_fetch_task($project);
\Drupal::service('update.processor')->createFetchTask($project);
$needs_refresh = TRUE;
continue;
@ -389,6 +408,45 @@ function update_get_available($refresh = FALSE) {
return $available;
}
/**
* Identifies equivalent security releases with a hardcoded list.
*
* Generally, only the latest minor version of Drupal 8 is supported. However,
* when security fixes are backported to an old branch, and the site owner
* updates to the release containing the backported fix, they should not
* see "Security update required!" again if the only other security releases
* are releases for the same advisories.
*
* @return string[]
* A list of security release numbers that are equivalent to this release
* (i.e. covered by the same advisory), for backported security fixes only.
*
* @internal
*
* @deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use the
* 'Insecure' release type tag in update XML provided by Drupal.org to
* determine if releases are insecure.
*/
function _update_equivalent_security_releases() {
trigger_error("_update_equivalent_security_releases() was a temporary fix and will be removed before 9.0.0. Use the 'Insecure' release type tag in update XML provided by Drupal.org to determine if releases are insecure.", E_USER_DEPRECATED);
switch (\Drupal::VERSION) {
case '8.3.8':
return ['8.4.5', '8.5.0-rc1'];
case '8.3.9':
return ['8.4.6', '8.5.1'];
case '8.4.5':
return ['8.5.0-rc1'];
case '8.4.6':
return ['8.5.1'];
case '8.4.7':
return ['8.5.2'];
case '8.4.8':
return ['8.5.3'];
}
return [];
}
/**
* Adds a task to the queue for fetching release history data for a project.
*
@ -437,15 +495,15 @@ function update_fetch_data_finished($success, $results) {
if ($success) {
if (!empty($results)) {
if (!empty($results['updated'])) {
drupal_set_message(\Drupal::translation()->formatPlural($results['updated'], 'Checked available update data for one project.', 'Checked available update data for @count projects.'));
\Drupal::messenger()->addStatus(\Drupal::translation()->formatPlural($results['updated'], 'Checked available update data for one project.', 'Checked available update data for @count projects.'));
}
if (!empty($results['failures'])) {
drupal_set_message(\Drupal::translation()->formatPlural($results['failures'], 'Failed to get available update data for one project.', 'Failed to get available update data for @count projects.'), 'error');
\Drupal::messenger()->addError(\Drupal::translation()->formatPlural($results['failures'], 'Failed to get available update data for one project.', 'Failed to get available update data for @count projects.'));
}
}
}
else {
drupal_set_message(t('An error occurred trying to get available update data.'), 'error');
\Drupal::messenger()->addError(t('An error occurred trying to get available update data.'), 'error');
}
}
@ -607,7 +665,6 @@ function template_preprocess_update_last_check(&$variables) {
* version of Drupal core.
*
* @see \Drupal\Core\Extension\ExtensionDiscovery
* @see _system_rebuild_module_data()
*/
function update_verify_update_archive($project, $archive_file, $directory) {
$errors = [];

View file

@ -5,7 +5,6 @@
* Code required only when rendering the available updates report.
*/
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Template\Attribute;
use Drupal\Core\Url;
@ -31,7 +30,7 @@ function template_preprocess_update_report(&$variables) {
'library' => [
'update/drupal.update.admin',
],
]
],
];
// For no project update data, populate no data message.
@ -54,7 +53,7 @@ function template_preprocess_update_report(&$variables) {
'#attributes' => ['class' => ['update']],
];
}
$row_key = !empty($project['title']) ? Unicode::strtolower($project['title']) : Unicode::strtolower($project['name']);
$row_key = !empty($project['title']) ? mb_strtolower($project['title']) : mb_strtolower($project['name']);
// Add the project status row and details.
$rows[$project['project_type']][$row_key]['status'] = $project_status;
@ -231,7 +230,7 @@ function template_preprocess_update_project_status(&$variables) {
$extra_item['data'] = [
'#prefix' => '<em>',
'#markup' => $value['data'],
'#suffix' => '</em>'
'#suffix' => '</em>',
];
$variables['extras'][] = $extra_item;
}