Commit 3f2b654a authored by jrockowitz's avatar jrockowitz

Revert "Issue #2857835: 8.x-5.0-beta8"

This reverts commit bd9b0ef1.
parent bd9b0ef1
......@@ -4,5 +4,5 @@ description: 'Demonstrate how to use the Webform module to build an application/
package: 'Webform Demo'
core: 8.x
dependencies:
- 'drupal:block'
- 'drupal:webform'
- block
- webform
......@@ -29,7 +29,7 @@ function webform_demo_application_evaluation_install() {
$devel_generate_manager = \Drupal::service('plugin.manager.develgenerate');
/** @var \Drupal\webform\Plugin\DevelGenerate\WebformSubmissionDevelGenerate $webform_submission_devel_generate */
$webform_submission_devel_generate = $devel_generate_manager->createInstance('webform_submission', []);
$webform_submission_devel_generate = $devel_generate_manager->createInstance('webform_submission', array());
$webform_submission_devel_generate->generateElements([
'webform_ids' => [
'demo_application' => 'demo_application'
......@@ -47,7 +47,7 @@ function webform_demo_application_evaluation_install() {
$devel_generate_manager = \Drupal::service('plugin.manager.develgenerate');
/** @var \Drupal\webform\Plugin\DevelGenerate\WebformSubmissionDevelGenerate $webform_submission_devel_generate */
$webform_submission_devel_generate = $devel_generate_manager->createInstance('webform_submission', []);
$webform_submission_devel_generate = $devel_generate_manager->createInstance('webform_submission', array());
$webform_submission_devel_generate->generateElements([
'webform_ids' => [
'demo_application' => 'demo_application'
......
......@@ -4,5 +4,5 @@ description: 'Provides development tools for the Webform module.'
package: Webform
core: 8.x
dependencies:
- 'drupal:devel'
- 'drupal:webform'
- devel
- webform
......@@ -4,4 +4,4 @@ description: 'Provides examples of all webform elements and functionality which
package: Webform
core: 8.x
dependencies:
- 'drupal:webform'
- webform
......@@ -9,4 +9,9 @@ dependencies:
- 'drupal:path'
- 'drupal:text'
- 'drupal:user'
- 'drupal:webform'
- field
- node
- path
- text
- user
- webform
......@@ -17,11 +17,11 @@ function webform_node_requirements($phase) {
// happen during a D7 to D8 content migration.
// @see https://www.drupal.org/node/2856599
if ($phase == 'install' && ($node_type = NodeType::load('webform'))) {
$requirements['webform_node'] = [
$requirements['webform_node'] = array(
'title' => t('Webform Node'),
'description' => t('%title content type already exists, please delete the %title content type before installing the Webform node module.', ['%title' => $node_type->label()]),
'severity' => REQUIREMENT_ERROR,
];
);
}
return $requirements;
}
......
......@@ -4,4 +4,4 @@ description: 'Provides starter templates that can be used create new webforms.'
package: Webform
core: 8.x
dependencies:
- 'drupal:webform'
- webform
......@@ -4,4 +4,4 @@ description: 'Provides a user interface for building and maintaining webforms.'
package: Webform
core: 8.x
dependencies:
- 'drupal:webform'
- webform
......@@ -20,7 +20,7 @@ class WebformAccess {
*
* @param \Drupal\webform\WebformInterface $webform
* A webform.
* @param \Drupal\Core\Entity\EntityInterface|null $source_entity
* @param \Drupal\Core\Entity\EntityInterface|null
* The source entity.
*
* @return \Drupal\Core\Access\AccessResultInterface
......
......@@ -79,8 +79,6 @@ class WebformHelpController extends ControllerBase implements ContainerInjection
/**
* Route title callback.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
* @param string $id
* The id of the dedicated help section.
*
......
......@@ -2,8 +2,11 @@
namespace Drupal\webform\Element;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\FormElement;
use Drupal\Core\Serialization\Yaml;
use Drupal\webform\Utility\WebformYaml;
/**
* Provides a webform element for element multiple property.
......
......@@ -493,8 +493,6 @@ class WebformElementStates extends FormElement {
*
* @param array $element
* An element.
* @param $name
* The name.
*
* @return string
* A unique key used to store the number of options for an element.
......
......@@ -3,6 +3,7 @@
namespace Drupal\webform\Element;
use Drupal\Core\Form\OptGroup;
use Drupal\Component\Utility\Html;
use Drupal\webform\Utility\WebformOptionsHelper;
/**
......
......@@ -957,10 +957,6 @@ class Webform extends ConfigEntityBundleBase implements WebformInterface {
*
* @param array $elements
* The webform elements.
* @param string $parent
* The parent key.
* @param int $depth
* The element's depth.
*/
protected function initElementsRecursive(array &$elements, $parent = '', $depth = 0) {
/** @var \Drupal\webform\WebformElementManagerInterface $element_manager */
......
......@@ -510,7 +510,7 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn
* Track the state of a submission.
*
* @return int
* Either STATE_NEW, STATE_DRAFT, STATE_COMPLETED, or STATE_UPDATED,
* Either STATE_NEW, STATE_DRAFT, STATE_COMPLETED, or STATE_UPDATED,
* depending on the last save operation performed.
*/
public function getState() {
......
......@@ -3,7 +3,9 @@
namespace Drupal\webform\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\WebformHandlerManagerInterface;
use Drupal\webform\WebformInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a duplicate form for webform handler.
......
......@@ -40,12 +40,8 @@ abstract class WebformHandlerFormBase extends FormBase {
}
/**
* Form constructor.
* {@inheritdoc}
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
* @param \Drupal\webform\WebformInterface $webform
* The webform.
* @param string $webform_handler
......@@ -241,9 +237,9 @@ abstract class WebformHandlerFormBase extends FormBase {
/**
* Process handler webform errors in webform.
*
* @param \Drupal\Core\Form\FormStateInterface $handler_state
* @param FormStateInterface $handler_state
* The webform handler webform state.
* @param \Drupal\Core\Form\FormStateInterface &$form_state
* @param FormStateInterface &$form_state
* The webform state.
*/
protected function processHandlerFormErrors(FormStateInterface $handler_state, FormStateInterface &$form_state) {
......
......@@ -45,7 +45,7 @@ class DeleteWebformSubmission extends ActionBase implements ContainerFactoryPlug
* The plugin implementation definition.
* @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory
* The tempstore factory.
* @param \Drupal\Core\Session\AccountInterface $current_user
* @param AccountInterface $current_user
* Current user.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user) {
......
......@@ -74,5 +74,4 @@ class Checkboxes extends OptionsBase {
return $form;
}
}
......@@ -68,6 +68,13 @@ class Table extends WebformElementBase {
$element['#tree'] = FALSE;
}
/**
* {@inheritdoc}
*/
protected function build($format, array &$element, $value, array $options = []) {
return parent::build($format, $element, $value, $options);
}
/**
* {@inheritdoc}
*/
......
......@@ -35,7 +35,7 @@ class Telephone extends TextBase {
public function prepare(array &$element, WebformSubmissionInterface $webform_submission) {
parent::prepare($element, $webform_submission);
// Add international library and classes.
// Add internation library and classes.
if (!empty($element['#international'])) {
$element['#attached']['library'][] = 'webform/webform.element.telephone';
$element['#attributes']['class'][] = 'js-webform-telephone-international';
......
......@@ -3,6 +3,7 @@
namespace Drupal\webform\Plugin\WebformElement;
use Drupal\webform\WebformSubmissionInterface;
use Drupal\webform\Element\WebformEntityTrait;
/**
* Provides an 'entity_reference' with options trait.
......
......@@ -2,8 +2,10 @@
namespace Drupal\webform\Plugin\WebformElement;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Form\FormState;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Element\WebformOptions;
use Drupal\webform\Element\WebformTelephone as WebformTelephoneElement;
/**
......@@ -29,7 +31,6 @@ class WebformTelephone extends WebformCompositeBase {
unset($default_properties['flexbox']);
return $default_properties;
}
/**
* {@inheritdoc}
*/
......@@ -104,6 +105,7 @@ class WebformTelephone extends WebformCompositeBase {
}
}
/**
* {@inheritdoc}
*/
......@@ -117,5 +119,4 @@ class WebformTelephone extends WebformCompositeBase {
];
return $form;
}
}
......@@ -35,7 +35,6 @@ class WebformTermSelect extends Select implements WebformEntityReferenceInterfac
unset($properties['options_randomize']);
return $properties;
}
/**
* {@inheritdoc}
*/
......@@ -96,7 +95,6 @@ class WebformTermSelect extends Select implements WebformEntityReferenceInterfac
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
// Overrides: \Drupal\webform\Plugin\WebformElement\WebformEntityReferenceTrait::validateConfigurationForm.
parent::validateConfigurationForm($form, $form_state);
}
......
......@@ -2,7 +2,7 @@
namespace Drupal\webform\Tests;
use Drupal\webform\Entity\Webform;
use \Drupal\webform\Entity\Webform;
/**
* Tests for webform block context.
......@@ -34,7 +34,7 @@ class WebformBlockContextTest extends WebformTestBase {
'node' => '@node.node_route_context:node',
];
foreach ($contexts as $type => $context) {
$block = $this->placeBlock('webform_test_block_context_block', ['label' => '{' . $type . ' context}']);
$block = $this->placeBlock('webform_test_block_context_block', ['label' => '{' . $type . ' context}']);
$block->setVisibilityConfig('webform', [
'id' => 'webform',
'webforms' => ['contact' => 'contact'],
......
......@@ -227,7 +227,7 @@ class WebformArrayHelper {
public static function shuffle(array $array) {
$keys = array_keys($array);
shuffle($keys);
$random = [];
$random = array();
foreach ($keys as $key) {
$random[$key] = $array[$key];
}
......
<?php
namespace Drupal\webform\Utility;
use Drupal\Component\Utility\Html;
/**
......@@ -102,20 +101,20 @@ class WebformOptionsHelper {
/**
* Decode HTML entities in options.
*
* Issue #2826451: TermSelection returning HTML characters in select list.
*
* @param array $options
* An associative array of options.
*
* @return string
* An associative array of options with HTML entities decoded.
*
* @see Issue #2826451: TermSelection returning HTML characters in select list.
*/
public static function decodeOptions(array $options) {
foreach ($options as $option_value => $option_text) {
if (is_array($option_text)) {
$options[$option_value] = self::decodeOptions($option_text);
}
else {
else{
$options[$option_value] = Html::decodeEntities((string) $option_text);
}
}
......
......@@ -569,8 +569,6 @@ interface WebformElementInterface extends PluginInspectionInterface, PluginFormI
*
* @param array $element
* An element.
* @parent string $value
* Value to be exported.
* @param array $export_options
* An associative array of export options.
*
......
......@@ -4,6 +4,7 @@ namespace Drupal\webform;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\user\Entity\User;
/**
* Provides a webform to manage access.
......@@ -43,7 +44,7 @@ class WebformEntityAccessForm extends EntityForm {
$form['access'][$name]['users'] = [
'#type' => 'webform_users',
'#title' => $this->t('Users'),
'#default_value' => $access[$name]['users'] ? $this->entityTypeManager->getStorage('user')->loadMultiple($access[$name]['users']) : [],
'#default_value' => $access[$name]['users'] ? User::loadMultiple($access[$name]['users']) : [],
];
}
......
......@@ -225,17 +225,17 @@ class WebformEntitySettingsForm extends EntityForm {
'#type' => 'container',
'#attributes' => ['class' => 'container-inline'],
];
$form['form']['scheduled']['dates']['open'] = [
$form['form']['scheduled']['dates']['open'] = array(
'#type' => 'datetime',
'#title' => $this->t('Open'),
'#default_value' => $webform->get('open') ? DrupalDateTime::createFromTimestamp(strtotime($webform->get('open'))) : NULL,
];
);
$form['form']['scheduled']['dates']['space'] = ['#markup' => ' &nbsp; '];
$form['form']['scheduled']['dates']['close'] = [
$form['form']['scheduled']['dates']['close'] = array(
'#type' => 'datetime',
'#title' => $this->t('Close'),
'#default_value' => $webform->get('close') ? DrupalDateTime::createFromTimestamp(strtotime($webform->get('close'))) : NULL,
];
);
$form['form']['form_closed_message'] = [
'#type' => 'webform_html_editor',
'#title' => $this->t('Webform closed message'),
......
......@@ -2,11 +2,10 @@
namespace Drupal\webform;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Serialization\Yaml;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Path\PathMatcherInterface;
......@@ -41,13 +40,6 @@ class WebformHelpManager implements WebformHelpManagerInterface {
*/
protected $currentUser;
/**
* The configuration object factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The module handler.
*
......@@ -95,8 +87,6 @@ class WebformHelpManager implements WebformHelpManagerInterface {
*
* @param \Drupal\Core\Session\AccountInterface $current_user
* Current user.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration object factory.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\State\StateInterface $state
......@@ -110,9 +100,8 @@ class WebformHelpManager implements WebformHelpManagerInterface {
* @param \Drupal\webform\WebformElementManagerInterface $element_manager
* The webform element manager.
*/
public function __construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, StateInterface $state, PathMatcherInterface $path_matcher, WebformAddOnsManagerInterface $addons_manager, WebformLibrariesManagerInterface $libraries_manager, WebformElementManagerInterface $element_manager) {
public function __construct(AccountInterface $current_user, ModuleHandlerInterface $module_handler, StateInterface $state, PathMatcherInterface $path_matcher, WebformAddOnsManagerInterface $addons_manager, WebformLibrariesManagerInterface $libraries_manager, WebformElementManagerInterface $element_manager) {
$this->currentUser = $current_user;
$this->configFactory = $config_factory;
$this->moduleHandler = $module_handler;
$this->state = $state;
$this->pathMatcher = $path_matcher;
......@@ -216,7 +205,7 @@ class WebformHelpManager implements WebformHelpManagerInterface {
'#suffix' => '</div>',
];
$build['about'] = $this->buildAbout();
if ($this->configFactory->get('webform.settings')->get('ui.video_display') !== 'hidden') {
if (\Drupal::config('webform.settings')->get('ui.video_display') !== 'hidden') {
$build['videos'] = $this->buildVideos();
}
$build['uses'] = $this->buildUses();
......
......@@ -64,9 +64,9 @@ interface WebformInterface extends ConfigEntityInterface, EntityWithPluginCollec
*
* @param string|bool|null $status
* The status of the configuration entity.
* - TRUE => WebformInterface::STATUS_OPEN.
* - FALSE => WebformInterface::STATUS_CLOSED.
* - NULL => WebformInterface::STATUS_SCHEDULED.
* - TRUE => WebformInterface::STATUS_OPEN
* - FALSE => WebformInterface::STATUS_CLOSED
* - NULL => WebformInterface::STATUS_SCHEDULED
*
* @return $this
*/
......
......@@ -2,7 +2,6 @@
namespace Drupal\webform;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Serialization\Yaml;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
......@@ -14,13 +13,6 @@ class WebformLibrariesManager implements WebformLibrariesManagerInterface {
use StringTranslationTrait;
/**
* The configuration object factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Libraries that provides additional functionality to the Webform module.
*
......@@ -30,12 +22,8 @@ class WebformLibrariesManager implements WebformLibrariesManagerInterface {
/**
* Constructs a WebformLibrariesManager object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration object factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
public function __construct() {
$this->libraries = $this->initLibraries();
}
......@@ -43,7 +31,7 @@ class WebformLibrariesManager implements WebformLibrariesManagerInterface {
* {@inheritdoc}
*/
public function requirements() {
$cdn = $this->configFactory->get('webform.settings')->get('library.cdn', FALSE);
$cdn = \Drupal::config('webform.settings')->get('library.cdn', FALSE);
$status = [];
$libraries = $this->getLibraries();
......
......@@ -11,7 +11,7 @@ interface WebformLibrariesManagerInterface {
* Get third party libraries status for hook_requirements and drush.
*
* @return array
* An associative array of third party libraries keyed by library name.
* An associative array of third party libraries keyed by library name.
*/
public function requirements();
......
......@@ -7,7 +7,6 @@ use Drupal\Component\Utility\Xss;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Url;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Psr\Log\LoggerInterface;
......@@ -54,13 +53,6 @@ class WebformMessageManager implements WebformMessageManagerInterface {
*/
protected $logger;
/**
* The renderer.
*
* @var \Drupal\Core\Render\RendererInterface
*/
protected $renderer;
/**
* Webform request handler.
*
......@@ -107,19 +99,16 @@ class WebformMessageManager implements WebformMessageManagerInterface {
* The entity manager.
* @param \Psr\Log\LoggerInterface $logger
* A logger instance.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
* @param \Drupal\webform\WebformRequestInterface $request_handler
* The webform request handler.
* @param \Drupal\webform\WebformTokenManagerInterface $token_manager
* The token manager.
*/
public function __construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger, RendererInterface $renderer, WebformRequestInterface $request_handler, WebformTokenManagerInterface $token_manager) {
public function __construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger, WebformRequestInterface $request_handler, WebformTokenManagerInterface $token_manager) {
$this->currentUser = $current_user;
$this->configFactory = $config_factory;
$this->entityStorage = $entity_type_manager->getStorage('webform_submission');
$this->logger = $logger;
$this->renderer = $renderer;
$this->requestHandler = $request_handler;
$this->tokenManager = $token_manager;
}
......@@ -155,7 +144,7 @@ class WebformMessageManager implements WebformMessageManagerInterface {
$build = $this->build($key);
// Do not display message via Ajax request.
if ($build && !$this->requestHandler->isAjax()) {
drupal_set_message($this->renderer->renderPlain($build), $type);
drupal_set_message(\Drupal::service('renderer')->renderPlain($build), $type);
return TRUE;
}
else {
......
......@@ -4,7 +4,7 @@ namespace Drupal\webform;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Uuid\Php;
use \Drupal\Component\Uuid\Php;
use Drupal\Core\Url;
/**
......@@ -68,5 +68,4 @@ class WebformSubmissionDuplicateForm extends WebformSubmissionForm {
$form_state->setRedirect($redirect_route_name, $redirect_route_parameters);
}
}
}
......@@ -8,7 +8,6 @@ use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StreamWrapper\StreamWrapperInterface;
use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface;
......@@ -22,13 +21,6 @@ class WebformSubmissionExporter implements WebformSubmissionExporterInterface {
use StringTranslationTrait;
/**
* The file system service.
*
* @var \Drupal\Core\File\FileSystemInterface
*/
protected $fileSystem;
/**
* The configuration object factory.
*
......@@ -109,8 +101,6 @@ class WebformSubmissionExporter implements WebformSubmissionExporterInterface {
/**
* Constructs a WebformSubmissionExporter object.
*
* @param \Drupal\Core\File\FileSystemInterface $file_system
* The file system service.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration object factory.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
......@@ -124,7 +114,7 @@ class WebformSubmissionExporter implements WebformSubmissionExporterInterface {
* @param \Drupal\webform\WebformExporterManagerInterface $exporter_manager
* The results exporter manager.
*/
public function __construct(FileSystemInterface $file_system, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, QueryFactory $query_factory, StreamWrapperManagerInterface $stream_wrapper_manager, WebformElementManagerInterface $element_manager, WebformExporterManagerInterface $exporter_manager) {
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, QueryFactory $query_factory, StreamWrapperManagerInterface $stream_wrapper_manager, WebformElementManagerInterface $element_manager, WebformExporterManagerInterface $exporter_manager) {
$this->configFactory = $config_factory;
$this->entityStorage = $entity_type_manager->getStorage('webform_submission');
$this->queryFactory = $query_factory;
......@@ -686,7 +676,7 @@ class WebformSubmissionExporter implements WebformSubmissionExporterInterface {
$archiver = new ArchiveTar($this->getArchiveFilePath(), 'gz');
$stream_wrappers = array_keys($this->streamWrapperManager->getNames(StreamWrapperInterface::WRITE_VISIBLE));
foreach ($stream_wrappers as $stream_wrapper) {
$files_directory = $this->fileSystem->realpath($stream_wrapper . '://webform/' . $webform->id());
$files_directory = \Drupal::service('file_system')->realpath($stream_wrapper . '://webform/' . $webform->id());
$files_directories[] = $files_directory;
}
}
......
......@@ -670,7 +670,7 @@ class WebformSubmissionForm extends ContentEntityForm {
];
}
uasort($element, ['Drupal\Component\Utility\SortArray', 'sortByWeightProperty']);
uasort($element, array('Drupal\Component\Utility\SortArray', 'sortByWeightProperty'));
return $element;
}
......
......@@ -208,7 +208,7 @@ interface WebformSubmissionInterface extends ContentEntityInterface, EntityOwner
* Track the state of a submission.
*
* @return int
* Either STATE_NEW, STATE_DRAFT, STATE_COMPLETED, or STATE_UPDATED,
* Either STATE_NEW, STATE_DRAFT, STATE_COMPLETED, or STATE_UPDATED,
* depending on the last save operation performed.
*/
public function getState();
......
......@@ -3,11 +3,7 @@
namespace Drupal\webform;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Datetime\TimeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Controller for webform submission notes.
......@@ -16,47 +12,15 @@ class WebformSubmissionNotesForm extends ContentEntityForm {
use WebformDialogTrait;
/**
* Webform request handler.
*
* @var \Drupal\webform\WebformRequestInterface
*/
protected $requestHandler;
/**
* Constructs a ContentEntityForm object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
* The entity type bundle service.
* @param \Drupal\Component\Datetime\TimeInterface $time
* The time service.
*/
public function __construct(EntityManagerInterface $entity_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, WebformRequestInterface $request_handler) {
parent::__construct($entity_manager, $entity_type_bundle_info, $time);
$this->requestHandler = $request_handler;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('entity_type.bundle.info'),
$container->get('datetime.time'),
$container->get('webform.request')
);
}
/**