Skip to content
Snippets Groups Projects
Verified Commit 8ecbefce authored by Dave Long's avatar Dave Long
Browse files

Issue #3443495 by smustgrave, mikelutz: Remove deprecated code from...

Issue #3443495 by smustgrave, mikelutz: Remove deprecated code from lib/Update, lib/Updated, and lib/Validation
parent c6b0df4e
No related branches found
No related tags found
26 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #160150 canceled
Pipeline: drupal

#160152

    ......@@ -3,7 +3,6 @@
    namespace Drupal\Core\Update;
    use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
    use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
    /**
    * Provides module updates versions handling.
    ......@@ -55,18 +54,13 @@ class UpdateHookRegistry {
    *
    * @param array $module_list
    * An associative array whose keys are the names of installed modules.
    * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface|\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
    * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
    * The key value factory.
    */
    public function __construct(array $module_list, KeyValueStoreInterface|KeyValueFactoryInterface $key_value_factory) {
    if ($module_list !== [] && array_is_list($module_list)) {
    @trigger_error('Calling ' . __METHOD__ . '() with the $enabled_modules argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use an associative array whose keys are the names of installed modules instead. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
    $module_list = \Drupal::service('module_handler')->getModuleList();
    }
    if ($key_value_factory instanceof KeyValueStoreInterface) {
    @trigger_error('Calling ' . __METHOD__ . '() with the $key_value_factory argument as a KeyValueStoreInterface instead of a KeyValueFactoryInterface is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
    $key_value_factory = \Drupal::service('keyvalue');
    }
    public function __construct(
    array $module_list,
    KeyValueFactoryInterface $key_value_factory,
    ) {
    $this->enabledModules = array_keys($module_list);
    $this->keyValue = $key_value_factory->get('system.schema');
    }
    ......
    ......@@ -23,20 +23,6 @@
    */
    class UpdateRegistry implements EventSubscriberInterface {
    /**
    * The used update name.
    *
    * @var string
    */
    protected $updateType = 'post_update';
    /**
    * The app root.
    *
    * @var string
    */
    protected $root;
    /**
    * The filename of the log file.
    *
    ......@@ -49,20 +35,6 @@ class UpdateRegistry implements EventSubscriberInterface {
    */
    protected $enabledExtensions;
    /**
    * The key value storage.
    *
    * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
    protected $keyValue;
    /**
    * The site path.
    *
    * @var string
    */
    protected $sitePath;
    /**
    * A static cache of all the extension updates scanned for.
    *
    ......@@ -78,38 +50,26 @@ class UpdateRegistry implements EventSubscriberInterface {
    *
    * @param string $root
    * The app root.
    * @param string $site_path
    * @param string $sitePath
    * The site path.
    * @param array $module_list
    * An associative array whose keys are the names of installed modules.
    * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value
    * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $keyValue
    * The key value store.
    * @param \Drupal\Core\Extension\ThemeHandlerInterface|bool|null $theme_handler
    * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
    * The theme handler.
    * @param string $update_type
    * @param string $updateType
    * The used update name.
    */
    public function __construct(
    $root,
    $site_path,
    $module_list,
    KeyValueStoreInterface $key_value,
    ThemeHandlerInterface|bool $theme_handler = NULL,
    string $update_type = 'post_update',
    protected $root,
    protected $sitePath,
    array $module_list,
    protected KeyValueStoreInterface $keyValue,
    ThemeHandlerInterface $theme_handler,
    protected string $updateType = 'post_update',
    ) {
    $this->root = $root;
    $this->sitePath = $site_path;
    if ($module_list !== [] && array_is_list($module_list)) {
    @trigger_error('Calling ' . __METHOD__ . '() with the $enabled_extensions argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use an associative array whose keys are the names of installed modules instead. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
    $module_list = \Drupal::service('module_handler')->getModuleList();
    }
    if ($theme_handler === NULL || is_bool($theme_handler)) {
    @trigger_error('Calling ' . __METHOD__ . '() with the $include_tests argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
    $theme_handler = \Drupal::service('theme_handler');
    }
    $this->enabledExtensions = array_merge(array_keys($module_list), array_keys($theme_handler->listInfo()));
    $this->keyValue = $key_value;
    $this->updateType = $update_type;
    }
    /**
    ......
    ......@@ -76,38 +76,6 @@ public static function canUpdate($project_name) {
    return (bool) \Drupal::service('extension.list.module')->getPath($project_name);
    }
    /**
    * Returns available database schema updates once a new version is installed.
    *
    * @return array
    *
    * @deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use
    * \Drupal\Core\Update\UpdateHookRegistry::getAvailableUpdates() instead.
    *
    * @see https://www.drupal.org/node/3359445
    */
    public function getSchemaUpdates() {
    @trigger_error(__METHOD__ . "() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Update\UpdateHookRegistry::getAvailableUpdates() instead. See https://www.drupal.org/node/3359445", E_USER_DEPRECATED);
    require_once DRUPAL_ROOT . '/core/includes/install.inc';
    require_once DRUPAL_ROOT . '/core/includes/update.inc';
    if (!self::canUpdate($this->name)) {
    return [];
    }
    \Drupal::moduleHandler()->loadInclude($this->name, 'install');
    if (!\Drupal::service('update.update_hook_registry')->getAvailableUpdates($this->name)) {
    return [];
    }
    $modules_with_updates = update_get_update_list();
    if ($updates = $modules_with_updates[$this->name]) {
    if ($updates['start']) {
    return $updates['pending'];
    }
    }
    return [];
    }
    /**
    * {@inheritdoc}
    */
    ......
    ......@@ -71,10 +71,7 @@ public function __construct(
    /**
    * {@inheritdoc}
    */
    public function atPath(mixed $path): static {
    if (!is_string($path)) {
    @\trigger_error('Passing the $path parameter as a non-string value to ' . __METHOD__ . '() is deprecated in drupal:10.3.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3396238', E_USER_DEPRECATED);
    }
    public function atPath(string $path): static {
    $this->propertyPath = PropertyPath::append($this->propertyPath, (string) $path);
    return $this;
    ......
    ......@@ -5,6 +5,7 @@
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\Core\Validation\Attribute\Constraint;
    use Symfony\Component\Validator\Constraints\Email;
    use Symfony\Component\Validator\Constraints\EmailValidator;
    /**
    * Count constraint.
    ......
    <?php
    namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
    use Symfony\Component\Validator\Constraints\Email;
    use Symfony\Component\Validator\Constraints\EmailValidator as SymfonyEmailValidator;
    /**
    * Email constraint.
    *
    * Overrides the symfony validator to use the HTML 5 setting.
    *
    * @internal Exists only to override the constructor to avoid a deprecation
    * in Symfony 6, and will be removed in drupal:11.0.0.
    */
    final class EmailValidator extends SymfonyEmailValidator {
    /**
    * {@inheritdoc}
    */
    public function __construct(string $defaultMode = Email::VALIDATION_MODE_HTML5) {
    parent::__construct($defaultMode);
    }
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment