You are here

function commerce_invoice_post_update_2 in Commerce Invoice 8.2

Revert the default invoice type and number pattern to change their labels.

File

./commerce_invoice.post_update.php, line 43
Post update functions for Invoice.

Code

function commerce_invoice_post_update_2() {

  /** @var \Drupal\commerce\Config\ConfigUpdaterInterface $config_updater */
  $config_updater = \Drupal::service('commerce.config_updater');
  $config_names = [
    'commerce_invoice.commerce_invoice_type.default',
    'commerce_number_pattern.commerce_number_pattern.invoice_default',
  ];
  $result = $config_updater
    ->revert($config_names);
  $message = implode('<br>', $result
    ->getFailed());
  return $message;
}