Skip to content
Snippets Groups Projects

Issue #3437409 ForbidCoreChangesValidator.php

Merged Ted Bowman requested to merge issue/automatic_updates-3437409:3437409-dont-allow-core into 3.0.x
2 unresolved threads
Files
3
@@ -5,6 +5,7 @@ declare(strict_types = 1);
namespace Drupal\automatic_updates_extensions\Validator;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
use Drupal\package_manager\ComposerInspector;
use Drupal\package_manager\Event\PreApplyEvent;
use Drupal\package_manager\Event\StatusCheckEvent;
@@ -13,7 +14,7 @@ use Drupal\package_manager\PathLocator;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* Validates that no changes were made to Drupal core packages.
* Validates that no changes were made to Drupal Core packages.
*
* @internal
* This is an internal part of Automatic Updates and may be changed or removed
@@ -25,7 +26,7 @@ final class ForbidCoreChangesValidator implements EventSubscriberInterface {
use StringTranslationTrait;
/**
* Constructs a StagedProjectsValidator object.
* Constructs a ForbidCoreChangesValidator object.
*
* @param \Drupal\package_manager\PathLocator $pathLocator
* The path locator service.
@@ -76,12 +77,15 @@ final class ForbidCoreChangesValidator implements EventSubscriberInterface {
}
if ($error_messages) {
$event->addError($error_messages, $this->t('Updating Drupal Core while updating extensions is currently not supported. The following changes were made to the Drupal core packages:'));
$event->addError($error_messages, $this->t(
'Updating Drupal Core while updating extensions is currently not supported. Use <a href=":url" >this form</a> to update Drupal core. The following changes were made to the Drupal core packages:',
[':url' => Url::fromRoute('update.report_update')->toString()]
));
}
}
/**
* Gets all the core packages for a given project root.
* Gets all the installed core packages for a given project root.
*
* This method differs from
* \Drupal\package_manager\ComposerInspector::getInstalledPackagesList in that
Loading