3 namespace Drupal\action;
5 use Drupal\Core\Form\FormStateInterface;
8 * Provides a form for action add forms.
12 class ActionAddForm extends ActionFormBase {
17 * @param string $action_id
20 public function buildForm(array $form, FormStateInterface $form_state, $action_id = NULL) {
21 $this->entity->setPlugin($action_id);
23 // Derive the label and type from the action definition.
24 $definition = $this->entity->getPluginDefinition();
25 $this->entity->set('label', $definition['label']);
26 $this->entity->set('type', $definition['type']);
28 return parent::buildForm($form, $form_state);