Commit 07f55924 authored by jrockowitz's avatar jrockowitz Committed by jrockowitz

Issue #2989232 by jrockowitz: Release 8.x-5.0-rc17

parent bde541cb
......@@ -42,7 +42,7 @@
/* Float toogle to the right of webform tabs */
.webform-tabs .webform-details-toggle-state-wrapper {
float: right
float: right;
}
@media screen and (max-width: 600px) {
......
......@@ -15,13 +15,13 @@
}
.webform-progress .progress-title[role="link"] {
color: #1976D2;
color: #1976d2;
}
.webform-progress .progress-title[role="link"]:hover,
.webform-progress .progress-title[role="link"]:focus {
text-decoration: underline;
color: #2196F3;
color: #2196f3;
}
/**
......
......@@ -118,7 +118,7 @@ References
[Git Release Notes for Drush](https://www.drupal.org/project/grn)
drush release-notes --nouser 8.x-5.0-VERSION 8.x-5.x
drush release-notes --nouser 8.x-5.0-rc16 8.x-5.x
7. Tag and create a new release
......
......@@ -2418,7 +2418,7 @@ function webform_update_8136() {
}
/**
* Update #counter_* attribute.s
* Update #counter_* attributes.
*
* Replace 'X' in counter message with '%d' and
* move '#counter_message' to '#counter_maxiumum_message'.
......
......@@ -557,7 +557,7 @@ function _webform_preprocess_element(array &$variables, $title_parents = ['title
_webform_preprocess_form_element_description_more($variables);
// Add help to title (aka label).
_webform_preprocess_help_title($title,$element);
_webform_preprocess_help_title($title, $element);
}
/**
......
......@@ -17,7 +17,6 @@ use Drupal\webform\Element\WebformCodeMirror;
use Drupal\webform\Element\WebformHtmlEditor;
use Drupal\webform\WebformMessageManagerInterface;
use Drupal\webform\WebformSubmissionInterface;
use Drupal\webform\Utility\WebformAccessibilityHelper;
use Drupal\webform\Utility\WebformDateHelper;
use Drupal\webform\Utility\WebformDialogHelper;
use Drupal\webform\Utility\WebformElementHelper;
......
......@@ -28,21 +28,20 @@
/**
* Show aria-labels.
*/
[role=main] [aria-label]:after{
content:"[aria-label]: " attr(aria-label);
[role=main] [aria-label]:after {
content: "[aria-label]: " attr(aria-label);
border: 2px dashed green !important;
padding: 4px !important;
position: relative !important;
font-size: 0.8em;
font-weight: normal;
color: green;
}
/**
* Show titles.
*/
[role=main] [title]:after{
[role=main] [title]:after {
content: "[title]: " attr(title);
border: 2px dashed green !important;
padding: 4px !important;
......
......@@ -249,7 +249,7 @@ class WebformNodeReferencesListController extends EntityListBuilder implements C
'#type' => 'link',
'#title' => $result_total,
'#attributes' => [
'aria-label' => $this->formatPlural($result_total, '@count result for @label', '@count results for @label', ['@label' => $entity->label()])
'aria-label' => $this->formatPlural($result_total, '@count result for @label', '@count results for @label', ['@label' => $entity->label()]),
],
'#url' => Url::fromRoute('entity.node.webform.results_submissions', $route_parameters),
],
......
......@@ -143,7 +143,7 @@ abstract class WebformUiElementFormBase extends FormBase implements WebformUiEle
$this->elementManager = $element_manager;
$this->elementsValidator = $elements_validator;
$this->tokenManager = $token_manager;
}
}
/**
* {@inheritdoc}
......
......@@ -5,9 +5,6 @@
* Provides a simple user interface for building and maintaining webforms.
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Utility\WebformDialogHelper;
/**
* Implements hook_entity_type_alter().
*/
......
......@@ -32,4 +32,5 @@ class WebformHandlerAccess {
}
return $access_result->addCacheTags(['config:webform.settings']);
}
}
......@@ -5,7 +5,6 @@ namespace Drupal\webform\Controller;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\HtmlCommand;
use Drupal\Core\Ajax\InvokeCommand;
use Drupal\Core\Controller\ControllerBase;
use Drupal\webform\Ajax\WebformAnnounceCommand;
use Drupal\webform\WebformSubmissionInterface;
......@@ -81,7 +80,7 @@ class WebformSubmissionController extends ControllerBase {
* @return \Drupal\Component\Render\FormattableMarkup
* Sticky icon.
*/
static public function buildSticky(WebformSubmissionInterface $webform_submission) {
public static function buildSticky(WebformSubmissionInterface $webform_submission) {
$t_args = ['@label' => $webform_submission->label()];
$args = [
'@state' => $webform_submission->isSticky() ? 'on' : 'off',
......@@ -99,7 +98,7 @@ class WebformSubmissionController extends ControllerBase {
* @return \Drupal\Component\Render\FormattableMarkup
* Locked icon.
*/
static public function buildLocked(WebformSubmissionInterface $webform_submission) {
public static function buildLocked(WebformSubmissionInterface $webform_submission) {
$t_args = ['@label' => $webform_submission->label()];
$args = [
'@state' => $webform_submission->isLocked() ? 'on' : 'off',
......
......@@ -202,7 +202,7 @@ class WebformLikert extends FormElement {
'data-likert-answers-count' => count($element['#answers']),
],
'#prefix' => '<div class="webform-likert-table-wrapper">',
'#suffix' => '</div>'
'#suffix' => '</div>',
] + $rows;
// Build table element with selected properties.
......
......@@ -391,7 +391,7 @@ class WebformMultiple extends FormElement {
if ($element['#sorting']) {
$header[] = [
'data' => WebformAccessibilityHelper::buildVisuallyHidden(t('Re-order')),
'class' => ["$table_id--handle", "webform-multiple-table--handle"],
'class' => ["$table_id--handle", 'webform-multiple-table--handle'],
];
}
......@@ -400,14 +400,14 @@ class WebformMultiple extends FormElement {
if ($element['#sorting']) {
$header[] = [
'data' => ['#markup' => t('Weight')],
'class' => ["$table_id--weight", "webform-multiple-table--weight"]
'class' => ["$table_id--weight", 'webform-multiple-table--weight'],
];
}
if ($element['#operations']) {
$header[] = [
'data' => WebformAccessibilityHelper::buildVisuallyHidden(t('Operations')),
'class' => ["$table_id--handle", "webform-multiple-table--operations"],
'class' => ["$table_id--handle", 'webform-multiple-table--operations'],
];
}
......
......@@ -222,7 +222,6 @@ class WebformEntitySettingsFormForm extends WebformEntitySettingsBaseForm {
];
}
// Wizard settings.
$form['wizard_settings'] = [
'#type' => 'details',
......
......@@ -323,7 +323,7 @@ class WebformEntitySettingsGeneralForm extends WebformEntitySettingsBaseForm {
'data-dialog-options' => Json::encode([
'width' => 400,
'height' => 400,
])
]),
],
];
$dialog_source = $dialog_link;
......
......@@ -194,7 +194,7 @@ class WebformEntitySettingsSubmissionsForm extends WebformEntitySettingsBaseForm
$form['submission_access_denied']['token_tree_link']['#states'] = [
'visible' => [
':input[name="submission_login"]' => ['checked' => TRUE],
]
],
];
}
......
......@@ -441,7 +441,7 @@ class WebformAdminConfigElementsForm extends WebformAdminConfigBaseForm {
$form['types']['excluded_elements']['#header']['description']['width'] = '50%';
// Add warning to all password elements.
foreach ($form['types']['excluded_elements']['#options'] as $element_type => &$excluded_element_option) {
if (strpos($element_type,'password') !== FALSE) {
if (strpos($element_type, 'password') !== FALSE) {
$excluded_element_option['description'] = [
'data' => [
'description' => ['#markup' => $excluded_element_option['description']],
......
......@@ -352,7 +352,7 @@ trait WebformAjaxFormTrait {
}
/**
* Set announcements
* Set announcements.
*
* @param array $announcements
* An associative array of announcements.
......
......@@ -208,7 +208,7 @@ class WebformResultsCustomForm extends FormBase {
'#default_value' => $format['element_format'],
];
// Submission settings
// Submission settings.
$form['submission'] = [
'#type' => 'details',
'#title' => $this->t('Submission settings'),
......
......@@ -111,7 +111,7 @@ element_key: 'some value'
# Add ':clear' to the end token to return an empty value when the token is missing.
title: '[webform_submission:node:title:clear]'
# The below example uses a token to get a field value from the current node.
full_name: '[webform_submission:node:field_full_name:clear]"
full_name: '[webform_submission:node:field_full_name:clear]",
],
];
......
......@@ -164,7 +164,7 @@ element_key: 'some value'
# Add ':clear' to the end token to return an empty value when the token is missing.
title: '[webform_submission:node:title:clear]'
# The below example uses a token to get a field value from the current node.
full_name: '[webform_submission:node:field_full_name:clear]"
full_name: '[webform_submission:node:field_full_name:clear]",
],
];
$element['settings']['token_tree_link'] = $token_manager->buildTreeElement();
......
......@@ -33,7 +33,6 @@ use Drupal\webform\WebformSubmissionInterface;
*/
class Address extends WebformCompositeBase {
/**
* {@inheritdoc}
*/
......
......@@ -3,7 +3,6 @@
namespace Drupal\webform\Plugin\WebformElement;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Utility\WebformElementHelper;
use Drupal\webform\WebformSubmissionInterface;
/**
......
......@@ -154,7 +154,7 @@ abstract class TextBase extends WebformElementBase {
$form['validation']['counter_container']['#states'] = [
'invisible' => [
':input[name="properties[counter_type]"]' => ['value' => ''],
]
],
];
$form['validation']['counter_container']['counter_minimum'] = [
'#type' => 'number',
......
......@@ -151,7 +151,7 @@ trait WebformTableTrait {
* @param array $option
* A table select option.
*
* @return string|\Drupal\Component\Render\MarkupInterface|NULL
* @return string|\Drupal\Component\Render\MarkupInterface|null
* Table selection option title/text.
*
* @see https://www.drupal.org/project/drupal/issues/2719453
......
......@@ -897,6 +897,7 @@ class WebformElementBase extends PluginBase implements WebformElementInterface {
}
}
}
/**
* Replace Core's composite #pre_render with Webform's composite #pre_render.
*
......
......@@ -508,7 +508,7 @@ class EmailWebformHandler extends WebformHandlerBase implements WebformHandlerMe
if ($format == 'html') {
$form['message']['body_custom_' . $format] = [
'#type' => 'webform_html_editor',
'#format' => $this->configFactory->get('webform.settings')->get('html_editor.mail_format')
'#format' => $this->configFactory->get('webform.settings')->get('html_editor.mail_format'),
];
}
else {
......
......@@ -59,22 +59,6 @@ class QueryStringWebformSourceEntity extends PluginBase implements WebformSource
*/
protected $webformEntityReferenceManager;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('entity_type.manager'),
$container->get('current_route_match'),
$container->get('request_stack'),
$container->get('language_manager'),
$container->get('webform.entity_reference_manager')
);
}
/**
* QueryStringWebformSourceEntity constructor.
*
......@@ -105,6 +89,22 @@ class QueryStringWebformSourceEntity extends PluginBase implements WebformSource
$this->webformEntityReferenceManager = $webform_entity_reference_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('entity_type.manager'),
$container->get('current_route_match'),
$container->get('request_stack'),
$container->get('language_manager'),
$container->get('webform.entity_reference_manager')
);
}
/**
* {@inheritdoc}
*/
......
......@@ -27,18 +27,6 @@ class RouteParametersWebformSourceEntity extends PluginBase implements WebformSo
*/
protected $routeMatch;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('current_route_match')
);
}
/**
* RouteParametersWebformSourceEntity constructor.
*
......@@ -57,6 +45,18 @@ class RouteParametersWebformSourceEntity extends PluginBase implements WebformSo
$this->routeMatch = $route_match;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('current_route_match')
);
}
/**
* {@inheritdoc}
*/
......
......@@ -8,7 +8,7 @@ namespace Drupal\webform\Utility;
class WebformAccessibilityHelper {
/**
* isually hide text using .visually-hidden class.
* Visually hide text using .visually-hidden class.
*
* The .visually-hidden class is used to render invisible content just for
* screen reader users.
......@@ -68,5 +68,5 @@ class WebformAccessibilityHelper {
];
}
}
}
}
......@@ -612,4 +612,3 @@ class WebformElementHelper {
}
}
......@@ -17,7 +17,7 @@ class WebformOptionsHelper {
const DESCRIPTION_DELIMITER = ' -- ';
/**
* Append option value to option text
* Append option value to option text.
*
* @param array $options
* An associative array of options.
......
......@@ -385,7 +385,6 @@ class WebformAddonsManager implements WebformAddonsManagerInterface {
'category' => 'integration',
];
// Mail: Mail System.
$projects['mailsystem'] = [
'title' => $this->t('Mail System'),
......@@ -394,7 +393,6 @@ class WebformAddonsManager implements WebformAddonsManagerInterface {
'category' => 'mail',
];
// Mail: Mail System: SendGrid Integration.
$projects['sendgrid_integration'] = [
'title' => $this->t('SendGrid Integration <em>(requires Mail System)</em>'),
......
......@@ -195,7 +195,7 @@ class WebformEntityReferenceManager implements WebformEntityReferenceManagerInte
return Webform::load($webform_id);
}
elseif ($webforms = $this->getWebforms($entity)) {
return reset($webforms );
return reset($webforms);
}
else {
return NULL;
......
......@@ -267,7 +267,7 @@ class WebformMessageManager implements WebformMessageManagerInterface {
case WebformMessageManagerInterface::SUBMISSION_DEFAULT_CONFIRMATION:
$t_args = ['%form' => ($source_entity) ? $source_entity->label() : $webform->label()];
return $this->t('New submission added to %form.',$t_args);
return $this->t('New submission added to %form.', $t_args);
case WebformMessageManagerInterface::FORM_SAVE_EXCEPTION:
$t_args = [
......
......@@ -337,7 +337,6 @@ class WebformSubmissionForm extends ContentEntityForm {
protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) {
// NOTE: We are not copying form values to the entity because
// webform element keys can override webform submission properties.
/* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */
$webform_submission = $entity;
$webform = $webform_submission->getWebform();
......@@ -948,10 +947,10 @@ class WebformSubmissionForm extends ContentEntityForm {
],
];
if ($this->getWebformSetting('wizard_progress_link')) {
$element ['#attributes']['data-wizard-progress-link'] = 'true';
$element['#attributes']['data-wizard-progress-link'] = 'true';
}
if ($this->getWebformSetting('wizard_preview_link')) {
$element ['#attributes']['data-wizard-preview-link'] = 'true';
$element['#attributes']['data-wizard-preview-link'] = 'true';
}
$index = 1;
......
......@@ -334,7 +334,7 @@ interface WebformSubmissionInterface extends ContentEntityInterface, EntityOwner
/**
* Gets the webform submission's source entity.
*
* @param boolean $translate
* @param bool $translate
* (optional) If TRUE the source entity will be translated.
*
* @return \Drupal\Core\Entity\EntityInterface|null
......
......@@ -88,7 +88,7 @@ class WebformTranslationManager implements WebformTranslationManagerInterface {
$route_name = $this->routeMatch->getRouteName();
// Don't initialize translation on webform CRUD routes.
if (preg_match ('/^entity\.webform\.(?:edit_form|duplicate_form|delete_form)$/', $route_name)) {
if (preg_match('/^entity\.webform\.(?:edit_form|duplicate_form|delete_form)$/', $route_name)) {
return TRUE;
}
......
......@@ -10,10 +10,8 @@ interface WebformTranslationManagerInterface {
/**
* Determine if the translated webform should be displayed.
*
* @param \Drupal\webform\WebformInterface $webform
*
* @return bool
* TRUE if the translated webform should be displaye.
* TRUE if the translated webform should be displayed.
*/
public function isAdminRoute();
......
......@@ -5,7 +5,6 @@
* Support module for webform related testing.
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Serialization\Yaml;
use Drupal\Core\Url;
use Drupal\webform\Utility\WebformElementHelper;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment