function field_post_update_clear_purge_batch_size

Same name and namespace in other branches
  1. main core/modules/field/field.post_update.php \field_post_update_clear_purge_batch_size()

Removes the purge_batch_size config.

File

core/modules/field/field.post_update.php, line 26

Code

function field_post_update_clear_purge_batch_size() : ?TranslatableMarkup {
  $config = \Drupal::configFactory()->getEditable('field.settings');
  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.", [
        '@field_purge_batch_size' => $purge_batch_size,
      ]);
    }
    else {
      // Remove the configuration as purge_batch_size is the only key.
      $config->delete();
    }
  }
  return NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.