Unverified Commit b36543da authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2715145 by andypost, phenaproxima, longwave, alexpott, RenatoG,...

Issue #2715145 by andypost, phenaproxima, longwave, alexpott, RenatoG, quietone, catch: Remove system.authorize config
parent bd04c705
Loading
Loading
Loading
Loading
+0 −1
Changes for core/modules/system/config/install/system.authorize.yml: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
filetransfer_default:
+0 −8
Changes for core/modules/system/config/schema/system.schema.yml: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -53,14 +53,6 @@ system.maintenance:
      type: text
      label: 'Message to display when in maintenance mode'

system.authorize:
  type: config_object
  label: 'Authorize settings'
  mapping:
    filetransfer_default:
      type: string
      label: 'Default file transfer protocol'

system.cron:
  type: config_object
  label: 'Cron settings'
+6 −2
Changes for core/modules/system/migrations/d7_system_authorize.yml: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -9,7 +9,11 @@ source:
    - authorize_filetransfer_default
  source_module: system
process:
   filetransfer_default: authorize_filetransfer_default
  filetransfer_default:
    plugin: skip_on_empty
    method: row
    source: empty
destination:
  plugin: config
  config_name: system.authorize
  config_name: null
  destination_module: system
+7 −0
Changes for core/modules/system/system.post_update.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -197,3 +197,10 @@ function system_post_update_service_advisory_settings() {
  $config = \Drupal::configFactory()->getEditable('system.advisories');
  $config->set('interval_hours', 6)->set('enabled', TRUE)->save();
}

/**
 * Remove obsolete system.authorize configuration.
 */
function system_post_update_delete_authorize_settings() {
  \Drupal::configFactory()->getEditable('system.authorize')->delete();
}
+38 −0
Changes for core/modules/system/tests/src/Functional/Update/DeleteAuthorizeSettingsUpdateTest.php: 38 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\system\Functional\Update;

use Drupal\FunctionalTests\Update\UpdatePathTestBase;

/**
 * Tests the upgrade path for removal the system.authorize configuration.
 *
 * @see https://www.drupal.org/node/3206320
 * @see system_post_update_delete_authorize_settings()
 *
 * @group Update
 */
class DeleteAuthorizeSettingsUpdateTest extends UpdatePathTestBase {

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

  /**
   * Tests system_post_update_delete_authorize_settings().
   */
  public function testSystemAuthorizeRemoval() {
    $this->assertArrayHasKey('filetransfer_default', $this->config('system.authorize')->getRawData());

    $this->runUpdates();

    $config = $this->config('system.authorize');
    $this->assertTrue($config->isNew());
  }

}
Loading