From 917abad6925db809613eacf4d893c3d8cc34e4d1 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 08:54:10 -1000
Subject: [PATCH 01/22] [#3521059]: Deprecate 'update.root' service and the
 src/UpdateRoot.php class

---
 core/modules/update/src/UpdateRoot.php  | 6 ++++++
 core/modules/update/update.services.yml | 1 +
 2 files changed, 7 insertions(+)

diff --git a/core/modules/update/src/UpdateRoot.php b/core/modules/update/src/UpdateRoot.php
index a2f1619d6ea6..6046d73d3fd2 100644
--- a/core/modules/update/src/UpdateRoot.php
+++ b/core/modules/update/src/UpdateRoot.php
@@ -7,6 +7,11 @@
 
 /**
  * Gets the root path used by the Update Manager to install or update projects.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 class UpdateRoot {
 
@@ -40,6 +45,7 @@ class UpdateRoot {
    *   The request stack.
    */
   public function __construct(DrupalKernelInterface $drupal_kernel, RequestStack $request_stack) {
+    @trigger_error(__CLASS__ . ' is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
     $this->drupalKernel = $drupal_kernel;
     $this->requestStack = $request_stack;
   }
diff --git a/core/modules/update/update.services.yml b/core/modules/update/update.services.yml
index 465df135529a..81cf6f5850cd 100644
--- a/core/modules/update/update.services.yml
+++ b/core/modules/update/update.services.yml
@@ -21,6 +21,7 @@ services:
   update.root:
     class: Drupal\update\UpdateRoot
     arguments: ['@kernel', '@request_stack']
+    deprecated: The "%service_id%" service is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364
   logger.channel.update:
     parent: logger.channel_base
     arguments: [ 'update' ]
-- 
GitLab


From ed0f82a646400d0b1cc6c22fc73633715b30cee7 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 09:00:45 -1000
Subject: [PATCH 02/22] [#3521059]: Deprecate more procedural functions in
 update.module

---
 core/modules/update/update.module | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index c4366293a059..982e80ee1f95 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -295,8 +295,15 @@ function _update_manager_unique_identifier() {
  * @return string
  *   The full path to the temporary directory where update file archives should
  *   be extracted.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 function _update_manager_extract_directory($create = TRUE) {
+  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+
   static $directory;
   if (!isset($directory)) {
     $directory = 'temporary://update-extraction-' . _update_manager_unique_identifier();
@@ -317,8 +324,15 @@ function _update_manager_extract_directory($create = TRUE) {
  * @return string
  *   The full path to the temporary directory where update file archives should
  *   be cached.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 function _update_manager_cache_directory($create = TRUE) {
+  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+
   static $directory;
   if (!isset($directory)) {
     $directory = 'temporary://update-cache-' . _update_manager_unique_identifier();
@@ -331,8 +345,15 @@ function _update_manager_cache_directory($create = TRUE) {
 
 /**
  * Clears the temporary files and directories based on file age from disk.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 function update_clear_update_disk_cache(): void {
+  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+
   // List of update module cache directories. Do not create the directories if
   // they do not exist.
   $directories = [
@@ -368,8 +389,15 @@ function update_clear_update_disk_cache(): void {
  *
  * @return bool
  *   TRUE if the file is stale and deleted successfully, FALSE otherwise.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 function update_delete_file_if_stale($path) {
+  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+
   if (file_exists($path)) {
     $filectime = filectime($path);
     $max_age = \Drupal::config('system.file')->get('temporary_maximum_age');
-- 
GitLab


From 3ac138900ff0b01641ce53ce16c37349c0d1f943 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 09:29:11 -1000
Subject: [PATCH 03/22] Mark Kernel/UpdateDeleteFileIfStaleTest.php as a legacy
 test

---
 .../update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php      | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php b/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php
index ff5a8b02d457..1e33d81d6141 100644
--- a/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php
+++ b/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php
@@ -10,6 +10,7 @@
  * Tests the update_delete_file_if_stale() function.
  *
  * @group update
+ * @group legacy
  */
 class UpdateDeleteFileIfStaleTest extends KernelTestBase {
 
-- 
GitLab


From dc57dbae1e244866d243449f649092132559f311 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 09:39:41 -1000
Subject: [PATCH 04/22] Add calls to deprecated code from deprecated code into
 .phpstan-baseline.php for now

---
 core/.phpstan-baseline.php | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 6f4a52139f11..56e8d22e1887 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -37825,6 +37825,14 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/update/src/Controller/UpdateController.php',
 ];
+$ignoreErrors[] = [
+	'message' => '#^Call to deprecated function update_clear_update_disk_cache\\(\\)\\:
+in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
+  replacement\\. Use composer to manage the code for your site\\.$#',
+	'identifier' => 'function.deprecated',
+	'count' => 1,
+	'path' => __DIR__ . '/modules/update/src/Hook/UpdateHooks.php',
+];
 $ignoreErrors[] = [
 	'message' => '#^Method Drupal\\\\update\\\\ProjectCoreCompatibility\\:\\:setReleaseMessage\\(\\) has no return type specified\\.$#',
 	'identifier' => 'missingType.return',
@@ -38071,6 +38079,36 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/update/update.authorize.inc',
 ];
+$ignoreErrors[] = [
+	'message' => '#^The "update\\.root" service is deprecated in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no replacement\\. Use composer to manage the code for your site\\. See https\\://www\\.drupal\\.org/node/3512364$#',
+	'identifier' => 'getDeprecatedService.deprecated',
+	'count' => 1,
+	'path' => __DIR__ . '/modules/update/update.authorize.inc',
+];
+$ignoreErrors[] = [
+	'message' => '#^Call to deprecated function _update_manager_cache_directory\\(\\)\\:
+in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
+  replacement\\. Use composer to manage the code for your site\\.$#',
+	'identifier' => 'function.deprecated',
+	'count' => 1,
+	'path' => __DIR__ . '/modules/update/update.manager.inc',
+];
+$ignoreErrors[] = [
+	'message' => '#^Call to deprecated function _update_manager_extract_directory\\(\\)\\:
+in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
+  replacement\\. Use composer to manage the code for your site\\.$#',
+	'identifier' => 'function.deprecated',
+	'count' => 1,
+	'path' => __DIR__ . '/modules/update/update.manager.inc',
+];
+$ignoreErrors[] = [
+	'message' => '#^Call to deprecated function update_delete_file_if_stale\\(\\)\\:
+in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
+  replacement\\. Use composer to manage the code for your site\\.$#',
+	'identifier' => 'function.deprecated',
+	'count' => 1,
+	'path' => __DIR__ . '/modules/update/update.manager.inc',
+];
 $ignoreErrors[] = [
 	'message' => '#^Function _update_no_data\\(\\) has no return type specified\\.$#',
 	'identifier' => 'missingType.return',
-- 
GitLab


From f8378d16e84ff139abbd350ab1b4c5c617e0580c Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 09:40:18 -1000
Subject: [PATCH 05/22] Move testClearDiskCache() from UpdateMiscTest to a new
 UpdateManagerTest that can be '@group legacy'

---
 .../src/Functional/UpdateManagerTest.php      | 32 +++++++++++++++++++
 .../tests/src/Functional/UpdateMiscTest.php   | 17 ----------
 2 files changed, 32 insertions(+), 17 deletions(-)
 create mode 100644 core/modules/update/tests/src/Functional/UpdateManagerTest.php

diff --git a/core/modules/update/tests/src/Functional/UpdateManagerTest.php b/core/modules/update/tests/src/Functional/UpdateManagerTest.php
new file mode 100644
index 000000000000..059d3602c584
--- /dev/null
+++ b/core/modules/update/tests/src/Functional/UpdateManagerTest.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Drupal\Tests\update\Functional;
+
+/**
+ * Tests legacy Update Manager functionality of the Update Status module.
+ *
+ * @group legacy
+ * @group update
+ */
+class UpdateManagerTest extends UpdateTestBase {
+
+  /**
+   * Checks that clearing the disk cache works.
+   */
+  public function testClearDiskCache(): void {
+    $directories = [
+      _update_manager_cache_directory(FALSE),
+      _update_manager_extract_directory(FALSE),
+    ];
+    // Check that update directories does not exists.
+    foreach ($directories as $directory) {
+      $this->assertDirectoryDoesNotExist($directory);
+    }
+
+    // Method must not fail if update directories do not exists.
+    update_clear_update_disk_cache();
+  }
+
+}
diff --git a/core/modules/update/tests/src/Functional/UpdateMiscTest.php b/core/modules/update/tests/src/Functional/UpdateMiscTest.php
index 5b544ea36b0e..3a06d965ee5e 100644
--- a/core/modules/update/tests/src/Functional/UpdateMiscTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateMiscTest.php
@@ -40,23 +40,6 @@ protected function setUp(): void {
     $this->drupalPlaceBlock('local_actions_block');
   }
 
-  /**
-   * Checks that clearing the disk cache works.
-   */
-  public function testClearDiskCache(): void {
-    $directories = [
-      _update_manager_cache_directory(FALSE),
-      _update_manager_extract_directory(FALSE),
-    ];
-    // Check that update directories does not exists.
-    foreach ($directories as $directory) {
-      $this->assertDirectoryDoesNotExist($directory);
-    }
-
-    // Method must not fail if update directories do not exists.
-    update_clear_update_disk_cache();
-  }
-
   /**
    * Tests the Update Status module when the update server returns 503 errors.
    */
-- 
GitLab


From fb4e338ec169ed1b0dbf09e58e84aad67422b11a Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 09:46:12 -1000
Subject: [PATCH 06/22] Add defaultTheme to UpdateManagerTest

---
 .../update/tests/src/Functional/UpdateManagerTest.php        | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/modules/update/tests/src/Functional/UpdateManagerTest.php b/core/modules/update/tests/src/Functional/UpdateManagerTest.php
index 059d3602c584..a69e06a72fdd 100644
--- a/core/modules/update/tests/src/Functional/UpdateManagerTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateManagerTest.php
@@ -12,6 +12,11 @@
  */
 class UpdateManagerTest extends UpdateTestBase {
 
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * Checks that clearing the disk cache works.
    */
-- 
GitLab


From cbe7667be4be67fefd9b695cfa7e37008134744e Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 12:23:52 -1000
Subject: [PATCH 07/22] [#3521059] Clarify comment at top of UpdateRoot.php

---
 core/modules/update/src/UpdateRoot.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/modules/update/src/UpdateRoot.php b/core/modules/update/src/UpdateRoot.php
index 6046d73d3fd2..9574c2f96573 100644
--- a/core/modules/update/src/UpdateRoot.php
+++ b/core/modules/update/src/UpdateRoot.php
@@ -6,7 +6,7 @@
 use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
- * Gets the root path used by the Update Manager to install or update projects.
+ * Gets the root path used by the legacy Update Manager to install or update projects.
  *
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
@@ -37,7 +37,7 @@ class UpdateRoot {
   protected $updateRoot;
 
   /**
-   * Constructs an UpdateRootFactory instance.
+   * Constructs an UpdateRoot instance.
    *
    * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
    *   The Drupal kernel.
-- 
GitLab


From af4b396b2c578398d9a1169259fe9633daa90dfc Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 12:24:39 -1000
Subject: [PATCH 08/22] Revert "Add calls to deprecated code from deprecated
 code into .phpstan-baseline.php for now"

This reverts commit be347a717a0ec6dceb8c303ee961a2d346560726.
---
 core/.phpstan-baseline.php | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index 56e8d22e1887..6f4a52139f11 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -37825,14 +37825,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/update/src/Controller/UpdateController.php',
 ];
-$ignoreErrors[] = [
-	'message' => '#^Call to deprecated function update_clear_update_disk_cache\\(\\)\\:
-in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
-  replacement\\. Use composer to manage the code for your site\\.$#',
-	'identifier' => 'function.deprecated',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/src/Hook/UpdateHooks.php',
-];
 $ignoreErrors[] = [
 	'message' => '#^Method Drupal\\\\update\\\\ProjectCoreCompatibility\\:\\:setReleaseMessage\\(\\) has no return type specified\\.$#',
 	'identifier' => 'missingType.return',
@@ -38079,36 +38071,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/update/update.authorize.inc',
 ];
-$ignoreErrors[] = [
-	'message' => '#^The "update\\.root" service is deprecated in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no replacement\\. Use composer to manage the code for your site\\. See https\\://www\\.drupal\\.org/node/3512364$#',
-	'identifier' => 'getDeprecatedService.deprecated',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/update.authorize.inc',
-];
-$ignoreErrors[] = [
-	'message' => '#^Call to deprecated function _update_manager_cache_directory\\(\\)\\:
-in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
-  replacement\\. Use composer to manage the code for your site\\.$#',
-	'identifier' => 'function.deprecated',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/update.manager.inc',
-];
-$ignoreErrors[] = [
-	'message' => '#^Call to deprecated function _update_manager_extract_directory\\(\\)\\:
-in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
-  replacement\\. Use composer to manage the code for your site\\.$#',
-	'identifier' => 'function.deprecated',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/update.manager.inc',
-];
-$ignoreErrors[] = [
-	'message' => '#^Call to deprecated function update_delete_file_if_stale\\(\\)\\:
-in drupal\\:11\\.2\\.0 and is removed from drupal\\:12\\.0\\.0\\. There is no
-  replacement\\. Use composer to manage the code for your site\\.$#',
-	'identifier' => 'function.deprecated',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/update/update.manager.inc',
-];
 $ignoreErrors[] = [
 	'message' => '#^Function _update_no_data\\(\\) has no return type specified\\.$#',
 	'identifier' => 'missingType.return',
-- 
GitLab


From ce94f2388eddf024a4fdb3d0aa472bc0217c6bfa Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 12:32:08 -1000
Subject: [PATCH 09/22] [#3521059]: Use @phpstan-ignore instead of updating the
 baseline for calls to deprecated functions and service

---
 core/modules/update/src/Hook/UpdateHooks.php | 1 +
 core/modules/update/update.authorize.inc     | 1 +
 core/modules/update/update.manager.inc       | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/core/modules/update/src/Hook/UpdateHooks.php b/core/modules/update/src/Hook/UpdateHooks.php
index 293882f01246..bd5876cc64a3 100644
--- a/core/modules/update/src/Hook/UpdateHooks.php
+++ b/core/modules/update/src/Hook/UpdateHooks.php
@@ -179,6 +179,7 @@ public function cron(): void {
       _update_cron_notify();
     }
     // Clear garbage from disk.
+    // @phpstan-ignore function.deprecated
     update_clear_update_disk_cache();
   }
 
diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc
index 8a2ba55d667f..b3f148ac7493 100644
--- a/core/modules/update/update.authorize.inc
+++ b/core/modules/update/update.authorize.inc
@@ -107,6 +107,7 @@ function update_authorize_batch_copy_project($project, $updater_name, $local_url
     return;
   }
 
+  // @phpstan-ignore getDeprecatedService.deprecated
   $updater = new $updater_name($local_url, \Drupal::getContainer()->get('update.root'));
 
   try {
diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc
index 46611f85cd87..bbe29684df03 100644
--- a/core/modules/update/update.manager.inc
+++ b/core/modules/update/update.manager.inc
@@ -172,9 +172,11 @@ function update_manager_file_get($url) {
   }
 
   // Check the cache and download the file if needed.
+  // @phpstan-ignore function.deprecated
   $cache_directory = _update_manager_cache_directory();
   $local = $cache_directory . '/' . \Drupal::service('file_system')->basename($parsed_url['path']);
 
+  // @phpstan-ignore function.deprecated
   if (!file_exists($local) || update_delete_file_if_stale($local)) {
     try {
       $data = (string) \Drupal::httpClient()->get($url)->getBody();
@@ -229,6 +231,7 @@ function update_manager_batch_project_get($project, $url, &$context): void {
   }
 
   // Extract it.
+  // @phpstan-ignore function.deprecated
   $extract_directory = _update_manager_extract_directory();
   try {
     update_manager_archive_extract($local_cache, $extract_directory);
-- 
GitLab


From 2d74ad98fcf25aca0b6505fef390b35e0126bd19 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 24 Apr 2025 15:59:29 -1000
Subject: [PATCH 10/22] [#3521059]: Apply suggestions to use __FUNCTION__ not
 __METHOD__ (since they're all procedural functions)

---
 core/modules/update/update.module | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 982e80ee1f95..f61b283a5e1d 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -302,7 +302,7 @@ function _update_manager_unique_identifier() {
  * @see https://www.drupal.org/node/3512364
  */
 function _update_manager_extract_directory($create = TRUE) {
-  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
 
   static $directory;
   if (!isset($directory)) {
@@ -331,7 +331,7 @@ function _update_manager_extract_directory($create = TRUE) {
  * @see https://www.drupal.org/node/3512364
  */
 function _update_manager_cache_directory($create = TRUE) {
-  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
 
   static $directory;
   if (!isset($directory)) {
@@ -352,7 +352,7 @@ function _update_manager_cache_directory($create = TRUE) {
  * @see https://www.drupal.org/node/3512364
  */
 function update_clear_update_disk_cache(): void {
-  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
 
   // List of update module cache directories. Do not create the directories if
   // they do not exist.
@@ -396,7 +396,7 @@ function update_clear_update_disk_cache(): void {
  * @see https://www.drupal.org/node/3512364
  */
 function update_delete_file_if_stale($path) {
-  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
 
   if (file_exists($path)) {
     $filectime = filectime($path);
-- 
GitLab


From a7f3d35a974b9c6ec8a716159319df773b0fe598 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Fri, 25 Apr 2025 07:28:19 -1000
Subject: [PATCH 11/22] [#3521059]: Stop calling
 update_clear_update_disk_cache() from hook_cron

---
 core/modules/update/src/Hook/UpdateHooks.php | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/core/modules/update/src/Hook/UpdateHooks.php b/core/modules/update/src/Hook/UpdateHooks.php
index bd5876cc64a3..49cb455a8430 100644
--- a/core/modules/update/src/Hook/UpdateHooks.php
+++ b/core/modules/update/src/Hook/UpdateHooks.php
@@ -178,9 +178,6 @@ public function cron(): void {
       \Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.fetch');
       _update_cron_notify();
     }
-    // Clear garbage from disk.
-    // @phpstan-ignore function.deprecated
-    update_clear_update_disk_cache();
   }
 
   /**
-- 
GitLab


From 5d894c5112158fef9db467e21e262187a4f4f102 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Wed, 30 Apr 2025 11:47:15 -1000
Subject: [PATCH 12/22] [#3521059]: Deprecate the 'authorize-report' template
 and template_preprocess_authorize_report()

---
 core/includes/theme.maintenance.inc                | 6 ++++++
 core/lib/Drupal/Core/Theme/ThemeCommonElements.php | 1 +
 2 files changed, 7 insertions(+)

diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index 2a37fbc9ffdc..b27d9923f72b 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -108,8 +108,14 @@ function _drupal_maintenance_theme(): void {
  * @param array $variables
  *   An associative array containing:
  *   - messages: An array of result messages.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 function template_preprocess_authorize_report(&$variables): void {
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
   $messages = [];
   if (!empty($variables['messages'])) {
     foreach ($variables['messages'] as $heading => $logs) {
diff --git a/core/lib/Drupal/Core/Theme/ThemeCommonElements.php b/core/lib/Drupal/Core/Theme/ThemeCommonElements.php
index 03e143662558..08e6a669283d 100644
--- a/core/lib/Drupal/Core/Theme/ThemeCommonElements.php
+++ b/core/lib/Drupal/Core/Theme/ThemeCommonElements.php
@@ -176,6 +176,7 @@ public static function commonElements(): array {
         ],
         'includes' => ['core/includes/theme.maintenance.inc'],
         'template' => 'authorize-report',
+        'deprecated' => 'The "authorize-report" template is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364',
       ],
       'pager' => [
         'render element' => 'pager',
-- 
GitLab


From 34f422f9017afcb4da2d572b80f201127dd8f553 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Wed, 30 Apr 2025 11:48:05 -1000
Subject: [PATCH 13/22] [#3521059]: Add @deprecated comments to
 authorize-report.html.twig (both from system and stable9)

---
 core/modules/system/templates/authorize-report.html.twig     | 5 +++++
 .../stable9/templates/admin/authorize-report.html.twig       | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/core/modules/system/templates/authorize-report.html.twig b/core/modules/system/templates/authorize-report.html.twig
index 914458684775..f10e9db2714e 100644
--- a/core/modules/system/templates/authorize-report.html.twig
+++ b/core/modules/system/templates/authorize-report.html.twig
@@ -12,6 +12,11 @@
  * @see template_preprocess_authorize_report()
  *
  * @ingroup themeable
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 #}
 {% if messages %}
diff --git a/core/themes/stable9/templates/admin/authorize-report.html.twig b/core/themes/stable9/templates/admin/authorize-report.html.twig
index 2e5a59c0c03b..8bab22602e40 100644
--- a/core/themes/stable9/templates/admin/authorize-report.html.twig
+++ b/core/themes/stable9/templates/admin/authorize-report.html.twig
@@ -10,6 +10,11 @@
  * - attributes: HTML attributes for the element.
  *
  * @see template_preprocess_authorize_report()
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 #}
 {% if messages %}
-- 
GitLab


From 5185e351ffb83f4207168ee2fbf0a80a95f604fc Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Wed, 30 Apr 2025 17:27:46 -1000
Subject: [PATCH 14/22] [#3521059]: Deprecate
 _update_manager_unique_identifier()

---
 core/modules/update/update.module | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index f61b283a5e1d..becd02161e00 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -276,6 +276,11 @@ function update_storage_clear(): void {
  *
  * @return string
  *   An eight character string uniquely identifying this Drupal installation.
+ *
+ * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
+ *   replacement. Use composer to manage the code for your site.
+ *
+ * @see https://www.drupal.org/node/3512364
  */
 function _update_manager_unique_identifier() {
   static $id;
-- 
GitLab


From 8ef33f5140566f6ac3585a43d6a586c76fc0bb79 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Wed, 30 Apr 2025 17:35:29 -1000
Subject: [PATCH 15/22] [#3521059]: Move all deprecation messages to link to a
 new CR NID

---
 core/includes/theme.maintenance.inc            |  4 ++--
 .../Drupal/Core/Theme/ThemeCommonElements.php  |  2 +-
 .../templates/authorize-report.html.twig       |  2 +-
 core/modules/update/src/UpdateRoot.php         |  4 ++--
 core/modules/update/update.module              | 18 +++++++++---------
 core/modules/update/update.services.yml        |  2 +-
 .../templates/admin/authorize-report.html.twig |  2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index b27d9923f72b..4438d058499b 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -112,10 +112,10 @@ function _drupal_maintenance_theme(): void {
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 function template_preprocess_authorize_report(&$variables): void {
-  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
   $messages = [];
   if (!empty($variables['messages'])) {
     foreach ($variables['messages'] as $heading => $logs) {
diff --git a/core/lib/Drupal/Core/Theme/ThemeCommonElements.php b/core/lib/Drupal/Core/Theme/ThemeCommonElements.php
index 08e6a669283d..5ddf58fd6f22 100644
--- a/core/lib/Drupal/Core/Theme/ThemeCommonElements.php
+++ b/core/lib/Drupal/Core/Theme/ThemeCommonElements.php
@@ -176,7 +176,7 @@ public static function commonElements(): array {
         ],
         'includes' => ['core/includes/theme.maintenance.inc'],
         'template' => 'authorize-report',
-        'deprecated' => 'The "authorize-report" template is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364',
+        'deprecated' => 'The "authorize-report" template is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119',
       ],
       'pager' => [
         'render element' => 'pager',
diff --git a/core/modules/system/templates/authorize-report.html.twig b/core/modules/system/templates/authorize-report.html.twig
index f10e9db2714e..f6f443c58075 100644
--- a/core/modules/system/templates/authorize-report.html.twig
+++ b/core/modules/system/templates/authorize-report.html.twig
@@ -16,7 +16,7 @@
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 #}
 {% if messages %}
diff --git a/core/modules/update/src/UpdateRoot.php b/core/modules/update/src/UpdateRoot.php
index 9574c2f96573..abcf499d5b4b 100644
--- a/core/modules/update/src/UpdateRoot.php
+++ b/core/modules/update/src/UpdateRoot.php
@@ -11,7 +11,7 @@
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 class UpdateRoot {
 
@@ -45,7 +45,7 @@ class UpdateRoot {
    *   The request stack.
    */
   public function __construct(DrupalKernelInterface $drupal_kernel, RequestStack $request_stack) {
-    @trigger_error(__CLASS__ . ' is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+    @trigger_error(__CLASS__ . ' is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
     $this->drupalKernel = $drupal_kernel;
     $this->requestStack = $request_stack;
   }
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index becd02161e00..f38605cc0d85 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -280,7 +280,7 @@ function update_storage_clear(): void {
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 function _update_manager_unique_identifier() {
   static $id;
@@ -304,10 +304,10 @@ function _update_manager_unique_identifier() {
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 function _update_manager_extract_directory($create = TRUE) {
-  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
 
   static $directory;
   if (!isset($directory)) {
@@ -333,10 +333,10 @@ function _update_manager_extract_directory($create = TRUE) {
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 function _update_manager_cache_directory($create = TRUE) {
-  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
 
   static $directory;
   if (!isset($directory)) {
@@ -354,10 +354,10 @@ function _update_manager_cache_directory($create = TRUE) {
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 function update_clear_update_disk_cache(): void {
-  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
 
   // List of update module cache directories. Do not create the directories if
   // they do not exist.
@@ -398,10 +398,10 @@ function update_clear_update_disk_cache(): void {
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 function update_delete_file_if_stale($path) {
-  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364', E_USER_DEPRECATED);
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
 
   if (file_exists($path)) {
     $filectime = filectime($path);
diff --git a/core/modules/update/update.services.yml b/core/modules/update/update.services.yml
index 81cf6f5850cd..bebf0398151c 100644
--- a/core/modules/update/update.services.yml
+++ b/core/modules/update/update.services.yml
@@ -21,7 +21,7 @@ services:
   update.root:
     class: Drupal\update\UpdateRoot
     arguments: ['@kernel', '@request_stack']
-    deprecated: The "%service_id%" service is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3512364
+    deprecated: The "%service_id%" service is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119
   logger.channel.update:
     parent: logger.channel_base
     arguments: [ 'update' ]
diff --git a/core/themes/stable9/templates/admin/authorize-report.html.twig b/core/themes/stable9/templates/admin/authorize-report.html.twig
index 8bab22602e40..8784ca30cd89 100644
--- a/core/themes/stable9/templates/admin/authorize-report.html.twig
+++ b/core/themes/stable9/templates/admin/authorize-report.html.twig
@@ -14,7 +14,7 @@
  * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no
  *   replacement. Use composer to manage the code for your site.
  *
- * @see https://www.drupal.org/node/3512364
+ * @see https://www.drupal.org/node/3522119
  */
 #}
 {% if messages %}
-- 
GitLab


From 9a9fcc2cafae1c70a1c299d94dbc3d098cd6a427 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 09:17:11 -1000
Subject: [PATCH 16/22] [#3521059]: Add update_post_update_clear_disk_cache()

---
 core/modules/update/update.post_update.php | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/core/modules/update/update.post_update.php b/core/modules/update/update.post_update.php
index 3462899d989b..1fc2fc0a123b 100644
--- a/core/modules/update/update.post_update.php
+++ b/core/modules/update/update.post_update.php
@@ -14,3 +14,23 @@ function update_remove_post_updates() {
     'update_post_update_set_blank_fetch_url_to_null' => '11.0.0',
   ];
 }
+
+/**
+ * Removes the legacy 'Update Manager' disk cache.
+ */
+function update_post_update_clear_disk_cache(): void {
+  // List of legacy 'Update Manager' cache directories. Do not create them if
+  // they do not exist.
+  $directories = [
+    // @phpstan-ignore function.deprecated
+    _update_manager_cache_directory(FALSE),
+    // @phpstan-ignore function.deprecated
+    _update_manager_extract_directory(FALSE),
+  ];
+  foreach ($directories as $directory) {
+    if (is_dir($directory)) {
+      \Drupal::service('file_system')->deleteRecursive($directory);
+    }
+  }
+
+}
-- 
GitLab


From f67afd403332ef2adc77c971c3e4901701d48749 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 10:15:25 -1000
Subject: [PATCH 17/22] [#3521059]: Fix update_post_update_clear_disk_cache()
 to not rely on any deprecated code

---
 core/modules/update/update.post_update.php | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/core/modules/update/update.post_update.php b/core/modules/update/update.post_update.php
index 1fc2fc0a123b..34ddba396858 100644
--- a/core/modules/update/update.post_update.php
+++ b/core/modules/update/update.post_update.php
@@ -5,6 +5,8 @@
  * Post update functions for Update Status.
  */
 
+use Drupal\Core\Site\Settings;
+
 /**
  * Implements hook_removed_post_updates().
  */
@@ -19,13 +21,14 @@ function update_remove_post_updates() {
  * Removes the legacy 'Update Manager' disk cache.
  */
 function update_post_update_clear_disk_cache(): void {
-  // List of legacy 'Update Manager' cache directories. Do not create them if
-  // they do not exist.
+  // @see _update_manager_unique_id()
+  $id = substr(hash('sha256', Settings::getHashSalt()), 0, 8);
+  // List of legacy 'Update Manager' cache directories.
   $directories = [
-    // @phpstan-ignore function.deprecated
-    _update_manager_cache_directory(FALSE),
-    // @phpstan-ignore function.deprecated
-    _update_manager_extract_directory(FALSE),
+    // @see _update_manager_cache_directory()
+    "temporary://update-cache-$id",
+    // @see _update_manager_extract_directory()
+    "temporary://update-extraction-$id",
   ];
   foreach ($directories as $directory) {
     if (is_dir($directory)) {
-- 
GitLab


From 8c69b379fecb2536987817aabecd80bab6686e3d Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 10:23:27 -1000
Subject: [PATCH 18/22] [#3521059]: Remove 'allow_authorize_operations' from
 default.settings.php

---
 .../scaffold/files/default.settings.php       | 24 -------------------
 sites/default/default.settings.php            | 24 -------------------
 2 files changed, 48 deletions(-)

diff --git a/core/assets/scaffold/files/default.settings.php b/core/assets/scaffold/files/default.settings.php
index 666a39643736..d4ba8a91829a 100644
--- a/core/assets/scaffold/files/default.settings.php
+++ b/core/assets/scaffold/files/default.settings.php
@@ -475,30 +475,6 @@
  */
 # $settings['class_loader_auto_detect'] = FALSE;
 
-/**
- * Authorized file system operations:
- *
- * The Update Manager module included with Drupal provides a mechanism for
- * site administrators to securely install missing updates for the site
- * directly through the web user interface. On securely-configured servers,
- * the Update manager will require the administrator to provide SSH or FTP
- * credentials before allowing the installation to proceed; this allows the
- * site to update the new files as the user who owns all the Drupal files,
- * instead of as the user the webserver is running as. On servers where the
- * webserver user is itself the owner of the Drupal files, the administrator
- * will not be prompted for SSH or FTP credentials (note that these server
- * setups are common on shared hosting, but are inherently insecure).
- *
- * Some sites might wish to disable the above functionality, and only update
- * the code directly via SSH or FTP themselves. This setting completely
- * disables all functionality related to these authorized file operations.
- *
- * @see https://www.drupal.org/node/244924
- *
- * Remove the leading hash signs to disable.
- */
-# $settings['allow_authorize_operations'] = FALSE;
-
 /**
  * Default mode for directories and files written by Drupal.
  *
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 666a39643736..d4ba8a91829a 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -475,30 +475,6 @@
  */
 # $settings['class_loader_auto_detect'] = FALSE;
 
-/**
- * Authorized file system operations:
- *
- * The Update Manager module included with Drupal provides a mechanism for
- * site administrators to securely install missing updates for the site
- * directly through the web user interface. On securely-configured servers,
- * the Update manager will require the administrator to provide SSH or FTP
- * credentials before allowing the installation to proceed; this allows the
- * site to update the new files as the user who owns all the Drupal files,
- * instead of as the user the webserver is running as. On servers where the
- * webserver user is itself the owner of the Drupal files, the administrator
- * will not be prompted for SSH or FTP credentials (note that these server
- * setups are common on shared hosting, but are inherently insecure).
- *
- * Some sites might wish to disable the above functionality, and only update
- * the code directly via SSH or FTP themselves. This setting completely
- * disables all functionality related to these authorized file operations.
- *
- * @see https://www.drupal.org/node/244924
- *
- * Remove the leading hash signs to disable.
- */
-# $settings['allow_authorize_operations'] = FALSE;
-
 /**
  * Default mode for directories and files written by Drupal.
  *
-- 
GitLab


From b7052b53797d8a866c6369875752e11302f454b8 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 10:23:55 -1000
Subject: [PATCH 19/22] [#3521059]: Deprecate the 'allow_authorize_operations'
 setting

---
 core/lib/Drupal/Core/Site/Settings.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/lib/Drupal/Core/Site/Settings.php b/core/lib/Drupal/Core/Site/Settings.php
index 63b56a865d49..e290480c0c8a 100644
--- a/core/lib/Drupal/Core/Site/Settings.php
+++ b/core/lib/Drupal/Core/Site/Settings.php
@@ -38,6 +38,10 @@ final class Settings {
    * @see self::handleDeprecations()
    */
   private static $deprecatedSettings = [
+    'allow_authorize_operations' => [
+      'replacement' => '',
+      'message' => 'The "allow_authorize_operations" setting is deprecated in drupal:11.2.0. This setting should be removed from the settings file, since its usage has been removed. See https://www.drupal.org/node/3522119.',
+    ],
     'state_cache' => [
       'replacement' => '',
       'message' => 'The "state_cache" setting is deprecated in drupal:11.0.0. This setting should be removed from the settings file, since its usage has been removed. See https://www.drupal.org/node/3177901.',
-- 
GitLab


From b419b3d0eec074dd63e3d9f5b667ba003b3d01fb Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 10:35:04 -1000
Subject: [PATCH 20/22] Revert "[#3521059]: Deprecate the
 'allow_authorize_operations' setting"

This reverts commit b7052b53797d8a866c6369875752e11302f454b8.
---
 core/lib/Drupal/Core/Site/Settings.php | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/core/lib/Drupal/Core/Site/Settings.php b/core/lib/Drupal/Core/Site/Settings.php
index e290480c0c8a..63b56a865d49 100644
--- a/core/lib/Drupal/Core/Site/Settings.php
+++ b/core/lib/Drupal/Core/Site/Settings.php
@@ -38,10 +38,6 @@ final class Settings {
    * @see self::handleDeprecations()
    */
   private static $deprecatedSettings = [
-    'allow_authorize_operations' => [
-      'replacement' => '',
-      'message' => 'The "allow_authorize_operations" setting is deprecated in drupal:11.2.0. This setting should be removed from the settings file, since its usage has been removed. See https://www.drupal.org/node/3522119.',
-    ],
     'state_cache' => [
       'replacement' => '',
       'message' => 'The "state_cache" setting is deprecated in drupal:11.0.0. This setting should be removed from the settings file, since its usage has been removed. See https://www.drupal.org/node/3177901.',
-- 
GitLab


From c9452f820017af3df7ff1f29e46b33825de0215b Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 10:56:45 -1000
Subject: [PATCH 21/22] [#3521059]: Add trigger_error() to deprecation for
 _update_manager_unique_identifier()

---
 core/modules/update/update.module | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index f38605cc0d85..3d67592e9bb4 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -283,6 +283,7 @@ function update_storage_clear(): void {
  * @see https://www.drupal.org/node/3522119
  */
 function _update_manager_unique_identifier() {
+  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
   static $id;
   if (!isset($id)) {
     $id = substr(hash('sha256', Settings::getHashSalt()), 0, 8);
@@ -311,6 +312,7 @@ function _update_manager_extract_directory($create = TRUE) {
 
   static $directory;
   if (!isset($directory)) {
+    // @phpstan-ignore function.deprecated
     $directory = 'temporary://update-extraction-' . _update_manager_unique_identifier();
     if ($create && !file_exists($directory)) {
       mkdir($directory);
-- 
GitLab


From 2595d9f0a433cc1f8d81ec0272b4979cee5e7ba6 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 1 May 2025 11:05:27 -1000
Subject: [PATCH 22/22] [#3521059]: Looks like phpstan doesn't notice the
 deprecated call inside a deprecated method, don't need to ignore

---
 core/modules/update/update.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 3d67592e9bb4..9f7df5e7cf78 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -284,6 +284,7 @@ function update_storage_clear(): void {
  */
 function _update_manager_unique_identifier() {
   @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no replacement. Use composer to manage the code for your site. See https://www.drupal.org/node/3522119', E_USER_DEPRECATED);
+
   static $id;
   if (!isset($id)) {
     $id = substr(hash('sha256', Settings::getHashSalt()), 0, 8);
@@ -312,7 +313,6 @@ function _update_manager_extract_directory($create = TRUE) {
 
   static $directory;
   if (!isset($directory)) {
-    // @phpstan-ignore function.deprecated
     $directory = 'temporary://update-extraction-' . _update_manager_unique_identifier();
     if ($create && !file_exists($directory)) {
       mkdir($directory);
-- 
GitLab