Verified Commit 46285c7a authored by Dave Long's avatar Dave Long
Browse files

fix: #3622469 Fix field.settings:purge_batch_size config name and key

By: pingwin4eg
By: hoxton
By: leandro713
(cherry picked from commit f2abd414)
parent 098c4f89
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/field/field.post_update.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ function field_post_update_clear_purge_batch_size(): ?TranslatableMarkup {
  if (!$config->isNew()) {
    $purge_batch_size = $config->get('purge_batch_size');
    if ($purge_batch_size !== Settings::get('field_purge_batch_size', 50)) {
      return t("The configuration field.settings:field_purge_batch_size is deprecated and is set to non-default value @field_purge_batch_size. Support for setting this through configuration will be removed in Drupal 13.0.0 and must set in settings.php: \$settings['field_purge_batch_size'] = '@field_purge_batch_size';, see https://www.drupal.org/node/3494023.", [
      return t("The configuration field.settings:purge_batch_size is deprecated and is set to non-default value @field_purge_batch_size. Support for setting this through configuration will be removed in Drupal 13.0.0 and must set in settings.php: \$settings['field_purge_batch_size'] = '@field_purge_batch_size';, see https://www.drupal.org/node/3494023.", [
        '@field_purge_batch_size' => $purge_batch_size,
      ]);
    }
+1 −1
Changes for core/modules/field/src/ConfigImporterFieldPurger.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public static function process(array &$context, ConfigImporter $config_importer)
   *   The config importer.
   */
  protected static function initializeSandbox(array &$context, ConfigImporter $config_importer) {
    if (!($config_purge_batch_size = \Drupal::config('field.field_settings')->get('purge_batch_size'))) {
    if (!($config_purge_batch_size = \Drupal::config('field.settings')->get('purge_batch_size'))) {
      $config_purge_batch_size = Settings::get('field_purge_batch_size', 50);
    }

+1 −1
Changes for core/modules/system/src/Hook/SystemHooks.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ public function cron(): void {
    }

    // Do a pass of purging on deleted entity field data, if any exists.
    if (!$config_purge_batch_size = \Drupal::config('field.field_settings')->get('purge_batch_size')) {
    if (!$config_purge_batch_size = \Drupal::config('field.settings')->get('purge_batch_size')) {
      $config_purge_batch_size = Settings::get('field_purge_batch_size', 50);
    }
    \Drupal::service(FieldPurger::class)->purgeBatch($config_purge_batch_size);