You are here

protected function SalesforceMappingFieldPluginBase::buildBrokenConfigurationForm in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php \Drupal\salesforce_mapping\SalesforceMappingFieldPluginBase::buildBrokenConfigurationForm()
  2. 5.0.x modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php \Drupal\salesforce_mapping\SalesforceMappingFieldPluginBase::buildBrokenConfigurationForm()

Helper for buildConfigurationForm() to build a broken field plugin.

Return value

array The dummy form with message to indicate the plugin is broken.

See also

buildConfigurationForm()

1 call to SalesforceMappingFieldPluginBase::buildBrokenConfigurationForm()
Broken::buildConfigurationForm in modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Broken.php
Form constructor.

File

modules/salesforce_mapping/src/SalesforceMappingFieldPluginBase.php, line 427

Class

SalesforceMappingFieldPluginBase
Defines a base Salesforce Mapping Field Plugin implementation.

Namespace

Drupal\salesforce_mapping

Code

protected function buildBrokenConfigurationForm(array &$pluginForm, FormStateInterface $form_state) {
  foreach ($this
    ->config() as $key => $value) {
    if (!empty($pluginForm[$key])) {
      $pluginForm[$key]['#type'] = 'hidden';
      $pluginForm[$key]['#value'] = $value;
    }
  }
  $pluginForm['drupal_field_type'] = [
    '#type' => 'hidden',
    '#value' => $this
      ->config('drupal_field_type'),
  ];
  return [
    'message' => [
      '#markup' => '<div class="error">' . $this
        ->t('The field plugin %plugin is broken or missing.', [
        '%plugin' => $this
          ->config('drupal_field_type'),
      ]) . '</div>',
    ],
  ];
}