Unverified Commit 849a6872 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3517070 by bbrala: Remove system.file.path config from system.schema.yml

parent 480738f3
Loading
Loading
Loading
Loading
Loading
+1 −0
Changes for core/modules/system/config/schema/system.schema.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -344,6 +344,7 @@ system.file:
    path:
      type: mapping
      label: 'Path settings'
      deprecated: "The 'path' config schema is deprecated in drupal:11.2.0 and will be removed from drupal 12.0.0. Use 'file_temp_path' key in settings.php instead. See https://www.drupal.org/node/3039255."
    temporary_maximum_age:
      type: integer
      label: 'Maximum age for temporary files'
+11 −0
Changes for core/modules/system/system.post_update.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -92,3 +92,14 @@ function system_post_update_sdc_uninstall(): void {
function system_post_update_remove_rss_cdata_subscriber(): void {
  // Empty update to trigger container rebuild.
}

/**
 * Remove path key in system.file.
 */
function system_post_update_remove_path_key(): void {
  if (\Drupal::config('system.file')->get('path') !== NULL) {
    \Drupal::configFactory()->getEditable('system.file')
      ->clear('path')
      ->save();
  }
}
+34 −0
Changes for core/modules/system/tests/src/Functional/Update/RemovePathKeyTest.php: 34 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\Tests\system\Functional\Update;

use Drupal\FunctionalTests\Update\UpdatePathTestBase;

/**
 * Tests the upgrade path for the system.file schema update.
 *
 * @group Update
 */
class RemovePathKeyTest extends UpdatePathTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles(): void {
    $this->databaseDumpFiles = [
      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-10.3.0.bare.standard.php.gz',
    ];
  }

  /**
   * Tests the upgrade path for removing system.file.path key.
   */
  public function testRunUpdates(): void {
    $this->assertIsArray(\Drupal::config('system.file')->get('path'));
    $this->runUpdates();
    $this->assertNull(\Drupal::config('system.file')->get('path'));
  }

}