You are here

function paragraphs_update_8015 in Paragraphs 8

Remove the base field overrides for moderation_state field.

File

./paragraphs.install, line 283
Installation hooks for Paragraphs module.

Code

function paragraphs_update_8015() {
  $config_factory = \Drupal::configFactory();
  $names = $config_factory
    ->listAll('core.base_field_override.paragraph.');
  foreach ($names as $name) {
    $config = $config_factory
      ->getEditable($name);
    if ($config
      ->get('field_name') === 'moderation_state') {
      $config
        ->delete();
    }
  }
}