You are here

class BrokenWebformVariant in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformVariant/BrokenWebformVariant.php \Drupal\webform\Plugin\WebformVariant\BrokenWebformVariant

Defines a fallback plugin for missing webform variant plugins.

Plugin annotation


@WebformVariant(
  id = "broken",
  label = @Translation("Broken/Missing"),
  category = @Translation("Broken"),
  description = @Translation("Broken/missing webform variant plugin.")
)

Hierarchy

Expanded class hierarchy of BrokenWebformVariant

1 file declares its use of BrokenWebformVariant
WebformVariantPluginCollection.php in src/Plugin/WebformVariantPluginCollection.php

File

src/Plugin/WebformVariant/BrokenWebformVariant.php, line 17

Namespace

Drupal\webform\Plugin\WebformVariant
View source
class BrokenWebformVariant extends WebformVariantBase {

  /**
   * {@inheritdoc}
   */
  public function isEnabled() {
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getSummary() {
    $t_args = [
      '%plugin_id' => $this
        ->getPluginId(),
    ];
    return [
      'message' => [
        '#markup' => $this
          ->t('This %plugin_id handler is broken or missing. You might need to enable the original module and/or clear the cache.', $t_args),
      ],
    ];
  }

  /**
   * Set a broken handler's plugin id.
   *
   * This allows broken handlers to preserve the original handler's plugin ID.
   *
   * @param string $plugin_id
   *   The original handler's plugin ID.
   *
   * @see \Drupal\webform\Plugin\WebformVariantPluginCollection::initializePlugin
   */
  public function setPluginId($plugin_id) {
    $this->pluginId = $plugin_id;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrokenWebformVariant::getSummary public function Returns a render array summarizing the configuration of the webform variant. Overrides WebformVariantBase::getSummary
BrokenWebformVariant::isEnabled public function Returns the webform variant enabled indicator. Overrides WebformVariantBase::isEnabled
BrokenWebformVariant::setPluginId public function Set a broken handler's plugin id.
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
WebformEntityInjectionTrait::$webform protected property The webform.
WebformEntityInjectionTrait::$webformSubmission protected property The webform submission.
WebformEntityInjectionTrait::getWebform public function Get the webform that this handler is attached to.
WebformEntityInjectionTrait::getWebformSubmission public function Set webform and webform submission entity.
WebformEntityInjectionTrait::resetEntities public function Reset webform and webform submission entity.
WebformEntityInjectionTrait::setEntities public function
WebformEntityInjectionTrait::setWebform public function Set the webform that this is handler is attached to.
WebformEntityInjectionTrait::setWebformSubmission public function Get the webform submission that this handler is handling.
WebformPluginSettingsTrait::getSetting public function
WebformPluginSettingsTrait::getSettings public function
WebformPluginSettingsTrait::setSetting public function
WebformPluginSettingsTrait::setSettings public function
WebformVariantBase::$configFactory protected property The configuration factory.
WebformVariantBase::$element_key protected property The element key of the webform variant.
WebformVariantBase::$label protected property The webform variant label.
WebformVariantBase::$notes protected property The webform variant notes.
WebformVariantBase::$status protected property The webform variant status.
WebformVariantBase::$variant_id protected property The webform variant ID.
WebformVariantBase::$weight protected property The weight of the webform variant.
WebformVariantBase::applyVariant public function Apply variant to the webform. Overrides WebformVariantInterface::applyVariant 3
WebformVariantBase::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm 3
WebformVariantBase::calculateDependencies public function
WebformVariantBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 1
WebformVariantBase::defaultConfiguration public function Gets default configuration for this plugin. Overrides ConfigurableInterface::defaultConfiguration 3
WebformVariantBase::description public function Returns the webform variant description. Overrides WebformVariantInterface::description
WebformVariantBase::disable public function Disables the webform variant. Overrides WebformVariantInterface::disable
WebformVariantBase::enable public function Enables the webform variant. Overrides WebformVariantInterface::enable
WebformVariantBase::getConfiguration public function Gets this plugin's configuration. Overrides ConfigurableInterface::getConfiguration
WebformVariantBase::getElementKey public function Returns the element key of the webform variant. Overrides WebformVariantInterface::getElementKey
WebformVariantBase::getLabel public function Returns the label of the webform variant. Overrides WebformVariantInterface::getLabel
WebformVariantBase::getMachineNameReplace public function Returns the webform variant machine name replacement character. Overrides WebformVariantInterface::getMachineNameReplace
WebformVariantBase::getMachineNameReplacePattern public function Returns the webform variant machine name replacement pattern. Overrides WebformVariantInterface::getMachineNameReplacePattern
WebformVariantBase::getNotes public function Returns notes of the webform variant. Overrides WebformVariantInterface::getNotes
WebformVariantBase::getOffCanvasWidth public function Get configuration form's off-canvas width. Overrides WebformVariantInterface::getOffCanvasWidth 1
WebformVariantBase::getStatus public function Returns the status of the webform variant. Overrides WebformVariantInterface::getStatus
WebformVariantBase::getVariantId public function Returns the unique ID representing the webform variant. Overrides WebformVariantInterface::getVariantId
WebformVariantBase::getWeight public function Returns the weight of the webform variant. Overrides WebformVariantInterface::getWeight
WebformVariantBase::isApplicable public function Determine if this variant is applicable to the webform. Overrides WebformVariantInterface::isApplicable 2
WebformVariantBase::isDisabled public function Returns the webform variant disabled indicator. Overrides WebformVariantInterface::isDisabled
WebformVariantBase::isExcluded public function Checks if the variant is excluded via webform.settings. Overrides WebformVariantInterface::isExcluded
WebformVariantBase::label public function Returns the webform variant label. Overrides WebformVariantInterface::label
WebformVariantBase::setConfiguration public function Sets the configuration for this plugin instance. Overrides ConfigurableInterface::setConfiguration
WebformVariantBase::setElementKey public function Sets the element key of this webform variant. Overrides WebformVariantInterface::setElementKey
WebformVariantBase::setLabel public function Sets the label for this webform variant. Overrides WebformVariantInterface::setLabel
WebformVariantBase::setNotes public function Set notes for this webform variant. Overrides WebformVariantInterface::setNotes
WebformVariantBase::setStatus public function Sets the status for this webform variant. Overrides WebformVariantInterface::setStatus
WebformVariantBase::setVariantId public function Sets the id for this webform variant. Overrides WebformVariantInterface::setVariantId
WebformVariantBase::setWeight public function Sets the weight for this webform variant. Overrides WebformVariantInterface::setWeight
WebformVariantBase::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm 3
WebformVariantBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm 1
WebformVariantBase::__construct public function Constructs a WebformVariantBase object. Overrides PluginBase::__construct 1