You are here

protected function CustomerProfile::validateConfiguration in Commerce Core 8.2

Validates configuration.

Throws

\RuntimeException Thrown if a configuration value is invalid.

Overrides InlineFormBase::validateConfiguration

File

modules/order/src/Plugin/Commerce/InlineForm/CustomerProfile.php, line 140

Class

CustomerProfile
Provides an inline form for managing a customer profile.

Namespace

Drupal\commerce_order\Plugin\Commerce\InlineForm

Code

protected function validateConfiguration() {
  parent::validateConfiguration();
  if (!is_array($this->configuration['available_countries'])) {
    throw new \RuntimeException('The available_countries configuration value must be an array.');
  }
  if (empty($this->configuration['address_book_uid'])) {

    // Defer copying if the customer is still unknown.
    $this->configuration['copy_on_save'] = FALSE;
  }
}