From b28c7579b18dbbdefe18565a866a60f358658577 Mon Sep 17 00:00:00 2001 From: Michael Lee <lee.5151@osu.edu> Date: Wed, 8 Dec 2021 14:01:17 -0500 Subject: [PATCH] update webform 9.1.0 => 9.1.2 --- composer.lock | 14 +- vendor/composer/installed.json | 16 +- vendor/composer/installed.php | 10 +- web/modules/webform/.tugboat/config.yml | 51 ++++ web/modules/webform/README.md | 2 +- web/modules/webform/composer.libraries.json | 16 +- web/modules/webform/cspell/dictionary.txt | 37 +++ web/modules/webform/css/webform.admin.css | 2 +- web/modules/webform/css/webform.ajax.css | 2 +- .../webform/css/webform.element.color.css | 6 + .../css/webform.element.details.toggle.css | 2 +- .../css/webform.element.excluded_elements.css | 11 + .../webform/css/webform.element.flexbox.css | 22 +- .../webform/css/webform.element.likert.css | 2 +- .../webform/css/webform.element.multiple.css | 17 +- .../webform/css/webform.element.scale.css | 36 +-- web/modules/webform/css/webform.form.css | 2 +- web/modules/webform/css/webform.form.tabs.css | 2 +- .../webform/css/webform.help.support.css | 40 +-- .../webform/css/webform.progress.tracker.css | 4 + .../webform/css/webform.theme.claro.css | 8 +- web/modules/webform/css/webform.theme.gin.css | 4 +- .../webform/css/webform.theme.olivero.css | 41 +++ .../webform/css/webform.theme.seven.css | 2 +- web/modules/webform/docs/RELEASE-NOTES.md | 95 ++---- web/modules/webform/docs/UPDATE-LIBRARIES.md | 14 +- web/modules/webform/drush/webform.drush.inc | 56 ++-- web/modules/webform/includes/webform.date.inc | 4 +- .../webform/includes/webform.editor.inc | 24 +- .../webform/includes/webform.form_alter.inc | 16 +- .../includes/webform.install.requirements.inc | 32 +-- .../includes/webform.install.update.inc | 270 +++++++++--------- .../webform/includes/webform.libraries.inc | 2 +- .../webform/includes/webform.theme.inc | 83 ++++-- .../includes/webform.theme.template.inc | 44 +-- .../webform/includes/webform.translation.inc | 9 +- web/modules/webform/js/webform.contextual.js | 1 + .../webform/js/webform.element.color.js | 6 +- .../webform/js/webform.element.date.js | 4 +- .../js/webform.element.excluded_elements.js | 39 +++ .../webform/js/webform.element.likert.js | 1 - .../js/webform.element.location.places.js | 1 - .../js/webform.element.options.admin.js | 2 - .../webform/js/webform.element.options.js | 1 - .../webform/js/webform.element.select.js | 1 - .../webform/js/webform.element.select2.js | 1 - web/modules/webform/js/webform.filter.js | 3 +- web/modules/webform/js/webform.states.js | 1 - .../src/Entity/WebformAccessGroup.php | 8 +- .../src/WebformAccessGroupInterface.php | 8 +- .../src/WebformAccessGroupListBuilder.php | 9 +- .../src/WebformAccessGroupStorage.php | 10 +- .../Functional/WebformAccessTokensTest.php | 8 +- .../webform_access/webform_access.info.yml | 6 +- .../webform_access/webform_access.module | 20 +- .../webform_access/webform_access.tokens.inc | 8 +- .../WebformAttachmentController.php | 2 +- .../src/Element/WebformAttachmentBase.php | 4 +- .../WebformElement/WebformAttachmentBase.php | 4 +- .../WebformElement/WebformAttachmentToken.php | 2 +- .../WebformElement/WebformAttachmentTwig.php | 2 +- .../WebformElement/WebformAttachmentUrl.php | 2 +- .../webform_attachment_test.info.yml | 6 +- .../src/Functional/WebformAttachmentTest.php | 28 +- .../webform_attachment.info.yml | 6 +- .../webform_bootstrap_test_module.info.yml | 6 +- .../src/Plugin/Preprocess/Region.php | 1 + .../webform_bootstrap_test_theme.info.yml | 6 +- .../webform_bootstrap.info.yml | 6 +- .../webform_bootstrap.module | 7 +- .../src/Plugin/WebformElement/WebformCard.php | 2 +- .../webform_cards_test.info.yml | 6 +- .../WebformCardsAjaxJavaScriptTest.php | 4 +- .../WebformCardsAutoForwardJavaScriptTest.php | 4 +- .../WebformCardsDraftJavaScriptTest.php | 2 +- .../WebformCardsProgressJavaScriptTest.php | 16 +- .../WebformCardsStatesJavaScriptTest.php | 2 +- .../WebformCardsToggleJavaScriptTest.php | 2 +- .../WebformCardsUiJavaScriptTest.php | 2 +- .../WebformCardsValidationJavaScriptTest.php | 2 +- .../webform_cards/webform_cards.info.yml | 6 +- .../webform_cards/webform_cards.module | 30 +- ...ebform_clientside_validation_test.info.yml | 6 +- ...formClientSideValidationJavaScriptTest.php | 8 +- .../webform_clientside_validation.info.yml | 6 +- ...bform_demo_application_evaluation.info.yml | 6 +- .../webform_demo_event_registration.info.yml | 6 +- .../webform_demo_group.info.yml | 6 +- .../webform_demo_group.install | 4 +- .../webform_demo_region_contact.info.yml | 6 +- .../src/Commands/WebformDevelCommands.php | 2 + .../WebformDevelEntityFormApiBaseForm.php | 6 +- .../WebformDevelEntityFormApiExportForm.php | 6 +- .../WebformDevelEntityFormApiTestForm.php | 4 +- .../Form/WebformDevelSubmissionApiForm.php | 2 +- .../webform_devel/src/WebformDevelSchema.php | 3 +- .../webform_devel/webform_devel.drush.inc | 4 +- .../webform_devel/webform_devel.info.yml | 6 +- .../WebformEntityPrintWebformExporter.php | 4 +- .../webform_entity_print_test.info.yml | 6 +- .../WebformEntityPrintFunctionalTest.php | 12 +- .../webform_entity_print.info.yml | 6 +- .../webform_entity_print.module | 4 +- .../webform_entity_print.webform.inc | 4 +- .../Element/WebformEntityPrintAttachment.php | 4 +- .../WebformEntityPrintAttachment.php | 7 +- ...form_entity_print_attachment_test.info.yml | 6 +- ...ormEntityPrintAttachmentFunctionalTest.php | 2 +- .../webform_entity_print_attachment.info.yml | 6 +- .../css/webform_example_composite.css | 6 - .../webform_example_composite.info.yml | 6 +- .../WebformExampleCustomFormSettingsForm.php | 3 + .../webform_example_custom_form.info.yml | 6 +- .../WebformElement/WebformExampleElement.php | 2 +- .../webform_example_element.info.yml | 6 +- ...ebform_example_element_properties.info.yml | 6 +- .../webform_example_handler.info.yml | 6 +- .../webform_example_remote_post.info.yml | 6 +- .../webform_example_variant.info.yml | 6 +- .../webform_examples.info.yml | 6 +- .../webform_examples_accessibility.info.yml | 6 +- .../webform_examples_accessibility.module | 16 +- .../webform_group/src/WebformGroupManager.php | 6 +- .../webform_group_test.info.yml | 6 +- .../WebformGroupElementAccessTest.php | 8 +- .../Functional/WebformGroupFormAccessTest.php | 8 +- .../WebformGroupRolesElementTest.php | 2 +- .../src/Functional/WebformGroupTokensTest.php | 4 +- .../WebformGroupUserInterfaceTest.php | 12 +- .../webform_group/webform_group.info.yml | 6 +- .../webform_group/webform_group.module | 12 +- .../webform_group/webform_group.tokens.inc | 4 +- .../js/webform_icheck.element.js | 1 - .../webform_icheck_test.info.yml | 6 +- .../webform_icheck/webform_icheck.info.yml | 6 +- .../webform_icheck/webform_icheck.module | 2 +- .../src/Element/WebformImageSelect.php | 2 +- .../src/Element/WebformImageSelectImages.php | 6 +- .../WebformElement/WebformImageSelect.php | 2 +- .../src/WebformImageSelectImagesStorage.php | 2 +- .../webform_image_select_test.info.yml | 6 +- .../WebformImageSelectElementTest.php | 2 +- .../WebformImageSelectImagesTest.php | 2 +- .../webform_image_select.info.yml | 6 +- .../webform_jqueryui_buttons_test.info.yml | 6 +- .../webform_jqueryui_buttons.info.yml | 6 +- .../WebformLocationGeocomplete.php | 4 +- ...webform_location_geocomplete_test.info.yml | 6 +- .../webform_location_geocomplete.info.yml | 6 +- .../src/Access/WebformNodeAccess.php | 2 +- .../webform_node_test_multiple.info.yml | 6 +- .../webform_node_test_translation.info.yml | 6 +- .../webform_node_test_translation.install | 4 +- .../Access/WebformNodeAccessClosedTest.php | 3 +- .../WebformNodeAccessPermissionsTest.php | 16 +- .../Access/WebformNodeAccessRulesTest.php | 2 +- .../WebformNodeEntityReferenceTest.php | 8 +- .../src/Functional/WebformNodeResultsTest.php | 2 +- .../tests/src/Functional/WebformNodeTest.php | 30 +- .../src/Functional/WebformNodeVariantTest.php | 2 +- .../webform_node/webform_node.info.yml | 6 +- .../src/Element/WebformOptionsCustom.php | 8 +- .../src/Entity/WebformOptionsCustom.php | 6 +- .../WebformOptionsCustomDeriverBase.php | 2 +- .../WebformElement/WebformOptionsCustom.php | 10 +- .../WebformOptionsCustomEntity.php | 2 +- .../src/WebformOptionsCustomStorage.php | 2 +- ...ebform_options_custom_entity_test.info.yml | 6 +- .../webform_options_custom_test.info.yml | 6 +- .../Functional/WebformOptionsCustomTest.php | 12 +- .../webform_options_custom.info.yml | 6 +- .../OptionsLimitWebformHandler.php | 44 ++- .../webform_options_limit_test.info.yml | 6 +- .../webform_options_limit.info.yml | 6 +- .../drush/webform_scheduled_email.drush.inc | 6 +- .../WebformScheduledEmailCommands.php | 3 + .../src/WebformScheduledEmailManager.php | 28 +- .../WebformScheduledEmailManagerInterface.php | 34 +-- .../webform_scheduled_email_test.info.yml | 6 +- ..._scheduled_email_test_translation.info.yml | 6 +- .../Functional/WebformScheduledEmailTest.php | 35 +-- .../WebformScheduledEmailTranslationTest.php | 2 +- .../webform_scheduled_email.info.yml | 6 +- .../src/Functional/WebformShareNodeTest.php | 2 +- .../tests/src/Functional/WebformShareTest.php | 2 +- .../Functional/WebformShareVariantTest.php | 2 +- .../webform_share/webform_share.info.yml | 6 +- .../webform_share/webform_share.module | 4 +- .../webform_shortcuts.info.yml | 6 +- .../webform_shortcuts.module | 2 + ...ebformSubmissionExportImportUploadForm.php | 20 +- ...mSubmissionExportImportWebformExporter.php | 2 +- .../WebformSubmissionExportImportImporter.php | 34 +-- ...ubmissionExportImportImporterInterface.php | 20 +- ...orm_submission_export_import_test.info.yml | 6 +- ...bform_submission_export_import_test.module | 3 +- ...rmSubmissionImportExportFunctionalTest.php | 9 +- .../webform_submission_export_import.info.yml | 6 +- .../webform_submission_export_import.module | 25 +- .../WebformSubmissionLogNodeTest.php | 2 +- .../Functional/WebformSubmissionLogTest.php | 6 +- .../webform_submission_log.info.yml | 6 +- .../Controller/WebformTemplatesController.php | 2 +- .../webform_templates.info.yml | 6 +- .../Plugin/WebformElement/WebformToggle.php | 2 +- .../Plugin/WebformElement/WebformToggles.php | 2 +- .../webform_toggles_test.info.yml | 6 +- .../webform_toggles/webform_toggles.info.yml | 6 +- .../modules/webform_ui/js/webform_ui.js | 2 - .../src/Form/WebformUiElementDeleteForm.php | 12 +- .../src/Form/WebformUiElementFormBase.php | 8 +- .../src/Form/WebformUiElementTypeFormBase.php | 12 +- .../src/WebformUiEntityElementsForm.php | 44 +-- .../WebformUiElementDefaultValueTest.php | 12 +- .../src/Functional/WebformUiElementTest.php | 54 ++-- .../WebformUiElementJavaScriptTest.php | 4 +- .../modules/webform_ui/webform_ui.info.yml | 6 +- web/modules/webform/phpcs.xml.dist | 43 +++ .../text/example_accessibility_advanced.txt | 62 +--- .../src/Cache/WebformBubbleableMetadata.php | 2 +- .../src/Commands/WebformCliService.php | 57 ++-- .../Commands/WebformCliServiceInterface.php | 1 + .../webform/src/Commands/WebformCommands.php | 58 ++-- .../src/Commands/WebformCommandsBase.php | 1 + .../WebformSanitizeSubmissionsCommands.php | 4 + .../Controller/WebformAddonsController.php | 30 +- .../Controller/WebformEntityController.php | 20 +- .../WebformPluginElementController.php | 4 +- .../WebformResultsExportController.php | 12 +- .../src/Controller/WebformTestController.php | 4 +- web/modules/webform/src/Element/Webform.php | 4 +- .../webform/src/Element/WebformActions.php | 7 +- .../src/Element/WebformAutocomplete.php | 1 + .../src/Element/WebformCheckboxValue.php | 1 + .../webform/src/Element/WebformCodeMirror.php | 6 +- .../src/Element/WebformCompositeBase.php | 4 +- .../WebformCompositeFormElementTrait.php | 2 +- .../src/Element/WebformComputedBase.php | 14 +- .../src/Element/WebformElementAttributes.php | 2 +- .../src/Element/WebformElementComposite.php | 4 +- .../src/Element/WebformElementStates.php | 15 +- .../src/Element/WebformEmailConfirm.php | 4 +- .../src/Element/WebformEntityTrait.php | 23 +- .../src/Element/WebformExcludedColumns.php | 4 +- .../src/Element/WebformExcludedElements.php | 96 +++++-- .../webform/src/Element/WebformHeight.php | 24 +- .../webform/src/Element/WebformHtmlEditor.php | 4 +- .../webform/src/Element/WebformLikert.php | 8 +- .../src/Element/WebformManagedFileBase.php | 2 +- .../webform/src/Element/WebformMapping.php | 4 +- .../webform/src/Element/WebformMessage.php | 7 +- .../webform/src/Element/WebformMultiple.php | 12 +- .../webform/src/Element/WebformOptions.php | 10 +- .../webform/src/Element/WebformOtherBase.php | 6 +- .../webform/src/Element/WebformScale.php | 4 +- .../webform/src/Element/WebformSignature.php | 2 +- .../src/Element/WebformSubmissionViews.php | 20 +- .../src/Element/WebformTableSelectSort.php | 2 +- web/modules/webform/src/Entity/Webform.php | 87 +++--- .../webform/src/Entity/WebformSubmission.php | 4 +- .../WebformEntitySettingsAssetsForm.php | 2 +- .../WebformEntitySettingsConfirmationForm.php | 3 +- .../WebformEntitySettingsFormForm.php | 5 +- .../WebformEntitySettingsGeneralForm.php | 5 + .../WebformEntitySettingsSubmissionsForm.php | 1 + .../WebformEntityStorageTrait.php | 1 + .../WebformAdminConfigBaseForm.php | 28 +- .../WebformAdminConfigElementsForm.php | 4 +- .../WebformAdminConfigFormsForm.php | 2 + .../WebformAdminConfigLibrariesForm.php | 6 +- .../WebformAdminConfigSubmissionsForm.php | 2 +- .../webform/src/Form/WebformAjaxFormTrait.php | 6 +- .../webform/src/Form/WebformBulkFormBase.php | 4 +- .../Form/WebformDeleteMultipleFormBase.php | 5 +- .../src/Form/WebformDialogFormTrait.php | 4 +- .../src/Form/WebformEntityBulkForm.php | 2 +- .../Form/WebformEntityDeleteMultipleForm.php | 2 +- .../src/Form/WebformHandlerDeleteForm.php | 4 +- .../src/Form/WebformResultsCustomForm.php | 14 +- .../src/Form/WebformSubmissionDeleteForm.php | 2 +- .../src/Form/WebformSubmissionResendForm.php | 8 +- .../Form/WebformSubmissionsDeleteFormBase.php | 8 +- .../src/Form/WebformVariantApplyForm.php | 4 +- .../src/Form/WebformVariantDeleteForm.php | 4 +- .../src/Form/WebformVariantFormBase.php | 4 +- .../Action/WebformEntityDeleteAction.php | 2 +- .../Action/WebformSubmissionDeleteAction.php | 2 +- .../Block/WebformSubmissionLimitBlock.php | 12 +- .../WebformSubmissionDevelGenerateTrait.php | 4 +- .../WebformEntityReferenceLinkFormatter.php | 4 +- ...bformEntityReferenceAutocompleteWidget.php | 2 +- .../WebformEntityReferenceSelectWidget.php | 2 +- .../LocalAction/WebformDialogLocalAction.php | 2 +- .../src/Plugin/WebformElement/Address.php | 13 +- .../src/Plugin/WebformElement/BooleanBase.php | 2 +- .../src/Plugin/WebformElement/Captcha.php | 2 +- .../src/Plugin/WebformElement/Checkbox.php | 2 +- .../src/Plugin/WebformElement/Checkboxes.php | 4 +- .../src/Plugin/WebformElement/Color.php | 4 +- .../Plugin/WebformElement/ContainerBase.php | 4 +- .../src/Plugin/WebformElement/Date.php | 4 +- .../src/Plugin/WebformElement/DateBase.php | 24 +- .../src/Plugin/WebformElement/DateList.php | 4 +- .../src/Plugin/WebformElement/DateTime.php | 4 +- .../src/Plugin/WebformElement/Details.php | 2 +- .../src/Plugin/WebformElement/Email.php | 2 +- .../WebformElement/EntityAutocomplete.php | 2 +- .../src/Plugin/WebformElement/Fieldset.php | 2 +- .../src/Plugin/WebformElement/Hidden.php | 2 +- .../src/Plugin/WebformElement/Item.php | 2 +- .../src/Plugin/WebformElement/Label.php | 2 +- .../Plugin/WebformElement/LanguageSelect.php | 2 +- .../src/Plugin/WebformElement/MachineName.php | 2 +- .../src/Plugin/WebformElement/Number.php | 2 +- .../src/Plugin/WebformElement/NumericBase.php | 2 +- .../src/Plugin/WebformElement/OptionsBase.php | 16 +- .../Plugin/WebformElement/PasswordConfirm.php | 2 +- .../Plugin/WebformElement/ProcessedText.php | 2 +- .../src/Plugin/WebformElement/Radios.php | 2 +- .../src/Plugin/WebformElement/Range.php | 4 +- .../src/Plugin/WebformElement/Select.php | 2 +- .../src/Plugin/WebformElement/Table.php | 2 +- .../src/Plugin/WebformElement/TableSelect.php | 2 +- .../src/Plugin/WebformElement/Telephone.php | 26 +- .../src/Plugin/WebformElement/TextBase.php | 6 +- .../src/Plugin/WebformElement/TextField.php | 2 +- .../src/Plugin/WebformElement/TextFormat.php | 10 +- .../src/Plugin/WebformElement/Textarea.php | 2 +- .../webform/src/Plugin/WebformElement/Url.php | 2 +- .../src/Plugin/WebformElement/Value.php | 2 +- .../Plugin/WebformElement/VerticalTabs.php | 2 +- .../src/Plugin/WebformElement/View.php | 2 +- .../Plugin/WebformElement/WebformActions.php | 2 +- .../WebformElement/WebformAutocomplete.php | 2 +- .../WebformElement/WebformCheckboxesOther.php | 2 +- .../WebformElement/WebformCodeMirror.php | 10 +- .../WebformElement/WebformCompositeBase.php | 78 ++--- .../WebformElement/WebformComputedBase.php | 2 +- .../WebformElement/WebformComputedTwig.php | 2 +- .../WebformElement/WebformCustomComposite.php | 12 +- .../WebformElement/WebformDisplayOnTrait.php | 2 +- .../Plugin/WebformElement/WebformElement.php | 2 +- .../WebformElement/WebformEmailConfirm.php | 2 +- .../WebformElement/WebformEmailMultiple.php | 2 +- .../WebformEntityOptionsTrait.php | 2 +- .../WebformEntityReferenceTrait.php | 18 +- .../Plugin/WebformElement/WebformFlexbox.php | 2 +- .../WebformElement/WebformHorizontalRule.php | 2 +- .../WebformElement/WebformImageFile.php | 4 +- .../Plugin/WebformElement/WebformLikert.php | 24 +- .../src/Plugin/WebformElement/WebformLink.php | 2 +- .../WebformElement/WebformLocationBase.php | 6 +- .../WebformElement/WebformLocationPlaces.php | 2 +- .../WebformElement/WebformManagedFileBase.php | 13 +- .../Plugin/WebformElement/WebformMapping.php | 24 +- .../Plugin/WebformElement/WebformMarkup.php | 2 +- .../WebformElement/WebformMarkupBase.php | 2 +- .../Plugin/WebformElement/WebformMessage.php | 2 +- .../src/Plugin/WebformElement/WebformMore.php | 2 +- .../Plugin/WebformElement/WebformRating.php | 2 +- .../src/Plugin/WebformElement/WebformSame.php | 2 +- .../Plugin/WebformElement/WebformSection.php | 2 +- .../WebformElement/WebformSignature.php | 6 +- .../Plugin/WebformElement/WebformTable.php | 4 +- .../Plugin/WebformElement/WebformTableRow.php | 9 +- .../WebformElement/WebformTableSelectSort.php | 2 +- .../WebformElement/WebformTableSort.php | 2 +- .../WebformElement/WebformTableTrait.php | 6 +- .../WebformElement/WebformTelephone.php | 2 +- .../WebformElement/WebformTermCheckboxes.php | 2 +- .../WebformElement/WebformTermSelect.php | 2 +- .../WebformElement/WebformTermsOfService.php | 2 +- .../src/Plugin/WebformElement/WebformTime.php | 4 +- .../Plugin/WebformElement/WebformVariant.php | 2 +- .../WebformElement/WebformWizardPage.php | 3 +- .../WebformElementAttachmentInterface.php | 2 +- .../webform/src/Plugin/WebformElementBase.php | 106 +++---- .../src/Plugin/WebformElementInterface.php | 48 ++-- .../src/Plugin/WebformElementManager.php | 6 +- .../TabularBaseWebformExporter.php | 12 +- .../src/Plugin/WebformExporterBase.php | 6 +- .../src/Plugin/WebformExporterManager.php | 2 +- .../WebformHandler/ActionWebformHandler.php | 6 +- .../WebformHandler/DebugWebformHandler.php | 5 - .../WebformHandler/EmailWebformHandler.php | 9 +- .../RemotePostWebformHandler.php | 8 +- .../WebformHandler/SettingsWebformHandler.php | 10 +- .../webform/src/Plugin/WebformHandlerBase.php | 43 ++- .../src/Plugin/WebformHandlerInterface.php | 28 +- .../src/Plugin/WebformHandlerManager.php | 2 +- .../Plugin/WebformPluginSettingsInterface.php | 2 +- .../src/Plugin/WebformPluginSettingsTrait.php | 2 +- .../src/Plugin/WebformSourceEntityManager.php | 1 + .../WebformVariant/OverrideWebformVariant.php | 4 +- .../src/Plugin/WebformVariantInterface.php | 4 +- .../src/Plugin/WebformVariantManager.php | 2 +- .../webform/src/Twig/WebformTwigExtension.php | 9 +- .../webform/src/Utility/WebformDateHelper.php | 4 +- .../src/Utility/WebformDialogHelper.php | 5 +- .../src/Utility/WebformElementHelper.php | 29 +- .../src/Utility/WebformLogicHelper.php | 2 +- .../src/Utility/WebformOptionsHelper.php | 4 +- .../webform/src/Utility/WebformYaml.php | 4 +- .../webform/src/WebformAccessRulesManager.php | 8 +- .../WebformAccessRulesManagerInterface.php | 8 +- .../webform/src/WebformAddonsManager.php | 140 ++++++--- .../src/WebformEntityAccessControlHandler.php | 4 +- .../webform/src/WebformEntityAddForm.php | 7 +- .../src/WebformEntityConditionsManager.php | 4 +- .../webform/src/WebformEntityElementsForm.php | 4 +- .../src/WebformEntityElementsValidator.php | 6 +- .../webform/src/WebformEntityListBuilder.php | 80 +++++- .../src/WebformEntityReferenceManager.php | 18 +- ...WebformEntityReferenceManagerInterface.php | 12 +- .../webform/src/WebformEntityStorage.php | 66 ++++- .../src/WebformEntityStorageInterface.php | 5 + .../webform/src/WebformEntityViewBuilder.php | 2 +- .../webform/src/WebformHelpManager.php | 115 ++++---- web/modules/webform/src/WebformInterface.php | 33 ++- .../webform/src/WebformLibrariesManager.php | 26 +- .../src/WebformLibrariesManagerInterface.php | 4 +- .../src/WebformMessageManagerInterface.php | 12 +- .../webform/src/WebformOptionsForm.php | 2 +- .../webform/src/WebformOptionsStorage.php | 4 +- web/modules/webform/src/WebformRequest.php | 8 +- .../WebformSubmissionConditionsValidator.php | 56 ++-- .../webform/src/WebformSubmissionExporter.php | 23 +- .../webform/src/WebformSubmissionForm.php | 158 ++++++---- .../webform/src/WebformSubmissionGenerate.php | 2 +- .../src/WebformSubmissionListBuilder.php | 40 +-- .../src/WebformSubmissionNotesForm.php | 6 +- .../webform/src/WebformSubmissionStorage.php | 54 ++-- .../src/WebformSubmissionStorageInterface.php | 44 +-- .../src/WebformSubmissionViewBuilder.php | 2 +- .../src/WebformSubmissionViewsData.php | 2 +- .../src/WebformThirdPartySettingsManager.php | 2 +- .../webform/src/WebformTokenManager.php | 16 +- .../src/WebformTranslationConfigManager.php | 85 +++--- ...bformTranslationConfigManagerInterface.php | 12 +- .../src/WebformTranslationLingotekManager.php | 6 +- ...ormTranslationLingotekManagerInterface.php | 10 +- .../webform/src/WebformTranslationManager.php | 6 +- .../templates/webform-access-denied.html.twig | 15 + ...webform.test_element_excluded_elements.yml | 12 +- .../webform.webform.test_element_help.yml | 5 +- .../webform.webform.test_form_autofill.yml | 25 +- .../webform_test.test_element_format.inc | 4 +- .../includes/webform_test.test_states.inc | 4 +- .../webform_test/webform_test.info.yml | 6 +- .../modules/webform_test/webform_test.module | 11 +- .../webform_test_ajax.info.yml | 6 +- .../webform_test_alter_hooks.info.yml | 6 +- .../webform_test_alter_hooks.module | 8 +- .../webform_test_block_context.info.yml | 6 +- .../webform_test_block_custom.info.yml | 6 +- ...bform_test_block_submission_limit.info.yml | 6 +- .../webform_test_config_performance.info.yml | 6 +- .../WebformTestEditorialController.php | 30 +- .../webform_test_editorial.info.yml | 6 +- .../webform_test_element.info.yml | 6 +- .../webform_test_element_input_masks.info.yml | 6 +- ...bform_test_entity_reference_views.info.yml | 6 +- .../webform_test_exporter.info.yml | 6 +- .../TestEntityMappingWebformHandler.php | 14 +- .../webform_test_handler.info.yml | 6 +- ...webform_test_handler_invoke_alter.info.yml | 6 +- .../WebformTestHandlerRemotePostClient.php | 4 +- .../webform_test_handler_remote_post.info.yml | 6 +- .../webform_test_markup.info.yml | 6 +- .../webform_test_message_custom.info.yml | 6 +- .../webform_test_options.info.yml | 6 +- .../webform_test_paragraphs.info.yml | 6 +- .../webform_test_rest.info.yml | 6 +- .../webform_test_states.info.yml | 6 +- .../webform_test_submissions.info.yml | 6 +- ...webform_test_third_party_settings.info.yml | 6 +- ...form_test_third_party_settings.webform.inc | 1 + .../webform_test_translation.info.yml | 6 +- .../webform_test_translation.install | 2 +- ...webform_test_translation_lingotek.info.yml | 6 +- .../webform_test_validate.info.yml | 6 +- .../WebformVariant/TestWebformVariant.php | 4 +- .../webform_test_variant.info.yml | 6 +- .../webform_test_views.info.yml | 6 +- .../webform_test_wizard_custom.info.yml | 6 +- .../Access/WebformAccessEntityJsonApiTest.php | 2 +- .../WebformAccessEntityPermissionsTest.php | 2 +- .../Access/WebformAccessEntityRestTest.php | 2 +- .../Access/WebformAccessEntityRulesTest.php | 20 +- ...WebformAccessSubmissionPermissionsTest.php | 20 +- .../src/Functional/Block/WebformBlockTest.php | 10 +- .../src/Functional/Cache/WebformCacheTest.php | 12 +- .../WebformCompositeCustomFileTest.php | 2 +- .../Composite/WebformCompositeFormatTest.php | 8 +- .../WebformCompositePluginFileTest.php | 8 +- .../Composite/WebformCompositeTest.php | 2 +- .../Element/WebformElementAccessTest.php | 2 +- .../Element/WebformElementActionsTest.php | 8 +- .../Element/WebformElementAddressTest.php | 12 +- .../Element/WebformElementCodeMirrorTest.php | 24 +- .../Element/WebformElementCompositeTest.php | 16 +- .../Element/WebformElementDateTest.php | 8 +- .../WebformElementEntityAutocompleteTest.php | 3 +- .../WebformElementExcludedElementsTest.php | 11 +- .../Element/WebformElementFieldsetTest.php | 2 +- .../WebformElementFormatCustomTest.php | 13 +- .../Element/WebformElementFormatTest.php | 36 ++- .../WebformElementManagedFilePrivateTest.php | 2 +- .../WebformElementManagedFilePublicTest.php | 4 +- .../Element/WebformElementManagedFileTest.php | 26 +- .../Element/WebformElementMediaFileTest.php | 7 +- .../Element/WebformElementMultipleTest.php | 20 +- .../Element/WebformElementOtherTest.php | 46 +-- .../WebformElementPluginDefinitionsTest.php | 33 ++- .../Element/WebformElementPluginTest.php | 8 +- .../Element/WebformElementPrivateTest.php | 2 +- .../Element/WebformElementSameTest.php | 2 +- .../Element/WebformElementSignatureTest.php | 8 +- .../Element/WebformElementStatesTest.php | 20 +- .../WebformElementTableSelectSortTest.php | 12 +- .../Element/WebformElementTableTest.php | 12 +- .../WebformElementTermReferenceTest.php | 12 +- .../Element/WebformElementTextFormatTest.php | 4 +- .../src/Functional/Field/WebformFieldTest.php | 2 +- .../WebformHandlerEmailAdvancedTest.php | 9 +- .../Handler/WebformHandlerEmailBasicTest.php | 2 +- .../Handler/WebformHandlerEmailStatesTest.php | 4 +- .../Handler/WebformHandlerRemotePostTest.php | 26 +- .../Functional/Handler/WebformHandlerTest.php | 12 +- .../WebformSettingsAccessDeniedTest.php | 49 ++-- .../Settings/WebformSettingsAutofillTest.php | 73 ++++- .../Settings/WebformSettingsBehaviorsTest.php | 40 +-- .../WebformSettingsConfidentialTest.php | 2 +- .../WebformSettingsConfirmationTest.php | 24 +- .../Settings/WebformSettingsDraftTest.php | 24 +- .../Settings/WebformSettingsFormTitleTest.php | 2 +- .../WebformSettingsLimitUniqueTest.php | 16 +- .../Settings/WebformSettingsLimitsTest.php | 6 +- .../Settings/WebformSettingsPathTest.php | 19 +- .../WebformSettingsPrepopulateTest.php | 12 +- .../Settings/WebformSettingsPreviousTest.php | 10 +- .../Settings/WebformSettingsScheduleTest.php | 8 +- .../States/WebformStatesHiddenTest.php | 2 +- .../States/WebformStatesServerTest.php | 107 +++---- .../States/WebformStatesWizardTest.php | 4 +- .../Variant/WebformVariantElementTest.php | 2 +- .../Functional/Variant/WebformVariantTest.php | 4 +- .../Views/WebformViewsBulkFormTest.php | 2 +- .../src/Functional/WebformBlockCacheTest.php | 2 + .../src/Functional/WebformBrowserTestBase.php | 2 + .../src/Functional/WebformEditorTest.php | 5 +- .../Functional/WebformEmailProviderTest.php | 8 +- .../WebformEntityTranslationTest.php | 10 +- .../tests/src/Functional/WebformHelpTest.php | 8 +- .../src/Functional/WebformLibrariesTest.php | 15 +- .../src/Functional/WebformListBuilderTest.php | 16 +- .../src/Functional/WebformOptionsTest.php | 2 +- .../src/Functional/WebformRenderingTest.php | 12 +- .../Functional/WebformResultsDisabledTest.php | 16 +- .../WebformResultsExportOptionsTest.php | 2 +- .../Functional/WebformSubmissionApiTest.php | 12 +- .../WebformSubmissionGenerateTest.php | 8 +- ...ubmissionListBuilderBulkOperationsTest.php | 22 +- ...formSubmissionListBuilderCustomizeTest.php | 16 +- .../WebformSubmissionListBuilderTest.php | 2 +- .../src/Functional/WebformSubmissionTest.php | 4 +- .../WebformSubmissionTokenOperationsTest.php | 19 +- .../Functional/WebformSubmissionViewTest.php | 2 +- .../Functional/WebformSubmissionViewsTest.php | 8 +- .../WebformThirdPartySettingsTest.php | 2 +- .../Wizard/WebformWizardValidateTest.php | 8 +- ...WebformElementCheckboxesJavaScriptTest.php | 3 +- .../WebformElementComputedJavaScriptTest.php | 2 +- .../WebformElementSignatureJavaScriptTest.php | 2 +- .../WebformSettingsAjaxJavaScriptTest.php | 28 +- .../WebformStatesCustomJavaScriptTest.php | 28 +- .../WebformStatesRequiredJavaScriptTest.php | 3 +- .../WebformFilterJavaScriptTest.php | 2 +- ...ormSubmissionListBuilderJavaScriptTest.php | 2 +- .../WebformWizardBasicJavaScriptTest.php | 4 +- .../WebformBreadcrumbBuilderTest.php | 8 +- .../src/Kernel/Entity/WebformEntityTest.php | 28 +- .../WebformEntityElementsValidationTest.php | 3 +- .../Kernel/WebformSubmissionStorageTest.php | 2 + .../src/Traits/WebformAssertLegacyTrait.php | 1 + .../src/Traits/WebformBrowserTestTrait.php | 40 +-- .../Unit/Access/WebformAccountAccessTest.php | 2 +- .../Access/WebformSourceEntityAccessTest.php | 2 +- .../Access/WebformSubmissionAccessTest.php | 2 +- .../Cache/WebformBubbleableMetadataTest.php | 10 +- .../Unit/Plugin/Block/WebformBlockTest.php | 5 - .../QueryStringWebformSourceEntityTest.php | 6 +- ...RouteParametersWebformSourceEntityTest.php | 2 +- .../field/WebformSubmissionBulkFormTest.php | 1 + .../Unit/Utility/WebformHtmlHelperTest.php | 4 +- .../WebformEntityAccessControlHandlerTest.php | 40 +-- .../src/Unit/WebformMessageManagerTest.php | 4 +- .../webform_test_bartik.info.yml | 6 +- .../third_party_settings/webform.captcha.inc | 6 +- web/modules/webform/webform.api.php | 7 +- web/modules/webform/webform.info.yml | 6 +- web/modules/webform/webform.install | 21 ++ web/modules/webform/webform.libraries.yml | 17 ++ web/modules/webform/webform.module | 24 +- web/modules/webform/webform.tokens.inc | 26 +- 605 files changed, 3795 insertions(+), 3046 deletions(-) create mode 100644 web/modules/webform/.tugboat/config.yml create mode 100644 web/modules/webform/cspell/dictionary.txt create mode 100644 web/modules/webform/css/webform.element.excluded_elements.css create mode 100644 web/modules/webform/css/webform.theme.olivero.css create mode 100644 web/modules/webform/js/webform.element.excluded_elements.js create mode 100644 web/modules/webform/phpcs.xml.dist create mode 100644 web/modules/webform/templates/webform-access-denied.html.twig diff --git a/composer.lock b/composer.lock index bacb0394b2..fd81a4a7f6 100644 --- a/composer.lock +++ b/composer.lock @@ -7988,17 +7988,17 @@ }, { "name": "drupal/webform", - "version": "6.1.0", + "version": "6.1.2", "source": { "type": "git", "url": "https://git.drupalcode.org/project/webform.git", - "reference": "6.1.0" + "reference": "6.1.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/webform-6.1.0.zip", - "reference": "6.1.0", - "shasum": "0dae48cc100133a4144ca8219d5506b917888588" + "url": "https://ftp.drupal.org/files/projects/webform-6.1.2.zip", + "reference": "6.1.2", + "shasum": "3afb96566f5d31474483e163b4e0138d43cffdcd" }, "require": { "drupal/core": "^8.8 || ^9" @@ -8046,8 +8046,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "6.1.0", - "datestamp": "1635676666", + "version": "6.1.2", + "datestamp": "1638917151", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index e8030e0548..ccbb5c05b5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -8315,18 +8315,18 @@ }, { "name": "drupal/webform", - "version": "6.1.0", - "version_normalized": "6.1.0.0", + "version": "6.1.2", + "version_normalized": "6.1.2.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/webform.git", - "reference": "6.1.0" + "reference": "6.1.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/webform-6.1.0.zip", - "reference": "6.1.0", - "shasum": "0dae48cc100133a4144ca8219d5506b917888588" + "url": "https://ftp.drupal.org/files/projects/webform-6.1.2.zip", + "reference": "6.1.2", + "shasum": "3afb96566f5d31474483e163b4e0138d43cffdcd" }, "require": { "drupal/core": "^8.8 || ^9" @@ -8374,8 +8374,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "6.1.0", - "datestamp": "1635676666", + "version": "6.1.2", + "datestamp": "1638917151", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index eaa6857e3d..89efbfe1fe 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '53db3df93a2cc7c1459d1053b5dceb54f235646a', + 'reference' => 'ad308d6a3a287476b951328993f5c9ebcc87f031', 'name' => 'osu-asc-webservices/d8-upstream', 'dev' => true, ), @@ -1838,12 +1838,12 @@ ), ), 'drupal/webform' => array( - 'pretty_version' => '6.1.0', - 'version' => '6.1.0.0', + 'pretty_version' => '6.1.2', + 'version' => '6.1.2.0', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/webform', 'aliases' => array(), - 'reference' => '6.1.0', + 'reference' => '6.1.2', 'dev_requirement' => false, ), 'drupal/workflows' => array( @@ -2104,7 +2104,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '53db3df93a2cc7c1459d1053b5dceb54f235646a', + 'reference' => 'ad308d6a3a287476b951328993f5c9ebcc87f031', 'dev_requirement' => false, ), 'pantheon-systems/quicksilver-pushback' => array( diff --git a/web/modules/webform/.tugboat/config.yml b/web/modules/webform/.tugboat/config.yml new file mode 100644 index 0000000000..3f2b9eb63c --- /dev/null +++ b/web/modules/webform/.tugboat/config.yml @@ -0,0 +1,51 @@ +services: + php: + image: q0rban/tugboat-drupal:9.2 + default: true + http: false + depends: mysql + commands: + update: | + set -eux + # Check out a branch using the unique Tugboat ID for this repository, to + # ensure we don't clobber an existing branch. + git checkout -b $TUGBOAT_REPO_ID + # Composer is hungry. You need a Tugboat project with a pretty sizeable + # chunk of memory. + export COMPOSER_MEMORY_LIMIT=-1 + # This is an environment variable we added in the Dockerfile that + # provides the path to Drupal composer root (not the web root). + cd $DRUPAL_COMPOSER_ROOT + # We configure the Drupal project to use the checkout of the module as a + # Composer package repository. + composer config repositories.tugboat vcs $TUGBOAT_ROOT + # Now we can require this module, specifing the branch name we created + # above that uses the $TUGBOAT_REPO_ID environment variable. + composer require drupal/webform:dev-$TUGBOAT_REPO_ID + # Install Drupal on the site. + vendor/bin/drush \ + --yes \ + --db-url=mysql://tugboat:tugboat@mysql:3306/tugboat \ + --site-name="Live preview for ${TUGBOAT_PREVIEW_NAME}" \ + --account-pass=admin \ + site:install standard + # Set up the files directory permissions. + mkdir -p $DRUPAL_DOCROOT/sites/default/files + chgrp -R www-data $DRUPAL_DOCROOT/sites/default/files + chmod 2775 $DRUPAL_DOCROOT/sites/default/files + chmod -R g+w $DRUPAL_DOCROOT/sites/default/files + # Enable the module. + vendor/bin/drush --yes pm:enable webform webform_ui webform_templates webform_examples webform_image_select webform_node webform_share webform_submission_log + build: | + set -eux + # Delete and re-check out this branch in case this is built from a Base Preview. + git branch -D $TUGBOAT_REPO_ID && git checkout -b $TUGBOAT_REPO_ID || true + export COMPOSER_MEMORY_LIMIT=-1 + cd $DRUPAL_COMPOSER_ROOT + composer install --optimize-autoloader + # Update this module, including all dependencies. + composer update drupal/webform --with-all-dependencies + vendor/bin/drush --yes updb + vendor/bin/drush cache:rebuild + mysql: + image: tugboatqa/mariadb diff --git a/web/modules/webform/README.md b/web/modules/webform/README.md index bf4d8b5421..b1e686727b 100644 --- a/web/modules/webform/README.md +++ b/web/modules/webform/README.md @@ -34,7 +34,7 @@ The Webform module is a form builder and submission manager for Drupal 8. https://simplytest.me/project/webform/6.x * Project status: - [Webform Project Board] https://contribkanban.com/board/webform/8.x-5.x + [Webform Project Board] https://contribkanban.com/board/webform/6.x * Comparision with other modules: https://www.drupal.org/node/2083353 diff --git a/web/modules/webform/composer.libraries.json b/web/modules/webform/composer.libraries.json index 1c5fa51d32..23ad36e9c7 100644 --- a/web/modules/webform/composer.libraries.json +++ b/web/modules/webform/composer.libraries.json @@ -95,13 +95,13 @@ "type": "package", "package": { "name": "ckeditor/autogrow", - "version": "4.16.2", + "version": "4.17.1", "type": "drupal-library", "extra": { "installer-name": "ckeditor.autogrow" }, "dist": { - "url": "https://download.ckeditor.com/autogrow/releases/autogrow_4.16.2.zip", + "url": "https://download.ckeditor.com/autogrow/releases/autogrow_4.17.1.zip", "type": "zip" } } @@ -125,13 +125,13 @@ "type": "package", "package": { "name": "ckeditor/fakeobjects", - "version": "4.16.2", + "version": "4.17.1", "type": "drupal-library", "extra": { "installer-name": "ckeditor.fakeobjects" }, "dist": { - "url": "https://download.ckeditor.com/fakeobjects/releases/fakeobjects_4.16.2.zip", + "url": "https://download.ckeditor.com/fakeobjects/releases/fakeobjects_4.17.1.zip", "type": "zip" } } @@ -140,13 +140,13 @@ "type": "package", "package": { "name": "ckeditor/image", - "version": "4.16.2", + "version": "4.17.1", "type": "drupal-library", "extra": { "installer-name": "ckeditor.image" }, "dist": { - "url": "https://download.ckeditor.com/image/releases/image_4.16.2.zip", + "url": "https://download.ckeditor.com/image/releases/image_4.17.1.zip", "type": "zip" } } @@ -155,13 +155,13 @@ "type": "package", "package": { "name": "ckeditor/link", - "version": "4.16.2", + "version": "4.17.1", "type": "drupal-library", "extra": { "installer-name": "ckeditor.link" }, "dist": { - "url": "https://download.ckeditor.com/link/releases/link_4.16.2.zip", + "url": "https://download.ckeditor.com/link/releases/link_4.17.1.zip", "type": "zip" } } diff --git a/web/modules/webform/cspell/dictionary.txt b/web/modules/webform/cspell/dictionary.txt new file mode 100644 index 0000000000..43654d3caf --- /dev/null +++ b/web/modules/webform/cspell/dictionary.txt @@ -0,0 +1,37 @@ +algolia +Algolia +Antibot +ANTIBOT +clientside +Clientside +codemirror +CodeMirror +geocomplete +icheck +imce +IMCE +inputmask +Inputmask +Interdiff +interdiff +jrockowitz +likert +Likert +lingotek +Lingotek +maillog +Maillog +rateit +Rockowitz +screencast +Screencast +submodule +unstarred +UNSTARRED +webform +Webform +webforms +Webforms +webform's +Webform's +wkhtmltopdf diff --git a/web/modules/webform/css/webform.admin.css b/web/modules/webform/css/webform.admin.css index 4893cd25d8..05272efe62 100644 --- a/web/modules/webform/css/webform.admin.css +++ b/web/modules/webform/css/webform.admin.css @@ -14,7 +14,7 @@ * Bulk form. */ .webform-bulk-form .form-item { - margin-right: 5px; + margin-right: 5px; } /** diff --git a/web/modules/webform/css/webform.ajax.css b/web/modules/webform/css/webform.ajax.css index 539398806c..711d1b3c61 100644 --- a/web/modules/webform/css/webform.ajax.css +++ b/web/modules/webform/css/webform.ajax.css @@ -16,7 +16,7 @@ * Floating Ajax message container. * * Display status message in a floating container at the bottom of the page. - * NOTE: It is disiplay to display message floating at top because of the floating + * NOTE: It is display to display message floating at top because of the floating * admin toolbar. * * @see Drupal.AjaxCommands.prototype.webformInsert diff --git a/web/modules/webform/css/webform.element.color.css b/web/modules/webform/css/webform.element.color.css index a279ecd3ad..35bdca3558 100644 --- a/web/modules/webform/css/webform.element.color.css +++ b/web/modules/webform/css/webform.element.color.css @@ -24,17 +24,23 @@ input.form-color.form-color-small { width: 16px; height: 16px; + min-width: 16px; + min-height: 16px; font-size: smaller; } input.form-color.form-color-medium { width: 24px; height: 24px; + min-width: 24px; + min-height: 24px; } input.form-color.form-color-large { width: 36px; height: 36px; + min-width: 36px; + min-height: 36px; } input.form-color.form-color-output { diff --git a/web/modules/webform/css/webform.element.details.toggle.css b/web/modules/webform/css/webform.element.details.toggle.css index 891230979b..39642a4b70 100644 --- a/web/modules/webform/css/webform.element.details.toggle.css +++ b/web/modules/webform/css/webform.element.details.toggle.css @@ -40,7 +40,7 @@ text-decoration: underline; } -/* Float toogle to the right of webform tabs */ +/* Float toggle to the right of webform tabs */ .webform-tabs .webform-details-toggle-state-wrapper { float: right; } diff --git a/web/modules/webform/css/webform.element.excluded_elements.css b/web/modules/webform/css/webform.element.excluded_elements.css new file mode 100644 index 0000000000..e498f508ed --- /dev/null +++ b/web/modules/webform/css/webform.element.excluded_elements.css @@ -0,0 +1,11 @@ +/** + * @file + * Excluded elements styles. + */ + +.webform-excluded-elements--child .form-type--boolean { + padding: 0 0 0 2em; +} +[dir="rtl"] .webform-excluded-elements--child .form-type--boolean { + padding: 0 2em 0 0; +} diff --git a/web/modules/webform/css/webform.element.flexbox.css b/web/modules/webform/css/webform.element.flexbox.css index e5f585d75b..f8d4179a58 100644 --- a/web/modules/webform/css/webform.element.flexbox.css +++ b/web/modules/webform/css/webform.element.flexbox.css @@ -13,7 +13,7 @@ margin: 1em -0.5em; } - /** + /* * Make sure flexbox is always using 'display: flex' when toggled via #states. * @see https://stackoverflow.com/questions/38491653/jquery-show-a-flex-box/4121 */ @@ -56,8 +56,8 @@ .container-inline .webform-flex--container > .form-item > input:not([type="checkbox"]), .container-inline .webform-flex--container > .form-item > select, - .webform-flex--container > .form-item.webform-element--title-inline > input:not([type="checkbox"]), - .webform-flex--container > .form-item.webform-element--title-inline > select { + .webform-flex--container > .form-item.webform-element--title-inline > input:not([type="checkbox"]), + .webform-flex--container > .form-item.webform-element--title-inline > select { width: inherit; } @@ -136,9 +136,7 @@ flex: 12; } - /** - * Select other. - */ + /* Select other */ .webform-flex--container > .form-type-webform-select-other select { width: 100%; } @@ -151,23 +149,17 @@ margin-top: 0.5em; } - /** - * Range. - */ + /* Range. */ .webform-flex--container > .form-type-range-output > .form-range-output { width: 66%; } - /** - * Composite. - */ + /* Composite. */ .form-composite > .webform-flexbox { margin: 1em -0.5em; } - /** - * Radios/checkboxes. - */ + /* Radios/checkboxes. */ .webform-flex--container .form-type-checkbox, .webform-flex--container .form-type-radio { white-space: nowrap; diff --git a/web/modules/webform/css/webform.element.likert.css b/web/modules/webform/css/webform.element.likert.css index 18967fc799..e2f490eb92 100644 --- a/web/modules/webform/css/webform.element.likert.css +++ b/web/modules/webform/css/webform.element.likert.css @@ -93,7 +93,7 @@ width: 100%; } - /** + /* * Show visually hidden radio title and description * when Likert is displayed inline on mobile. * @see \Drupal\webform\Element\WebformLikert::processWebformLikert diff --git a/web/modules/webform/css/webform.element.multiple.css b/web/modules/webform/css/webform.element.multiple.css index cfc13d3f5c..165dd46f73 100644 --- a/web/modules/webform/css/webform.element.multiple.css +++ b/web/modules/webform/css/webform.element.multiple.css @@ -20,6 +20,11 @@ white-space: nowrap; } +.webform-multiple-table td .webform-element-help--title, +.webform-multiple-table td .webform-element-help--content { + white-space: normal; +} + .webform-multiple-table td .description, .webform-multiple-table td .messages, .webform-multiple-table td .form-item--error-message { @@ -71,10 +76,10 @@ } .webform-multiple-table td .container-inline select, -.form-type-webform-multiple.webform-has-field-prefix td select, -.form-type-webform-multiple.webform-has-field-suffix td select, -.form-type-webform-multiple.webform-has-field-prefix td input, -.form-type-webform-multiple.webform-has-field-suffix td input { +.webform-multiple-table td.webform-has-field-prefix select, +.webform-multiple-table td.webform-has-field-suffix select, +.webform-multiple-table td.webform-has-field-prefix input, +.webform-multiple-table td.webform-has-field-suffix input { width: auto; } @@ -167,8 +172,8 @@ } .webform-multiple-table-responsive tr { - display: block; position: relative; + display: block; padding: 0.5em 0; } @@ -189,7 +194,7 @@ .webform-multiple-table-responsive td.webform-multiple-table--operations { position: absolute; - top: .75em; + top: 0.75em; right: 0; } diff --git a/web/modules/webform/css/webform.element.scale.css b/web/modules/webform/css/webform.element.scale.css index 45f46d344a..8fd6433787 100644 --- a/web/modules/webform/css/webform.element.scale.css +++ b/web/modules/webform/css/webform.element.scale.css @@ -11,8 +11,8 @@ * Options. */ .webform-scale-options { - white-space: nowrap; margin: 0 -4px; + white-space: nowrap; } .webform-scale-options .form-item { @@ -33,17 +33,17 @@ } .webform-scale-options input + label { + /* Default. */ + width: 36px; + height: 36px; + margin: 0; text-align: center; color: #666; border: 3px solid #ccc; border-radius: 50%; background-color: #fff; - margin: 0; - /* Default. */ - width: 36px; - height: 36px; - line-height: 36px; font-size: 1.2em; + line-height: 36px; } /** @@ -52,8 +52,8 @@ .webform-scale-text { position: relative; height: 1em; - line-height: 1em; margin: 4px 2px; + line-height: 1em; } .webform-scale-text-min, @@ -104,7 +104,7 @@ box-shadow: 0 0 5px #0074bd; } -/******************************************************************************/ +/* ************************************************************************** */ /** * Small. @@ -120,9 +120,9 @@ .webform-scale-small input + label { width: 24px; height: 24px; - line-height: 24px; - font-size: 1.1em; border-width: 2px; + font-size: 1.1em; + line-height: 24px; } /** @@ -131,8 +131,8 @@ .webform-scale-medium input + label { width: 36px; height: 36px; - line-height: 36px; font-size: 1.2em; + line-height: 36px; } @media (max-width: 768px) { @@ -147,9 +147,9 @@ .webform-scale-medium input + label { width: 24px; height: 24px; - line-height: 24px; - font-size: 1.1em; border-width: 2px; + font-size: 1.1em; + line-height: 24px; } } @@ -159,8 +159,8 @@ .webform-scale-large input + label { width: 48px; height: 48px; - line-height: 48px; font-size: 1.5em; + line-height: 48px; } @media (max-width: 768px) { @@ -175,13 +175,13 @@ .webform-scale-large input + label { width: 36px; height: 36px; - line-height: 36px; - font-size: 1.2em; border-width: 2px; + font-size: 1.2em; + line-height: 36px; } } -/******************************************************************************/ +/* ************************************************************************** */ /** * Square. @@ -209,10 +209,10 @@ } .webform-scale-flexbox .form-item { - margin: 0 !important; display: table; width: 100%; height: 100%; + margin: 0 !important; } .webform-scale-flexbox input + label { display: table-cell; diff --git a/web/modules/webform/css/webform.form.css b/web/modules/webform/css/webform.form.css index 6594a928f3..983e4f27ba 100644 --- a/web/modules/webform/css/webform.form.css +++ b/web/modules/webform/css/webform.form.css @@ -8,8 +8,8 @@ */ html.js .js-webform-visually-hidden, html.js .js-webform-visually-hidden[style*="display: none"] { - display: inline !important; position: absolute !important; + display: inline !important; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); width: 1px; diff --git a/web/modules/webform/css/webform.form.tabs.css b/web/modules/webform/css/webform.form.tabs.css index 0ceee5c65b..d6029a5d47 100644 --- a/web/modules/webform/css/webform.form.tabs.css +++ b/web/modules/webform/css/webform.form.tabs.css @@ -8,5 +8,5 @@ } .webform-tabs ul.webform-tabs-item-list li { - margin: 0 .2em 0 0; + margin: 0 0.2em 0 0; } diff --git a/web/modules/webform/css/webform.help.support.css b/web/modules/webform/css/webform.help.support.css index d2e80423fe..ecd671ef6c 100644 --- a/web/modules/webform/css/webform.help.support.css +++ b/web/modules/webform/css/webform.help.support.css @@ -6,50 +6,50 @@ */ .webform-help-support { + margin-bottom: 25px; border: 1px solid #ccc; border-radius: 3px; - margin-bottom: 25px; } .webform-help-support__header { - background-color: #f5f5f2; - padding: 10px; - margin: 0; overflow: hidden; + margin: 0; + padding: 10px; + text-transform: uppercase; border-top-left-radius: 3px; border-top-right-radius: 3px; + background-color: #f5f5f2; font-size: 14px; - text-transform: uppercase; } .webform-help-support__header-more { - font-weight: normal; text-transform: none; font-size: 12px; + font-weight: normal; } .webform-help-support__item { - background: #fcfcfa; - border-top: 1px solid #ccc; - padding: 10px 10px 20px; - box-sizing: border-box; overflow-x: auto; + box-sizing: border-box; + padding: 10px 10px 20px; + border-top: 1px solid #ccc; + background: #fcfcfa; } .webform-help-support__item-icon { display: inline-block; - height: 55px; width: 55px; + height: 55px; vertical-align: top; } .webform-help-support__item-icon:before { - content: ""; - background-size: 45px; - background-position: 50% center; - background-repeat: no-repeat; + display: block; width: 100%; height: 100%; - display: block; + content: ""; + background-repeat: no-repeat; + background-position: 50% center; + background-size: 45px; } .webform-help-support__item-icon--contribute:before { background-image: url(../icons/cccccc/drupal.svg); @@ -62,11 +62,11 @@ } .webform-help-support__item-details { - box-sizing: border-box; + position: relative; display: inline-block; + box-sizing: border-box; width: calc(100% - 60px); padding-left: 10px; /* LTR */ - position: relative; } [dir="rtl"] .webform-help-support__item-details { padding-right: 10px; @@ -80,8 +80,8 @@ @media screen and (min-width: 48em) { .webform-help-support__items { display: flex; - flex-wrap: wrap; overflow-x: hidden; + flex-wrap: wrap; } .webform-help-support__item { @@ -115,7 +115,7 @@ display: none; } .webform-help-support { - border-top: 0; margin-top: 25px; + border-top: 0; } } diff --git a/web/modules/webform/css/webform.progress.tracker.css b/web/modules/webform/css/webform.progress.tracker.css index fd3f514ccc..7a7dfb7337 100644 --- a/web/modules/webform/css/webform.progress.tracker.css +++ b/web/modules/webform/css/webform.progress.tracker.css @@ -80,3 +80,7 @@ .webform-progress-tracker .progress-step.is-complete:hover .progress-marker[role="link"]:before { background-color: #1976f2; } + +.webform-progress-tracker .progress-marker::after { + z-index: auto; +} diff --git a/web/modules/webform/css/webform.theme.claro.css b/web/modules/webform/css/webform.theme.claro.css index 23ecd8a9db..4db3330d73 100644 --- a/web/modules/webform/css/webform.theme.claro.css +++ b/web/modules/webform/css/webform.theme.claro.css @@ -20,10 +20,6 @@ margin-bottom: 1.5rem; } -/***************************************************************************** */ -/* Fields */ -/***************************************************************************** */ - /***************************************************************************** */ /* Messages */ /***************************************************************************** */ @@ -307,3 +303,7 @@ div.webform-form-filter input.webform-form-filter-text { .webform-off-canvas .fieldset__wrapper--group { margin: 0; } + +.webform-off-canvas #drupal-off-canvas .form-type--boolean { + margin-left: 1.6875rem; +} diff --git a/web/modules/webform/css/webform.theme.gin.css b/web/modules/webform/css/webform.theme.gin.css index 6d1b2df63c..7fa61c3a15 100644 --- a/web/modules/webform/css/webform.theme.gin.css +++ b/web/modules/webform/css/webform.theme.gin.css @@ -19,10 +19,10 @@ div.block-help-block { */ .webform-message .messages.messages--webform { color: #fff; + border: 2px solid transparent; + border-radius: 12px; background-color: #353641; box-shadow: none; - border-radius: 12px; - border: 2px solid transparent; } .webform-message .messages.messages--webform { diff --git a/web/modules/webform/css/webform.theme.olivero.css b/web/modules/webform/css/webform.theme.olivero.css new file mode 100644 index 0000000000..3304fa87b2 --- /dev/null +++ b/web/modules/webform/css/webform.theme.olivero.css @@ -0,0 +1,41 @@ +/** + * @file + * Olivero theme styles. + */ + +/* + * Adjust the tableselect sort element's first column because checkbox are wider. + */ +.tableselect-sort td:first-child { + width: 70px; +} + +/* + * Remove webform scale element's label padding. + */ +[dir="ltr"] .webform-scale-options input[type="radio"] + label, +[dir="rtl"] .webform-scale-options input[type="radio"] + label { + padding: 0; +} + +/* + * Make the message close link bigger and a different color. + */ +.webform-message__link { + opacity: 0.66; +} + +html.js .webform-message--close .webform-message__link { + color: #ffd23f; + font-size: 48px; + line-height: 48px; + font-weight: normal; +} + +/* + * Hide Olivero's close message button. + * @see core/themes/olivero/js/messages.js + */ +.webform-message .messages__button { + display: none; +} diff --git a/web/modules/webform/css/webform.theme.seven.css b/web/modules/webform/css/webform.theme.seven.css index 14c8306ffc..db34025be4 100644 --- a/web/modules/webform/css/webform.theme.seven.css +++ b/web/modules/webform/css/webform.theme.seven.css @@ -97,7 +97,7 @@ pre.webform-codemirror-runmode { * * @see https://www.drupal.org/project/webform/issues/3228968 */ -.webform-ui-dialog a.button--primary { +.webform-ui-dialog a.button--primary { color: #fff; } diff --git a/web/modules/webform/docs/RELEASE-NOTES.md b/web/modules/webform/docs/RELEASE-NOTES.md index 73f65724f4..d9491df5f1 100644 --- a/web/modules/webform/docs/RELEASE-NOTES.md +++ b/web/modules/webform/docs/RELEASE-NOTES.md @@ -18,82 +18,53 @@ Steps for creating a new release [PHP](https://www.drupal.org/node/1587138) - # Check Drupal PHP coding standards - cd /var/www/sites/d8_webform/web - phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info modules/sandbox/webform > ~/webform-php-coding-standards.txt - cat ~/webform-php-coding-standards.txt + # Check Drupal PHP coding standards and best practices. + phpcs . - # Check Drupal PHP best practices - cd /var/www/sites/d8_webform/web - phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info modules/sandbox/webform > ~/webform-php-best-practice.txt - cat ~/webform-php-best-practice.txt + # Show sniff codes in all reports. + phpcs -s . # Install PHP version compatibility (One-time) - cd /var/www/sites/d8_webform + cd ~/Sites/drupal_webform composer require --dev phpcompatibility/php-compatibility # Check PHP version compatibility - cd /var/www/sites/d8_webform/web + cd ~/Sites/drupal_webform/web phpcs --runtime-set testVersion 8.0 --standard=../vendor/phpcompatibility/php-compatibility/PHPCompatibility --extensions=php,module,inc,install,test,profile,theme modules/sandbox/webform > ~/webform-php-compatibility.txt cat ~/webform-php-compatibility.txt [JavaScript](https://www.drupal.org/node/2873849) # Install Eslint. (One-time) - cd /var/www/sites/d8_webform/web/core + cd ~/Sites/drupal_webform/web/core yarn install # Check Drupal JavaScript (ES5) legacy coding standards. - cd /var/www/sites/d8_webform/web + cd ~/Sites/drupal_webform/web core/node_modules/.bin/eslint --no-eslintrc -c=core/.eslintrc.legacy.json --ext=.js modules/sandbox/webform > ~/webform-javascript-coding-standards.txt cat ~/webform-javascript-coding-standards.txt [CSS](https://www.drupal.org/node/3041002) # Install Eslint. (One-time) - cd /var/www/sites/d8_webform/web/core + cd ~/Sites/drupal_webform/web/core yarn install - cd /var/www/sites/d8_webform/web/core + cd ~/Sites/drupal_webform/web/core yarn run lint:css ../modules/sandbox/webform/css --fix [Spell Check](https://www.drupal.org/node/3122084) for Drupal 9.1+ # Install Pspell. (One-time) - cd /var/www/sites/d8_webform/web/core + cd ~/Sites/drupal_webform/web/core yarn install # Update dictionary. (core/misc/cspell/dictionary.txt) - algolia - Algolia - Antibot - ANTIBOT - codemirror - CodeMirror - imce - IMCE - inputmask - Inputmask - likert - Likert - lingotek - Lingotek - maillog - Maillog - Rockowitz - screencast - Screencast - unstarred - UNSTARRED - webform - Webform - webforms - Webforms - webform's - Webform's - wkhtmltopdf - - cd /var/www/sites/d8_webform/web/core + + cd ~/Sites/drupal_webform/web/ + cat modules/sandbox/webform/cspell/dictionary.txt >> core/misc/cspell/dictionary.txt + + cd ~/Sites/drupal_webform/web/core yarn run spellcheck ../modules/sandbox/webform/**/* > ~/webform-spell-check.txt cat ~/webform-spell-check.txt @@ -115,7 +86,7 @@ Steps for creating a new release @see [Redirect output to a file #137](https://github.com/mglaman/drupal-check/issues/137) - cd /var/www/sites/d8_webform/ + cd ~/Sites/drupal_webform composer require mglaman/drupal-check # Deprecations. vendor/mglaman/drupal-check/drupal-check --no-progress -d web/modules/sandbox/webform @@ -126,11 +97,11 @@ Steps for creating a new release [phpstan-drupal](https://github.com/mglaman/phpstan-drupal) [phpstan-drupal-deprecations](https://github.com/mglaman/phpstan-drupal-deprecations) - cd /var/www/sites/d8_webform/ + cd ~/Sites/drupal_webform composer require mglaman/phpstan-drupal composer require phpstan/phpstan-deprecation-rules -Create `/var/www/sites/d8_webform/phpstan.neon` +Create `~/Sites/drupal_webformphpstan.neon` parameters: customRulesetUsed: true @@ -147,7 +118,7 @@ Create `/var/www/sites/d8_webform/phpstan.neon` Run PHPStan with memory limit increased - cd /var/www/sites/d8_webform/ + cd ~/Sites/drupal_webform ./vendor/bin/phpstan --memory-limit=1024M analyse web/modules/sandbox/webform > ~/webform-deprecated.txt cat ~/webform-deprecated.txt @@ -158,16 +129,12 @@ Run PHPStan with memory limit increased Pa11y is your automated accessibility testing pal. -Notes -- Requires node 8.x+ - - # Enable accessibility examples. drush en -y webform_examples_accessibility # Text. - mkdir -p /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity/text - cd /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity/text + mkdir -p ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity/text + cd ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity/text pa11y http://localhost/wf/webform/example_accessibility_basic > example_accessibility_basic.txt pa11y http://localhost/wf/webform/example_accessibility_advanced > example_accessibility_advanced.txt pa11y http://localhost/wf/webform/example_accessibility_containers > example_accessibility_containers.txt @@ -175,8 +142,8 @@ Notes pa11y http://localhost/wf/webform/example_accessibility_labels > example_accessibility_labels.txt # HTML. - mkdir -p /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity/html - cd /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity/html + mkdir -p ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity/html + cd ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity/html pa11y --reporter html http://localhost/wf/webform/example_accessibility_basic > example_accessibility_basic.html pa11y --reporter html http://localhost/wf/webform/example_accessibility_advanced > example_accessibility_advanced.html pa11y --reporter html http://localhost/wf/webform/example_accessibility_containers > example_accessibility_containers.html @@ -184,12 +151,12 @@ Notes pa11y --reporter html http://localhost/wf/webform/example_accessibility_labels > example_accessibility_labels.html # Remove localhost from reports. - cd /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity + cd ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity find . -name '*.html' -exec sed -i '' -e 's|http://localhost/wf/webform/|http://localhost/webform/|g' {} \; # PDF. - mkdir -p /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity/pdf - cd /var/www/sites/d8_webform/web/modules/sandbox/webform/reports/accessiblity/pdf + mkdir -p ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity/pdf + cd ~/Sites/drupal_webform/web/modules/sandbox/webform/reports/accessiblity/pdf wkhtmltopdf --dpi 384 ../html/example_accessibility_basic.html example_accessibility_basic.pdf wkhtmltopdf --dpi 384 ../html/example_accessibility_advanced.html example_accessibility_advanced.pdf wkhtmltopdf --dpi 384 ../html/example_accessibility_containers.html example_accessibility_containers.pdf @@ -203,11 +170,11 @@ Notes [SimpleTest](https://www.drupal.org/node/645286) # Run all tests - cd /var/www/sites/d8_webform + cd ~/Sites/drupal_webform php core/scripts/run-tests.sh --suppress-deprecations --url http://localhost/wf --module webform --dburl mysql://drupal_d8_webform:drupal.@dm1n@localhost/drupal_d8_webform # Run single tests - cd /var/www/sites/d8_webform + cd ~/Sites/drupal_webform php core/scripts/run-tests.sh --suppress-deprecations --url http://localhost/wf --verbose --class "Drupal\Tests\webform\Functional\WebformListBuilderTest" [PHPUnit](https://www.drupal.org/node/2116263) @@ -224,11 +191,11 @@ References export SIMPLETEST_BASE_URL='http://localhost/wf'; # Execute all Webform PHPUnit tests. - cd /var/www/sites/d8_webform/web/core + cd ~/Sites/drupal_webform/web/core php ../../vendor/phpunit/phpunit/phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --group webform # Execute individual PHPUnit tests. - cd /var/www/sites/d8_webform/web/core + cd ~/Sites/drupal_webform/web/core # Functional test. php ../../vendor/phpunit/phpunit/phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" ../modules/sandbox/webform/tests/src/Functional/WebformExampleFunctionalTest.php diff --git a/web/modules/webform/docs/UPDATE-LIBRARIES.md b/web/modules/webform/docs/UPDATE-LIBRARIES.md index 37f722174c..b31637d225 100644 --- a/web/modules/webform/docs/UPDATE-LIBRARIES.md +++ b/web/modules/webform/docs/UPDATE-LIBRARIES.md @@ -55,7 +55,7 @@ Check external libraries are download. Enable and download all libraries - cd /var/www/sites/d8_webform + cd ~/Sites/drupal_webform drush php-eval "\Drupal::configFactory()->getEditable('webform.settings')->set('libraries.excluded_libraries', [])->save();" drush en -y webform_image_select webform_toggles webform_location_geocomplete webform_icheck webform_options_custom drush webform:libraries:download @@ -63,22 +63,22 @@ Enable and download all libraries Update libraries.zip # Checkout branch - cd /var/www/sites/d8_webform/web/modules/sandbox/webform_libraries/ + cd ~/Sites/drupal_webform/web/modules/sandbox/webform_libraries/ git checkout 6.x # Remove libraries.zip - cd /var/www/sites/d8_webform/web/modules/sandbox/webform_libraries/ + cd ~/Sites/drupal_webform/web/modules/sandbox/webform_libraries/ rm -Rf libraries.zip # Create libraries.zip - cd /var/www/sites/d8_webform/web/ + cd ~/Sites/drupal_webform/web/ zip -r libraries.zip libraries - mv libraries.zip /private/var/www/sites/d8_webform/web/modules/sandbox/webform_libraries/libraries.zip + mv libraries.zip ~/Sites/drupal_webform/web/modules/sandbox/webform_libraries/libraries.zip Commit changes # Commit changes. - cd /var/www/sites/d8_webform/web/modules/sandbox/webform_libraries/ + cd ~/Sites/drupal_webform/web/modules/sandbox/webform_libraries/ git checkout 6.x git commit -am"Update webform_libraries" git push @@ -87,5 +87,5 @@ Commit changes 7. Update composer.libraries.json ---------------------------------- - cd /var/www/sites/d8_webform/web/modules/sandbox/webform + cd ~/Sites/drupal_webform/web/modules/sandbox/webform drush webform:libraries:composer > composer.libraries.json diff --git a/web/modules/webform/drush/webform.drush.inc b/web/modules/webform/drush/webform.drush.inc index fc9c75e57a..ffd3e3f9d3 100644 --- a/web/modules/webform/drush/webform.drush.inc +++ b/web/modules/webform/drush/webform.drush.inc @@ -274,9 +274,9 @@ function webform_drush_command() { ); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-export. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -292,9 +292,9 @@ function drush_webform_export() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_export'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-import. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -310,9 +310,9 @@ function drush_webform_import() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_import'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-purge. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -328,9 +328,9 @@ function drush_webform_purge() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_purge'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-tidy. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -346,9 +346,9 @@ function drush_webform_tidy() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_tidy'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-libraries-status. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). @@ -357,9 +357,9 @@ function drush_webform_libraries_status() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_libraries_status'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-libraries-composer. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). @@ -368,9 +368,9 @@ function drush_webform_libraries_composer() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_libraries_composer'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-libraries-download. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). @@ -379,9 +379,9 @@ function drush_webform_libraries_download() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_libraries_download'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-libraries-remove. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). @@ -390,9 +390,9 @@ function drush_webform_libraries_remove() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_libraries_remove'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-generate. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -408,9 +408,9 @@ function drush_webform_generate() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_generate'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-repair. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). @@ -419,9 +419,9 @@ function drush_webform_repair() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_repair'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-remove-orphans. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). @@ -430,9 +430,9 @@ function drush_webform_remove_orphans() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_remove_orphans'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-docs. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -448,9 +448,9 @@ function drush_webform_docs() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_docs'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-composer-update. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND_validate(). @@ -466,9 +466,9 @@ function drush_webform_composer_update() { return call_user_func_array([\Drupal::service('webform.cli_service'), 'drush_webform_composer_update'], func_get_args()); } -/******************************************************************************/ +/* ************************************************************************** */ // drush webform-generate-commands. DO NOT EDIT. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). diff --git a/web/modules/webform/includes/webform.date.inc b/web/modules/webform/includes/webform.date.inc index db63b428a9..265ae1715a 100644 --- a/web/modules/webform/includes/webform.date.inc +++ b/web/modules/webform/includes/webform.date.inc @@ -48,7 +48,7 @@ function _webform_datetime_date(array &$element, FormStateInterface $form_state, return; } - $type = (isset($element['#date_date_element'])) ? $element['#date_date_element'] : 'date'; + $type = $element['#date_date_element'] ?? 'date'; switch ($type) { case 'datepicker': // Convert #type from datepicker to textfield. @@ -111,7 +111,7 @@ function _webform_datetime_time(array &$element, FormStateInterface $form_state, $element['time']['#attributes']['data-max-year'] ); - $type = (isset($element['#date_time_element'])) ? $element['#date_time_element'] : 'time'; + $type = $element['#date_time_element'] ?? 'time'; switch ($type) { case 'timepicker': diff --git a/web/modules/webform/includes/webform.editor.inc b/web/modules/webform/includes/webform.editor.inc index 0eca85961a..ebec16e5a5 100644 --- a/web/modules/webform/includes/webform.editor.inc +++ b/web/modules/webform/includes/webform.editor.inc @@ -19,9 +19,9 @@ use Drupal\webform\WebformInterface; use Drupal\Component\Utility\Html; -/******************************************************************************/ +/* ************************************************************************** */ // Webform entity hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_webform_insert(). @@ -61,11 +61,11 @@ function webform_webform_delete(WebformInterface $webform) { _webform_delete_file_usage($uuids, $webform->getEntityTypeId(), $webform->id(), 0); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform config (settings) hooks. // @see \Drupal\webform\Form\AdminConfig\WebformAdminConfigBaseForm::loadConfig // @see \Drupal\webform\Form\AdminConfig\WebformAdminConfigBaseForm::saveConfig -/******************************************************************************/ +/* ************************************************************************** */ /** * Update config editor file references. @@ -99,9 +99,9 @@ function _webform_config_delete(Config $config) { _webform_delete_file_usage($uuids, 'config', $config->getName(), 0); } -/******************************************************************************/ +/* ************************************************************************** */ // Config entity functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Finds all files referenced (data-entity-uuid) by config entity. @@ -118,9 +118,9 @@ function _webform_get_config_entity_file_uuids(ConfigEntityInterface $entity) { return _webform_get_array_file_uuids($entity->toArray()); } -/******************************************************************************/ +/* ************************************************************************** */ // Config settings functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Finds all files referenced (data-entity-uuid) in an associative array. @@ -138,9 +138,9 @@ function _webform_get_array_file_uuids(array $data) { return _webform_parse_file_uuids($text); } -/******************************************************************************/ +/* ************************************************************************** */ // File usage functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Records file usage of files referenced by formatted text fields. @@ -223,9 +223,9 @@ function _webform_delete_file_usage(array $uuids, $type, $id, $count) { } } -/******************************************************************************/ +/* ************************************************************************** */ // File parsing functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Parse text for any linked files with data-entity-uuid attributes. diff --git a/web/modules/webform/includes/webform.form_alter.inc b/web/modules/webform/includes/webform.form_alter.inc index 7d64ab6c0c..6ce8b8cb8a 100644 --- a/web/modules/webform/includes/webform.form_alter.inc +++ b/web/modules/webform/includes/webform.form_alter.inc @@ -85,9 +85,9 @@ function _webform_form_webform_submission_form_after_build($form, FormStateInter return $form; } -/******************************************************************************/ +/* ************************************************************************** */ // Update manager. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for update manager update form. @@ -133,9 +133,9 @@ function webform_form_update_manager_update_form_alter(&$form, FormStateInterfac ]; } -/******************************************************************************/ +/* ************************************************************************** */ // Views. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for views exposed form. @@ -151,9 +151,9 @@ function webform_form_views_exposed_form_alter(&$form, FormStateInterface $form_ } } -/******************************************************************************/ +/* ************************************************************************** */ // SMTP. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for SMTP admin settings form. @@ -172,9 +172,9 @@ function _webform_form_smtp_admin_settings_submit(&$form, FormStateInterface $fo $email_provider->check(); } -/******************************************************************************/ +/* ************************************************************************** */ // Configuration management. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for config single import form. diff --git a/web/modules/webform/includes/webform.install.requirements.inc b/web/modules/webform/includes/webform.install.requirements.inc index 0476e67bf1..c40c4e35bf 100644 --- a/web/modules/webform/includes/webform.install.requirements.inc +++ b/web/modules/webform/includes/webform.install.requirements.inc @@ -19,9 +19,9 @@ function webform_requirements($phase) { $requirements = []; - /****************************************************************************/ + /* ************************************************************************ */ // Experimental modules. - /****************************************************************************/ + /* ************************************************************************ */ // Warn if any experimental webform modules are installed. // @see system_requirements() @@ -44,9 +44,9 @@ function webform_requirements($phase) { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Check HTML email handling. - /****************************************************************************/ + /* ************************************************************************ */ /** @var \Drupal\webform\WebformEmailProviderInterface $email_provider */ $email_provider = \Drupal::service('webform.email_provider'); @@ -79,9 +79,9 @@ function webform_requirements($phase) { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Check private file upload. - /****************************************************************************/ + /* ************************************************************************ */ $scheme_options = ManagedFile::getVisibleStreamWrappers(); if (isset($scheme_options['private'])) { @@ -99,17 +99,17 @@ function webform_requirements($phase) { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Check external libraries. - /****************************************************************************/ + /* ************************************************************************ */ /** @var \Drupal\webform\WebformLibrariesManagerInterface $libraries_manager */ $libraries_manager = \Drupal::service('webform.libraries_manager'); $requirements += $libraries_manager->requirements(); - /****************************************************************************/ + /* ************************************************************************ */ // Check Bootstrap theme. - /****************************************************************************/ + /* ************************************************************************ */ if (\Drupal::config('webform.settings')->get('requirements.bootstrap')) { $bootstrap_enabled = FALSE; @@ -141,9 +141,9 @@ function webform_requirements($phase) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Check Clientside validation module. - /****************************************************************************/ + /* ************************************************************************ */ if (\Drupal::config('webform.settings')->get('requirements.clientside_validation') && \Drupal::moduleHandler()->moduleExists('clientside_validation')) { @@ -163,9 +163,9 @@ function webform_requirements($phase) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Check jQuery UI Datepicker module. - /****************************************************************************/ + /* ************************************************************************ */ $config_factory = \Drupal::configFactory(); $has_datepicker = FALSE; @@ -198,9 +198,9 @@ function webform_requirements($phase) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Check SPAM protection. - /****************************************************************************/ + /* ************************************************************************ */ if (\Drupal::config('webform.settings')->get('requirements.spam')) { $spam_protection = FALSE; diff --git a/web/modules/webform/includes/webform.install.update.inc b/web/modules/webform/includes/webform.install.update.inc index 357f4921eb..24410a8bc4 100644 --- a/web/modules/webform/includes/webform.install.update.inc +++ b/web/modules/webform/includes/webform.install.update.inc @@ -8,6 +8,7 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\Component\Uuid\Php as Uuid; use Drupal\Core\Cache\Cache; +use Drupal\Core\Database\SchemaObjectExistsException; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Database\Database; use Drupal\Core\Render\Element; @@ -43,17 +44,17 @@ function webform_update_dependencies() { return $dependencies; } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta1 - December 7, 2016 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta2 - December 8, 2016 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta3 - December, 21 2016. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2834203: Convert webform field target_id to 32 characters. @@ -125,9 +126,9 @@ function webform_update_8005() { // @see webform_update_8006() which fixes this broken hook. } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta4 - December 26, 2016. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2837090: Undefined function call webform_schema. @@ -169,9 +170,9 @@ function webform_update_8006() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta5 - January 30, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2840521: Add support for global CSS and JS. @@ -288,9 +289,9 @@ function webform_update_8013() { _webform_update_actions(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta6 - February 13, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2848042: Rework #type shorthand prefix handling. @@ -374,13 +375,13 @@ function webform_update_8018() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta7 - February 15, 2017 (No updates required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta8 - March 5, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2853302: Allow confirmation page title to be customized. @@ -401,13 +402,13 @@ function webform_update_8020() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta9 - March 5, 2017 (No updates required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta10 - April 4, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2858139: Add OptGroup support to WebformOption entity. @@ -743,13 +744,13 @@ function webform_update_8034() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta11 - April 6, 2017 (No updates required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta12 - April 21, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2867529: Email handler states setting should be index array. @@ -866,9 +867,9 @@ function webform_update_8041() { $config->save(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta13 - May 31, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2875371: Can't Add Email Handler w/Select "Send To". @@ -1122,9 +1123,9 @@ function webform_update_8049() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta14 - June 28, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2856472: Allow multiple drafts per users. @@ -1278,9 +1279,9 @@ function webform_update_8062() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta15 - June 30, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2891108: Recreating deleted webform with same name results in error. @@ -1297,9 +1298,9 @@ function webform_update_8063() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta16 - August 7, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2878193: Allow actions (aka submit buttons) to be placed anywhere on a webform. @@ -1455,9 +1456,9 @@ function webform_update_8071() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta17 - September 10 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2901738: Add support conditions to WebformHandler. @@ -1536,9 +1537,9 @@ function webform_update_8075() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta18 - September 12, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2908080: Allow options single and multiple format to be specified during export. @@ -1575,9 +1576,9 @@ function webform_update_8076() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta19 - September 28, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2909723: Improve hook requirements. @@ -1613,9 +1614,9 @@ function webform_update_8079() { $admin_config->save(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta20 - October 30, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2914153: Add 'More' hide/show text support to elements. @@ -1704,13 +1705,13 @@ function webform_update_8087() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta21 - October 30, 2017 (No updates required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta22 - November 1, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2919989: Add horizontal rule element. @@ -1719,17 +1720,17 @@ function webform_update_8088() { _webform_update_admin_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta23 - November 2, 2017 (No updates required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta24 - November 16, 2017 (No updates required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-beta25 - December 11, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2920762: Typo in update 8087: "wizard_comfirmation_label". @@ -1798,9 +1799,9 @@ function webform_update_8094() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc1 - December 25, 2017. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2918721: Access controlling Webform administration. @@ -1844,9 +1845,9 @@ function webform_update_8097() { _webform_update_webform_handler_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc2 - January 30, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2933705: Element Range. @@ -1973,9 +1974,9 @@ function webform_update_8104() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc3 - February 4, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2941174 Notice: Undefined index: administer in WebformEntitySettingsAccessForm. @@ -1985,9 +1986,9 @@ function webform_update_8105() { webform_update_8095(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc4 - March 13, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2934970: Fully support for inline error form. @@ -2133,17 +2134,17 @@ function webform_update_8114() { ->execute(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc5 - March 14, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc6 - March 16, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc7 - March 23, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2955218: Allow query and token to be removed from confirmation URL. @@ -2152,9 +2153,9 @@ function webform_update_8115() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc8 - April 2, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Stop #multiple__label and #multiple__labels from being saved with every element. @@ -2179,9 +2180,9 @@ function webform_update_8117() { $config->save(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc9 - April 7, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2957074: Invalid Tokens in Email Handler. @@ -2224,17 +2225,17 @@ function webform_update_8121() { _webform_update_webform_handler_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc10 - April 9, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc11 - April 20, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc12 - April 25 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2952419: Attached files are deleted without usage checking. @@ -2243,9 +2244,9 @@ function webform_update_8122() { _webform_update_admin_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc13 - June 4, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2962442: Remove [webform-authenticated-user] token and use [current-user] token with clear value option. @@ -2308,9 +2309,9 @@ function webform_update_8126() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc14 - June 6, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2974597: Enable default publishing status of new webforms. @@ -2335,9 +2336,9 @@ function webform_update_8129() { _webform_update_webform_handler_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc15 - June 12, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2974153: Non admin duplicate form. @@ -2346,9 +2347,9 @@ function webform_update_8130() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc16 - June 29, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2980470: Convert email handler "default" settings to use "_default_" to prevent localization issues. @@ -2411,9 +2412,9 @@ function webform_update_8132() { _webform_update_admin_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc17 - August 6, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2890861: Webform toggle element is not accessible. @@ -2476,13 +2477,13 @@ function webform_update_8136() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc18 - August 7, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc19 - September 6, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Update #counter_* attributes. @@ -2661,17 +2662,17 @@ function webform_update_8143() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc20 - September 7, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc21 - September 8, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc22. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2998239: Swift Mailer no longer working after custom email handler theme option was added. @@ -2718,9 +2719,9 @@ function webform_update_8146() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc23 - October 20, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #3006468: Hide empty fields on on submission page. @@ -2753,9 +2754,9 @@ function webform_update_8149() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc24 - October 22, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #2980032: SUBMISSION BEHAVIORS: Allow edit the previous submission. @@ -2764,17 +2765,17 @@ function webform_update_8150() { _webform_update_webform_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc25 - November 5, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc26 - November 5, 2018 (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc27 - November 28, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #3013767: Computed twig element is not working on multi-step form. @@ -2870,9 +2871,9 @@ function webform_update_8154() { _webform_update_webform_settings(); } -/******************************************************************************/ -// Webform-8.x-5.0-rc28 - December 7, 2018 -/******************************************************************************/ +/* ************************************************************************** */ +// Webform-8.x-5.0-rc28 - December 7, 2018. +/* ************************************************************************** */ /** * Issue #3017679: 2 different validation range modes for date/time field. @@ -2920,13 +2921,13 @@ function webform_update_8155() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc29 - December 7, 2018. (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc30 - December 16, 2018. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #3015180: Add 'webform_submission_log' submodule. @@ -2944,7 +2945,7 @@ function webform_update_8156() { try { \Drupal::service('module_installer')->install(['webform_submission_log']); } - catch (\Drupal\Core\Database\SchemaObjectExistsException $exception) { + catch (SchemaObjectExistsException $exception) { // This is actually expected. The table {webform_submission_log} would exist // from webform submission entity schema. } @@ -2971,17 +2972,17 @@ function webform_update_8156() { } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0-rc31 - December 31, 2018. (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.0 - December 24, 2018. (No update required). -/******************************************************************************/ +/* ************************************************************************** */ -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.1 - January 2, 2019. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #3022398: Possible modification to update hook and/or documentation. @@ -2990,9 +2991,9 @@ function webform_update_8157() { _webform_update_webform_submission_storage_schema(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform-8.x-5.2 - TDB. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #3023863: Typo in State/Province codes options. @@ -3021,7 +3022,7 @@ function webform_update_8159() { continue; } - list($entity_type, $field_name) = explode('.', $field_storage_config->getConfigTarget()); + [$entity_type, $field_name] = explode('.', $field_storage_config->getConfigTarget()); $bundles = $field_storage_config->getBundles(); foreach ($bundles as $bundle) { $config = \Drupal::configFactory() @@ -3936,9 +3937,9 @@ function webform_update_8214() { _webform_update_webform_handler_settings(); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform 6.x. -/******************************************************************************/ +/* ************************************************************************** */ /** * Issue #3087699: JQuery UI is being phased out from Drupal core. @@ -4010,9 +4011,6 @@ function webform_update_8603() { * Issue #3144019: Move webform_editorial to webform_test_editorial. */ function webform_update_8604() { - // Remove the webform_editorial.module which has changed to the - // webform_test_editorial.module, which is now a test module. - // Remove 'webform_editorial' from core.extensions. $extension_config = \Drupal::configFactory()->getEditable('core.extension'); $module = $extension_config->get('module'); @@ -4063,7 +4061,7 @@ function webform_update_8606() { if ($path_changed) { $webform_config->setData($data)->save(); - /** @var WebformInterface $webform */ + /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load($data['id']); $webform->setSetting('page_submit_path', $data['settings']['page_submit_path']); $webform->setSetting('page_confirm_path', $data['settings']['page_confirm_path']); @@ -4206,7 +4204,7 @@ function webform_update_8620() { webform_update_8209(); } - /** +/** * Issue #3158114: Delete own submission with secure token not working. */ function webform_update_8621() { @@ -4262,12 +4260,14 @@ function webform_update_8625() { } /** - * Issue #3240399: Move form #method, #action, and #attributes from properties to settings + * Issue #3240399: Move form #method, #action, and #attributes. */ -function webform_update_8626() { +function webform_update_8636() { // Add new method, action, and attributes settings to all webforms. _webform_update_webform_settings(); + $messages = []; + // Move properties to settings. $properties = [ '#method' => 'form_method', @@ -4278,7 +4278,13 @@ function webform_update_8626() { foreach ($config_factory->listAll('webform.webform.') as $webform_config_name) { $webform_config = $config_factory->getEditable($webform_config_name); $data = $webform_config->getRawData(); - $elements = WebformYaml::decode($data['elements']); + try { + $elements = WebformYaml::decode($data['elements']); + } + catch (\Exception $exception) { + $messages[] = $webform_config_name . ' - ' . $exception->getMessage(); + continue; + } $has_property = FALSE; foreach ($properties as $property_name => $setting_name) { if (isset($elements[$property_name])) { @@ -4293,4 +4299,6 @@ function webform_update_8626() { $webform_config->save(); } } + + return implode(PHP_EOL, $messages); } diff --git a/web/modules/webform/includes/webform.libraries.inc b/web/modules/webform/includes/webform.libraries.inc index 506cbe94b2..6c4ba63395 100644 --- a/web/modules/webform/includes/webform.libraries.inc +++ b/web/modules/webform/includes/webform.libraries.inc @@ -63,7 +63,7 @@ function webform_library_info_alter(&$libraries, $extension) { $tippyjs_library = $libraries_manager->getLibrary('tippyjs/6.x'); $libraries['libraries.tippyjs']['directory'] = 'tippyjs/6.x'; $libraries['libraries.tippyjs']['version'] = $tippyjs_library['version']; - $libraries['libraries.tippyjs']['cdn'] = ['/libraries/tippyjs/6.x/' => 'https://unpkg.com/tippy.js@' . $tippyjs_library['version'] . '/dist/']; + $libraries['libraries.tippyjs']['cdn'] = ['/libraries/tippyjs/6.x/' => 'https://unpkg.com/tippy.js@' . $tippyjs_library['version'] . '/dist/']; $libraries['libraries.tippyjs']['js'] = ['/libraries/tippyjs/6.x/' . basename($tippyjs_library['download_url']->toString()) => []]; } diff --git a/web/modules/webform/includes/webform.theme.inc b/web/modules/webform/includes/webform.theme.inc index 1428a0db2b..0994137a0e 100644 --- a/web/modules/webform/includes/webform.theme.inc +++ b/web/modules/webform/includes/webform.theme.inc @@ -12,12 +12,14 @@ use Drupal\Core\Template\Attribute; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\webform\Element\WebformSelectOther; +use Drupal\webform\Plugin\WebformElement\Radios as WebformRadios; +use Drupal\webform\Plugin\WebformElement\WebformEntityRadios; use Drupal\webform\Utility\WebformAccessibilityHelper; use Drupal\webform\Utility\WebformElementHelper; -/******************************************************************************/ +/* ************************************************************************** */ // Theme hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_theme(). @@ -43,6 +45,9 @@ function webform_theme() { 'webform_actions' => [ 'render element' => 'element', ], + 'webform_access_denied' => [ + 'variables' => ['message' => '', 'attributes' => []], + ], 'webform_handler_action_summary' => [ 'variables' => ['settings' => NULL, 'handler' => NULL], @@ -228,9 +233,9 @@ function webform_theme_registry_alter(&$theme_registry) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocessors. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements preprocess_menu_local_action() for single local action link templates. @@ -328,9 +333,9 @@ function webform_preprocess_status_messages(&$variables) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocess tables. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_preprocess_table() for table templates. @@ -359,7 +364,7 @@ function webform_preprocess_table(&$variables) { // Get language from edit link. $route_parameters = $row['cells'][1]['content']['#links']['edit']['url']->getRouteParameters(); - $langcode = (isset($route_parameters['langcode'])) ? $route_parameters['langcode'] : NULL; + $langcode = $route_parameters['langcode'] ?? NULL; $language = \Drupal::languageManager()->getLanguage($langcode); // Convert the first cell in the row to a link. @@ -372,9 +377,9 @@ function webform_preprocess_table(&$variables) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocess containers. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_preprocess_datetime_form() for datetime form element templates. @@ -492,11 +497,31 @@ function webform_preprocess_fieldset(&$variables) { if (isset($element['#webform_key'])) { unset($variables['attributes']['required']); } + + // Add role="radiogroup" on fieldsets containing radiobuttons. + // Add aria-required="true" only on fieldsets containing required + // radiobuttons. + // + // Issue #3240249: Aria-required on fieldset trigger accessibility fails. + // @see https://www.drupal.org/project/webform/issues/3240249 + /** @var \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager */ + $element_manager = \Drupal::service('plugin.manager.webform.element'); + $element_plugin = $element_manager->getElementInstance($element); + $is_radios = ($element_plugin instanceof WebformRadios || $element_plugin instanceof WebformEntityRadios); + if ($is_radios) { + $variables['attributes']['role'] = 'radiogroup'; + $id = $variables['attributes']['id'] . '-legend'; + $variables['legend']['attributes']['id'] = $id; + $variables['attributes']['aria-labelledby'] = $id; + } + elseif (isset($variables['attributes']['aria-required'])) { + unset($variables['attributes']['aria-required']); + } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocess form element. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_preprocess_form_element() for form element templates. @@ -533,14 +558,16 @@ function webform_preprocess_form_element(&$variables) { // Add missing classes to the Claro theme's form elements. // @see core/modules/system/templates/form-element.html.twig // @see claro/templates/form-element.html.twig - // @todo Once Claro is stable determine if this code should removed. + // @todo Once Claro and Oliver are stable determine if this code is needed. static $is_claro_theme; + static $is_olivero_theme; if (!isset($is_claro_theme)) { /** @var \Drupal\webform\WebformThemeManagerInterface $theme_manager */ $theme_manager = \Drupal::service('webform.theme_manager'); $is_claro_theme = $theme_manager->isActiveTheme('claro'); + $is_olivero_theme = $theme_manager->isActiveTheme('olivero'); } - if ($is_claro_theme) { + if ($is_claro_theme || $is_olivero_theme) { // Add system .form-type-TYPE class. if (!empty($variables['type'])) { $variables['attributes']['class'][] = 'form-type-' . Html::getClass($variables['type']); @@ -580,9 +607,9 @@ function webform_preprocess_form_element_label(&$variables) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocess file/image elements. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_preprocess_file_managed_file() for file managed file templates. @@ -612,8 +639,8 @@ function webform_preprocess_file_managed_file(&$variables) { $label = [ '#type' => 'html_tag', '#tag' => 'label', - '#value' => (isset($element['#button__title'])) ? $element['#button__title'] : (empty($element['#multiple']) ? t('Choose file') : t('Choose files')), - '#attributes' => (isset($element['#button__attributes'])) ? $element['#button__attributes'] : [], + '#value' => $element['#button__title'] ?? (empty($element['#multiple']) ? t('Choose file') : t('Choose files')), + '#attributes' => $element['#button__attributes'] ?? [], ]; // Add 'for' attribute. @@ -702,9 +729,9 @@ function webform_preprocess_image(&$variables) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocess helpers. -/******************************************************************************/ +/* ************************************************************************** */ /** * Prepares variables for checkboxes and radios options templates. @@ -740,7 +767,7 @@ function _webform_preprocess_options(array &$variables) { */ function _webform_preprocess_element(array &$variables, $title_parents = ['title']) { $element = &$variables['element']; - $type = (isset($element['#type'])) ? $element['#type'] : ''; + $type = $element['#type'] ?? ''; // Fix details 'description' property which does not have description.content. // @see template_preprocess_details @@ -849,13 +876,13 @@ function _webform_preprocess_description_help(array &$variables) { */ function _webform_preprocess_help(array &$variables, $title_parents = ['title']) { $element = &$variables['element']; - $type = (isset($element['#type'])) ? $element['#type'] : ''; + $type = $element['#type'] ?? ''; if (empty($element['#help'])) { return; } - $help_display = (isset($element['#help_display'])) ? $element['#help_display'] : 'title_after'; + $help_display = $element['#help_display'] ?? 'title_after'; // Determine target variable (aka render element). $targets = [ @@ -957,9 +984,9 @@ function _webform_preprocess_form_element_description_more(array &$variables) { ] + array_intersect_key($element, array_flip(['#more', '#more_title'])); } -/******************************************************************************/ +/* ************************************************************************** */ // Theme suggestions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Provides alternate named suggestions for a specific theme hook. @@ -1065,10 +1092,10 @@ function webform_theme_suggestions_$hook(array \$variables) { exit; } -/******************************************************************************/ +/* ************************************************************************** */ // Webform theme suggestions. // Generate using _webform_devel_hook_theme_suggestions_generate(); -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_theme_suggestions_HOOK(). @@ -1196,9 +1223,9 @@ function webform_theme_suggestions_webform_progress_tracker(array $variables) { return _webform_theme_suggestions($variables, 'webform_progress_tracker'); } -/******************************************************************************/ +/* ************************************************************************** */ // Custom theme suggestions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Add webform options display suggestions to radios and checkboxes. diff --git a/web/modules/webform/includes/webform.theme.template.inc b/web/modules/webform/includes/webform.theme.template.inc index 029a2894ee..9759452ee0 100644 --- a/web/modules/webform/includes/webform.theme.template.inc +++ b/web/modules/webform/includes/webform.theme.template.inc @@ -436,7 +436,7 @@ function template_preprocess_webform_element_base_html(array &$variables) { if (empty($variables['options']['email']) && isset($element['#type'])) { $type = $element['#type']; - $attributes = (isset($element['#format_attributes'])) ? $element['#format_attributes'] : []; + $attributes = $element['#format_attributes'] ?? []; $attributes += ['class' => []]; // Use wrapper attributes for the id instead of #id, // this stops the <label> from having a 'for' attribute. @@ -506,9 +506,9 @@ function _template_progress_webform_set_title(array &$variables, $strip_tags = F } } -/******************************************************************************/ +/* ************************************************************************** */ // Preprocess templates. -/******************************************************************************/ +/* ************************************************************************** */ /** * Prepares variables for webform 'wizard' progress templates. @@ -618,15 +618,15 @@ function _template_preprocess_webform_progress(array &$variables) { foreach ($pages as $key => $page) { $variables['progress'][] = [ 'name' => $key, - 'title' => (isset($page['#title'])) ? $page['#title'] : '', - 'type' => (isset($page['#type'])) ? $page['#type'] : 'page', + 'title' => $page['#title'] ?? '', + 'type' => $page['#type'] ?? 'page', ]; } } -/******************************************************************************/ +/* ************************************************************************** */ // Element templates. -/******************************************************************************/ +/* ************************************************************************** */ /** * Prepares variables for webform message templates. @@ -714,13 +714,13 @@ function template_preprocess_webform_section(array &$variables) { $element = $variables['element']; Element::setAttributes($element, ['id']); RenderElement::setAttributes($element); - $variables['attributes'] = isset($element['#attributes']) ? $element['#attributes'] : []; - $variables['prefix'] = isset($element['#field_prefix']) ? $element['#field_prefix'] : NULL; - $variables['suffix'] = isset($element['#field_suffix']) ? $element['#field_suffix'] : NULL; - $variables['title_display'] = isset($element['#title_display']) ? $element['#title_display'] : NULL; - $variables['title_tag'] = isset($element['#title_tag']) ? $element['#title_tag'] : 'h2'; - $variables['title_attributes'] = isset($element['#title_attributes']) ? $element['#title_attributes'] : []; - $variables['description_display'] = isset($element['#description_display']) ? $element['#description_display'] : 'before'; + $variables['attributes'] = $element['#attributes'] ?? []; + $variables['prefix'] = $element['#field_prefix'] ?? NULL; + $variables['suffix'] = $element['#field_suffix'] ?? NULL; + $variables['title_display'] = $element['#title_display'] ?? NULL; + $variables['title_tag'] = $element['#title_tag'] ?? 'h2'; + $variables['title_attributes'] = $element['#title_attributes'] ?? []; + $variables['description_display'] = $element['#description_display'] ?? 'before'; $variables['children'] = $element['#children']; $variables['required'] = !empty($element['#required']) ? $element['#required'] : NULL; @@ -752,9 +752,9 @@ function template_preprocess_webform_section(array &$variables) { _webform_preprocess_element($variables); } -/******************************************************************************/ -// Composite templates -/******************************************************************************/ +/* ************************************************************************** */ +// Composite templates. +/* ************************************************************************** */ /** * Prepares variables for webform composite templates. @@ -774,7 +774,7 @@ function _template_preprocess_webform_composite(array &$variables) { } // Set flexbox variable used for multi column element layout. - $variables['flexbox'] = (isset($element['#flexbox'])) ? $element['#flexbox'] : FALSE; + $variables['flexbox'] = $element['#flexbox'] ?? FALSE; } /** @@ -855,9 +855,9 @@ function template_preprocess_webform_composite_telephone(array &$variables) { _template_preprocess_webform_composite($variables); } -/******************************************************************************/ -// Element templates -/******************************************************************************/ +/* ************************************************************************** */ +// Element templates. +/* ************************************************************************** */ /** * Prepares variables for webform element help templates. @@ -871,7 +871,7 @@ function template_preprocess_webform_composite_telephone(array &$variables) { * - attributes: The help attributes. */ function template_preprocess_webform_element_help(array &$variables) { - $attributes = (isset($variables['attributes'])) ? $variables['attributes'] : []; + $attributes = $variables['attributes'] ?? []; $attributes['class'][] = 'webform-element-help'; $attributes['class'][] = 'js-webform-element-help'; $attributes['role'] = 'tooltip'; diff --git a/web/modules/webform/includes/webform.translation.inc b/web/modules/webform/includes/webform.translation.inc index 0f751dd996..deccb18624 100644 --- a/web/modules/webform/includes/webform.translation.inc +++ b/web/modules/webform/includes/webform.translation.inc @@ -52,9 +52,9 @@ function webform_form_locale_translate_edit_form_alter(&$form, FormStateInterfac } } -/******************************************************************************/ +/* ************************************************************************** */ // Configuration translation. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for config translation add form. @@ -65,7 +65,6 @@ function webform_form_config_translation_add_form_alter(&$form, FormStateInterfa $translation_config_manager->alterForm($form, $form_state); } - /** * Implements hook_form_FORM_ID_alter() for config translation edit form. */ @@ -75,9 +74,9 @@ function webform_form_config_translation_edit_form_alter(&$form, FormStateInterf $translation_config_manager->alterForm($form, $form_state); } -/******************************************************************************/ +/* ************************************************************************** */ // Lingotek integration. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_lingotek_config_entity_document_upload(). diff --git a/web/modules/webform/js/webform.contextual.js b/web/modules/webform/js/webform.contextual.js index aacfe44c89..939e0a3eb3 100644 --- a/web/modules/webform/js/webform.contextual.js +++ b/web/modules/webform/js/webform.contextual.js @@ -16,6 +16,7 @@ this.href = this.href.split('?')[0]; // Add ?_webform_test={webform} to the current page's URL. + // phpcs:ignore if (/webform\/([^/]+)\/test$/.test(this.href)) { this.href = window.location.pathname + '?_webform_test=' + RegExp.$1; } diff --git a/web/modules/webform/js/webform.element.color.js b/web/modules/webform/js/webform.element.color.js index f5ff08948f..78443f8182 100644 --- a/web/modules/webform/js/webform.element.color.js +++ b/web/modules/webform/js/webform.element.color.js @@ -28,10 +28,8 @@ // the end user. var $output = $('<input class="form-color-output ' + $element.attr('class') + ' js-webform-input-mask" data-inputmask-mask="\\#######" />').uniqueId(); var $label = $element.parent('.js-form-type-color').find('label').clone(); - $label.attr({ - for: $output.attr('id'), - class: 'visually-hidden' - }); + var id = $output.attr('id'); + $label.attr({for: id, class: 'visually-hidden'}); if ($.fn.inputmask) { $output.inputmask(); } diff --git a/web/modules/webform/js/webform.element.date.js b/web/modules/webform/js/webform.element.date.js index e9c9c81612..02afc895fc 100644 --- a/web/modules/webform/js/webform.element.date.js +++ b/web/modules/webform/js/webform.element.date.js @@ -58,11 +58,11 @@ // @see http://stackoverflow.com/questions/16702398/convert-a-php-date-format-to-a-jqueryui-datepicker-date-format // @see http://php.net/manual/en/function.date.php options.dateFormat = dateFormat - // Year. + // Year. .replace('Y', 'yy') // A full numeric representation of a year, 4 digits (1999 or 2003) .replace('y', 'y') // A two digit representation of a year (99 or 03) // Month. - .replace('F', 'MM') // A full textual representation of a month, such as January or March (January through December) + .replace('F', 'MM') // A full textual representation of a month, such as January or March (January through December) .replace('m', 'mm') // Numeric representation of a month, with leading zeros (01 through 12) .replace('M', 'M') // A short textual representation of a month, three letters (Jan through Dec) .replace('n', 'm') // Numeric representation of a month, without leading zeros (1 through 12) diff --git a/web/modules/webform/js/webform.element.excluded_elements.js b/web/modules/webform/js/webform.element.excluded_elements.js new file mode 100644 index 0000000000..0267b0666d --- /dev/null +++ b/web/modules/webform/js/webform.element.excluded_elements.js @@ -0,0 +1,39 @@ +/** + * @file + * JavaScript behaviors for excluded elements. + */ + +(function ($, Drupal) { + + 'use strict'; + + /** + * Add excluded element composite element support. + * + * @type {Drupal~behavior} + */ + Drupal.behaviors.webformExcludedElementsComposite = { + attach: function (context) { + $('.form-type-webform-excluded-elements [data-composite] input:checkbox') + .once('webform-excluded-elements') + .on('click', function () { + var checked = this.checked; + var compositeKey = this.value; + $(this) + .closest('table') + .find('[data-composite-parent="' + compositeKey + '"]') + .each(function () { + // Toggle selected class on table row. + $(this).toggleClass('selected', checked); + + // Toggled enabled/disabled and checked on the + // composite sub-element. + $('input:checkbox', this) + .attr('disabled', !checked) + .prop('checked', checked); + }); + }); + } + }; + +})(jQuery, Drupal); diff --git a/web/modules/webform/js/webform.element.likert.js b/web/modules/webform/js/webform.element.likert.js index 9449de17f3..c53c64f1ca 100644 --- a/web/modules/webform/js/webform.element.likert.js +++ b/web/modules/webform/js/webform.element.likert.js @@ -23,4 +23,3 @@ }); })(jQuery, Drupal); - diff --git a/web/modules/webform/js/webform.element.location.places.js b/web/modules/webform/js/webform.element.location.places.js index bbd0717464..a2e152d540 100644 --- a/web/modules/webform/js/webform.element.location.places.js +++ b/web/modules/webform/js/webform.element.location.places.js @@ -120,4 +120,3 @@ }; })(jQuery, Drupal, drupalSettings); - diff --git a/web/modules/webform/js/webform.element.options.admin.js b/web/modules/webform/js/webform.element.options.admin.js index d3dec800ce..04ca4c12ff 100644 --- a/web/modules/webform/js/webform.element.options.admin.js +++ b/web/modules/webform/js/webform.element.options.admin.js @@ -7,7 +7,6 @@ 'use strict'; - /** * Attach handlers to options (admin) element. * @@ -51,5 +50,4 @@ } }; - })(jQuery, Drupal); diff --git a/web/modules/webform/js/webform.element.options.js b/web/modules/webform/js/webform.element.options.js index 31765293aa..41d7e74404 100644 --- a/web/modules/webform/js/webform.element.options.js +++ b/web/modules/webform/js/webform.element.options.js @@ -23,5 +23,4 @@ } }; - })(jQuery, Drupal); diff --git a/web/modules/webform/js/webform.element.select.js b/web/modules/webform/js/webform.element.select.js index 8b493e1f3b..4f2fed4bb6 100644 --- a/web/modules/webform/js/webform.element.select.js +++ b/web/modules/webform/js/webform.element.select.js @@ -24,5 +24,4 @@ } }; - })(jQuery, Drupal); diff --git a/web/modules/webform/js/webform.element.select2.js b/web/modules/webform/js/webform.element.select2.js index 5827c29b95..fabc8d26bf 100644 --- a/web/modules/webform/js/webform.element.select2.js +++ b/web/modules/webform/js/webform.element.select2.js @@ -98,5 +98,4 @@ } }); - })(jQuery, Drupal); diff --git a/web/modules/webform/js/webform.filter.js b/web/modules/webform/js/webform.filter.js index faa52b9e83..65442a0771 100644 --- a/web/modules/webform/js/webform.filter.js +++ b/web/modules/webform/js/webform.filter.js @@ -44,7 +44,7 @@ var hasDetails = $details.length; var totalItems; var args = { - '@item': $input.data('item-singlular') || Drupal.t('item'), + '@item': $input.data('item-singular') || Drupal.t('item'), '@items': $input.data('item-plural') || Drupal.t('items'), '@total': null }; @@ -64,7 +64,6 @@ } } - /** * Reset the filtering * diff --git a/web/modules/webform/js/webform.states.js b/web/modules/webform/js/webform.states.js index 314f7f793c..0d7522f214 100644 --- a/web/modules/webform/js/webform.states.js +++ b/web/modules/webform/js/webform.states.js @@ -67,7 +67,6 @@ // Dependents. /* ************************************************************************ */ - // Apply solution included in #1962800 patch. // Issue #1962800: Form #states not working with literal integers as // values in IE11. diff --git a/web/modules/webform/modules/webform_access/src/Entity/WebformAccessGroup.php b/web/modules/webform/modules/webform_access/src/Entity/WebformAccessGroup.php index 9722108a31..d833f521c0 100644 --- a/web/modules/webform/modules/webform_access/src/Entity/WebformAccessGroup.php +++ b/web/modules/webform/modules/webform_access/src/Entity/WebformAccessGroup.php @@ -207,9 +207,9 @@ public function getEmails() { return $this->emails; } - /****************************************************************************/ + /* ************************************************************************ */ // Add/Remote methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -305,9 +305,9 @@ public function removeEmail($email) { return $this; } - /****************************************************************************/ + /* ************************************************************************ */ // Caching methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_access/src/WebformAccessGroupInterface.php b/web/modules/webform/modules/webform_access/src/WebformAccessGroupInterface.php index 64f7dd2240..3a221ce8b6 100644 --- a/web/modules/webform/modules/webform_access/src/WebformAccessGroupInterface.php +++ b/web/modules/webform/modules/webform_access/src/WebformAccessGroupInterface.php @@ -99,9 +99,9 @@ public function setEmails(array $emails); */ public function getEmails(); - /****************************************************************************/ + /* ************************************************************************ */ // Add/Remote methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Add admin user id to webform access group. @@ -191,9 +191,9 @@ public function addEmail($email); */ public function removeEmail($email); - /****************************************************************************/ + /* ************************************************************************ */ // Caching methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Invalidates an entity's cache tags upon save. diff --git a/web/modules/webform/modules/webform_access/src/WebformAccessGroupListBuilder.php b/web/modules/webform/modules/webform_access/src/WebformAccessGroupListBuilder.php index b17fe081b5..eda78f817e 100644 --- a/web/modules/webform/modules/webform_access/src/WebformAccessGroupListBuilder.php +++ b/web/modules/webform/modules/webform_access/src/WebformAccessGroupListBuilder.php @@ -231,7 +231,7 @@ public function buildOperations(EntityInterface $entity) { */ public function load() { $entity_ids = $this->getEntityIds(); - /* @var $entities \Drupal\webform\WebformInterface[] */ + /** @var \Drupal\webform\WebformInterface[] $entities */ $entities = $this->storage->loadMultiple($entity_ids); // If the user is not a webform admin, check access to each access group. @@ -246,9 +246,9 @@ public function load() { return $entities; } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build a renderable array of email addresses. @@ -294,7 +294,8 @@ public static function buildUserAccounts(array $uids) { public static function buildEntities(array $entity_references) { $items = []; foreach ($entity_references as $entity_reference) { - list($entity_type, $entity_id, $field_name, $webform_id) = explode(':', $entity_reference); + // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable + [$entity_type, $entity_id, $field_name, $webform_id] = explode(':', $entity_reference); $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id); $webform = \Drupal::entityTypeManager()->getStorage('webform')->load($webform_id); if ($entity && $webform) { diff --git a/web/modules/webform/modules/webform_access/src/WebformAccessGroupStorage.php b/web/modules/webform/modules/webform_access/src/WebformAccessGroupStorage.php index 8aee4e2e70..1c1e006dff 100644 --- a/web/modules/webform/modules/webform_access/src/WebformAccessGroupStorage.php +++ b/web/modules/webform/modules/webform_access/src/WebformAccessGroupStorage.php @@ -53,7 +53,7 @@ protected function doLoadMultiple(array $ids = NULL) { $admins[$record['group_id']][] = $record['uid']; } foreach ($webform_access_groups as $group_id => $webform_access_group) { - $webform_access_group->setAdminIds((isset($admins[$group_id])) ? $admins[$group_id] : []); + $webform_access_group->setAdminIds($admins[$group_id] ?? []); } // Load users. @@ -68,7 +68,7 @@ protected function doLoadMultiple(array $ids = NULL) { $users[$record['group_id']][] = $record['uid']; } foreach ($webform_access_groups as $group_id => $webform_access_group) { - $webform_access_group->setUserIds((isset($users[$group_id])) ? $users[$group_id] : []); + $webform_access_group->setUserIds($users[$group_id] ?? []); } // Load entities. @@ -84,7 +84,7 @@ protected function doLoadMultiple(array $ids = NULL) { $entities[$group_id][] = implode(':', $record); } foreach ($webform_access_groups as $group_id => $webform_access_group) { - $webform_access_group->setEntityIds((isset($entities[$group_id])) ? $entities[$group_id] : []); + $webform_access_group->setEntityIds($entities[$group_id] ?? []); } return $webform_access_groups; @@ -137,7 +137,7 @@ protected function doSave($id, EntityInterface $entity) { ->fields(['group_id', 'entity_type', 'entity_id', 'field_name', 'webform_id']); $values = ['group_id' => $entity->id()]; foreach ($entities as $entity) { - list($values['entity_type'], $values['entity_id'], $values['field_name'], $values['webform_id']) = explode(':', $entity); + [$values['entity_type'], $values['entity_id'], $values['field_name'], $values['webform_id']] = explode(':', $entity); $query->values($values); } $query->execute(); @@ -212,7 +212,7 @@ public function getUserEntities(AccountInterface $account, $entity_type = NULL) foreach ($webform_access_groups as $webform_access_group) { $entities = $webform_access_group->getEntityIds(); foreach ($entities as $entity) { - list($source_entity_type, $source_entity_id) = explode(':', $entity); + [$source_entity_type, $source_entity_id] = explode(':', $entity); if (!$entity_type || $source_entity_type === $entity_type) { $source_entity_ids[] = $source_entity_id; } diff --git a/web/modules/webform/modules/webform_access/tests/src/Functional/WebformAccessTokensTest.php b/web/modules/webform/modules/webform_access/tests/src/Functional/WebformAccessTokensTest.php index c81c5b3d4f..f2e69b1222 100644 --- a/web/modules/webform/modules/webform_access/tests/src/Functional/WebformAccessTokensTest.php +++ b/web/modules/webform/modules/webform_access/tests/src/Functional/WebformAccessTokensTest.php @@ -46,9 +46,9 @@ public function testWebformAccessTokens() { $token_manager = \Drupal::service('webform.token_manager'); $token_data['webform_access'] = $webform_submission; - /**************************************************************************/ + /* ********************************************************************** */ // [webform_access:type:TYPE] tokens. - /**************************************************************************/ + /* ********************************************************************** */ // Check [webform_access:type:employee] token. $result = $token_manager->replace('[webform_access:type:employee]', $webform_submission, $token_data); @@ -74,9 +74,9 @@ public function testWebformAccessTokens() { $result = $token_manager->replace('[webform_access:type:manager]', $webform_submission, $token_data); $this->assertEqual('other_user@example.com,manager_admin_custom@test.com', $result); - /**************************************************************************/ + /* ********************************************************************** */ // [webform_access:type] tokens. - /**************************************************************************/ + /* ********************************************************************** */ // Check [webform_access:type] token. $result = $token_manager->replace('[webform_access:type]', $webform_submission, $token_data); diff --git a/web/modules/webform/modules/webform_access/webform_access.info.yml b/web/modules/webform/modules/webform_access/webform_access.info.yml index 842fe84e5d..b4fbe8aec4 100644 --- a/web/modules/webform/modules/webform_access/webform_access.info.yml +++ b/web/modules/webform/modules/webform_access/webform_access.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'webform:webform_node' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_access/webform_access.module b/web/modules/webform/modules/webform_access/webform_access.module index 3fc3766d58..9546c5d31f 100644 --- a/web/modules/webform/modules/webform_access/webform_access.module +++ b/web/modules/webform/modules/webform_access/webform_access.module @@ -49,9 +49,9 @@ function webform_access_webform_help_info() { return $help; } -/******************************************************************************/ +/* ************************************************************************** */ // Delete relationship hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_user_delete(). @@ -104,9 +104,9 @@ function webform_access_field_storage_config_delete(EntityInterface $entity) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Access checking. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_menu_local_tasks_alter(). @@ -299,9 +299,9 @@ function webform_access_webform_submission_query_access_alter(AlterableInterface } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform access groups (node) entity. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_field_widget_form_alter(). @@ -393,9 +393,9 @@ function _webform_access_form_node_form_submit(&$form, FormStateInterface $form_ } } -/******************************************************************************/ +/* ************************************************************************** */ // Webform access group users. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for user form. @@ -463,9 +463,9 @@ function _webform_access_user_profile_form_submit($form, FormStateInterface $for Cache::invalidateTags(['webform_submission_list']); } -/******************************************************************************/ +/* ************************************************************************** */ // Webform access group helper functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Build element used to select webform access groups. diff --git a/web/modules/webform/modules/webform_access/webform_access.tokens.inc b/web/modules/webform/modules/webform_access/webform_access.tokens.inc index cf20492c59..b1ccb9d1f3 100644 --- a/web/modules/webform/modules/webform_access/webform_access.tokens.inc +++ b/web/modules/webform/modules/webform_access/webform_access.tokens.inc @@ -8,6 +8,8 @@ use Drupal\Core\Render\BubbleableMetadata; use Drupal\webform_access\Entity\WebformAccessType; +// phpcs:disable Drupal.Commenting.InlineComment.InvalidEndChar + /** * Implements hook_token_info(). */ @@ -67,7 +69,7 @@ function webform_access_token_info() { } $tokens['webform_access'] = $webform_access; - /****************************************************************************/ + /* ************************************************************************ */ return ['types' => $types, 'tokens' => $tokens]; } @@ -92,9 +94,9 @@ function webform_access_tokens($type, $tokens, array $data, array $options, Bubb // Type is always defined (type, admins, users, or emails) $type = $parts[0]; // Access type id is optional. - $webform_access_type_id = (isset($parts[1])) ? $parts[1] : NULL; + $webform_access_type_id = $parts[1] ?? NULL; // Properties can be admins, users, or emails. - $property = (isset($parts[2])) ? $parts[2] : NULL; + $property = $parts[2] ?? NULL; /** @var \Drupal\webform_access\WebformAccessGroupInterface $webform_access_group */ $webform_access_groups = $webform_access_group_storage->loadByEntities($webform, $source_entity, NULL, $webform_access_type_id); diff --git a/web/modules/webform/modules/webform_attachment/src/Controller/WebformAttachmentController.php b/web/modules/webform/modules/webform_attachment/src/Controller/WebformAttachmentController.php index dc0cc0d68d..7bcfa1bd50 100644 --- a/web/modules/webform/modules/webform_attachment/src/Controller/WebformAttachmentController.php +++ b/web/modules/webform/modules/webform_attachment/src/Controller/WebformAttachmentController.php @@ -87,7 +87,7 @@ public function download(WebformInterface $webform, WebformSubmissionInterface $ /** @var \Drupal\webform_attachment\Element\WebformAttachmentInterface $element_info */ // Get base form element for webform element derivatives. // @see \Drupal\webform_entity_print\Plugin\Derivative\WebformEntityPrintWebformElementDeriver - list($type) = explode(':', $element['#type']); + [$type] = explode(':', $element['#type']); $element_info = $this->elementInfo->createInstance($type); // Get attachment information. diff --git a/web/modules/webform/modules/webform_attachment/src/Element/WebformAttachmentBase.php b/web/modules/webform/modules/webform_attachment/src/Element/WebformAttachmentBase.php index d44a04256f..220c45c709 100644 --- a/web/modules/webform/modules/webform_attachment/src/Element/WebformAttachmentBase.php +++ b/web/modules/webform/modules/webform_attachment/src/Element/WebformAttachmentBase.php @@ -59,9 +59,9 @@ public static function processWebformAttachment(&$element, FormStateInterface $f return $element; } - /****************************************************************************/ + /* ************************************************************************ */ // File methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentBase.php b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentBase.php index ae80b2a9ee..f2ed483a37 100644 --- a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentBase.php +++ b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentBase.php @@ -77,7 +77,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['filename', 'link_title']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -229,7 +229,7 @@ public function form(array $form, FormStateInterface $form_state) { // Add warning about disabled attachments. $form['conditional_logic']['states_attachment'] = [ '#type' => 'webform_message', - '#message_message' => t('Disabled attachments will not be included as file attachments in sent emails.'), + '#message_message' => $this->t('Disabled attachments will not be included as file attachments in sent emails.'), '#message_type' => 'warning', '#message_close' => TRUE, '#message_storage' => WebformMessage::STORAGE_SESSION, diff --git a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentToken.php b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentToken.php index c2550f2bdb..0ca1425f11 100644 --- a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentToken.php +++ b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentToken.php @@ -25,7 +25,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentTwig.php b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentTwig.php index 3a962ef5cf..5302fd10cb 100644 --- a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentTwig.php +++ b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentTwig.php @@ -27,7 +27,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentUrl.php b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentUrl.php index e7715deaed..d330adf577 100644 --- a/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentUrl.php +++ b/web/modules/webform/modules/webform_attachment/src/Plugin/WebformElement/WebformAttachmentUrl.php @@ -34,7 +34,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['url']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_attachment/tests/modules/webform_attachment_test/webform_attachment_test.info.yml b/web/modules/webform/modules/webform_attachment/tests/modules/webform_attachment_test/webform_attachment_test.info.yml index b5e342cf39..6b3110f71d 100644 --- a/web/modules/webform/modules/webform_attachment/tests/modules/webform_attachment_test/webform_attachment_test.info.yml +++ b/web/modules/webform/modules/webform_attachment/tests/modules/webform_attachment_test/webform_attachment_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_attachment' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_attachment/tests/src/Functional/WebformAttachmentTest.php b/web/modules/webform/modules/webform_attachment/tests/src/Functional/WebformAttachmentTest.php index cf089aec83..8df8730792 100644 --- a/web/modules/webform/modules/webform_attachment/tests/src/Functional/WebformAttachmentTest.php +++ b/web/modules/webform/modules/webform_attachment/tests/src/Functional/WebformAttachmentTest.php @@ -29,9 +29,9 @@ public function testWebformAttachment() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Email. - /**************************************************************************/ + /* ********************************************************************** */ $webform_id = 'test_attachment_email'; $webform_attachment_email = Webform::load($webform_id); @@ -78,9 +78,9 @@ public function testWebformAttachment() { $this->drupalGet("/webform/$webform_id/submissions/$sid/attachment/email/attachment-$attachment_date.xml"); $this->assertResponse(404, 'Page not found when not an attachment element is specified'); - /**************************************************************************/ + /* ********************************************************************** */ // Token. - /**************************************************************************/ + /* ********************************************************************** */ $webform_id = 'test_attachment_token'; $webform_attachment_token = Webform::load('test_attachment_token'); @@ -102,9 +102,9 @@ public function testWebformAttachment() { $this->drupalGet("/webform/$webform_id/submissions/$sid/attachment/webform_attachment_token_download/test_token.txt"); $this->assertRaw('textfield: Some text'); - /**************************************************************************/ + /* ********************************************************************** */ // Twig. - /**************************************************************************/ + /* ********************************************************************** */ $webform_id = 'test_attachment_twig'; $webform_attachment_twig = Webform::load('test_attachment_twig'); @@ -127,9 +127,9 @@ public function testWebformAttachment() { $this->assertRaw('<?xml version="1.0"?> <textfield>Some text</textfield>'); - /**************************************************************************/ + /* ********************************************************************** */ // URL. - /**************************************************************************/ + /* ********************************************************************** */ $webform_id = 'test_attachment_url'; $webform_attachment_url = Webform::load('test_attachment_url'); @@ -156,9 +156,9 @@ public function testWebformAttachment() { $this->drupalGet("/webform/$webform_id/submissions/$sid/attachment/webform_attachment_url_download/MAINTAINERS.txt"); $this->assertRaw('https://www.drupal.org/contribute'); - /**************************************************************************/ + /* ********************************************************************** */ // Access. - /**************************************************************************/ + /* ********************************************************************** */ // Switch to anonymous user. $this->drupalLogout(); @@ -215,9 +215,9 @@ public function testWebformAttachment() { $this->drupalGet("/webform/$webform_id/submissions/$sid/attachment/private/private.txt"); $this->assertResponse(200, 'Access allowed to private.txt'); - /**************************************************************************/ + /* ********************************************************************** */ // Sanitize. - /**************************************************************************/ + /* ********************************************************************** */ $webform_attachment_santize = Webform::load('test_attachment_sanitize'); @@ -226,9 +226,9 @@ public function testWebformAttachment() { $element = $webform_attachment_santize->getElement('webform_attachment_token'); $this->assertEqual(WebformAttachmentToken::getFileName($element, $webform_submission), 'some-text.txt'); - /**************************************************************************/ + /* ********************************************************************** */ // States (enabled/disabled). - /**************************************************************************/ + /* ********************************************************************** */ $webform_id = 'test_attachment_states'; $webform_attachment_states = Webform::load($webform_id); diff --git a/web/modules/webform/modules/webform_attachment/webform_attachment.info.yml b/web/modules/webform/modules/webform_attachment/webform_attachment.info.yml index 9bfd9ddb5a..ac7ebe8c85 100644 --- a/web/modules/webform/modules/webform_attachment/webform_attachment.info.yml +++ b/web/modules/webform/modules/webform_attachment/webform_attachment.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_bootstrap/tests/modules/webform_bootstrap_test_module/webform_bootstrap_test_module.info.yml b/web/modules/webform/modules/webform_bootstrap/tests/modules/webform_bootstrap_test_module/webform_bootstrap_test_module.info.yml index 541704bc30..b8361c1317 100644 --- a/web/modules/webform/modules/webform_bootstrap/tests/modules/webform_bootstrap_test_module/webform_bootstrap_test_module.info.yml +++ b/web/modules/webform/modules/webform_bootstrap/tests/modules/webform_bootstrap_test_module/webform_bootstrap_test_module.info.yml @@ -9,7 +9,7 @@ dependencies: # Issue #3110478: [Webform 8.x-6.x] Track the D9 readiness state of the Webform module's (optional) dependencies. # - 'styleguide:styleguide' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/src/Plugin/Preprocess/Region.php b/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/src/Plugin/Preprocess/Region.php index cac9f5330e..c1d79f076d 100644 --- a/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/src/Plugin/Preprocess/Region.php +++ b/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/src/Plugin/Preprocess/Region.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\webform_bootstrap_test_theme\Plugin\Preprocess; diff --git a/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/webform_bootstrap_test_theme.info.yml b/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/webform_bootstrap_test_theme.info.yml index e347869d8e..c603af0f17 100644 --- a/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/webform_bootstrap_test_theme.info.yml +++ b/web/modules/webform/modules/webform_bootstrap/tests/themes/webform_bootstrap_test_theme/webform_bootstrap_test_theme.info.yml @@ -22,7 +22,7 @@ regions: libraries: - 'webform_bootstrap_test_theme/global-styling' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.info.yml b/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.info.yml index 5556642da9..e69254bd71 100644 --- a/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.info.yml +++ b/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.module b/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.module index f69bbbde1f..87ac8e6c40 100644 --- a/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.module +++ b/web/modules/webform/modules/webform_bootstrap/webform_bootstrap.module @@ -5,12 +5,13 @@ * Helps support Webform to Bootstrap integration. */ -use Drupal\Core\Asset\AttachedAssetsInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\webform\Utility\WebformArrayHelper; use Drupal\webform\Utility\WebformElementHelper; use Drupal\webform_bootstrap\WebformBootstrapRenderCallbacks; +// phpcs:disable Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing + /** * Implements hook_page_attachments(). */ @@ -25,7 +26,7 @@ function webform_bootstrap_page_attachments(array &$attachments) { /** * Implements hook_webform_element_ELEMENT_TYPE_alter(). */ -function webform_bootstrap_webform_element_webform_terms_of_service_alter(array &$element, \Drupal\Core\Form\FormStateInterface $form_state, array $context) { +function webform_bootstrap_webform_element_webform_terms_of_service_alter(array &$element, FormStateInterface $form_state, array $context) { // Terms of service agreement must always be displayed, so disable // smart description. $element['#smart_description'] = FALSE; @@ -34,7 +35,7 @@ function webform_bootstrap_webform_element_webform_terms_of_service_alter(array /** * Implements hook_webform_element_ELEMENT_TYPE_alter(). */ -function webform_bootstrap_webform_element_webform_likert_alter(array &$element, \Drupal\Core\Form\FormStateInterface $form_state, array $context) { +function webform_bootstrap_webform_element_webform_likert_alter(array &$element, FormStateInterface $form_state, array $context) { $element['#pre_render'] = array_merge([[WebformBootstrapRenderCallbacks::class, 'webformLikertPreRender']], $element['#pre_render']); } diff --git a/web/modules/webform/modules/webform_cards/src/Plugin/WebformElement/WebformCard.php b/web/modules/webform/modules/webform_cards/src/Plugin/WebformElement/WebformCard.php index 74023131c6..ff7aac60a8 100644 --- a/web/modules/webform/modules/webform_cards/src/Plugin/WebformElement/WebformCard.php +++ b/web/modules/webform/modules/webform_cards/src/Plugin/WebformElement/WebformCard.php @@ -47,7 +47,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['prev_button_label', 'next_button_label']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_cards/tests/modules/webform_cards_test/webform_cards_test.info.yml b/web/modules/webform/modules/webform_cards/tests/modules/webform_cards_test/webform_cards_test.info.yml index 89286d80ad..2844efc796 100644 --- a/web/modules/webform/modules/webform_cards/tests/modules/webform_cards_test/webform_cards_test.info.yml +++ b/web/modules/webform/modules/webform_cards/tests/modules/webform_cards_test/webform_cards_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_cards' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAjaxJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAjaxJavaScriptTest.php index ab32e8b968..f0565b4758 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAjaxJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAjaxJavaScriptTest.php @@ -28,7 +28,7 @@ public function testAjax() { $page = $session->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ // Get the webform and load card 1. $this->drupalGet('/webform/test_cards_ajax'); @@ -54,7 +54,7 @@ public function testAjax() { $actual_path = parse_url($this->getSession()->getCurrentUrl(), PHP_URL_PATH) ?: ''; $this->assertEquals($base_path . 'webform/test_cards_ajax', $actual_path); - /**************************************************************************/ + /* ********************************************************************** */ // Get the webform and load card 1. $this->drupalGet('/webform/test_cards_ajax'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAutoForwardJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAutoForwardJavaScriptTest.php index 1959fd9961..28b954c0c7 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAutoForwardJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsAutoForwardJavaScriptTest.php @@ -26,7 +26,7 @@ public function testAutoForward() { $page = $session->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_cards_auto_forward'); $assert_session->waitForElement('css', '.webform-card--active[data-webform-key="textfield"]'); @@ -67,7 +67,7 @@ public function testAutoForward() { $page->pressButton('edit-submit'); $assert_session->pageTextContains('New submission added to Test: Webform: Cards auto-forward.'); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_cards_auto_forward_hide'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsDraftJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsDraftJavaScriptTest.php index 15d8ad2534..77b4e0b87b 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsDraftJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsDraftJavaScriptTest.php @@ -26,7 +26,7 @@ public function testDraft() { $page = $session->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ // Get the webform and load card 1. $this->drupalGet('/webform/test_cards_draft'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsProgressJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsProgressJavaScriptTest.php index d5e922d41a..15aa48f815 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsProgressJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsProgressJavaScriptTest.php @@ -29,9 +29,9 @@ public function testProgress() { $webform = Webform::load('test_cards_progress'); - /**************************************************************************/ + /* ********************************************************************** */ // Progress (test_cards_progress). - /**************************************************************************/ + /* ********************************************************************** */ // Get the webform and load card 1. $this->drupalGet('/webform/test_cards_progress'); @@ -71,9 +71,9 @@ public function testProgress() { $this->assertElementVisible('#edit-preview-prev'); $this->assertElementVisible('#edit-submit'); - /**************************************************************************/ + /* ********************************************************************** */ // Progress track. - /**************************************************************************/ + /* ********************************************************************** */ // Enable tracking by name. $webform->setSetting('wizard_track', 'name')->save(); @@ -110,9 +110,9 @@ public function testProgress() { $page->pressButton('edit-preview-next'); $this->assertQuery('custom_param=1&page=webform_preview'); - /**************************************************************************/ + /* ********************************************************************** */ // Progress confirmation. - /**************************************************************************/ + /* ********************************************************************** */ // Check that confirmation is NOT included in progress. $this->drupalGet('/webform/test_cards_progress'); @@ -133,9 +133,9 @@ public function testProgress() { $assert_session->pageTextNotContains('Complete'); $assert_session->pageTextContains('Done'); - /**************************************************************************/ + /* ********************************************************************** */ // Progress bar and links (test_cards_progress_links). - /**************************************************************************/ + /* ********************************************************************** */ // Get the webform and load card 1. $this->drupalGet('/webform/test_cards_progress_links'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsStatesJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsStatesJavaScriptTest.php index 7dedd939f2..514d769af3 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsStatesJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsStatesJavaScriptTest.php @@ -26,7 +26,7 @@ public function testStates() { $page = $session->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ // Check that all progress steps are visible. $this->drupalGet('/webform/test_cards_states'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsToggleJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsToggleJavaScriptTest.php index d55d500940..d27739556c 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsToggleJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsToggleJavaScriptTest.php @@ -26,7 +26,7 @@ public function testToggle() { $page = $session->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_cards_toggle'); $assert_session->waitForElement('css', 'button.webform-cards-toggle'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsUiJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsUiJavaScriptTest.php index bbe323ed51..5389599bc4 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsUiJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsUiJavaScriptTest.php @@ -33,7 +33,7 @@ public function testUi() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Check that 'Add page' and 'Add card' actions are visible. $this->drupalGet('/admin/structure/webform/manage/contact'); diff --git a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsValidationJavaScriptTest.php b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsValidationJavaScriptTest.php index 1ca03bea1a..24718542a7 100644 --- a/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsValidationJavaScriptTest.php +++ b/web/modules/webform/modules/webform_cards/tests/src/FunctionalJavaScript/WebformCardsValidationJavaScriptTest.php @@ -26,7 +26,7 @@ public function testValidation() { $page = $session->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_cards_validation_errors'); diff --git a/web/modules/webform/modules/webform_cards/webform_cards.info.yml b/web/modules/webform/modules/webform_cards/webform_cards.info.yml index 210351e8a4..7f8f415523 100644 --- a/web/modules/webform/modules/webform_cards/webform_cards.info.yml +++ b/web/modules/webform/modules/webform_cards/webform_cards.info.yml @@ -8,7 +8,7 @@ dependencies: - 'webform:webform_clientside_validation' - 'drupal:inline_form_errors' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_cards/webform_cards.module b/web/modules/webform/modules/webform_cards/webform_cards.module index e888089387..4a0c9e7352 100644 --- a/web/modules/webform/modules/webform_cards/webform_cards.module +++ b/web/modules/webform/modules/webform_cards/webform_cards.module @@ -36,9 +36,9 @@ function webform_cards_entity_base_field_info(EntityTypeInterface $entity_type) } } -/******************************************************************************/ +/* ************************************************************************** */ // Menu hook. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_menu_local_actions_alter(). @@ -64,9 +64,9 @@ function webform_cards_preprocess_menu_local_action(&$variables) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Entity hook. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_ENTITY_TYPE_presave() for webform_submission entities. @@ -77,9 +77,9 @@ function webform_cards_webform_submission_presave(WebformSubmissionInterface $we } } -/******************************************************************************/ +/* ************************************************************************** */ // Form alter hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_webform_submission_form_alter(). @@ -252,7 +252,7 @@ function webform_cards_webform_submission_form_alter(array &$form, FormStateInte if ($webform->getSetting('form_unsaved', TRUE)) { $form['actions']['cards_prev']['#attributes']['data-webform-unsaved-ignore'] = TRUE; $form['actions']['cards_next']['#attributes']['data-webform-unsaved-ignore'] = TRUE; - }; + } // Process the submitted values before they are stored. $form['#entity_builders'][] = 'webform_card_webform_submission_builder'; @@ -554,9 +554,9 @@ function _webform_cards_form_alter_elements(array &$form, array $elements) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Theming. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_theme(). @@ -587,12 +587,12 @@ function template_preprocess_webform_card(array &$variables) { $element = $variables['element']; Element::setAttributes($element, ['id']); RenderElement::setAttributes($element); - $variables['attributes'] = isset($element['#attributes']) ? $element['#attributes'] : []; - $variables['prefix'] = isset($element['#field_prefix']) ? $element['#field_prefix'] : NULL; - $variables['suffix'] = isset($element['#field_suffix']) ? $element['#field_suffix'] : NULL; - $variables['title_display'] = isset($element['#title_display']) ? $element['#title_display'] : NULL; - $variables['title_tag'] = isset($element['#title_tag']) ? $element['#title_tag'] : 'h2'; - $variables['title_attributes'] = isset($element['#title_attributes']) ? $element['#title_attributes'] : []; + $variables['attributes'] = $element['#attributes'] ?? []; + $variables['prefix'] = $element['#field_prefix'] ?? NULL; + $variables['suffix'] = $element['#field_suffix'] ?? NULL; + $variables['title_display'] = $element['#title_display'] ?? NULL; + $variables['title_tag'] = $element['#title_tag'] ?? 'h2'; + $variables['title_attributes'] = $element['#title_attributes'] ?? []; $variables['children'] = $element['#children']; // Allow markup in title. diff --git a/web/modules/webform/modules/webform_clientside_validation/tests/modules/webform_clientside_validation_test/webform_clientside_validation_test.info.yml b/web/modules/webform/modules/webform_clientside_validation/tests/modules/webform_clientside_validation_test/webform_clientside_validation_test.info.yml index 7aa9cbe02c..c488c4ee00 100644 --- a/web/modules/webform/modules/webform_clientside_validation/tests/modules/webform_clientside_validation_test/webform_clientside_validation_test.info.yml +++ b/web/modules/webform/modules/webform_clientside_validation/tests/modules/webform_clientside_validation_test/webform_clientside_validation_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_clientside_validation' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_clientside_validation/tests/src/FunctionalJavascript/Validation/WebformClientSideValidationJavaScriptTest.php b/web/modules/webform/modules/webform_clientside_validation/tests/src/FunctionalJavascript/Validation/WebformClientSideValidationJavaScriptTest.php index d8109f7508..31e1aaf9cb 100644 --- a/web/modules/webform/modules/webform_clientside_validation/tests/src/FunctionalJavascript/Validation/WebformClientSideValidationJavaScriptTest.php +++ b/web/modules/webform/modules/webform_clientside_validation/tests/src/FunctionalJavascript/Validation/WebformClientSideValidationJavaScriptTest.php @@ -35,9 +35,9 @@ public function testClientSideValidation() { $page = $this->getSession()->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ // Table select. - /**************************************************************************/ + /* ********************************************************************** */ // Check that all radios and checkbox tables triggers client side validation. $this->drupalGet('/webform/test_clientside_validation'); @@ -63,9 +63,9 @@ public function testClientSideValidation() { $this->assertCssSelect('#edit-tableselect-radios.required'); $this->assertCssSelect('#edit-tableselect-radios-one[required]'); - /**************************************************************************/ + /* ********************************************************************** */ // Other elements. - /**************************************************************************/ + /* ********************************************************************** */ // Check that custom 'other' error messages work. $this->drupalGet('/webform/test_clientside_validation'); diff --git a/web/modules/webform/modules/webform_clientside_validation/webform_clientside_validation.info.yml b/web/modules/webform/modules/webform_clientside_validation/webform_clientside_validation.info.yml index 7a3e1c5e49..2e97bc7240 100644 --- a/web/modules/webform/modules/webform_clientside_validation/webform_clientside_validation.info.yml +++ b/web/modules/webform/modules/webform_clientside_validation/webform_clientside_validation.info.yml @@ -8,7 +8,7 @@ dependencies: - 'clientside_validation:clientside_validation' - 'clientside_validation:clientside_validation_jquery' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_demo/webform_demo_application_evaluation/webform_demo_application_evaluation.info.yml b/web/modules/webform/modules/webform_demo/webform_demo_application_evaluation/webform_demo_application_evaluation.info.yml index 548ea764bc..ff3dc687c6 100644 --- a/web/modules/webform/modules/webform_demo/webform_demo_application_evaluation/webform_demo_application_evaluation.info.yml +++ b/web/modules/webform/modules/webform_demo/webform_demo_application_evaluation/webform_demo_application_evaluation.info.yml @@ -9,7 +9,7 @@ dependencies: - 'webform:webform' - 'webform:webform_node' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_demo/webform_demo_event_registration/webform_demo_event_registration.info.yml b/web/modules/webform/modules/webform_demo/webform_demo_event_registration/webform_demo_event_registration.info.yml index 7fa6b6549d..ead08f16a0 100644 --- a/web/modules/webform/modules/webform_demo/webform_demo_event_registration/webform_demo_event_registration.info.yml +++ b/web/modules/webform/modules/webform_demo/webform_demo_event_registration/webform_demo_event_registration.info.yml @@ -13,7 +13,7 @@ dependencies: - 'webform:webform_scheduled_email' - 'webform:webform_share' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.info.yml b/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.info.yml index a478a44f69..fac45c68a0 100644 --- a/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.info.yml +++ b/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.info.yml @@ -11,7 +11,7 @@ dependencies: - 'webform:webform_node' - 'webform:webform_group' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.install b/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.install index 64eda4150c..73823973dd 100644 --- a/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.install +++ b/web/modules/webform/modules/webform_demo/webform_demo_group/webform_demo_group.install @@ -4,8 +4,8 @@ * @file * Install, update and uninstall functions for the webform demo group module. * - * drush php-eval "module_load_include('install', 'webform_demo_group'); webform_demo_group_install()"; - * drush php-eval "module_load_include('install', 'webform_demo_group'); webform_demo_group_uninstall()"; + * `drush php-eval "module_load_include('install', 'webform_demo_group'); webform_demo_group_install()";` + * `drush php-eval "module_load_include('install', 'webform_demo_group'); webform_demo_group_uninstall()";` */ use Drupal\Core\Language\Language; diff --git a/web/modules/webform/modules/webform_demo/webform_demo_region_contact/webform_demo_region_contact.info.yml b/web/modules/webform/modules/webform_demo/webform_demo_region_contact/webform_demo_region_contact.info.yml index 13f8471a4f..d73ccb5443 100644 --- a/web/modules/webform/modules/webform_demo/webform_demo_region_contact/webform_demo_region_contact.info.yml +++ b/web/modules/webform/modules/webform_demo/webform_demo_region_contact/webform_demo_region_contact.info.yml @@ -10,7 +10,7 @@ dependencies: - 'webform:webform_node' - 'webform:webform_access' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_devel/src/Commands/WebformDevelCommands.php b/web/modules/webform/modules/webform_devel/src/Commands/WebformDevelCommands.php index 16a5154afb..66538ba3b3 100644 --- a/web/modules/webform/modules/webform_devel/src/Commands/WebformDevelCommands.php +++ b/web/modules/webform/modules/webform_devel/src/Commands/WebformDevelCommands.php @@ -1,5 +1,7 @@ <?php +// phpcs:ignoreFile + namespace Drupal\webform_devel\Commands; use Drupal\Core\Serialization\Yaml; diff --git a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiBaseForm.php b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiBaseForm.php index 39c0d8c42d..6b0d8521c2 100644 --- a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiBaseForm.php +++ b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiBaseForm.php @@ -77,9 +77,9 @@ protected function initialize() { $this->translatableProperties = $translatable_properties; } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Cleanup webform elements. @@ -195,7 +195,7 @@ protected function wrapTranslatableValue($value) { protected function isPropertyTranslatable($property) { $property = str_replace('#', '', $property); if (strpos($property, '__') !== FALSE) { - list(, $child_property) = explode('__', $property); + [, $child_property] = explode('__', $property); return isset($this->translatableProperties[$child_property]); } else { diff --git a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiExportForm.php b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiExportForm.php index 1d33727e55..1214e08511 100644 --- a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiExportForm.php +++ b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiExportForm.php @@ -184,9 +184,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $form_state->setResponse($response); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set webform elements default values using test data. @@ -195,8 +195,6 @@ public function submitForm(array &$form, FormStateInterface $form_state) { * An render array representing elements. */ protected function setDefaultValues(array &$elements) { - /** @var \Drupal\webform\WebformInterface $webform */ - $webform = $this->getEntity(); $flattened_elements =& WebformFormHelper::flattenElements($elements); foreach ($flattened_elements as $element_key => &$element) { $element_plugin = $this->elementManager->getElementInstance($element); diff --git a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiTestForm.php b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiTestForm.php index c0b01e7b1a..7197e8f444 100644 --- a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiTestForm.php +++ b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelEntityFormApiTestForm.php @@ -87,9 +87,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->messenger()->addWarning($this->renderer->renderPlain($build)); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set webform elements default values using test data. diff --git a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelSubmissionApiForm.php b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelSubmissionApiForm.php index a5ced9547d..3437c16f05 100644 --- a/web/modules/webform/modules/webform_devel/src/Form/WebformDevelSubmissionApiForm.php +++ b/web/modules/webform/modules/webform_devel/src/Form/WebformDevelSubmissionApiForm.php @@ -56,7 +56,7 @@ public function getFormId() { public function buildForm(array $form, FormStateInterface $form_state) { /** @var \Drupal\webform\WebformInterface $webform */ /** @var \Drupal\Core\Entity\EntityInterface $source_entity */ - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); $values = []; diff --git a/web/modules/webform/modules/webform_devel/src/WebformDevelSchema.php b/web/modules/webform/modules/webform_devel/src/WebformDevelSchema.php index fc83a93f7d..60f694fabc 100644 --- a/web/modules/webform/modules/webform_devel/src/WebformDevelSchema.php +++ b/web/modules/webform/modules/webform_devel/src/WebformDevelSchema.php @@ -53,7 +53,8 @@ class WebformDevelSchema implements WebformDevelSchemaInterface { * @param \Drupal\Core\Render\ElementInfoManagerInterface $element_info * The element info manager. * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager - * The entity field manager. * @param \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager + * The entity field manager. + * @param \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager * The webform element manager. */ public function __construct(ElementInfoManagerInterface $element_info, EntityFieldManagerInterface $entity_field_manager, WebformElementManagerInterface $element_manager) { diff --git a/web/modules/webform/modules/webform_devel/webform_devel.drush.inc b/web/modules/webform/modules/webform_devel/webform_devel.drush.inc index 093b3fd140..28398301e1 100644 --- a/web/modules/webform/modules/webform_devel/webform_devel.drush.inc +++ b/web/modules/webform/modules/webform_devel/webform_devel.drush.inc @@ -42,9 +42,9 @@ function webform_devel_drush_help($section) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Reset. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). diff --git a/web/modules/webform/modules/webform_devel/webform_devel.info.yml b/web/modules/webform/modules/webform_devel/webform_devel.info.yml index 4fc58b291b..3814e44869 100644 --- a/web/modules/webform/modules/webform_devel/webform_devel.info.yml +++ b/web/modules/webform/modules/webform_devel/webform_devel.info.yml @@ -7,7 +7,7 @@ dependencies: - 'devel:devel' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_entity_print/src/Plugin/WebformExporter/WebformEntityPrintWebformExporter.php b/web/modules/webform/modules/webform_entity_print/src/Plugin/WebformExporter/WebformEntityPrintWebformExporter.php index a55bb16a32..ff49d2128e 100644 --- a/web/modules/webform/modules/webform_entity_print/src/Plugin/WebformExporter/WebformEntityPrintWebformExporter.php +++ b/web/modules/webform/modules/webform_entity_print/src/Plugin/WebformExporter/WebformEntityPrintWebformExporter.php @@ -135,9 +135,9 @@ public function getBatchLimit() { return 10; } - /****************************************************************************/ + /* ************************************************************************ */ // Export type methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get export type id. diff --git a/web/modules/webform/modules/webform_entity_print/tests/modules/webform_entity_print_test/webform_entity_print_test.info.yml b/web/modules/webform/modules/webform_entity_print/tests/modules/webform_entity_print_test/webform_entity_print_test.info.yml index 1b4ad283fc..09a1d21524 100644 --- a/web/modules/webform/modules/webform_entity_print/tests/modules/webform_entity_print_test/webform_entity_print_test.info.yml +++ b/web/modules/webform/modules/webform_entity_print/tests/modules/webform_entity_print_test/webform_entity_print_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_entity_print' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_entity_print/tests/src/Functional/WebformEntityPrintFunctionalTest.php b/web/modules/webform/modules/webform_entity_print/tests/src/Functional/WebformEntityPrintFunctionalTest.php index 89ad966535..ae6b268d87 100644 --- a/web/modules/webform/modules/webform_entity_print/tests/src/Functional/WebformEntityPrintFunctionalTest.php +++ b/web/modules/webform/modules/webform_entity_print/tests/src/Functional/WebformEntityPrintFunctionalTest.php @@ -29,9 +29,9 @@ public function testEntityPrint() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // PDF link default. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_entity_print'); $sid = $this->postSubmissionTest($webform); @@ -122,9 +122,9 @@ public function testEntityPrint() { $this->drupalGet("/admin/structure/webform/manage/test_entity_print/submission/$sid"); $this->assertNoLink('Download PDF'); - /**************************************************************************/ + /* ********************************************************************** */ // Exporter. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformSubmissionExporterInterface $submission_exporter */ $submission_exporter = \Drupal::service('webform_submission.exporter'); @@ -141,9 +141,9 @@ public function testEntityPrint() { $files = $this->getArchiveContents($submission_exporter->getArchiveFilePath()); $this->assertEquals(["submission-$sid.pdf" => "submission-$sid.pdf"], $files); - /**************************************************************************/ + /* ********************************************************************** */ // PDF link custom. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_entity_print_custom'); $sid = $this->postSubmissionTest($webform); diff --git a/web/modules/webform/modules/webform_entity_print/webform_entity_print.info.yml b/web/modules/webform/modules/webform_entity_print/webform_entity_print.info.yml index fb879b28aa..93fccb718e 100644 --- a/web/modules/webform/modules/webform_entity_print/webform_entity_print.info.yml +++ b/web/modules/webform/modules/webform_entity_print/webform_entity_print.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'entity_print:entity_print' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_entity_print/webform_entity_print.module b/web/modules/webform/modules/webform_entity_print/webform_entity_print.module index 6c2e8ea845..97a9c3e1af 100644 --- a/web/modules/webform/modules/webform_entity_print/webform_entity_print.module +++ b/web/modules/webform/modules/webform_entity_print/webform_entity_print.module @@ -21,7 +21,7 @@ /** * The name of the query parameter for webform entity print image tokens. */ -define('WEBFORM_ENTITY_PRINT_IMAGE_TOKEN', 'webform_entity_print_itok'); +define('WEBFORM_ENTITY_PRINT_IMAGE_TOKEN', 'webform_entity_print_itok'); // phpcs:ignore /** * Implements hook_webform_submission_access(). @@ -286,7 +286,7 @@ function webform_entity_print_preprocess_entity_print(array &$variables) { $webform_id = $webform->id(); $sid = $webform_submission->id(); - // Render the webform submission data + // Render the webform submission data. $html = (string) \Drupal::service('renderer')->render($content); // Only matching <img src=""/>. diff --git a/web/modules/webform/modules/webform_entity_print/webform_entity_print.webform.inc b/web/modules/webform/modules/webform_entity_print/webform_entity_print.webform.inc index e9f8ad390e..b4c37fda3d 100644 --- a/web/modules/webform/modules/webform_entity_print/webform_entity_print.webform.inc +++ b/web/modules/webform/modules/webform_entity_print/webform_entity_print.webform.inc @@ -81,8 +81,8 @@ function _webform_entity_print_form(array &$element, array $template_settings, a foreach ($export_types as $export_type => $definition) { $t_args = ['@label' => $definition['label']]; $defaults = ['enabled' => FALSE, 'link_text' => '', 'link_attributes' => []]; - $default_settings = (isset($default_export_type_settings[$export_type])) ? $default_export_type_settings[$export_type] : $defaults; - $settings = (isset($export_type_settings[$export_type])) ? $export_type_settings[$export_type] : []; + $default_settings = $default_export_type_settings[$export_type] ?? $defaults; + $settings = $export_type_settings[$export_type] ?? []; $settings += $defaults; $states_trigger = '.js-webform_entity_print-' . $export_type; $element['webform_entity_print']['export_types'][$export_type] = [ diff --git a/web/modules/webform/modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php b/web/modules/webform/modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php index f6b0d1ee89..d15ef81d7f 100644 --- a/web/modules/webform/modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php +++ b/web/modules/webform/modules/webform_entity_print_attachment/src/Element/WebformEntityPrintAttachment.php @@ -40,7 +40,7 @@ public static function getFileContent(array $element, WebformSubmissionInterface // Set view mode or render custom twig. // @see \Drupal\webform\WebformSubmissionViewBuilder::view // @see webform_entity_print_attachment_webform_submission_view_alter() - $view_mode = (isset($element['#view_mode'])) ? $element['#view_mode'] : 'html'; + $view_mode = $element['#view_mode'] ?? 'html'; if ($view_mode === 'twig') { $webform_submission->_webform_view_mode_twig = $element['#template']; } @@ -96,7 +96,7 @@ protected static function getExportTypeId(array $element) { return $element['#export_type']; } else { - list(, $export_type_id) = explode(':', $element['#type']); + [, $export_type_id] = explode(':', $element['#type']); return $export_type_id; } } diff --git a/web/modules/webform/modules/webform_entity_print_attachment/src/Plugin/WebformElement/WebformEntityPrintAttachment.php b/web/modules/webform/modules/webform_entity_print_attachment/src/Plugin/WebformElement/WebformEntityPrintAttachment.php index 64d98d95ec..fed6800ab0 100644 --- a/web/modules/webform/modules/webform_entity_print_attachment/src/Plugin/WebformElement/WebformEntityPrintAttachment.php +++ b/web/modules/webform/modules/webform_entity_print_attachment/src/Plugin/WebformElement/WebformEntityPrintAttachment.php @@ -28,6 +28,7 @@ class WebformEntityPrintAttachment extends WebformAttachmentBase { * @var \Drupal\entity_print\Plugin\ExportTypeManagerInterface */ protected $exportTypeManager; + /** * {@inheritdoc} */ @@ -50,7 +51,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -59,7 +60,7 @@ public function finalize(array &$element, WebformSubmissionInterface $webform_su parent::finalize($element, $webform_submission); // Explode element_type:export_type. // @see \Drupal\webform_entity_print_attachment\Element\WebformEntityPrintAttachment::getExportTypeId - list($element['#type'], $element['#export_type']) = explode(':', $element['#type']); + [$element['#type'], $element['#export_type']] = explode(':', $element['#type']); } /** @@ -117,7 +118,7 @@ public function form(array $form, FormStateInterface $form_state) { * An export type file extension. */ protected function getExportTypeFileExtension() { - list(, $export_type_id) = explode(':', $this->getPluginId()); + [, $export_type_id] = explode(':', $this->getPluginId()); $definition = $this->exportTypeManager->getDefinition($export_type_id); return $definition['file_extension']; } diff --git a/web/modules/webform/modules/webform_entity_print_attachment/tests/modules/webform_entity_print_attachment_test/webform_entity_print_attachment_test.info.yml b/web/modules/webform/modules/webform_entity_print_attachment/tests/modules/webform_entity_print_attachment_test/webform_entity_print_attachment_test.info.yml index 9a22805bbb..cfbd9d5df7 100644 --- a/web/modules/webform/modules/webform_entity_print_attachment/tests/modules/webform_entity_print_attachment_test/webform_entity_print_attachment_test.info.yml +++ b/web/modules/webform/modules/webform_entity_print_attachment/tests/modules/webform_entity_print_attachment_test/webform_entity_print_attachment_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_entity_print_attachment' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_entity_print_attachment/tests/src/Functional/WebformEntityPrintAttachmentFunctionalTest.php b/web/modules/webform/modules/webform_entity_print_attachment/tests/src/Functional/WebformEntityPrintAttachmentFunctionalTest.php index efe4af52e6..90e2e96e43 100644 --- a/web/modules/webform/modules/webform_entity_print_attachment/tests/src/Functional/WebformEntityPrintAttachmentFunctionalTest.php +++ b/web/modules/webform/modules/webform_entity_print_attachment/tests/src/Functional/WebformEntityPrintAttachmentFunctionalTest.php @@ -25,7 +25,7 @@ public function testEntityPrintAttachment() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Check that the PDF attachment is added to the sent email. $this->postSubmission($webform); diff --git a/web/modules/webform/modules/webform_entity_print_attachment/webform_entity_print_attachment.info.yml b/web/modules/webform/modules/webform_entity_print_attachment/webform_entity_print_attachment.info.yml index 58e82d34af..477eca1cb1 100644 --- a/web/modules/webform/modules/webform_entity_print_attachment/webform_entity_print_attachment.info.yml +++ b/web/modules/webform/modules/webform_entity_print_attachment/webform_entity_print_attachment.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform_attachment' - 'webform:webform_entity_print' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_composite/css/webform_example_composite.css b/web/modules/webform/modules/webform_example_composite/css/webform_example_composite.css index a86fd92d7f..f59527d84c 100644 --- a/web/modules/webform/modules/webform_example_composite/css/webform_example_composite.css +++ b/web/modules/webform/modules/webform_example_composite/css/webform_example_composite.css @@ -3,12 +3,6 @@ * Webform example composite styles. */ -.webform_example_composite_multiple-table--first_name {} - -.webform_example_composite_multiple-table--last_name {} - -.webform_example_composite_multiple-table--date_of_birth {} - .webform_example_composite_multiple-table--sex { min-width: 100px; } diff --git a/web/modules/webform/modules/webform_example_composite/webform_example_composite.info.yml b/web/modules/webform/modules/webform_example_composite/webform_example_composite.info.yml index 1938903a6f..3ef4b8495a 100644 --- a/web/modules/webform/modules/webform_example_composite/webform_example_composite.info.yml +++ b/web/modules/webform/modules/webform_example_composite/webform_example_composite.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_custom_form/src/Form/WebformExampleCustomFormSettingsForm.php b/web/modules/webform/modules/webform_example_custom_form/src/Form/WebformExampleCustomFormSettingsForm.php index 5cc2f56ba8..a272363bc5 100644 --- a/web/modules/webform/modules/webform_example_custom_form/src/Form/WebformExampleCustomFormSettingsForm.php +++ b/web/modules/webform/modules/webform_example_custom_form/src/Form/WebformExampleCustomFormSettingsForm.php @@ -6,6 +6,9 @@ use Drupal\Core\Form\FormStateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +// phpcs:disable DrupalPractice.General.OptionsT.TforValue +// phpcs:disable DrupalPractice.General.DescriptionT.DescriptionT + /** * Example: Webform Custom (Configuration) Form configuration settings form. */ diff --git a/web/modules/webform/modules/webform_example_custom_form/webform_example_custom_form.info.yml b/web/modules/webform/modules/webform_example_custom_form/webform_example_custom_form.info.yml index ecde84b88c..ac6c77cb03 100644 --- a/web/modules/webform/modules/webform_example_custom_form/webform_example_custom_form.info.yml +++ b/web/modules/webform/modules/webform_example_custom_form/webform_example_custom_form.info.yml @@ -8,7 +8,7 @@ dependencies: - 'webform:webform' - 'webform:webform_devel' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_element/src/Plugin/WebformElement/WebformExampleElement.php b/web/modules/webform/modules/webform_example_element/src/Plugin/WebformElement/WebformExampleElement.php index 2974891c4a..fcd411a7b3 100644 --- a/web/modules/webform/modules/webform_example_element/src/Plugin/WebformElement/WebformExampleElement.php +++ b/web/modules/webform/modules/webform_example_element/src/Plugin/WebformElement/WebformExampleElement.php @@ -41,7 +41,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_example_element/webform_example_element.info.yml b/web/modules/webform/modules/webform_example_element/webform_example_element.info.yml index 6d0dd899f8..424dd3ebce 100644 --- a/web/modules/webform/modules/webform_example_element/webform_example_element.info.yml +++ b/web/modules/webform/modules/webform_example_element/webform_example_element.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_element_properties/webform_example_element_properties.info.yml b/web/modules/webform/modules/webform_example_element_properties/webform_example_element_properties.info.yml index f0528852d2..82d942c852 100644 --- a/web/modules/webform/modules/webform_example_element_properties/webform_example_element_properties.info.yml +++ b/web/modules/webform/modules/webform_example_element_properties/webform_example_element_properties.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'webform:webform_ui' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_handler/webform_example_handler.info.yml b/web/modules/webform/modules/webform_example_handler/webform_example_handler.info.yml index b5545f46f6..c5269b26d6 100644 --- a/web/modules/webform/modules/webform_example_handler/webform_example_handler.info.yml +++ b/web/modules/webform/modules/webform_example_handler/webform_example_handler.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_remote_post/webform_example_remote_post.info.yml b/web/modules/webform/modules/webform_example_remote_post/webform_example_remote_post.info.yml index d34f74ce26..600c62e151 100644 --- a/web/modules/webform/modules/webform_example_remote_post/webform_example_remote_post.info.yml +++ b/web/modules/webform/modules/webform_example_remote_post/webform_example_remote_post.info.yml @@ -7,7 +7,7 @@ dependencies: - 'token:token' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_example_variant/webform_example_variant.info.yml b/web/modules/webform/modules/webform_example_variant/webform_example_variant.info.yml index 8764731cd6..9797e3e2b7 100644 --- a/web/modules/webform/modules/webform_example_variant/webform_example_variant.info.yml +++ b/web/modules/webform/modules/webform_example_variant/webform_example_variant.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_examples/webform_examples.info.yml b/web/modules/webform/modules/webform_examples/webform_examples.info.yml index 34d8d24d23..1cb2acbc6e 100644 --- a/web/modules/webform/modules/webform_examples/webform_examples.info.yml +++ b/web/modules/webform/modules/webform_examples/webform_examples.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.info.yml b/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.info.yml index e169e49c7b..41a771fc00 100644 --- a/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.info.yml +++ b/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'drupal:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.module b/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.module index 9305408c29..4350574686 100644 --- a/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.module +++ b/web/modules/webform/modules/webform_examples_accessibility/webform_examples_accessibility.module @@ -39,9 +39,9 @@ function webform_examples_accessibility_webform_submission_form_alter(array &$fo '#weight' => -1000, ]; - /****************************************************************************/ + /* ************************************************************************ */ // Accessibility. - /****************************************************************************/ + /* ************************************************************************ */ // Get query without ajax parameters. $query = \Drupal::request()->query->all(); @@ -55,9 +55,9 @@ function webform_examples_accessibility_webform_submission_form_alter(array &$fo '#url' => Url::fromRoute('<current>', [], ['query' => ['accessibility' => $accessibility ? 0 : 1] + $query]), ]; - /****************************************************************************/ + /* ************************************************************************ */ // Required. - /****************************************************************************/ + /* ************************************************************************ */ $form['accessibility'][] = ['#markup' => ' | ']; @@ -86,9 +86,9 @@ function webform_examples_accessibility_webform_submission_form_alter(array &$fo } } - /****************************************************************************/ + /* ************************************************************************ */ // No validate. - /****************************************************************************/ + /* ************************************************************************ */ $form['accessibility'][] = ['#markup' => ' | ']; @@ -107,9 +107,9 @@ function webform_examples_accessibility_webform_submission_form_alter(array &$fo '#url' => Url::fromRoute('<current>', [], ['query' => ['novalidate' => $novalidate ? 0 : 1] + $query]), ]; - /****************************************************************************/ + /* ************************************************************************ */ // Inline form error. - /****************************************************************************/ + /* ************************************************************************ */ if (\Drupal::moduleHandler()->moduleExists('inline_form_errors')) { $form['accessibility'][] = ['#markup' => ' | ']; diff --git a/web/modules/webform/modules/webform_group/src/WebformGroupManager.php b/web/modules/webform/modules/webform_group/src/WebformGroupManager.php index 93b69c00cc..213bb24db9 100644 --- a/web/modules/webform/modules/webform_group/src/WebformGroupManager.php +++ b/web/modules/webform/modules/webform_group/src/WebformGroupManager.php @@ -162,7 +162,7 @@ public function getCurrentGroupContent() { // Get group content id for the source entity. $group_content_ids = $group_content_storage->getQuery() - ->condition('entity_id', $source_entity->id()) + ->condition('entity_id', (int) $source_entity->id()) ->execute(); /** @var \Drupal\group\Entity\GroupContentInterface[] $group_contents */ $group_contents = $group_content_storage->loadMultiple($group_content_ids); @@ -250,9 +250,9 @@ public function getAccessRules(WebformInterface $webform) { return $access_rules; } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get current user group roles for group content. diff --git a/web/modules/webform/modules/webform_group/tests/modules/webform_group_test/webform_group_test.info.yml b/web/modules/webform/modules/webform_group/tests/modules/webform_group_test/webform_group_test.info.yml index 52791fbf64..0b049bbde3 100644 --- a/web/modules/webform/modules/webform_group/tests/modules/webform_group_test/webform_group_test.info.yml +++ b/web/modules/webform/modules/webform_group/tests/modules/webform_group_test/webform_group_test.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform_group' - 'group:group_test_config' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupElementAccessTest.php b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupElementAccessTest.php index 6ffe193fed..9a04d8452f 100644 --- a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupElementAccessTest.php +++ b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupElementAccessTest.php @@ -30,9 +30,9 @@ public function testGroupElementAccess() { $group->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Webform node not related to any group. - /**************************************************************************/ + /* ********************************************************************** */ // Logout. $this->drupalLogout(); @@ -67,9 +67,9 @@ public function testGroupElementAccess() { $this->assertNoFieldByName('member'); $this->assertNoFieldByName('custom'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform node related to a group. - /**************************************************************************/ + /* ********************************************************************** */ // Add webform node to group. $group->addContent($node, 'group_node:webform'); diff --git a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupFormAccessTest.php b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupFormAccessTest.php index 6ad70e91e5..cd003c8195 100644 --- a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupFormAccessTest.php +++ b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupFormAccessTest.php @@ -36,9 +36,9 @@ public function testGroupFormAccess() { $group->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Create access. - /**************************************************************************/ + /* ********************************************************************** */ // Logout. $this->drupalLogout(); @@ -111,9 +111,9 @@ public function testGroupFormAccess() { $this->drupalGet('/node/' . $node->id()); $this->assertFieldByName('message'); - /**************************************************************************/ + /* ********************************************************************** */ // Update any access. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogout(); diff --git a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupRolesElementTest.php b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupRolesElementTest.php index 7db58d0449..061da272f6 100644 --- a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupRolesElementTest.php +++ b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupRolesElementTest.php @@ -19,7 +19,7 @@ class WebformGroupRolesElementTest extends WebformGroupBrowserTestBase { public function testGroupRolesElement() { $webform = Webform::load('test_element_group_roles'); - /**************************************************************************/ + /* ********************************************************************** */ // Check default element properties. $element = []; diff --git a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupTokensTest.php b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupTokensTest.php index 26c3074ab3..c532664cfc 100644 --- a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupTokensTest.php +++ b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupTokensTest.php @@ -49,9 +49,9 @@ public function testWebformAccessTokens() { $token_manager = \Drupal::service('webform.token_manager'); $token_data['webform_group'] = $webform_submission; - /**************************************************************************/ + /* ********************************************************************** */ // [webform_group:role:GROUP_ROLE] tokens. - /**************************************************************************/ + /* ********************************************************************** */ // Enable group roles and owner. \Drupal::configFactory()->getEditable('webform_group.settings') diff --git a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupUserInterfaceTest.php b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupUserInterfaceTest.php index d7d03dcdb3..5e903fabb8 100644 --- a/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupUserInterfaceTest.php +++ b/web/modules/webform/modules/webform_group/tests/src/Functional/WebformGroupUserInterfaceTest.php @@ -24,9 +24,9 @@ class WebformGroupUserInterfaceTest extends WebformGroupBrowserTestBase { public function testGroupUserInterfaceAccess() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Webform. - /**************************************************************************/ + /* ********************************************************************** */ // Check 'Webform Access' integration. // @see webform_group_form_webform_settings_access_form_alter() @@ -44,9 +44,9 @@ public function testGroupUserInterfaceAccess() { $this->debug($access_rules); $this->assertEqual($access_rules['create']['group_roles'], ['member']); - /**************************************************************************/ + /* ********************************************************************** */ // Element. - /**************************************************************************/ + /* ********************************************************************** */ // Check 'Element' integration. // @see webform_group_form_webform_ui_element_form_alter() @@ -63,9 +63,9 @@ public function testGroupUserInterfaceAccess() { $element = $webform->getElement('name'); $this->assertEqual($element['#access_create_group_roles'], ['member']); - /**************************************************************************/ + /* ********************************************************************** */ // Handler. - /**************************************************************************/ + /* ********************************************************************** */ // Check that group roles must be enabled for 'Email Handler' integration. // @see webform_group_form_webform_handler_form_alter() diff --git a/web/modules/webform/modules/webform_group/webform_group.info.yml b/web/modules/webform/modules/webform_group/webform_group.info.yml index 6dd9fb294f..e1c6b7f0db 100644 --- a/web/modules/webform/modules/webform_group/webform_group.info.yml +++ b/web/modules/webform/modules/webform_group/webform_group.info.yml @@ -9,7 +9,7 @@ dependencies: - 'group:group' - 'group:gnode' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_group/webform_group.module b/web/modules/webform/modules/webform_group/webform_group.module index fb014d7372..d3687794f7 100644 --- a/web/modules/webform/modules/webform_group/webform_group.module +++ b/web/modules/webform/modules/webform_group/webform_group.module @@ -16,9 +16,9 @@ use Drupal\webform\Plugin\WebformHandler\EmailWebformHandler; use Drupal\webform\WebformSubmissionInterface; -/******************************************************************************/ +/* ************************************************************************** */ // Schema definitions hook. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_config_schema_info_alter(). @@ -36,9 +36,9 @@ function webform_group_config_schema_info_alter(&$definitions) { ]; } -/******************************************************************************/ +/* ************************************************************************** */ // Form and element UI alter hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_FORM_ID_alter() for webform handler form. @@ -287,9 +287,9 @@ function _webform_group_form_webform_admin_config_handlers_form_submit(&$form, F } } -/******************************************************************************/ +/* ************************************************************************** */ // Access controls. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_ENTITY_TYPE_access() for webform entities. diff --git a/web/modules/webform/modules/webform_group/webform_group.tokens.inc b/web/modules/webform/modules/webform_group/webform_group.tokens.inc index 446acdeafc..b44f461936 100644 --- a/web/modules/webform/modules/webform_group/webform_group.tokens.inc +++ b/web/modules/webform/modules/webform_group/webform_group.tokens.inc @@ -78,7 +78,7 @@ function webform_group_token_info() { $tokens['webform_group'] = $webform_group; - /****************************************************************************/ + /* ************************************************************************ */ return ['types' => $types, 'tokens' => $tokens]; } @@ -108,7 +108,7 @@ function webform_group_tokens($type, $tokens, array $data, array $options, Bubbl if ($token_name === 'role') { // Get group role id. - $token_role_id = (isset($parts[1])) ? $parts[1] : NULL; + $token_role_id = $parts[1] ?? NULL; if (!$token_role_id) { continue; } diff --git a/web/modules/webform/modules/webform_icheck/js/webform_icheck.element.js b/web/modules/webform/modules/webform_icheck/js/webform_icheck.element.js index 66a5c0563f..86bfb17270 100644 --- a/web/modules/webform/modules/webform_icheck/js/webform_icheck.element.js +++ b/web/modules/webform/modules/webform_icheck/js/webform_icheck.element.js @@ -106,5 +106,4 @@ }); } - })(jQuery, Drupal); diff --git a/web/modules/webform/modules/webform_icheck/tests/modules/webform_icheck_test/webform_icheck_test.info.yml b/web/modules/webform/modules/webform_icheck/tests/modules/webform_icheck_test/webform_icheck_test.info.yml index 7646061259..0abd8bc9f9 100644 --- a/web/modules/webform/modules/webform_icheck/tests/modules/webform_icheck_test/webform_icheck_test.info.yml +++ b/web/modules/webform/modules/webform_icheck/tests/modules/webform_icheck_test/webform_icheck_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_icheck' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_icheck/webform_icheck.info.yml b/web/modules/webform/modules/webform_icheck/webform_icheck.info.yml index 384709a495..9576166552 100644 --- a/web/modules/webform/modules/webform_icheck/webform_icheck.info.yml +++ b/web/modules/webform/modules/webform_icheck/webform_icheck.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_icheck/webform_icheck.module b/web/modules/webform/modules/webform_icheck/webform_icheck.module index 0b1a8732e6..eb92206ba6 100644 --- a/web/modules/webform/modules/webform_icheck/webform_icheck.module +++ b/web/modules/webform/modules/webform_icheck/webform_icheck.module @@ -70,7 +70,7 @@ function webform_icheck_webform_element_configuration_form_alter(&$form, FormSta * Implements hook_webform_element_alter(). */ function webform_icheck_webform_element_alter(array &$element, FormStateInterface $form_state, array $context) { - $element_type = (isset($element['#type'])) ? $element['#type'] : ''; + $element_type = $element['#type'] ?? ''; if (!_webform_icheck_is_supported($element_type)) { return; } diff --git a/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelect.php b/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelect.php index cd4a2f0e6c..5e6577942b 100644 --- a/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelect.php +++ b/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelect.php @@ -46,7 +46,7 @@ public static function processSelect(&$element, FormStateInterface $form_state, // Add label filter. if ($element['#show_label'] && $element['#filter']) { - $field_prefix = (isset($element['#field_prefix'])) ? $element['#field_prefix'] : NULL; + $field_prefix = $element['#field_prefix'] ?? NULL; $wrapper_class = 'js-' . Html::getClass($element['#name'] . '-filter'); $element['#wrapper_attributes']['class'][] = $wrapper_class; diff --git a/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelectImages.php b/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelectImages.php index 9e72c55ccc..99e0ee3fab 100644 --- a/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelectImages.php +++ b/web/modules/webform/modules/webform_image_select/src/Element/WebformImageSelectImages.php @@ -22,8 +22,8 @@ public function getInfo() { $class = get_class($this); return [ '#input' => TRUE, - '#label' => t('image'), - '#labels' => t('images'), + '#label' => $this->t('image'), + '#labels' => $this->t('images'), '#min_items' => 3, '#empty_items' => 1, '#add_more_items' => 1, @@ -100,7 +100,7 @@ public static function processWebformImageSelectImages(&$element, FormStateInter ], '#error_no_message' => TRUE, '#add_more_input_label' => t('more images'), - '#default_value' => (isset($element['#default_value'])) ? $element['#default_value'] : [], + '#default_value' => $element['#default_value'] ?? [], ]; if (function_exists('imce_process_url_element')) { diff --git a/web/modules/webform/modules/webform_image_select/src/Plugin/WebformElement/WebformImageSelect.php b/web/modules/webform/modules/webform_image_select/src/Plugin/WebformElement/WebformImageSelect.php index b1debb758b..b62171864a 100644 --- a/web/modules/webform/modules/webform_image_select/src/Plugin/WebformElement/WebformImageSelect.php +++ b/web/modules/webform/modules/webform_image_select/src/Plugin/WebformElement/WebformImageSelect.php @@ -84,7 +84,7 @@ protected function defineTranslatableProperties() { ]); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_image_select/src/WebformImageSelectImagesStorage.php b/web/modules/webform/modules/webform_image_select/src/WebformImageSelectImagesStorage.php index 3697288d86..e9892f558b 100644 --- a/web/modules/webform/modules/webform_image_select/src/WebformImageSelectImagesStorage.php +++ b/web/modules/webform/modules/webform_image_select/src/WebformImageSelectImagesStorage.php @@ -74,7 +74,7 @@ public function getUsedByWebforms(WebformImageSelectImagesInterface $webform_ima } $options_id = $webform_images->id(); - return (isset($this->usedByWebforms[$options_id])) ? $this->usedByWebforms[$options_id] : []; + return $this->usedByWebforms[$options_id] ?? []; } } diff --git a/web/modules/webform/modules/webform_image_select/tests/modules/webform_image_select_test/webform_image_select_test.info.yml b/web/modules/webform/modules/webform_image_select/tests/modules/webform_image_select_test/webform_image_select_test.info.yml index 00f5dffdbe..4752bf9a9b 100644 --- a/web/modules/webform/modules/webform_image_select/tests/modules/webform_image_select_test/webform_image_select_test.info.yml +++ b/web/modules/webform/modules/webform_image_select/tests/modules/webform_image_select_test/webform_image_select_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_image_select' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectElementTest.php b/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectElementTest.php index f6a58f071c..c354746f32 100644 --- a/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectElementTest.php +++ b/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectElementTest.php @@ -32,7 +32,7 @@ public function testImageSelect() { $this->assertRaw('<select data-limit="2" data-drupal-selector="edit-image-select-limit" data-images="{"kitten_1":{"text":"Cute Kitten 1","src":"http:\/\/placekitten.com\/220\/200"},"kitten_2":{"text":"Cute Kitten 2","src":"http:\/\/placekitten.com\/180\/200"},"kitten_3":{"text":"Cute Kitten 3","src":"http:\/\/placekitten.com\/130\/200"},"kitten_4":{"text":"Cute Kitten 4","src":"http:\/\/placekitten.com\/270\/200"}}" class="webform-image-select js-webform-image-select form-select" multiple="multiple" name="image_select_limit[]" id="edit-image-select-limit">'); // Check rendering of image select with HTML markup and XSS test. - $this->assertRaw('<select data-drupal-selector="edit-image-select-html" data-show-label="data-show-label" data-images="{"\u003C1\u003E":{"text":"Cute \u003Cb style=\u0022color:red\u0022\u003EKitten\u003C\/b\u003E 1","src":"http:\/\/placekitten.com\/220\/200"},"\u00222\u0022":{"text":"Cute \u003Cem style=\u0022color:blue\u0022\u003EKitten\u003C\/em\u003E 2","src":"http:\/\/placekitten.com\/180\/200"},"\u00263":{"text":"Cute \u003Cu style=\u0022color:green\u0022\u003EKitten\u003C\/u\u003E 3","src":"http:\/\/placekitten.com\/130\/200"},"4":{"text":"Cute Kitten 4 alert(\u0022XSS\u0022);","src":"http:\/\/placekitten.com\/270\/200"}}" class="webform-image-select js-webform-image-select form-select" id="edit-image-select-html" name="image_select_html"><option value="" selected="selected">- None -</option><option value="<1>">Cute Kitten 1</option><option value=""2"">Cute Kitten 2</option><option value="&3">Cute Kitten 3</option><option value="4">Cute Kitten 4 alert("XSS");</option></select>'); + $this->assertRaw('<select data-drupal-selector="edit-image-select-html" data-show-label="data-show-label" data-images="{"\u003C1\u003E":{"text":"Cute \u003Cb\u003EKitten\u003C\/b\u003E 1","src":"http:\/\/placekitten.com\/220\/200"},"\u00222\u0022":{"text":"Cute \u003Cem\u003EKitten\u003C\/em\u003E 2","src":"http:\/\/placekitten.com\/180\/200"},"\u00263":{"text":"Cute \u003Cu\u003EKitten\u003C\/u\u003E 3","src":"http:\/\/placekitten.com\/130\/200"},"4":{"text":"Cute Kitten 4 alert(\u0022XSS\u0022);","src":"http:\/\/placekitten.com\/270\/200"}}" class="webform-image-select js-webform-image-select form-select" id="edit-image-select-html" name="image_select_html"><option value="" selected="selected">- None -</option><option value="<1>">Cute Kitten 1</option><option value=""2"">Cute Kitten 2</option><option value="&3">Cute Kitten 3</option><option value="4">Cute Kitten 4 alert("XSS");</option></select>'); // Check rendering with filter. $this->assertRaw('<input class="webform-form-filter-text form-search" data-focus="false" data-item-singlular="animal" data-item-plural="animals" data-summary=".js-image-select-filter-custom-filter .webform-image-select-summary" data-no-results=".js-image-select-filter-custom-filter .webform-image-select-no-results" data-element=".js-image-select-filter-custom-filter .thumbnails" data-source=".thumbnail p" data-parent="li" data-selected=".selected" title="Enter a keyword to filter by." type="search" id="edit-image-select-filter-custom-filter" name="image_select_filter_custom_filter" size="30" maxlength="128" placeholder="Find an animal" />'); diff --git a/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectImagesTest.php b/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectImagesTest.php index 78ee3cf3af..faf3365911 100644 --- a/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectImagesTest.php +++ b/web/modules/webform/modules/webform_image_select/tests/src/Functional/WebformImageSelectImagesTest.php @@ -31,7 +31,7 @@ public function testWebformImageSelectImages() { 'administer webform', ]); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($normal_user); diff --git a/web/modules/webform/modules/webform_image_select/webform_image_select.info.yml b/web/modules/webform/modules/webform_image_select/webform_image_select.info.yml index e25aaa9479..73fa7aab7e 100644 --- a/web/modules/webform/modules/webform_image_select/webform_image_select.info.yml +++ b/web/modules/webform/modules/webform_image_select/webform_image_select.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_jqueryui_buttons/tests/modules/webform_jqueryui_buttons_test/webform_jqueryui_buttons_test.info.yml b/web/modules/webform/modules/webform_jqueryui_buttons/tests/modules/webform_jqueryui_buttons_test/webform_jqueryui_buttons_test.info.yml index b6a6fe6df3..78add6f28d 100644 --- a/web/modules/webform/modules/webform_jqueryui_buttons/tests/modules/webform_jqueryui_buttons_test/webform_jqueryui_buttons_test.info.yml +++ b/web/modules/webform/modules/webform_jqueryui_buttons/tests/modules/webform_jqueryui_buttons_test/webform_jqueryui_buttons_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_jqueryui_buttons' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_jqueryui_buttons/webform_jqueryui_buttons.info.yml b/web/modules/webform/modules/webform_jqueryui_buttons/webform_jqueryui_buttons.info.yml index 2acdb69a1a..ba7a78e559 100644 --- a/web/modules/webform/modules/webform_jqueryui_buttons/webform_jqueryui_buttons.info.yml +++ b/web/modules/webform/modules/webform_jqueryui_buttons/webform_jqueryui_buttons.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'jquery_ui_checkboxradio:jquery_ui_checkboxradio' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_location_geocomplete/src/Plugin/WebformElement/WebformLocationGeocomplete.php b/web/modules/webform/modules/webform_location_geocomplete/src/Plugin/WebformElement/WebformLocationGeocomplete.php index c97ac74332..748c3b934c 100644 --- a/web/modules/webform/modules/webform_location_geocomplete/src/Plugin/WebformElement/WebformLocationGeocomplete.php +++ b/web/modules/webform/modules/webform_location_geocomplete/src/Plugin/WebformElement/WebformLocationGeocomplete.php @@ -38,7 +38,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultBaseProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -63,7 +63,7 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we $google_map_url = UrlGenerator::fromUri('http://maps.google.com/', ['query' => ['q' => $value['value']]]); $location = $value['location']; - $key = (isset($element['#api_key'])) ? $element['#api_key'] : $this->configFactory->get('webform.settings')->get('element.default_google_maps_api_key'); + $key = $element['#api_key'] ?? $this->configFactory->get('webform.settings')->get('element.default_google_maps_api_key'); $center = urlencode($value['location']); $image_map_uri = "https://maps.googleapis.com/maps/api/staticmap?zoom=14&size=600x338&markers=color:red%7C$location&key=$key¢er=$center"; diff --git a/web/modules/webform/modules/webform_location_geocomplete/tests/modules/webform_location_geocomplete_test/webform_location_geocomplete_test.info.yml b/web/modules/webform/modules/webform_location_geocomplete/tests/modules/webform_location_geocomplete_test/webform_location_geocomplete_test.info.yml index 84b1dab0d4..ce48fb1b08 100644 --- a/web/modules/webform/modules/webform_location_geocomplete/tests/modules/webform_location_geocomplete_test/webform_location_geocomplete_test.info.yml +++ b/web/modules/webform/modules/webform_location_geocomplete/tests/modules/webform_location_geocomplete_test/webform_location_geocomplete_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_location_geocomplete' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_location_geocomplete/webform_location_geocomplete.info.yml b/web/modules/webform/modules/webform_location_geocomplete/webform_location_geocomplete.info.yml index b5c648a8a9..73ee6d64d3 100644 --- a/web/modules/webform/modules/webform_location_geocomplete/webform_location_geocomplete.info.yml +++ b/web/modules/webform/modules/webform_location_geocomplete/webform_location_geocomplete.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_node/src/Access/WebformNodeAccess.php b/web/modules/webform/modules/webform_node/src/Access/WebformNodeAccess.php index e0bfe09cab..696b56cb24 100644 --- a/web/modules/webform/modules/webform_node/src/Access/WebformNodeAccess.php +++ b/web/modules/webform/modules/webform_node/src/Access/WebformNodeAccess.php @@ -139,7 +139,7 @@ public static function checkWebformAccess($operation, $entity_access, NodeInterf */ public static function checkWebformSubmissionAccess($operation, $entity_access, NodeInterface $node, WebformSubmissionInterface $webform_submission, AccountInterface $account) { $access_result = static::checkAccess($operation, $entity_access, $node, $webform_submission, $account); - if ($access_result->isForbidden()) { + if (!$access_result->isAllowed()) { return $access_result; } diff --git a/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_multiple/webform_node_test_multiple.info.yml b/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_multiple/webform_node_test_multiple.info.yml index 105881adbf..a0e7dcddeb 100644 --- a/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_multiple/webform_node_test_multiple.info.yml +++ b/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_multiple/webform_node_test_multiple.info.yml @@ -13,7 +13,7 @@ dependencies: - 'webform:webform' - 'webform:webform_node' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.info.yml b/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.info.yml index f77de0d587..439a2b5dea 100644 --- a/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.info.yml +++ b/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.info.yml @@ -9,7 +9,7 @@ dependencies: - 'webform:webform_test_translation' - 'drupal:content_translation' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.install b/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.install index 6fd10d5a20..8cf11e972b 100644 --- a/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.install +++ b/web/modules/webform/modules/webform_node/tests/modules/webform_node_test_translation/webform_node_test_translation.install @@ -22,8 +22,8 @@ function webform_node_test_translation_install() { // Initialize webform node content type title field translation. // // Below $values are from… - // $values = $form_state->getValues(); - // var_export($values['settings']['node']['webform']); exit; + // $values = $form_state->getValues(); + // var_export($values['settings']['node']['webform']); exit; // // within content_translation_form_language_content_settings_submit(). // diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessClosedTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessClosedTest.php index c164d08282..5cc0e2016b 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessClosedTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessClosedTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\webform_node\Functional\Access; -use Drupal\webform\Entity\Webform; use Drupal\Tests\webform_node\Functional\WebformNodeBrowserTestBase; /** @@ -28,7 +27,7 @@ public function testAccessClosedT() { $account = $this->drupalCreateUser(['access content']); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($account); diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessPermissionsTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessPermissionsTest.php index a32351b32a..290516e522 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessPermissionsTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessPermissionsTest.php @@ -61,9 +61,9 @@ public function testAccessPermissions() { $node = $this->createWebformNode('contact', ['uid' => $submission_own_node_account->id()]); $nid = $node->id(); - /**************************************************************************/ + /* ********************************************************************** */ // Own submission permissions (authenticated). - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($submission_own_account); @@ -116,9 +116,9 @@ public function testAccessPermissions() { $this->drupalGet("node/{$nid}/webform/results/submissions"); $this->assertResponse(403); - /**************************************************************************/ + /* ********************************************************************** */ // Any submission permissions. - /**************************************************************************/ + /* ********************************************************************** */ // Login as any user. $this->drupalLogin($submission_any_account); @@ -133,9 +133,9 @@ public function testAccessPermissions() { $this->drupalGet("node/{$nid}/webform/submission/{$sid_1}"); $this->assertResponse(200); - /**************************************************************************/ + /* ********************************************************************** */ // Own submission node permissions. - /**************************************************************************/ + /* ********************************************************************** */ // Login as own node user. $this->drupalLogin($submission_own_node_account); @@ -158,9 +158,9 @@ public function testAccessPermissions() { $this->drupalGet("node/{$nid}/webform/submissions/{$sid_1}/delete"); $this->assertResponse(200); - /**************************************************************************/ + /* ********************************************************************** */ // Any submission node permissions. - /**************************************************************************/ + /* ********************************************************************** */ // Login as any node user. $this->drupalLogin($submission_any_node_account); diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessRulesTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessRulesTest.php index 2cc2c96f7b..6cb7f7d5e7 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessRulesTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/Access/WebformNodeAccessRulesTest.php @@ -38,7 +38,7 @@ public function testAccessRules() { $rid = $account->getRoles(TRUE)[0]; $uid = $account->id(); - /**************************************************************************/ + /* ********************************************************************** */ // Log in normal user and get their rid. $this->drupalLogin($account); diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeEntityReferenceTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeEntityReferenceTest.php index 50c8956db5..00912d998f 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeEntityReferenceTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeEntityReferenceTest.php @@ -40,7 +40,7 @@ public function testEntityReference() { $this->assertRaw('webform_test_multiple_b'); $this->assertRaw('textfield_a'); - /**************************************************************************/ + /* ********************************************************************** */ // Check test form B (B is the default because its weight is -1). $this->drupalGet('/node/1/webform/test'); @@ -60,7 +60,7 @@ public function testEntityReference() { // Check user data is NULL. $this->assertNull($user_data->get('webform_node', $this->rootUser->id(), 1)); - /**************************************************************************/ + /* ********************************************************************** */ // Select webform A. $this->drupalGet('/node/1/webform/test'); @@ -84,7 +84,7 @@ public function testEntityReference() { $this->assertRaw('textfield_a'); $this->assertNoRaw('textfield_b'); - /**************************************************************************/ + /* ********************************************************************** */ // Select webform A. $this->drupalGet('/node/1/webform/test'); @@ -108,7 +108,7 @@ public function testEntityReference() { $this->assertRaw('textfield_a'); $this->assertNoRaw('textfield_b'); - /**************************************************************************/ + /* ********************************************************************** */ // Delete the node. Node::load(1)->delete(); diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeResultsTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeResultsTest.php index e80577e932..895a762448 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeResultsTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeResultsTest.php @@ -50,7 +50,7 @@ public function testResults() { /** @var \Drupal\webform\WebformSubmissionStorageInterface $submission_storage */ $submission_storage = \Drupal::entityTypeManager()->getStorage('webform_submission'); - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('contact'); diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeTest.php index 27e51de81f..2cb7f50be1 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeTest.php @@ -53,7 +53,7 @@ public function testNode() { $normal_user = $this->drupalCreateUser(); - /**************************************************************************/ + /* ********************************************************************** */ // Check table names. $this->assertEqual($entity_reference_manager->getTableNames(), [ @@ -61,9 +61,9 @@ public function testNode() { "node_revision__webform" => 'webform', ]); - /**************************************************************************/ + /* ********************************************************************** */ // Webform node basic. - /**************************************************************************/ + /* ********************************************************************** */ // Check contact webform. $this->drupalGet('/node/' . $node->id()); @@ -76,9 +76,9 @@ public function testNode() { $this->drupalGet('/node/' . $node->id()); $this->assertFieldByName('name', 'John Smith'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform closed. - /**************************************************************************/ + /* ********************************************************************** */ $webform->setStatus(WebformInterface::STATUS_CLOSED); $webform->save(); @@ -97,9 +97,9 @@ public function testNode() { $webform->save(); $this->drupalLogout(); - /**************************************************************************/ + /* ********************************************************************** */ // Webform node open and closed. - /**************************************************************************/ + /* ********************************************************************** */ // Check contact webform closed. $node->webform->status = WebformInterface::STATUS_CLOSED; @@ -120,9 +120,9 @@ public function testNode() { $this->postNodeSubmission($node); $this->assertRaw('This is a custom inline confirmation message.'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform node scheduled. - /**************************************************************************/ + /* ********************************************************************** */ // Check scheduled to open. $node->webform->target_id = 'contact'; @@ -179,9 +179,9 @@ public function testNode() { $this->drupalGet('/node/' . $node->id()); $this->assertRaw('{Custom closed message}'); - /**************************************************************************/ + /* ********************************************************************** */ // Submission limit (test_form_limit). - /**************************************************************************/ + /* ********************************************************************** */ // Set per source entity total and user limit. // @see \Drupal\webform\Tests\WebformSubmissionFormSettingsTest::testSettings @@ -267,9 +267,9 @@ public function testNode() { $this->assertRaw('3 webform + source entity submission(s)'); $this->assertRaw('3 webform + source entity limit'); - /**************************************************************************/ + /* ********************************************************************** */ // Prepopulate source entity. - /**************************************************************************/ + /* ********************************************************************** */ $webform_contact = Webform::load('contact'); @@ -303,9 +303,9 @@ public function testNode() { $this->assertEqual($submission->getSourceEntity()->id(), $node->id()); } - /**************************************************************************/ + /* ********************************************************************** */ // Check displaying link to webform. - /**************************************************************************/ + /* ********************************************************************** */ // Set webform reference to be displayed as a link. $display_options = [ diff --git a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeVariantTest.php b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeVariantTest.php index bcbddf1ea4..d661623b18 100644 --- a/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeVariantTest.php +++ b/web/modules/webform/modules/webform_node/tests/src/Functional/WebformNodeVariantTest.php @@ -35,7 +35,7 @@ public function testNodeVariant() { number: '1'"; $node->save(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/modules/webform_node/webform_node.info.yml b/web/modules/webform/modules/webform_node/webform_node.info.yml index c764ac21f8..dddd4d00d0 100644 --- a/web/modules/webform/modules/webform_node/webform_node.info.yml +++ b/web/modules/webform/modules/webform_node/webform_node.info.yml @@ -11,7 +11,7 @@ dependencies: - 'drupal:user' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_options_custom/src/Element/WebformOptionsCustom.php b/web/modules/webform/modules/webform_options_custom/src/Element/WebformOptionsCustom.php index 3f9f425f95..e24b73abad 100644 --- a/web/modules/webform/modules/webform_options_custom/src/Element/WebformOptionsCustom.php +++ b/web/modules/webform/modules/webform_options_custom/src/Element/WebformOptionsCustom.php @@ -113,7 +113,7 @@ public static function processWebformOptionsCustom(&$element, FormStateInterface $descriptions = []; foreach ($element['#options'] as $option_value => $option_text) { if (WebformOptionsHelper::hasOptionDescription($option_text)) { - list($option_text, $option_description) = WebformOptionsHelper::splitOption($option_text); + [$option_text, $option_description] = WebformOptionsHelper::splitOption($option_text); $element['#options'][$option_value] = $option_text; $descriptions[$option_value] = Xss::filterAdmin($option_description); } @@ -245,9 +245,9 @@ public static function validateWebformOptionsCustom(&$element, FormStateInterfac $form_state->setValueForElement($element, $value); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set a custom options element #options property. @@ -299,7 +299,7 @@ public static function setTemplateOptions(array &$element) { foreach ($options as $option_value => $option_text) { $option_description = ''; if (WebformOptionsHelper::hasOptionDescription($option_text)) { - list($option_text, $option_description) = WebformOptionsHelper::splitOption($option_text); + [$option_text, $option_description] = WebformOptionsHelper::splitOption($option_text); } $options_by_text[$option_text] = ['value' => $option_value, 'text' => $option_text, 'description' => $option_description]; } diff --git a/web/modules/webform/modules/webform_options_custom/src/Entity/WebformOptionsCustom.php b/web/modules/webform/modules/webform_options_custom/src/Entity/WebformOptionsCustom.php index 77856d2432..b96b3d105a 100644 --- a/web/modules/webform/modules/webform_options_custom/src/Entity/WebformOptionsCustom.php +++ b/web/modules/webform/modules/webform_options_custom/src/Entity/WebformOptionsCustom.php @@ -334,9 +334,9 @@ public function getPreview() { // Set default #options. if (empty($element['#options'])) { $element['#options'] = [ - 'one' => t('One -- This is the number 1.'), - 'two' => t('Two -- This is the number 2.'), - 'three' => t('Three -- This is the number 3.'), + 'one' => $this->t('One -- This is the number 1.'), + 'two' => $this->t('Two -- This is the number 2.'), + 'three' => $this->t('Three -- This is the number 3.'), ]; } diff --git a/web/modules/webform/modules/webform_options_custom/src/Plugin/Derivative/WebformOptionsCustomDeriverBase.php b/web/modules/webform/modules/webform_options_custom/src/Plugin/Derivative/WebformOptionsCustomDeriverBase.php index 2f6c2229c7..09edae1a4b 100644 --- a/web/modules/webform/modules/webform_options_custom/src/Plugin/Derivative/WebformOptionsCustomDeriverBase.php +++ b/web/modules/webform/modules/webform_options_custom/src/Plugin/Derivative/WebformOptionsCustomDeriverBase.php @@ -28,7 +28,7 @@ abstract class WebformOptionsCustomDeriverBase extends DeriverBase implements Co * Constructs new WebformReusableCompositeDeriver. * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager. + * The entity type manager. */ public function __construct(EntityTypeManagerInterface $entity_type_manager) { $this->entityTypeManager = $entity_type_manager; diff --git a/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php b/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php index 2bf0ac9b6b..6841730940 100644 --- a/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php +++ b/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php @@ -49,7 +49,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -120,7 +120,7 @@ protected function build($format, array &$element, WebformSubmissionInterface $w public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); - list(, $webform_options_custom_id) = explode(':', $this->getPluginId()); + [, $webform_options_custom_id] = explode(':', $this->getPluginId()); /** @var \Drupal\webform_options_custom\WebformOptionsCustomInterface $webform_options_custom */ $webform_options_custom = $this->entityTypeManager->getStorage('webform_options_custom')->load($webform_options_custom_id); $element = $webform_options_custom->getElement(); @@ -185,7 +185,7 @@ public function form(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function preview() { - list(, $webform_options_custom_id) = explode(':', $this->getPluginId()); + [, $webform_options_custom_id] = explode(':', $this->getPluginId()); /** @var \Drupal\webform_options_custom\WebformOptionsCustomInterface $webform_options_custom */ $webform_options_custom = $this->entityTypeManager->getStorage('webform_options_custom')->load($webform_options_custom_id); @@ -245,7 +245,7 @@ protected function setOptions(array &$element, array $settings = []) { } // Set element custom template options. - list($type, $options_custom) = explode(':', $this->getPluginId()); + [$type, $options_custom] = explode(':', $this->getPluginId()); $element['#type'] = $type; $element['#options_custom'] = $options_custom; @@ -261,7 +261,7 @@ protected function setOptions(array &$element, array $settings = []) { * A webform custom options entity. */ protected function getEntity() { - list(, $webform_options_custom_id) = explode(':', $this->getPluginId()); + [, $webform_options_custom_id] = explode(':', $this->getPluginId()); return $this->entityTypeManager->getStorage('webform_options_custom')->load($webform_options_custom_id); } diff --git a/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustomEntity.php b/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustomEntity.php index 298d380f6c..d986ff912f 100644 --- a/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustomEntity.php +++ b/web/modules/webform/modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustomEntity.php @@ -26,7 +26,7 @@ class WebformOptionsCustomEntity extends WebformOptionsCustom implements Webform * {@inheritdoc} */ protected function setOptions(array &$element, array $settings = []) { - list($type, $options_custom) = explode(':', $this->getPluginId()); + [$type, $options_custom] = explode(':', $this->getPluginId()); $element['#type'] = $type; $element['#options_custom'] = $options_custom; diff --git a/web/modules/webform/modules/webform_options_custom/src/WebformOptionsCustomStorage.php b/web/modules/webform/modules/webform_options_custom/src/WebformOptionsCustomStorage.php index 4a8471e2e7..eadfa16b7d 100644 --- a/web/modules/webform/modules/webform_options_custom/src/WebformOptionsCustomStorage.php +++ b/web/modules/webform/modules/webform_options_custom/src/WebformOptionsCustomStorage.php @@ -74,7 +74,7 @@ public function getUsedByWebforms(WebformOptionsCustomInterface $webform_options } $options_id = $webform_options_custom->id(); - return (isset($this->usedByWebforms[$options_id])) ? $this->usedByWebforms[$options_id] : []; + return $this->usedByWebforms[$options_id] ?? []; } } diff --git a/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_entity_test/webform_options_custom_entity_test.info.yml b/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_entity_test/webform_options_custom_entity_test.info.yml index 6aea59bd57..21742de7a3 100644 --- a/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_entity_test/webform_options_custom_entity_test.info.yml +++ b/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_entity_test/webform_options_custom_entity_test.info.yml @@ -8,7 +8,7 @@ dependencies: - 'webform:webform_options_limit' - 'webform:webform_options_custom' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_test/webform_options_custom_test.info.yml b/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_test/webform_options_custom_test.info.yml index d0cf34c89c..f93cac6a1e 100644 --- a/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_test/webform_options_custom_test.info.yml +++ b/web/modules/webform/modules/webform_options_custom/tests/modules/webform_options_custom_test/webform_options_custom_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_options_custom' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_options_custom/tests/src/Functional/WebformOptionsCustomTest.php b/web/modules/webform/modules/webform_options_custom/tests/src/Functional/WebformOptionsCustomTest.php index ce9359e82b..8d59760d20 100644 --- a/web/modules/webform/modules/webform_options_custom/tests/src/Functional/WebformOptionsCustomTest.php +++ b/web/modules/webform/modules/webform_options_custom/tests/src/Functional/WebformOptionsCustomTest.php @@ -28,9 +28,9 @@ class WebformOptionsCustomTest extends WebformBrowserTestBase { public function testOptionsCustom() { $webform = Webform::load('test_element_options_custom_html'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform custom options element. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_options_custom_html'); @@ -84,9 +84,9 @@ public function testOptionsCustom() { $this->drupalGet('/webform/javascript/test_element_options_custom_html'); $this->assertRaw("window.console && window.console.log('Test: HTML advanced loaded.');"); - /**************************************************************************/ + /* ********************************************************************** */ // Webform custom options entity. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); @@ -121,9 +121,9 @@ public function testOptionsCustom() { // Check 'data-select-hidden' attribute. $this->assertCssSelect('.webform-options-custom--test-html[data-select-hidden]'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform custom options Twig. - /**************************************************************************/ + /* ********************************************************************** */ // Get preview has 3 options. $this->drupalGet('/admin/structure/webform/options/custom/manage/test_twig/preview'); diff --git a/web/modules/webform/modules/webform_options_custom/webform_options_custom.info.yml b/web/modules/webform/modules/webform_options_custom/webform_options_custom.info.yml index 115ba322d3..22543394ca 100644 --- a/web/modules/webform/modules/webform_options_custom/webform_options_custom.info.yml +++ b/web/modules/webform/modules/webform_options_custom/webform_options_custom.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php b/web/modules/webform/modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php index a2e30ef236..539005f5ac 100644 --- a/web/modules/webform/modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php +++ b/web/modules/webform/modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php @@ -404,6 +404,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#states' => [ 'visible' => [ ':input[name="settings[option_message_display]"]' => ['value' => WebformOptionsLimitHandlerInterface::MESSAGE_DISPLAY_DESCRIPTION], + // phpcs:ignore Squiz.Arrays.ArrayDeclaration.NoKeySpecified $tableselect_states, ], ], @@ -455,9 +456,9 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s } } - /****************************************************************************/ + /* ************************************************************************ */ // Alter element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -513,9 +514,9 @@ public function alterElement(array &$element, FormStateInterface $form_state, ar $element['#element_validate'][] = [get_called_class(), 'validateElement']; } - /****************************************************************************/ + /* ************************************************************************ */ // Element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Validate webform element limit. @@ -559,9 +560,9 @@ protected function setElementLimitReachedMessage(array &$element) { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Options element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set an options element's default value. @@ -651,7 +652,6 @@ protected function alterOptionsElement(array &$element, array $limits, array $re * An options element's option limits. */ protected function alterOptionsElementLabels(array &$options, array $limits) { - $message_display = $this->configuration['option_message_display']; foreach ($options as $option_value => $option_text) { if ($this->isTableSelectElement()) { if (isset($limits[$option_value])) { @@ -663,9 +663,7 @@ protected function alterOptionsElementLabels(array &$options, array $limits) { $option = &$options[$option_value][0]; switch ($message_display) { case WebformOptionsLimitHandlerInterface::MESSAGE_DISPLAY_DESCRIPTION: - list( - $option['value'], - $option['webform_options_limit']) = explode(' --', $label); + [$option['value'], $option['webform_options_limit']] = explode(' --', $label); break; case WebformOptionsLimitHandlerInterface::MESSAGE_DISPLAY_LABEL: @@ -794,9 +792,9 @@ public function validateOptionsElement(array $element, FormStateInterface $form_ } } - /****************************************************************************/ + /* ************************************************************************ */ // Boolean element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set a boolean element's default value. @@ -915,9 +913,9 @@ public function validateBooleanElement(array $element, FormStateInterface $form_ } } - /****************************************************************************/ + /* ************************************************************************ */ // Form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -927,10 +925,10 @@ public function submitForm(array &$form, FormStateInterface $form_state, Webform Cache::invalidateTags(['webform:' . $this->getWebform()->id()]); } - /****************************************************************************/ + /* ************************************************************************ */ // Summary method. // @see \Drupal\webform_options_limit\Controller\WebformOptionsLimitController - /****************************************************************************/ + /* ************************************************************************ */ /** * Build summary table. @@ -1002,9 +1000,9 @@ public function buildSummaryTable() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get element. @@ -1150,9 +1148,9 @@ protected function getElementOptions() { return ($element) ? OptGroup::flattenOptions($element['#options']) : []; } - /****************************************************************************/ + /* ************************************************************************ */ // Limits methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an associative array of options limits. @@ -1181,7 +1179,7 @@ protected function getOptionsLimits(array $values = []) { $limit = (isset($this->configuration['limits'][$option_key])) ? $this->configuration['limits'][$option_key] : $default_limit; - $total = (isset($totals[$option_key])) ? $totals[$option_key] : 0; + $total = $totals[$option_key] ?? 0; $limits[$option_key] = $this->getLimitInformation($option_label, $limit, $total); } return $limits; @@ -1358,9 +1356,9 @@ protected function getTotalQuery() { return $query; } - /****************************************************************************/ + /* ************************************************************************ */ // Labels and messages methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an options or boolean element's limit status message. diff --git a/web/modules/webform/modules/webform_options_limit/tests/modules/webform_options_limit_test/webform_options_limit_test.info.yml b/web/modules/webform/modules/webform_options_limit/tests/modules/webform_options_limit_test/webform_options_limit_test.info.yml index 5ee171408a..55a734dd5b 100644 --- a/web/modules/webform/modules/webform_options_limit/tests/modules/webform_options_limit_test/webform_options_limit_test.info.yml +++ b/web/modules/webform/modules/webform_options_limit/tests/modules/webform_options_limit_test/webform_options_limit_test.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'webform:webform_options_limit' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_options_limit/webform_options_limit.info.yml b/web/modules/webform/modules/webform_options_limit/webform_options_limit.info.yml index 3311d5c6ac..2c5ac3e2e4 100644 --- a/web/modules/webform/modules/webform_options_limit/webform_options_limit.info.yml +++ b/web/modules/webform/modules/webform_options_limit/webform_options_limit.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_scheduled_email/drush/webform_scheduled_email.drush.inc b/web/modules/webform/modules/webform_scheduled_email/drush/webform_scheduled_email.drush.inc index bd260b15b7..525f8e3352 100644 --- a/web/modules/webform/modules/webform_scheduled_email/drush/webform_scheduled_email.drush.inc +++ b/web/modules/webform/modules/webform_scheduled_email/drush/webform_scheduled_email.drush.inc @@ -52,9 +52,9 @@ function webform_scheduled_email_help($section) { } } -/******************************************************************************/ -// Export -/******************************************************************************/ +/* ************************************************************************** */ +// Export. +/* ************************************************************************** */ /** * Implements drush_hook_COMMAND(). diff --git a/web/modules/webform/modules/webform_scheduled_email/src/Commands/WebformScheduledEmailCommands.php b/web/modules/webform/modules/webform_scheduled_email/src/Commands/WebformScheduledEmailCommands.php index d50a4a7f72..a3ee5d507b 100644 --- a/web/modules/webform/modules/webform_scheduled_email/src/Commands/WebformScheduledEmailCommands.php +++ b/web/modules/webform/modules/webform_scheduled_email/src/Commands/WebformScheduledEmailCommands.php @@ -1,5 +1,7 @@ <?php +// phpcs:ignoreFile + namespace Drupal\webform_scheduled_email\Commands; use Consolidation\AnnotatedCommand\CommandData; @@ -72,6 +74,7 @@ public function drush_webform_scheduled_email_cron_validate(CommandData $command * The handler ID you want the cron task to be executed for * @option schedule_limit * The maximum number of emails to be scheduled. If set to 0 no emails will be scheduled. (Default 1000) + * * @option send_limit * The maximum number of emails to be sent. If set to 0 no emails will be sent. (Default 500) * @aliases wfsec,webform-scheduled-email-cron diff --git a/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManager.php b/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManager.php index 93a2386517..a9aa68874f 100644 --- a/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManager.php +++ b/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManager.php @@ -107,9 +107,9 @@ public function __construct(TimeInterface $time, Connection $database, LanguageM $this->entityReferenceManager = $entity_reference_manager; } - /****************************************************************************/ + /* ************************************************************************ */ // Scheduled message functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -200,9 +200,9 @@ public function getSendDate(WebformSubmissionInterface $webform_submission, $han return date_format($date, $this->getDateFormat()); } - /****************************************************************************/ + /* ************************************************************************ */ // State/actions functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -456,9 +456,9 @@ public function delete(EntityInterface $entity, $handler_id = NULL) { $query->execute(); } - /****************************************************************************/ + /* ************************************************************************ */ // Queuing/sending functions (aka the tumbleweed). - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -502,7 +502,7 @@ public function cron(EntityInterface $entity = NULL, $handler_id = NULL, $schedu $context['@handler'] = $entity->getHandler($handler_id)->label(); $message = "@entity: Cron task executed '@handler' handler. (@summary)"; } - }; + } $this->getLogger()->notice($message, $context); $stats['_message'] = $message; $stats['_context'] = $context; @@ -536,7 +536,7 @@ protected function cronSchedule(EntityInterface $entity = NULL, $handler_id = NU return $stats; } - list($webform, $webform_submission, $source_entity) = $this->getEntities($entity); + [$webform, $webform_submission, $source_entity] = $this->getEntities($entity); $query = $this->database->select('webform_scheduled_email', 'w') ->fields('w', ['eid', 'sid', 'webform_id', 'entity_type', 'entity_id', 'handler_id', 'state', 'send']) @@ -623,7 +623,7 @@ protected function cronSend(EntityInterface $entity = NULL, $handler_id = NULL, return $stats; } - list($webform, $webform_submission, $source_entity) = $this->getEntities($entity); + [$webform, $webform_submission, $source_entity] = $this->getEntities($entity); // IMPORTANT: Only scheduled emails with state = ::SUBMISSION_SEND will // be sent. @@ -736,9 +736,9 @@ protected function cronSend(EntityInterface $entity = NULL, $handler_id = NULL, return $stats; } - /****************************************************************************/ + /* ************************************************************************ */ // Statistic/tracking functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -777,16 +777,16 @@ public function ready(EntityInterface $entity = NULL, $handler_id = NULL) { * {@inheritdoc} */ public function total(EntityInterface $entity = NULL, $handler_id = NULL, $state = FALSE) { - list($webform, $webform_submission, $source_entity) = $this->getEntities($entity); + [$webform, $webform_submission, $source_entity] = $this->getEntities($entity); $query = $this->database->select('webform_scheduled_email', 'w'); $this->addQueryConditions($query, $webform, $webform_submission, $source_entity, $handler_id, $state); return $query->countQuery()->execute()->fetchField(); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get webform or webform_submission logger. diff --git a/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManagerInterface.php b/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManagerInterface.php index 2e8fd1f05a..c5ae03a2cc 100644 --- a/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManagerInterface.php +++ b/web/modules/webform/modules/webform_scheduled_email/src/WebformScheduledEmailManagerInterface.php @@ -10,11 +10,11 @@ */ interface WebformScheduledEmailManagerInterface { - /****************************************************************************/ + /* ************************************************************************ */ // Submission scheduling state constants. - /****************************************************************************/ + /* ************************************************************************ */ // These constants are used the webform_scheduled_email.state column. - /****************************************************************************/ + /* ************************************************************************ */ /** * Denote submission to be scheduled. (state = 'schedule' AND send IS NULL) @@ -37,12 +37,12 @@ interface WebformScheduledEmailManagerInterface { */ const SUBMISSION_UNSCHEDULE = 'unschedule'; - /****************************************************************************/ + /* ************************************************************************ */ // Submission scheduling state constants. - /****************************************************************************/ + /* ************************************************************************ */ // These constants are used build 'webform_scheduled_email' queries. // @see \Drupal\webform_scheduled_email\WebformScheduledEmailManager::addQueryConditions - /****************************************************************************/ + /* ************************************************************************ */ /** * Denote submission to be sent. (state = 'send' AND send IS NOT NULL) @@ -79,9 +79,9 @@ interface WebformScheduledEmailManagerInterface { */ const SUBMISSION_TOTAL = 'total'; - /****************************************************************************/ + /* ************************************************************************ */ // Email tracking constants. - /****************************************************************************/ + /* ************************************************************************ */ /** * Denote email being scheduled. @@ -139,9 +139,9 @@ interface WebformScheduledEmailManagerInterface { */ const EMAIL_NOT_SENT = 'not_sent'; - /****************************************************************************/ + /* ************************************************************************ */ // Scheduled message functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get scheduled email date type (date or datetime). @@ -196,7 +196,7 @@ public function hasScheduledEmail(WebformSubmissionInterface $webform_submission * @param string $handler_id * The webform handler ID. * - * @return \stdClass|null + * @return object|null * The scheduled email record or NULL */ public function load(WebformSubmissionInterface $webform_submission, $handler_id); @@ -215,9 +215,9 @@ public function load(WebformSubmissionInterface $webform_submission, $handler_id */ public function getSendDate(WebformSubmissionInterface $webform_submission, $handler_id); - /****************************************************************************/ + /* ************************************************************************ */ // State/actions functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Scheduled an email to be send at a later date. @@ -263,9 +263,9 @@ public function reschedule(EntityInterface $entity, $handler_id = NULL); */ public function delete(EntityInterface $entity, $handler_id = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Queuing/sending functions (aka the tumbleweed). - /****************************************************************************/ + /* ************************************************************************ */ /** * Cron task for scheduling and sending emails. @@ -293,9 +293,9 @@ public function delete(EntityInterface $entity, $handler_id = NULL); */ public function cron(EntityInterface $entity = NULL, $handler_id = NULL, $schedule_limit = 1000, $send_limit = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Statistic/tracking functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get all the handler's statistics. diff --git a/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test/webform_scheduled_email_test.info.yml b/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test/webform_scheduled_email_test.info.yml index d6ed2feb04..f27113ab16 100644 --- a/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test/webform_scheduled_email_test.info.yml +++ b/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test/webform_scheduled_email_test.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'webform:webform_scheduled_email' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test_translation/webform_scheduled_email_test_translation.info.yml b/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test_translation/webform_scheduled_email_test_translation.info.yml index 199d36217a..852189c514 100644 --- a/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test_translation/webform_scheduled_email_test_translation.info.yml +++ b/web/modules/webform/modules/webform_scheduled_email/tests/modules/webform_scheduled_email_test_translation/webform_scheduled_email_test_translation.info.yml @@ -10,7 +10,7 @@ dependencies: - 'webform:webform' - 'webform:webform_scheduled_email' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTest.php b/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTest.php index e994985bb8..48bde00525 100644 --- a/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTest.php +++ b/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTest.php @@ -32,9 +32,9 @@ public function testWebformScheduledEmail() { $yesterday = date($scheduled_manager->getDateFormat(), strtotime('-1 days')); $tomorrow = date($scheduled_manager->getDateFormat(), strtotime('+1 days')); - /**************************************************************************/ + /* ********************************************************************** */ // Submission scheduling. - /**************************************************************************/ + /* ********************************************************************** */ // Check scheduled email yesterday. $sid = $this->postSubmission($webform_schedule, ['send' => 'yesterday']); @@ -93,9 +93,9 @@ public function testWebformScheduledEmail() { $this->assertText("Test: Handler: Test scheduled email: Submission #$sid: Email not scheduled for Broken handler because [broken] is not a valid date/token."); $this->assertEqual($scheduled_manager->total($webform_schedule), 0); - /**************************************************************************/ + /* ********************************************************************** */ // Submission scheduling with date/time. - /**************************************************************************/ + /* ********************************************************************** */ // Change schedule type to 'datetime'. \Drupal::configFactory()->getEditable('webform_scheduled_email.settings') @@ -115,7 +115,7 @@ public function testWebformScheduledEmail() { ->set('schedule_type', 'date') ->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Check deleting handler removes scheduled emails. // @todo Figure out why the below exception is occurring during tests only. // "Drupal\Component\Plugin\Exception\PluginNotFoundException: Plugin ID 'tomorrow' was not found. " @@ -123,11 +123,11 @@ public function testWebformScheduledEmail() { // $webform->deleteWebformHandler($handler); // $total = \Drupal::database()->select('webform_scheduled_email')->countQuery()->execute()->fetchField(); // $this->assertEqual($total, 3); - /**************************************************************************/ + /* ********************************************************************** */ - /**************************************************************************/ + /* ********************************************************************** */ // Webform scheduling. - /**************************************************************************/ + /* ********************************************************************** */ // Purge all submissions. $this->purgeSubmissions(); @@ -162,7 +162,8 @@ public function testWebformScheduledEmail() { // Runs Reschedule yesterday submissions which includes all submissions. $stats = $scheduled_manager->cron(); - $this->assertNotEqual($stats['sent'], 6);$this->assertEqual($stats['sent'], 3); + $this->assertNotEqual($stats['sent'], 6); + $this->assertEqual($stats['sent'], 3); $this->assertEqual($scheduled_manager->stats($webform_schedule), [ 'total' => 3, 'waiting' => 0, @@ -176,9 +177,9 @@ public function testWebformScheduledEmail() { $this->assertEqual($scheduled_manager->waiting($webform_schedule), 6); $this->assertEqual($scheduled_manager->ready($webform_schedule), 0); - /**************************************************************************/ + /* ********************************************************************** */ // Webform scheduling with conditions. - /**************************************************************************/ + /* ********************************************************************** */ // Purge all submissions. $this->purgeSubmissions(); @@ -221,9 +222,9 @@ public function testWebformScheduledEmail() { // Clear yesterday conditions. $yesterday_handler->setConditions([]); - /**************************************************************************/ + /* ********************************************************************** */ // Ignore past scheduling. - /**************************************************************************/ + /* ********************************************************************** */ // Purge all submissions. $this->purgeSubmissions(); @@ -233,9 +234,9 @@ public function testWebformScheduledEmail() { $this->assertEqual($scheduled_manager->total($webform_schedule), 0); $this->assertRaw('<em class="placeholder">Test: Handler: Test scheduled email: Submission #' . $sid . '</em>: Email <b>ignored</b> by <em class="placeholder">Last year</em> handler to be sent on <em class="placeholder">2016-01-01</em>.'); - /**************************************************************************/ + /* ********************************************************************** */ // Source entity scheduling. - /**************************************************************************/ + /* ********************************************************************** */ // Purge all submissions. $this->purgeSubmissions(); @@ -327,9 +328,9 @@ public function testWebformScheduledEmail() { // Purge all submissions. $this->purgeSubmissions(); - /**************************************************************************/ + /* ********************************************************************** */ // Testing. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTranslationTest.php b/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTranslationTest.php index 9bc93eb5cd..f08f069e61 100644 --- a/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTranslationTest.php +++ b/web/modules/webform/modules/webform_scheduled_email/tests/src/Functional/WebformScheduledEmailTranslationTest.php @@ -28,7 +28,7 @@ public function testWebformScheduledEmailTranslation() { /** @var \Drupal\webform_scheduled_email\WebformScheduledEmailManagerInterface $scheduled_manager */ $scheduled_manager = \Drupal::service('webform_scheduled_email.manager'); - /**************************************************************************/ + /* ********************************************************************** */ // Scheduled English email. $this->drupalPostForm('/webform/' . $webform_schedule->id(), [], 'Submit'); diff --git a/web/modules/webform/modules/webform_scheduled_email/webform_scheduled_email.info.yml b/web/modules/webform/modules/webform_scheduled_email/webform_scheduled_email.info.yml index e0f2d56fa7..bb7a352aa5 100644 --- a/web/modules/webform/modules/webform_scheduled_email/webform_scheduled_email.info.yml +++ b/web/modules/webform/modules/webform_scheduled_email/webform_scheduled_email.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareNodeTest.php b/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareNodeTest.php index 73b1a2d8d8..f593798f21 100644 --- a/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareNodeTest.php +++ b/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareNodeTest.php @@ -39,7 +39,7 @@ public function testShare() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Check share page access denied. $this->drupalGet('/webform/contact/share'); diff --git a/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareTest.php b/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareTest.php index cbe1de5408..9226094404 100644 --- a/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareTest.php +++ b/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareTest.php @@ -40,7 +40,7 @@ public function testShare() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Check share page access denied. $this->drupalGet('/webform/contact/share'); diff --git a/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareVariantTest.php b/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareVariantTest.php index 062c55e66d..554c611b16 100644 --- a/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareVariantTest.php +++ b/web/modules/webform/modules/webform_share/tests/src/Functional/WebformShareVariantTest.php @@ -41,7 +41,7 @@ public function testVariant() { $config = \Drupal::configFactory()->getEditable('webform.settings'); $config->set('settings.default_share', TRUE)->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Check default letter and number. $this->drupalGet("/webform/test_variant_multiple/share/$library/$version"); diff --git a/web/modules/webform/modules/webform_share/webform_share.info.yml b/web/modules/webform/modules/webform_share/webform_share.info.yml index 927eea6a06..76f314ca37 100644 --- a/web/modules/webform/modules/webform_share/webform_share.info.yml +++ b/web/modules/webform/modules/webform_share/webform_share.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_share/webform_share.module b/web/modules/webform/modules/webform_share/webform_share.module index 0be1ba401c..2f8b75b294 100644 --- a/web/modules/webform/modules/webform_share/webform_share.module +++ b/web/modules/webform/modules/webform_share/webform_share.module @@ -164,9 +164,9 @@ function webform_share_page_top(array &$page_top) { unset($page_top['toolbar']); } -/******************************************************************************/ +/* ************************************************************************** */ // Theme functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_theme(). diff --git a/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.info.yml b/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.info.yml index cde12e4958..1e8fdf6ef1 100644 --- a/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.info.yml +++ b/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform' - 'webform:webform_ui' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.module b/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.module index 74005fbbe1..dcc8e4f5de 100644 --- a/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.module +++ b/web/modules/webform/modules/webform_shortcuts/webform_shortcuts.module @@ -42,6 +42,7 @@ function webform_shortcuts_preprocess_block(&$variables) { $config = \Drupal::config('webform_shortcuts.settings'); // Shortcuts. + // phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified $shortcuts = [ '--', 'add_element' => t('Add element'), @@ -54,6 +55,7 @@ function webform_shortcuts_preprocess_block(&$variables) { 'toggle_weights' => t('Show/hide row weights'), '--', ]; + // phpcs:enable Squiz.Arrays.ArrayDeclaration.KeySpecified $items = []; $last_shortcut = ''; diff --git a/web/modules/webform/modules/webform_submission_export_import/src/Form/WebformSubmissionExportImportUploadForm.php b/web/modules/webform/modules/webform_submission_export_import/src/Form/WebformSubmissionExportImportUploadForm.php index 4d69cf3569..15bc849695 100644 --- a/web/modules/webform/modules/webform_submission_export_import/src/Form/WebformSubmissionExportImportUploadForm.php +++ b/web/modules/webform/modules/webform_submission_export_import/src/Form/WebformSubmissionExportImportUploadForm.php @@ -109,9 +109,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // @see \Drupal\webform_submission_export_import\Form\WebformSubmissionExportImportUploadForm::buildConfirmForm } - /****************************************************************************/ + /* ************************************************************************ */ // Upload form. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build upload form. @@ -295,9 +295,9 @@ public function submitUploadForm(array &$form, FormStateInterface $form_state) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Confirm form. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build confirm import form. @@ -472,9 +472,9 @@ public function getCancelUrl() { return Url::fromRoute('<current>'); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set the CSV file URI. @@ -518,11 +518,11 @@ protected function appendNameToOptions(array $options) { return $options; } - /****************************************************************************/ + /* ************************************************************************ */ // Batch functions. // Using static method to prevent the service container from being serialized. - // "Prevents exception 'AssertionError' with message 'The container was serialized.'." - /****************************************************************************/ + // Prevents 'AssertionError: The container was serialized.' exception. + /* ************************************************************************ */ /** * Batch API; Initialize batch operations. @@ -572,7 +572,7 @@ public static function batchSet(WebformInterface $webform, EntityInterface $sour * @param mixed|array $context * The batch current context. */ - public static function batchProcess(WebformInterface $webform, EntityInterface $source_entity = NULL, $import_uri = '', array $import_options = [], array &$context = []) { + public static function batchProcess(WebformInterface $webform, EntityInterface $source_entity = NULL, $import_uri = '', array $import_options = [], &$context = []) { /** @var \Drupal\webform_submission_export_import\WebformSubmissionExportImportImporterInterface $importer */ $importer = \Drupal::service('webform_submission_export_import.importer'); $importer->setWebform($webform); diff --git a/web/modules/webform/modules/webform_submission_export_import/src/Plugin/WebformExporter/WebformSubmissionExportImportWebformExporter.php b/web/modules/webform/modules/webform_submission_export_import/src/Plugin/WebformExporter/WebformSubmissionExportImportWebformExporter.php index ef3fab54fe..524e74070d 100644 --- a/web/modules/webform/modules/webform_submission_export_import/src/Plugin/WebformExporter/WebformSubmissionExportImportWebformExporter.php +++ b/web/modules/webform/modules/webform_submission_export_import/src/Plugin/WebformExporter/WebformSubmissionExportImportWebformExporter.php @@ -27,7 +27,7 @@ class WebformSubmissionExportImportWebformExporter extends WebformExporterBase { /** * Webform submission export importer service. * - * @var \Drupal\webform_submission_export_import\WebformSubmissionExportImportImporterInterface $importer + * @var \Drupal\webform_submission_export_import\WebformSubmissionExportImportImporterInterface */ protected $importer; diff --git a/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.php b/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.php index 9833ca4921..74eb7faa6c 100644 --- a/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.php +++ b/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.php @@ -227,9 +227,9 @@ public function getDefaultImportOptions() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Webform field definitions and elements. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -256,9 +256,9 @@ public function getElements() { return $this->elements; } - /****************************************************************************/ + /* ************************************************************************ */ // Export. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -288,7 +288,7 @@ public function exportSubmission(WebformSubmissionInterface $webform_submission, break; default: - $value = (isset($submission_data[$field_name])) ? $submission_data[$field_name] : ''; + $value = $submission_data[$field_name] ?? ''; break; } $record[] = $this->exportValue($value); @@ -325,7 +325,7 @@ public function exportSubmission(WebformSubmissionInterface $webform_submission, $value = $element_plugin->getValue($element, $webform_submission); $question_keys = array_keys($element['#questions']); foreach ($question_keys as $question_key) { - $question_value = (isset($value[$question_key])) ? $value[$question_key] : ''; + $question_value = $value[$question_key] ?? ''; $record[] = $this->exportValue($question_value); } } @@ -334,7 +334,7 @@ public function exportSubmission(WebformSubmissionInterface $webform_submission, $value = $element_plugin->getValue($element, $webform_submission); $composite_element_keys = array_keys($element_plugin->getCompositeElements()); foreach ($composite_element_keys as $composite_element_key) { - $composite_value = (isset($value[$composite_element_key])) ? $value[$composite_element_key] : ''; + $composite_value = $value[$composite_element_key] ?? ''; $record[] = $this->exportValue($composite_value); } } @@ -365,9 +365,9 @@ public function exportSubmission(WebformSubmissionInterface $webform_submission, return $record; } - /****************************************************************************/ + /* ************************************************************************ */ // Import. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -607,7 +607,7 @@ protected function importPrepareRecord(array &$record, WebformSubmissionInterfac } // Get element and composite key and confirm that the element exists. - list($element_key, $composite_key) = explode('__', $name); + [$element_key, $composite_key] = explode('__', $name); if (!isset($elements[$element_key])) { continue; } @@ -712,7 +712,7 @@ protected function importManageFileElement(array $element, $value, WebformSubmis $element_plugin->prepare($element, $this->getSubmissionStorage()->create(['webform_id' => $webform->id()])); // Get file destination. - $file_destination = isset($element['#upload_location']) ? $element['#upload_location'] : NULL; + $file_destination = $element['#upload_location'] ?? NULL; if (isset($file_destination) && !$this->fileSystem->prepareDirectory($file_destination, FileSystemInterface::CREATE_DIRECTORY)) { $this->loggerFactory->get('file') ->notice('The upload directory %directory for the file element %name could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', [ @@ -979,9 +979,9 @@ protected function importConvertRecordToValues(array $record) { return $values; } - /****************************************************************************/ + /* ************************************************************************ */ // Summary. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1082,9 +1082,9 @@ public function getSourceToDestinationColumnMapping() { return $mapping; } - /****************************************************************************/ + /* ************************************************************************ */ // Batch. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1101,9 +1101,9 @@ public function requiresBatch() { return ($this->getTotal() > $this->getBatchLimit()) ? TRUE : FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // Helpers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an entity's export id or UUID based on the export options. diff --git a/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporterInterface.php b/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporterInterface.php index 89beedfb36..54151215f7 100644 --- a/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporterInterface.php +++ b/web/modules/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporterInterface.php @@ -102,9 +102,9 @@ public function getImportOption($name); */ public function getDefaultImportOptions(); - /****************************************************************************/ + /* ************************************************************************ */ // Webform field definitions and elements. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get a webform's field definitions. @@ -122,9 +122,9 @@ public function getFieldDefinitions(); */ public function getElements(); - /****************************************************************************/ + /* ************************************************************************ */ // Export. - /****************************************************************************/ + /* ************************************************************************ */ /** * Create CSV export header. @@ -147,9 +147,9 @@ public function exportHeader(); */ public function exportSubmission(WebformSubmissionInterface $webform_submission, array $export_options = []); - /****************************************************************************/ + /* ************************************************************************ */ // Import. - /****************************************************************************/ + /* ************************************************************************ */ /** * Import records from CSV import file. @@ -165,9 +165,9 @@ public function exportSubmission(WebformSubmissionInterface $webform_submission, */ public function import($offset = 0, $limit = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Summary. - /****************************************************************************/ + /* ************************************************************************ */ /** * Total number of submissions to be imported. @@ -203,9 +203,9 @@ public function getDestinationColumns(); */ public function getSourceToDestinationColumnMapping(); - /****************************************************************************/ + /* ************************************************************************ */ // Batch. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the number of submissions to be exported with each batch. diff --git a/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.info.yml b/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.info.yml index 4c5499e17a..4eb0e82c29 100644 --- a/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.info.yml +++ b/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.info.yml @@ -7,7 +7,7 @@ dependencies: - 'webform:webform_submission_export_import' - 'webform:webform_image_select' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.module b/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.module index 9b9e16ef0e..a98b5efe99 100644 --- a/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.module +++ b/web/modules/webform/modules/webform_submission_export_import/tests/modules/webform_submission_export_import_test/webform_submission_export_import_test.module @@ -77,7 +77,7 @@ function webform_submission_export_import_test_form_webform_submission_export_im $form['import']['import_url']['#help'] = FALSE; $form['#attached']['library'][] = 'webform_submission_export_import_test/webform_submission_export_import_test'; } - + // phpcs:disable /* // Get webform.csv and external.csv from Google Sheets. file_put_contents( @@ -89,4 +89,5 @@ function webform_submission_export_import_test_form_webform_submission_export_im file_get_contents('https://docs.google.com/spreadsheets/d/e/2PACX-1vTYImRfGbGGCtKq7hrYGkm5jJo_P0fwNrLOBpcSapBkEUPlBToShXcSJAdDAF5hjVupbGFAm1anUtip/pub?gid=173244372&single=true&output=csv') ); */ + // phpcs:enable } diff --git a/web/modules/webform/modules/webform_submission_export_import/tests/src/Functional/WebformSubmissionImportExportFunctionalTest.php b/web/modules/webform/modules/webform_submission_export_import/tests/src/Functional/WebformSubmissionImportExportFunctionalTest.php index 80490b05d4..344556f06d 100644 --- a/web/modules/webform/modules/webform_submission_export_import/tests/src/Functional/WebformSubmissionImportExportFunctionalTest.php +++ b/web/modules/webform/modules/webform_submission_export_import/tests/src/Functional/WebformSubmissionImportExportFunctionalTest.php @@ -53,7 +53,7 @@ public function testSubmissionExport() { $this->drupalPostForm('/admin/structure/webform/manage/test_submission_export_import/results/download', ['exporter' => 'webform_submission_export_import'], 'Download'); file_put_contents($export_csv_uri, $this->getRawContent()); - /**************************************************************************/ + /* ********************************************************************** */ // Import CSV export without any changes. $actual_stats = $importer->import(); @@ -89,6 +89,7 @@ public function testSubmissionExport() { $submissions[0]->setNotes('This is a note'); $submissions[0]->save(); + // phpcs:disable // @todo Determine why the below test is failing via DrupalCI. return; @@ -143,6 +144,7 @@ public function testSubmissionExport() { // Check all other values remained the same. $this->assertEquals($expected_values, $actual_values); + // phpcs:enable } /** @@ -161,7 +163,7 @@ public function testSubmissionImport() { $importer->setWebform($webform); $importer->setImportUri($webform_csv_url); - /**************************************************************************/ + /* ********************************************************************** */ // Upload the webform.csv. $this->drupalPostForm( @@ -341,7 +343,6 @@ public function testSubmissionImport() { ], ]; // Unset YAML warning which can vary from server to server. - unset( $expected_stats['warnings'][2][1], $actual_stats['warnings'][2][1] @@ -415,7 +416,7 @@ public function testSubmissionImport() { $this->assertRaw('Submission import completed. (total: 1; created: 0; updated: 1; skipped: 0)'); } - /****************************************************************************/ + /* ************************************************************************ */ /** * Load a webform submission using a property value. diff --git a/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.info.yml b/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.info.yml index bd228b1f9d..6f4427fa95 100644 --- a/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.info.yml +++ b/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.module b/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.module index 39cf3c158d..cbdac0de67 100644 --- a/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.module +++ b/web/modules/webform/modules/webform_submission_export_import/webform_submission_export_import.module @@ -42,10 +42,10 @@ function webform_submission_export_import_local_tasks_alter(&$local_tasks) { } } -/******************************************************************************/ +/* ************************************************************************** */ // The below code is copy of _file_save_upload_single() which allows imported // files to be securely created. -/******************************************************************************/ +/* ************************************************************************** */ /** * Saves a file upload to a new location. @@ -98,20 +98,20 @@ function _webform_submission_export_import_file_save_upload_single(\SplFileInfo return FALSE; case UPLOAD_ERR_OK: - /************************************************************************/ + // phpcs:disable + /* ******************************************************************** */ // DO NOT USE IF UPLOADED FILE. - /************************************************************************/ - /* + /* ******************************************************************** */ // Final check that this is a valid upload, if it isn't, use the // default error handler. - if (is_uploaded_file($file_info->getRealPath())) { - break; - } - */ + // if (is_uploaded_file($file_info->getRealPath())) { + // break; + // } + // phpcs:enable break; default: - // Unknown error + // Unknown error. \Drupal::messenger()->addError(t('The file %file could not be saved. An unknown error has occurred.', ['%file' => $file_info->getFilename()])); return FALSE; @@ -222,9 +222,10 @@ function _webform_submission_export_import_file_save_upload_single(\SplFileInfo $file->setFileUri($file->destination); - /************************************************************************/ + /* ******************************************************************** */ // DO NOT USE MOVE UPLOADED FILE. - /************************************************************************/ + /* ******************************************************************** */ + // phpcs:ignore // if (!drupal_move_uploaded_file($file_info->getRealPath(), $file->getFileUri())) { if (!\Drupal::service('file_system')->move($file_info->getRealPath(), $file->getFileUri(), $replace)) { \Drupal::messenger()->addError(t('File upload error. Could not move uploaded file.')); diff --git a/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogNodeTest.php b/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogNodeTest.php index a5c7a4d33b..692f14c610 100644 --- a/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogNodeTest.php +++ b/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogNodeTest.php @@ -59,7 +59,7 @@ public function testSubmissionLog() { $this->assertResponse(200); $this->assertNoRaw('No log messages available.'); $this->assertRaw('<a href="' . $base_path . 'node/' . $nid . '/webform/submission/' . $sid . '/log">' . $sid . '</a>'); - $this->assertRaw(t('@title created.', ['@title' => $submission->label()])); + $this->assertRaw($this->t('@title created.', ['@title' => $submission->label()])); // Check webform node submission log tab. $this->drupalGet("node/$nid/webform/submission/$sid/log"); diff --git a/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogTest.php b/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogTest.php index 7c5f7df1ae..a9a52c93e8 100644 --- a/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogTest.php +++ b/web/modules/webform/modules/webform_submission_log/tests/src/Functional/WebformSubmissionLogTest.php @@ -43,7 +43,7 @@ public function testSubmissionLog() { $webform = Webform::load('test_submission_log'); - /**************************************************************************/ + /* ********************************************************************** */ // Check submission created. $sid_1 = $this->postSubmission($webform); @@ -131,10 +131,10 @@ public function testSubmissionLog() { $this->assertEqual($log->sid, 2); $this->assertEqual($log->uid, $admin_user->id()); $this->assertEqual($log->handler_id, ''); - /**************************************************************************/ + /* ********************************************************************** */ // $this->assertEqual($log->operation, 'submission completed'); // $this->assertEqual($log->message, 'Test: Submission: Logging: Submission #2 completed using saved draft.'); - /**************************************************************************/ + /* ********************************************************************** */ $this->assertEqual($log->webform_id, 'test_submission_log'); $this->assertNull($log->entity_type); $this->assertNull($log->entity_id); diff --git a/web/modules/webform/modules/webform_submission_log/webform_submission_log.info.yml b/web/modules/webform/modules/webform_submission_log/webform_submission_log.info.yml index 1e9f0327e5..4a8c237f1d 100644 --- a/web/modules/webform/modules/webform_submission_log/webform_submission_log.info.yml +++ b/web/modules/webform/modules/webform_submission_log/webform_submission_log.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_templates/src/Controller/WebformTemplatesController.php b/web/modules/webform/modules/webform_templates/src/Controller/WebformTemplatesController.php index 1b79e40f23..7681bbe4c3 100644 --- a/web/modules/webform/modules/webform_templates/src/Controller/WebformTemplatesController.php +++ b/web/modules/webform/modules/webform_templates/src/Controller/WebformTemplatesController.php @@ -233,7 +233,7 @@ protected function getTemplates($keys = '', $category = '') { return []; } - /* @var $entities \Drupal\webform\WebformInterface[] */ + /** @var \Drupal\webform\WebformInterface[] $entities */ $entities = $this->getWebformStorage()->loadMultiple($entity_ids); // If the user is not a webform admin, check view access to each webform. diff --git a/web/modules/webform/modules/webform_templates/webform_templates.info.yml b/web/modules/webform/modules/webform_templates/webform_templates.info.yml index bef93c36c9..1cad1d485e 100644 --- a/web/modules/webform/modules/webform_templates/webform_templates.info.yml +++ b/web/modules/webform/modules/webform_templates/webform_templates.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggle.php b/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggle.php index 48869452cf..ddbc8a3b2b 100644 --- a/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggle.php +++ b/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggle.php @@ -36,7 +36,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggles.php b/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggles.php index 4ecbebb57e..fd0baca7c2 100644 --- a/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggles.php +++ b/web/modules/webform/modules/webform_toggles/src/Plugin/WebformElement/WebformToggles.php @@ -38,7 +38,7 @@ protected function defineDefaultProperties() { } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/modules/webform_toggles/tests/modules/webform_toggles_test/webform_toggles_test.info.yml b/web/modules/webform/modules/webform_toggles/tests/modules/webform_toggles_test/webform_toggles_test.info.yml index 5ef48395d5..3fff310a6c 100644 --- a/web/modules/webform/modules/webform_toggles/tests/modules/webform_toggles_test/webform_toggles_test.info.yml +++ b/web/modules/webform/modules/webform_toggles/tests/modules/webform_toggles_test/webform_toggles_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform_toggles' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_toggles/webform_toggles.info.yml b/web/modules/webform/modules/webform_toggles/webform_toggles.info.yml index 25000b2cbd..865e680517 100644 --- a/web/modules/webform/modules/webform_toggles/webform_toggles.info.yml +++ b/web/modules/webform/modules/webform_toggles/webform_toggles.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/modules/webform_ui/js/webform_ui.js b/web/modules/webform/modules/webform_ui/js/webform_ui.js index df4ea9e2f6..b2d7429ee5 100644 --- a/web/modules/webform/modules/webform_ui/js/webform_ui.js +++ b/web/modules/webform/modules/webform_ui/js/webform_ui.js @@ -7,7 +7,6 @@ 'use strict'; - /** * Move toggle weight element to the first child of the edit form. * @@ -92,7 +91,6 @@ var direction = (event.which === 37) ? 'prev' : 'next'; var $focus; - // Move keyboard focus within operations dropbutton. if ($(this).closest('.webform-dropbutton').length) { if (direction === 'next' && diff --git a/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementDeleteForm.php b/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementDeleteForm.php index c7f01f2b3e..233d97e8ab 100644 --- a/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementDeleteForm.php +++ b/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementDeleteForm.php @@ -76,9 +76,9 @@ public static function create(ContainerInterface $container) { return $instance; } - /****************************************************************************/ + /* ************************************************************************ */ // Delete form. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -155,9 +155,9 @@ public function getDetails() { } } - /****************************************************************************/ + /* ************************************************************************ */ // Form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -209,9 +209,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $form_state->setRedirectUrl($this->webform->toUrl('edit-form', ['query' => $query])); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get deleted elements as item list. diff --git a/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementFormBase.php b/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementFormBase.php index 40fcfb9d64..047a8dfd4a 100644 --- a/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementFormBase.php +++ b/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementFormBase.php @@ -571,9 +571,9 @@ protected function getParentKeyPrefix($parent_key) { return NULL; } - /****************************************************************************/ + /* ************************************************************************ */ // Element key handling. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determines if the webform element key already exists. @@ -634,9 +634,9 @@ public function getDefaultKey() { } } - /****************************************************************************/ + /* ************************************************************************ */ // Default value handling. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build update default value form elements. diff --git a/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php b/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php index 021a38368b..755bd16fa1 100644 --- a/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php +++ b/web/modules/webform/modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php @@ -173,9 +173,9 @@ public function submitAjaxForm(array &$form, FormStateInterface $form_state) { return $response; } - /****************************************************************************/ + /* ************************************************************************ */ // Table methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get table header. @@ -265,9 +265,9 @@ protected function buildRow(WebformElementInterface $webform_element, Url $url, return $row; } - /****************************************************************************/ + /* ************************************************************************ */ // Preview methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determine if webform element type preview is enabled. @@ -452,9 +452,9 @@ protected function buildElementPreviewPlaceholder($text) { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Gets the sorted definition of all WebformElement plugins. diff --git a/web/modules/webform/modules/webform_ui/src/WebformUiEntityElementsForm.php b/web/modules/webform/modules/webform_ui/src/WebformUiEntityElementsForm.php index 687ba5234b..a8810e5d2f 100644 --- a/web/modules/webform/modules/webform_ui/src/WebformUiEntityElementsForm.php +++ b/web/modules/webform/modules/webform_ui/src/WebformUiEntityElementsForm.php @@ -106,28 +106,28 @@ public function buildForm(array $form, FormStateInterface $form_state) { } $form['webform_ui_elements'] = [ - '#type' => 'table', - '#header' => $header, - '#empty' => $this->t('Please add elements to this webform.'), - '#attributes' => [ - 'class' => ['webform-ui-elements-table'], + '#type' => 'table', + '#header' => $header, + '#empty' => $this->t('Please add elements to this webform.'), + '#attributes' => [ + 'class' => ['webform-ui-elements-table'], + ], + '#tabledrag' => [ + [ + 'action' => 'match', + 'relationship' => 'parent', + 'group' => 'row-parent-key', + 'source' => 'row-key', + 'hidden' => TRUE, /* hides the WEIGHT & PARENT tree columns below */ + 'limit' => FALSE, ], - '#tabledrag' => [ - [ - 'action' => 'match', - 'relationship' => 'parent', - 'group' => 'row-parent-key', - 'source' => 'row-key', - 'hidden' => TRUE, /* hides the WEIGHT & PARENT tree columns below */ - 'limit' => FALSE, - ], - [ - 'action' => 'order', - 'relationship' => 'sibling', - 'group' => 'row-weight', - ], + [ + 'action' => 'order', + 'relationship' => 'sibling', + 'group' => 'row-weight', ], - ] + $rows; + ], + ] + $rows; if ($rows && !$webform->hasActions()) { $form['webform_ui_elements'] += ['webform_actions_default' => $this->getCustomizeActionsRow()]; @@ -187,7 +187,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) { } $parent_keys[] = $current_parent_key; - $current_parent_key = (isset($webform_ui_elements[$current_parent_key]['parent_key'])) ? $webform_ui_elements[$current_parent_key]['parent_key'] : NULL; + $current_parent_key = $webform_ui_elements[$current_parent_key]['parent_key'] ?? NULL; } } @@ -484,7 +484,7 @@ protected function getElementRow(array $element, $delta, array $parent_options) // Add element key and type. $row['#attributes']['data-webform-key'] = $element['#webform_key']; - $row['#attributes']['data-webform-type'] = (isset($element['#type'])) ? $element['#type'] : ''; + $row['#attributes']['data-webform-type'] = $element['#type'] ?? ''; $row['#attributes']['class'] = $row_class; diff --git a/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementDefaultValueTest.php b/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementDefaultValueTest.php index 2d65eed0d4..ede13c009d 100644 --- a/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementDefaultValueTest.php +++ b/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementDefaultValueTest.php @@ -25,9 +25,9 @@ public function testElementDefaultValue() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Single text field. - /**************************************************************************/ + /* ********************************************************************** */ // Check validation when trying to set default value. $this->drupalPostForm('/admin/structure/webform/manage/contact/element/add/textfield', [], 'Set default value'); @@ -47,9 +47,9 @@ public function testElementDefaultValue() { $this->drupalPostForm(NULL, ['default_value' => '{default value}'], 'Update default value'); $this->assertFieldByName('properties[default_value]', '{default value}'); - /**************************************************************************/ + /* ********************************************************************** */ // Multiple text field. - /**************************************************************************/ + /* ********************************************************************** */ // Check set default value generates a multiple textfield element. $edit = [ @@ -64,9 +64,9 @@ public function testElementDefaultValue() { $this->drupalPostForm(NULL, ['default_value[items][0][_item_]' => '{default value}'], 'Update default value'); $this->assertFieldByName('properties[default_value]', '{default value}'); - /**************************************************************************/ + /* ********************************************************************** */ // Single address (composite) field. - /**************************************************************************/ + /* ********************************************************************** */ // Check set default value generates a single address element. $edit = [ diff --git a/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementTest.php b/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementTest.php index 13f0c3dbc3..58754f355e 100644 --- a/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementTest.php +++ b/web/modules/webform/modules/webform_ui/tests/src/Functional/WebformUiElementTest.php @@ -45,9 +45,9 @@ public function testElements() { $webform_contact = Webform::load('contact'); - /**************************************************************************/ + /* ********************************************************************** */ // Multiple. - /**************************************************************************/ + /* ********************************************************************** */ // Check multiple enabled before submission. $this->drupalGet('/admin/structure/webform/manage/contact/element/name/edit'); @@ -61,9 +61,9 @@ public function testElements() { $this->assertRaw('<select data-drupal-selector="edit-properties-multiple-container-cardinality" disabled="disabled" id="edit-properties-multiple-container-cardinality" name="properties[multiple][container][cardinality]" class="form-select">'); $this->assertRaw('<em>There is data for this element in the database. This setting can no longer be changed.</em>'); - /**************************************************************************/ + /* ********************************************************************** */ // Reordering. - /**************************************************************************/ + /* ********************************************************************** */ // Check original contact element order. $this->assertEqual(['name', 'email', 'subject', 'message', 'actions'], array_keys($webform_contact->getElementsDecodedAndFlattened())); @@ -83,9 +83,9 @@ public function testElements() { $webform_contact = Webform::load('contact'); $this->assertEqual(['message', 'subject', 'email', 'name', 'actions'], array_keys($webform_contact->getElementsDecodedAndFlattened())); - /**************************************************************************/ + /* ********************************************************************** */ // Hierarchy. - /**************************************************************************/ + /* ********************************************************************** */ // Create a simple test form. $values = ['id' => 'test']; @@ -126,9 +126,9 @@ public function testElements() { $this->assertRaw('Parent <em class="placeholder">details_01</em> key is not valid.'); $this->assertRaw('Parent <em class="placeholder">details_02</em> key is not valid.'); - /**************************************************************************/ + /* ********************************************************************** */ // Required. - /**************************************************************************/ + /* ********************************************************************** */ // Check name is required. $this->drupalGet('/admin/structure/webform/manage/contact'); @@ -141,9 +141,9 @@ public function testElements() { $this->drupalPostForm('/admin/structure/webform/manage/contact', $edit, 'Save elements'); $this->assertNoFieldChecked('edit-webform-ui-elements-name-required'); - /**************************************************************************/ + /* ********************************************************************** */ // Notes. - /**************************************************************************/ + /* ********************************************************************** */ // Add admin notes to contact name element. $edit = [ @@ -152,9 +152,9 @@ public function testElements() { $this->drupalPostForm('/admin/structure/webform/manage/contact/element/name/edit', $edit, 'Save'); $this->assertRaw('<span data-drupal-selector="edit-webform-ui-elements-name-title-notes" class="webform-element-help js-webform-element-help" role="tooltip" tabindex="0" aria-label="Your Name" data-webform-help="<div class="webform-element-help--title">Your Name</div><div class="webform-element-help--content">This is an admin note.</div>"><span aria-hidden="true">?</span></span>'); - /**************************************************************************/ - // CRUD - /**************************************************************************/ + /* ********************************************************************** */ + // CRUD. + /* ********************************************************************** */ // Check that 'Save + Add element' is only visible in dialogs. $this->drupalGet('/admin/structure/webform/manage/contact/element/add/textfield'); @@ -215,9 +215,9 @@ public function testElements() { $this->drupalGet('/admin/structure/webform/manage/contact/element/add/password'); $this->assertResponse(403); - /**************************************************************************/ - // Change type - /**************************************************************************/ + /* ********************************************************************** */ + // Change type. + /* ********************************************************************** */ // Check create element. $this->drupalPostForm('/admin/structure/webform/manage/contact/element/add/textfield', ['key' => 'test', 'properties[title]' => 'Test'], 'Save'); @@ -227,23 +227,23 @@ public function testElements() { // Check change element type link. $this->assertRaw('Text field <a href="' . $base_path . 'admin/structure/webform/manage/contact/element/test/change" class="button button--small webform-ajax-link" data-dialog-type="modal" data-dialog-options="{"width":800,"dialogClass":"webform-ui-dialog"}" data-drupal-selector="edit-change-type" id="edit-change-type">Change</a>'); // Check text field has description. - $this->assertRaw(t('A short description of the element used as help for the user when they use the webform.')); + $this->assertRaw('A short description of the element used as help for the user when they use the webform.'); // Check change element types. $this->drupalGet('/admin/structure/webform/manage/contact/element/test/change'); - $this->assertRaw(t('Hidden')); + $this->assertRaw('Hidden'); $this->assertCssSelect('a[href$="admin/structure/webform/manage/contact/element/test/edit?type=hidden"][data-dialog-type][data-dialog-options][data-drupal-selector="edit-elements-hidden-operation"]'); - $this->assertRaw(t('Search')); + $this->assertRaw('Search'); $this->assertCssSelect('a[href$="admin/structure/webform/manage/contact/element/test/edit?type=search"][data-dialog-type][data-dialog-options][data-drupal-selector="edit-elements-search-operation"]'); - $this->assertRaw(t('Telephone')); + $this->assertRaw('Telephone'); $this->assertCssSelect('a[href$="admin/structure/webform/manage/contact/element/test/edit?type=tel"][data-dialog-type][data-dialog-options][data-drupal-selector="edit-elements-tel-operation"]'); - $this->assertRaw(t('URL')); + $this->assertRaw('URL'); $this->assertCssSelect('a[href$="admin/structure/webform/manage/contact/element/test/edit?type=url"][data-dialog-type][data-dialog-options][data-drupal-selector="edit-elements-url-operation"]'); // Check change element type. $this->drupalGet('/admin/structure/webform/manage/contact/element/test/edit', ['query' => ['type' => 'hidden']]); // Check hidden has no description. - $this->assertNoRaw(t('A short description of the element used as help for the user when they use the webform.')); + $this->assertNoRaw('A short description of the element used as help for the user when they use the webform.'); $this->assertRaw('Hidden <a href="' . $base_path . 'admin/structure/webform/manage/contact/element/test/edit" class="button button--small webform-ajax-link" data-dialog-type="dialog" data-dialog-renderer="off_canvas" data-dialog-options="{"width":600,"dialogClass":"ui-dialog-off-canvas webform-off-canvas"}" data-drupal-selector="edit-cancel" id="edit-cancel">Cancel</a>'); $this->assertRaw('(Changing from <em class="placeholder">Text field</em>)'); @@ -261,9 +261,9 @@ public function testElements() { $this->drupalGet('/admin/structure/webform/manage/contact/element/test_color/change'); $this->assertResponse(404); - /**************************************************************************/ - // Date - /**************************************************************************/ + /* ********************************************************************** */ + // Date. + /* ********************************************************************** */ // Check GNU Date Input Format validation. $edit = [ @@ -272,9 +272,9 @@ public function testElements() { $this->drupalPostForm('/admin/structure/webform/manage/test_element_date/element/date_min_max_dynamic/edit', $edit, 'Save'); $this->assertRaw('The Default value could not be interpreted in <a href="https://www.gnu.org/software/tar/manual/html_chapter/tar_7.html#Date-input-formats">GNU Date Input Format</a>.'); - /**************************************************************************/ + /* ********************************************************************** */ // Off-canvas width. - /**************************************************************************/ + /* ********************************************************************** */ // Check add off-canvas element width is 800. $this->drupalGet('/admin/structure/webform/manage/contact/element/add'); diff --git a/web/modules/webform/modules/webform_ui/tests/src/FunctionalJavascript/WebformUiElementJavaScriptTest.php b/web/modules/webform/modules/webform_ui/tests/src/FunctionalJavascript/WebformUiElementJavaScriptTest.php index 5f86ccb02a..58642c26ad 100644 --- a/web/modules/webform/modules/webform_ui/tests/src/FunctionalJavascript/WebformUiElementJavaScriptTest.php +++ b/web/modules/webform/modules/webform_ui/tests/src/FunctionalJavascript/WebformUiElementJavaScriptTest.php @@ -5,7 +5,7 @@ use Drupal\Tests\webform\FunctionalJavascript\WebformWebDriverTestBase; /** - * Tests webform UI element JavasScript. + * Tests webform UI element JavaScript. * * @group webform_ui */ @@ -30,7 +30,7 @@ public function testElement() { $page = $this->getSession()->getPage(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/modules/webform_ui/webform_ui.info.yml b/web/modules/webform/modules/webform_ui/webform_ui.info.yml index 7e6ae4e97c..7703750d1f 100644 --- a/web/modules/webform/modules/webform_ui/webform_ui.info.yml +++ b/web/modules/webform/modules/webform_ui/webform_ui.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/phpcs.xml.dist b/web/modules/webform/phpcs.xml.dist new file mode 100644 index 0000000000..67a853ed5c --- /dev/null +++ b/web/modules/webform/phpcs.xml.dist @@ -0,0 +1,43 @@ +<ruleset name="webforme"> + + <description>Webform coding styles</description> + + <!-- Use Drupal coding standards --> + <rule ref="Drupal"/> + <rule ref="DrupalPractice"/> + + <!-- Test all the Drupal PHP file extensions --> + <arg name="extensions" value="php,module,inc,install,test,profile,theme,js,css" /> + + <!-- Issue #3185082: Drupal.Arrays.Array.LongLineDeclaration make me write less readable code --> + <rule ref="Drupal.Arrays.Array"> + <exclude name="Drupal.Arrays.Array.LongLineDeclaration"/> + </rule> + + <!-- Issue #3173782: Increase line length limit --> + <rule ref="Drupal.Files.LineLength"> + <properties> + <property name="lineLimit" value="120" /> + <property name="absoluteLineLimit" value="0" /> + </properties> + </rule> + + <!-- Rules that need to ignored --> + <rule ref="Drupal"> + <exclude name="Drupal.Arrays.Array.ArrayIndentation"/> + <exclude name="Drupal.Commenting.DocComment.ShortNotCapital"/> + <exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/> + <exclude name="Drupal.Commenting.InlineComment.NotCapital"/> + <exclude name="Drupal.Files.LineLength.TooLong"/> + <exclude name="Drupal.NamingConventions.ValidVariableName.LowerCamelName"/> + <exclude name="Drupal.Semantics.FunctionT.NotLiteralString"/> + <exclude name="Drupal.Semantics.FunctionT.ConcatString"/> + <exclude name="Drupal.Strings.UnnecessaryStringConcat.Found"/> + </rule> + + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"> + <exclude name="Generic.CodeAnalysis.UselessOverridingMethod.Found"/> + </rule> + +</ruleset> + diff --git a/web/modules/webform/reports/accessiblity/text/example_accessibility_advanced.txt b/web/modules/webform/reports/accessiblity/text/example_accessibility_advanced.txt index 704c785698..5e10d2a8e5 100644 --- a/web/modules/webform/reports/accessiblity/text/example_accessibility_advanced.txt +++ b/web/modules/webform/reports/accessiblity/text/example_accessibility_advanced.txt @@ -10,21 +10,6 @@ Results for URL: http://localhost/wf/webform/example_accessibility_advanced ├── #edit-option-elements > div > div:nth-child(2) > span > span:nth-child(1) > span > ul > li > input └── <input class="select2-search__field" type="search" tabindex="0" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" placeholder="" style="width: 0.75em;"> - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-likert-table-q1-likert-question > label - └── <label>Please answer question 1?</label> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-likert-table-q2-likert-question > label - └── <label>How about now answering questio...</label> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-likert-table-q3-likert-question > label - └── <label>Finally, here is question 3?</label> - • Error: Duplicate id attribute value "iti-item-gb" found on the web page. ├── WCAG2AA.Principle4.Guideline4_1.4_1_1.F77 ├── #iti-item-gb @@ -40,50 +25,5 @@ Results for URL: http://localhost/wf/webform/example_accessibility_advanced ├── #edit-widget-elements > div > div:nth-child(4) > label > a └── <a role="button" href="#terms">terms of service</a> - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-tableselect > tbody > tr:nth-child(1) > td:nth-child(2) - └── <td>One</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-tableselect > tbody > tr:nth-child(2) > td:nth-child(2) - └── <td>Two</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-tableselect > tbody > tr:nth-child(3) > td:nth-child(2) - └── <td>Three</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-table-sort > tbody > tr:nth-child(1) > td:nth-child(1) - └── <td><a href="#" class="tabledrag-ha...</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-table-sort > tbody > tr:nth-child(2) > td:nth-child(1) - └── <td><a href="#" class="tabledrag-ha...</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-table-sort > tbody > tr:nth-child(3) > td:nth-child(1) - └── <td><a href="#" class="tabledrag-ha...</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-tableselect-sort > tbody > tr:nth-child(1) > td:nth-child(2) - └── <td>One</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-tableselect-sort > tbody > tr:nth-child(2) > td:nth-child(2) - └── <td>Two</td> - - • Error: This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of 1.87:1. Recommendation: change text colour to #757575. - ├── WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail - ├── #edit-webform-tableselect-sort > tbody > tr:nth-child(3) > td:nth-child(2) - └── <td>Three</td> - -16 Errors +4 Errors diff --git a/web/modules/webform/src/Cache/WebformBubbleableMetadata.php b/web/modules/webform/src/Cache/WebformBubbleableMetadata.php index 6b49845332..436c2676bf 100644 --- a/web/modules/webform/src/Cache/WebformBubbleableMetadata.php +++ b/web/modules/webform/src/Cache/WebformBubbleableMetadata.php @@ -17,7 +17,7 @@ class WebformBubbleableMetadata extends BubbleableMetadata { * replaces all existing cache contexts and tags. * * @param array $build - * A render array + * A render array. * * @see \Drupal\Core\Render\BubbleableMetadata::applyTo * @see \Drupal\webform\WebformSubmissionForm::buildForm diff --git a/web/modules/webform/src/Commands/WebformCliService.php b/web/modules/webform/src/Commands/WebformCliService.php index 393e4fdf5a..ee7a67753d 100644 --- a/web/modules/webform/src/Commands/WebformCliService.php +++ b/web/modules/webform/src/Commands/WebformCliService.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\webform\Commands; @@ -76,9 +77,9 @@ public function __call($name, array $arguments) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Commands. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -315,9 +316,9 @@ public function webform_drush_command() { return $items; } - /******************************************************************************/ + /* ************************************************************************** */ // Export - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -379,9 +380,9 @@ public function drush_webform_export($webform_id = NULL) { return NULL; } - /******************************************************************************/ + /* ************************************************************************** */ // Import. - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -443,9 +444,9 @@ public function drush_webform_import($webform_id = NULL, $import_uri = NULL) { return NULL; } - /******************************************************************************/ + /* ************************************************************************** */ // Purge - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -528,9 +529,9 @@ public function drush_webform_purge($webform_id = NULL) { } } - /******************************************************************************/ + /* ************************************************************************** */ // Tidy - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -636,9 +637,9 @@ public function drush_webform_tidy($target = NULL) { } } - /******************************************************************************/ + /* ************************************************************************** */ // Devel Generate. - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -664,9 +665,9 @@ public function drush_webform_generate($webform_id = NULL, $num = NULL) { $instance->generate($values); } - /******************************************************************************/ + /* ************************************************************************** */ // Libraries - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -825,9 +826,9 @@ public function drush_webform_libraries_remove($status = NULL) { return $removed; } - /******************************************************************************/ + /* ************************************************************************** */ // Repair. - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -941,9 +942,9 @@ public function drush_webform_remove_orphans() { } } - /******************************************************************************/ + /* ************************************************************************** */ // Docs. - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -1067,9 +1068,9 @@ protected function _drush_webform_docs_tidy($html) { return $html; } - /******************************************************************************/ + /* ************************************************************************** */ // Composer. - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -1247,9 +1248,9 @@ protected function drush_webform_composer_set_libraries(&$repositories, &$requir $require = WebformObjectHelper::sortByProperty($require); } - /******************************************************************************/ + /* ************************************************************************** */ // Generate commands. - /******************************************************************************/ + /* ************************************************************************** */ /** * {@inheritdoc} @@ -1282,9 +1283,9 @@ protected function drush_webform_generate_commands_drush8() { foreach ($items as $command_key => $command_item) { // Command name. $functions[] = " -/******************************************************************************/ +/* ************************************************************************** */ // drush $command_key. DO NOT EDIT. -/******************************************************************************/"; +/* ************************************************************************** */"; // Validate. $validate_method = 'drush_' . str_replace('-', '_', $command_key) . '_validate'; @@ -1375,9 +1376,9 @@ protected function drush_webform_generate_commands_drush9() { // Command name. $methods[] = " - /****************************************************************************/ + /* ************************************************************************ */ // drush $command_name. DO NOT EDIT. - /****************************************************************************/"; + /* ************************************************************************ */"; // Validate. $validate_method = 'drush_' . str_replace('-', '_', $command_key) . '_validate'; @@ -1487,9 +1488,9 @@ class WebformCommands extends WebformCommandsBase { }"; } - /******************************************************************************/ + /* ************************************************************************** */ // Helper functions. - /******************************************************************************/ + /* ************************************************************************** */ /** * Validate webform_id argument and source entity-type and entity-id options. diff --git a/web/modules/webform/src/Commands/WebformCliServiceInterface.php b/web/modules/webform/src/Commands/WebformCliServiceInterface.php index 539cf8c89a..a4a791afdc 100644 --- a/web/modules/webform/src/Commands/WebformCliServiceInterface.php +++ b/web/modules/webform/src/Commands/WebformCliServiceInterface.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\webform\Commands; diff --git a/web/modules/webform/src/Commands/WebformCommands.php b/web/modules/webform/src/Commands/WebformCommands.php index 01dbaacf39..1b36b47a8c 100644 --- a/web/modules/webform/src/Commands/WebformCommands.php +++ b/web/modules/webform/src/Commands/WebformCommands.php @@ -16,9 +16,9 @@ */ class WebformCommands extends WebformCommandsBase { - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:export. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:export @@ -64,9 +64,9 @@ public function drush_webform_export($webform = NULL, array $options = ['exporte $this->cliService->drush_webform_export($webform); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:import. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:import @@ -93,9 +93,9 @@ public function drush_webform_import($webform = NULL, $import_uri = NULL, array $this->cliService->drush_webform_import($webform, $import_uri); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:purge. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:purge @@ -126,9 +126,9 @@ public function drush_webform_purge($webform_id = NULL, array $options = ['all' $this->cliService->drush_webform_purge($webform_id); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:tidy. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:tidy @@ -154,9 +154,9 @@ public function drush_webform_tidy($target = NULL, array $options = ['dependenci $this->cliService->drush_webform_tidy($target); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:libraries:status. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Displays the status of third party libraries required by the Webform module. @@ -170,9 +170,9 @@ public function drush_webform_libraries_status() { $this->cliService->drush_webform_libraries_status(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:libraries:composer. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Generates the Webform module's composer.json with libraries as repositories. @@ -187,9 +187,9 @@ public function drush_webform_libraries_composer(array $options = ['disable-tls' $this->cliService->drush_webform_libraries_composer(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:libraries:download. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Download third party libraries required by the Webform module. @@ -203,9 +203,9 @@ public function drush_webform_libraries_download() { $this->cliService->drush_webform_libraries_download(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:libraries:remove. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Removes all downloaded third party libraries required by the Webform module. @@ -219,9 +219,9 @@ public function drush_webform_libraries_remove() { $this->cliService->drush_webform_libraries_remove(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:generate. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:generate @@ -248,9 +248,9 @@ public function drush_webform_generate($webform_id = NULL, $num = NULL, array $o $this->cliService->drush_webform_generate($webform_id, $num); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:repair. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Makes sure all Webform admin configuration and webform settings are up-to-date. @@ -264,9 +264,9 @@ public function drush_webform_repair() { $this->cliService->drush_webform_repair(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:remove:orphans. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Removes orphaned submissions where the submission's webform was deleted. @@ -280,9 +280,9 @@ public function drush_webform_remove_orphans() { $this->cliService->drush_webform_remove_orphans(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:docs. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:docs @@ -305,9 +305,9 @@ public function drush_webform_docs() { $this->cliService->drush_webform_docs(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:composer:update. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * @hook validate webform:composer:update @@ -331,9 +331,9 @@ public function drush_webform_composer_update(array $options = ['disable-tls' => $this->cliService->drush_webform_composer_update(); } - /****************************************************************************/ + /* ************************************************************************ */ // drush webform:generate:commands. DO NOT EDIT. - /****************************************************************************/ + /* ************************************************************************ */ /** * Generate Drush commands from webform.drush.inc for Drush 8.x to WebformCommands for Drush 9.x. @@ -347,4 +347,4 @@ public function drush_webform_generate_commands() { $this->cliService->drush_webform_generate_commands(); } -} \ No newline at end of file +} diff --git a/web/modules/webform/src/Commands/WebformCommandsBase.php b/web/modules/webform/src/Commands/WebformCommandsBase.php index 20ecb96ee0..e79981a402 100644 --- a/web/modules/webform/src/Commands/WebformCommandsBase.php +++ b/web/modules/webform/src/Commands/WebformCommandsBase.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\webform\Commands; diff --git a/web/modules/webform/src/Commands/WebformSanitizeSubmissionsCommands.php b/web/modules/webform/src/Commands/WebformSanitizeSubmissionsCommands.php index 385c8430ca..07f4002478 100644 --- a/web/modules/webform/src/Commands/WebformSanitizeSubmissionsCommands.php +++ b/web/modules/webform/src/Commands/WebformSanitizeSubmissionsCommands.php @@ -76,6 +76,8 @@ public function sanitize($result, CommandData $command_data) { } /** + * Sanitization options. + * * @hook option sql-sanitize * @option sanitize-webform-submissions * By default, submissions are truncated. Specify 'no' to disable that. @@ -83,6 +85,8 @@ public function sanitize($result, CommandData $command_data) { public function options($options = ['sanitize-webform-submissions' => NULL]) {} /** + * Sanitization messages. + * * @hook on-event sql-sanitize-confirms * * {@inheritdoc} diff --git a/web/modules/webform/src/Controller/WebformAddonsController.php b/web/modules/webform/src/Controller/WebformAddonsController.php index b6e84fc82c..6e91cac3cd 100644 --- a/web/modules/webform/src/Controller/WebformAddonsController.php +++ b/web/modules/webform/src/Controller/WebformAddonsController.php @@ -120,21 +120,6 @@ public function index() { ]; $projects = $this->addons->getProjects($category_name); foreach ($projects as $project_name => &$project) { - // Append (Experimental) to title. - if (!empty($project['experimental'])) { - $project['title'] .= ' [' . $this->t('EXPERIMENTAL') . ']'; - } - // Prepend logo to title. - if (isset($project['logo'])) { - $project['title'] = Markup::create('<img src="' . $project['logo']->toString() . '" alt="' . $project['title'] . '"/>' . $project['title']); - } - $project['description'] .= '<br /><small>' . $project['url']->toString() . '</small>'; - - // Append recommended to project's description. - if (!empty($project['recommended'])) { - $project['description'] .= '<br /><b class="color-success"> ★' . $this->t('Recommended') . '</b>'; - } - if (!empty($project['install']) && !$this->moduleHandler()->moduleExists($project_name)) { // If current user can install module then display a dismissible warning. if ($this->currentUser()->hasPermission('administer modules')) { @@ -150,6 +135,21 @@ public function index() { ]; } } + + // Append (Experimental) to title. + if (!empty($project['experimental'])) { + $project['title'] .= ' [' . $this->t('EXPERIMENTAL') . ']'; + } + // Prepend logo to title. + if (isset($project['logo'])) { + $project['title'] = Markup::create('<img src="' . $project['logo']->toString() . '" alt="' . $project['title'] . '"/>' . $project['title']); + } + $project['description'] .= '<br /><small>' . $project['url']->toString() . '</small>'; + + // Append recommended to project's description. + if (!empty($project['recommended'])) { + $project['description'] .= '<br /><b class="color-success"> ★' . $this->t('Recommended') . '</b>'; + } } $build['projects'][$category_name]['content'] = [ diff --git a/web/modules/webform/src/Controller/WebformEntityController.php b/web/modules/webform/src/Controller/WebformEntityController.php index 300a3899ae..1fa4508ae2 100644 --- a/web/modules/webform/src/Controller/WebformEntityController.php +++ b/web/modules/webform/src/Controller/WebformEntityController.php @@ -90,14 +90,14 @@ public function addForm(Request $request, WebformInterface $webform) { public function css(Request $request, WebformInterface $webform) { $assets = $webform->getAssets(); if ($webform->access('update')) { - $response = new WebformUncacheableResponse($assets['css'], 200, ['Content-Type' => 'text/css']); + return new WebformUncacheableResponse($assets['css'], 200, ['Content-Type' => 'text/css']); } else { $response = new CacheableResponse($assets['css'], 200, ['Content-Type' => 'text/css']); + return $response + ->addCacheableDependency($webform) + ->addCacheableDependency($this->config('webform.settings')); } - return $response - ->addCacheableDependency($webform) - ->addCacheableDependency($this->config('webform.settings')); } /** @@ -114,14 +114,14 @@ public function css(Request $request, WebformInterface $webform) { public function javascript(Request $request, WebformInterface $webform) { $assets = $webform->getAssets(); if ($webform->access('update')) { - $response = new WebformUncacheableResponse($assets['javascript'], 200, ['Content-Type' => 'text/javascript']); + return new WebformUncacheableResponse($assets['javascript'], 200, ['Content-Type' => 'text/javascript']); } else { $response = new CacheableResponse($assets['javascript'], 200, ['Content-Type' => 'text/javascript']); + return $response + ->addCacheableDependency($webform) + ->addCacheableDependency($this->config('webform.settings')); } - return $response - ->addCacheableDependency($webform) - ->addCacheableDependency($this->config('webform.settings')); } /** @@ -140,7 +140,7 @@ public function javascript(Request $request, WebformInterface $webform) { public function confirmation(Request $request, WebformInterface $webform = NULL, WebformSubmissionInterface $webform_submission = NULL) { /** @var \Drupal\Core\Entity\EntityInterface $source_entity */ if (!$webform) { - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); } else { $source_entity = $this->requestHandler->getCurrentSourceEntity('webform'); @@ -342,7 +342,7 @@ public function accessDeniedTitle(WebformInterface $webform) { public function title(WebformInterface $webform = NULL) { /** @var \Drupal\Core\Entity\EntityInterface $source_entity */ if (!$webform) { - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); } else { $source_entity = $this->requestHandler->getCurrentSourceEntity('webform'); diff --git a/web/modules/webform/src/Controller/WebformPluginElementController.php b/web/modules/webform/src/Controller/WebformPluginElementController.php index 4ce7bbf5d9..addb0d3f11 100644 --- a/web/modules/webform/src/Controller/WebformPluginElementController.php +++ b/web/modules/webform/src/Controller/WebformPluginElementController.php @@ -88,7 +88,7 @@ public function index() { 'access_update_users', 'access_view_roles', 'access_view_users', - ];; + ]; $default_properties = array_combine($default_properties, $default_properties); // Test element is only enabled if the Webform Devel and UI module are @@ -176,7 +176,7 @@ public function index() { // Element info. $element_info_definitions = [ 'input' => (empty($webform_element_info['#input'])) ? $this->t('No') : $this->t('Yes'), - 'theme' => (isset($webform_element_info['#theme'])) ? $webform_element_info['#theme'] : 'N/A', + 'theme' => $webform_element_info['#theme'] ?? 'N/A', 'theme_wrappers' => (isset($webform_element_info['#theme_wrappers'])) ? implode('; ', $webform_element_info['#theme_wrappers']) : 'N/A', ]; $element_info = []; diff --git a/web/modules/webform/src/Controller/WebformResultsExportController.php b/web/modules/webform/src/Controller/WebformResultsExportController.php index 4573799821..d7f163fb16 100644 --- a/web/modules/webform/src/Controller/WebformResultsExportController.php +++ b/web/modules/webform/src/Controller/WebformResultsExportController.php @@ -61,7 +61,7 @@ public static function create(ContainerInterface $container) { * A response that renders or redirects to the CSV file. */ public function index(Request $request) { - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); $this->submissionExporter->setWebform($webform); $this->submissionExporter->setSourceEntity($source_entity); @@ -131,7 +131,7 @@ public function index(Request $request) { * A response that renders or redirects to the CSV file. */ public function file(Request $request, $filename) { - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); $this->submissionExporter->setWebform($webform); $this->submissionExporter->setSourceEntity($source_entity); @@ -180,11 +180,11 @@ public function downloadFile($file_path, $download = TRUE) { return $response; } - /****************************************************************************/ + /* ************************************************************************ */ // Batch functions. // Using static method to prevent the service container from being serialized. - // "Prevents exception 'AssertionError' with message 'The container was serialized.'." - /****************************************************************************/ + // Prevents 'AssertionError: The container was serialized.' exception. + /* ************************************************************************ */ /** * Batch API; Initialize batch operations. @@ -240,7 +240,7 @@ public static function batchSet(WebformInterface $webform, EntityInterface $sour * @param mixed|array $context * The batch current context. */ - public static function batchProcess(WebformInterface $webform, EntityInterface $source_entity = NULL, array $export_options = [], array &$context = []) { + public static function batchProcess(WebformInterface $webform, EntityInterface $source_entity = NULL, array $export_options = [], &$context = []) { /** @var \Drupal\webform\WebformSubmissionExporterInterface $submission_exporter */ $submission_exporter = \Drupal::service('webform_submission.exporter'); $submission_exporter->setWebform($webform); diff --git a/web/modules/webform/src/Controller/WebformTestController.php b/web/modules/webform/src/Controller/WebformTestController.php index 525ab9f047..dde159c118 100644 --- a/web/modules/webform/src/Controller/WebformTestController.php +++ b/web/modules/webform/src/Controller/WebformTestController.php @@ -68,7 +68,7 @@ public static function create(ContainerInterface $container) { public function testForm(Request $request) { /** @var \Drupal\webform\WebformInterface $webform */ /** @var \Drupal\Core\Entity\EntityInterface $source_entity */ - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); // Test a single webform handler which is set via // ?_webform_handler={handler_id}. @@ -140,7 +140,7 @@ public function testForm(Request $request) { public function title(WebformInterface $webform) { /** @var \Drupal\webform\WebformInterface $webform */ /** @var \Drupal\Core\Entity\EntityInterface $source_entity */ - list($webform, $source_entity) = $this->requestHandler->getWebformEntities(); + [$webform, $source_entity] = $this->requestHandler->getWebformEntities(); return $this->t('Testing %title webform', ['%title' => ($source_entity) ? $source_entity->label() : $webform->label()]); } diff --git a/web/modules/webform/src/Element/Webform.php b/web/modules/webform/src/Element/Webform.php index 01c09f00b5..6001cc1e19 100644 --- a/web/modules/webform/src/Element/Webform.php +++ b/web/modules/webform/src/Element/Webform.php @@ -138,9 +138,9 @@ public static function buildAccessDenied(WebformInterface $webform) { $attributes['class'][] = 'webform-access-denied'; $build = [ - '#type' => 'container', + '#theme' => 'webform_access_denied', '#attributes' => $attributes, - 'message' => WebformHtmlEditor::checkMarkup($message), + '#message' => WebformHtmlEditor::checkMarkup($message), ]; return static::addCacheableDependency($build, $webform); diff --git a/web/modules/webform/src/Element/WebformActions.php b/web/modules/webform/src/Element/WebformActions.php index 862422feb8..eccfbd8d23 100644 --- a/web/modules/webform/src/Element/WebformActions.php +++ b/web/modules/webform/src/Element/WebformActions.php @@ -18,6 +18,11 @@ */ class WebformActions extends Container { + /** + * Buttons. + * + * @var string[] + */ public static $buttons = [ 'submit', 'reset', @@ -152,7 +157,7 @@ public static function processWebformActions(&$element, FormStateInterface $form else { $element[$button_name]['#attributes'][$attribute_name] = $attribute_value; } - }; + } } if (Element::isVisibleElement($element[$button_name])) { diff --git a/web/modules/webform/src/Element/WebformAutocomplete.php b/web/modules/webform/src/Element/WebformAutocomplete.php index 1d9971c5a8..3f28efd7d7 100644 --- a/web/modules/webform/src/Element/WebformAutocomplete.php +++ b/web/modules/webform/src/Element/WebformAutocomplete.php @@ -44,4 +44,5 @@ public static function preRenderWebformAutocomplete($element) { protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['autocomplete_items']); } + } diff --git a/web/modules/webform/src/Element/WebformCheckboxValue.php b/web/modules/webform/src/Element/WebformCheckboxValue.php index 8ce0ba15fe..09c2873a18 100644 --- a/web/modules/webform/src/Element/WebformCheckboxValue.php +++ b/web/modules/webform/src/Element/WebformCheckboxValue.php @@ -54,6 +54,7 @@ public static function processWebformCheckboxValue(&$element, FormStateInterface $properties = [ '#title' => '#title', + // phpcs:ignore DrupalPractice.General.DescriptionT.DescriptionT '#description' => '#description', '#help' => '#help', ]; diff --git a/web/modules/webform/src/Element/WebformCodeMirror.php b/web/modules/webform/src/Element/WebformCodeMirror.php index 18958251ab..f1ae27d3ce 100644 --- a/web/modules/webform/src/Element/WebformCodeMirror.php +++ b/web/modules/webform/src/Element/WebformCodeMirror.php @@ -233,9 +233,9 @@ public static function getMode($mode) { return (isset(static::$modes[$mode])) ? static::$modes[$mode] : static::$modes['text']; } - /****************************************************************************/ + /* ************************************************************************ */ // Language/markup validation callback. - /****************************************************************************/ + /* ************************************************************************ */ /** * Validate HTML. @@ -339,7 +339,7 @@ protected static function validateYaml($element, FormStateInterface $form_state, $value = $element['#value']; $data = Yaml::decode($value); if (!is_array($data) && $value) { - throw new \Exception(t('YAML must contain an associative array of elements.')); + throw new \Exception('YAML must contain an associative array of elements.'); } return NULL; } diff --git a/web/modules/webform/src/Element/WebformCompositeBase.php b/web/modules/webform/src/Element/WebformCompositeBase.php index cfbce98548..ab2692ba5d 100644 --- a/web/modules/webform/src/Element/WebformCompositeBase.php +++ b/web/modules/webform/src/Element/WebformCompositeBase.php @@ -191,9 +191,9 @@ public static function validateWebformComposite(&$element, FormStateInterface $f } } - /****************************************************************************/ + /* ************************************************************************ */ // Composite Elements. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Element/WebformCompositeFormElementTrait.php b/web/modules/webform/src/Element/WebformCompositeFormElementTrait.php index 1d9bb2e0b7..3a7ba3abd0 100644 --- a/web/modules/webform/src/Element/WebformCompositeFormElementTrait.php +++ b/web/modules/webform/src/Element/WebformCompositeFormElementTrait.php @@ -69,7 +69,7 @@ public static function preRenderWebformCompositeFormElement($element) { $element['#attached']['library'][] = 'webform/webform.composite'; // Set theme wrapper to wrapper type. - $wrapper_type = (isset($element['#wrapper_type'])) ? $element['#wrapper_type'] : 'fieldset'; + $wrapper_type = $element['#wrapper_type'] ?? 'fieldset'; $element['#theme_wrappers'][] = $wrapper_type; // Apply wrapper specific enhancements. diff --git a/web/modules/webform/src/Element/WebformComputedBase.php b/web/modules/webform/src/Element/WebformComputedBase.php index 7b8002b252..7d3b5008a0 100644 --- a/web/modules/webform/src/Element/WebformComputedBase.php +++ b/web/modules/webform/src/Element/WebformComputedBase.php @@ -91,9 +91,9 @@ public static function processWebformComputed(&$element, FormStateInterface $for $element += ['#element_validate' => []]; array_unshift($element['#element_validate'], [get_called_class(), 'validateWebformComputed']); - /**************************************************************************/ - // Ajax support - /**************************************************************************/ + /* ********************************************************************** */ + // Ajax support. + /* ********************************************************************** */ // Enabled Ajax support only for computed elements associated with a // webform submission form. @@ -172,9 +172,9 @@ public static function validateWebformComputed(&$element, FormStateInterface $fo } } - /****************************************************************************/ + /* ************************************************************************ */ // Form/Ajax callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set computed element's value. @@ -295,9 +295,9 @@ public static function ajaxWebformComputedCallback(array $form, FormStateInterfa return $element; } - /****************************************************************************/ + /* ************************************************************************ */ // Form/Ajax helpers and callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an element's value mode/type. diff --git a/web/modules/webform/src/Element/WebformElementAttributes.php b/web/modules/webform/src/Element/WebformElementAttributes.php index d8bdea43f6..8ef45808d4 100644 --- a/web/modules/webform/src/Element/WebformElementAttributes.php +++ b/web/modules/webform/src/Element/WebformElementAttributes.php @@ -130,7 +130,7 @@ public static function processWebformElementAttributes(&$element, FormStateInter // Apply custom properties. Typically used for descriptions. foreach ($element as $key => $value) { if (strpos($key, '__') !== FALSE) { - list($element_key, $property_key) = explode('__', ltrim($key, '#')); + [$element_key, $property_key] = explode('__', ltrim($key, '#')); $element[$element_key]["#$property_key"] = $value; } } diff --git a/web/modules/webform/src/Element/WebformElementComposite.php b/web/modules/webform/src/Element/WebformElementComposite.php index c626bcc632..08d9cea053 100644 --- a/web/modules/webform/src/Element/WebformElementComposite.php +++ b/web/modules/webform/src/Element/WebformElementComposite.php @@ -130,7 +130,7 @@ public static function processWebformElementComposite(&$element, FormStateInterf '#min_items' => 1, '#header' => TRUE, '#add' => FALSE, - '#default_value' => (isset($element['#default_value'])) ? $element['#default_value'] : NULL, + '#default_value' => $element['#default_value'] ?? NULL, '#error_no_message' => TRUE, '#element' => [ 'settings' => [ @@ -340,7 +340,7 @@ public static function validateWebformElementComposite(&$element, FormStateInter $element_plugin = $element_manager->getElementInstance($composite_element); $t_args = [ - '%title' => (isset($composite_element['#title'])) ? $composite_element['#title'] : $composite_element_key, + '%title' => $composite_element['#title'] ?? $composite_element_key, '@type' => $composite_element['#type'], ]; diff --git a/web/modules/webform/src/Element/WebformElementStates.php b/web/modules/webform/src/Element/WebformElementStates.php index b79850c434..82616cc30d 100644 --- a/web/modules/webform/src/Element/WebformElementStates.php +++ b/web/modules/webform/src/Element/WebformElementStates.php @@ -468,6 +468,7 @@ protected static function buildConditionRow(array $element, array $condition, $t '#type' => 'textfield', '#title' => t('Value'), '#title_display' => 'invisible', + '#maxlength' => NULL, '#size' => 25, '#default_value' => $condition['value'], '#placeholder' => t('Enter value…'), @@ -565,9 +566,9 @@ protected static function buildOperations($table_id, $row_index, array $ajax_set return $operations; } - /****************************************************************************/ + /* ************************************************************************ */ // Callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * Form submission handler for adding another state. @@ -740,9 +741,9 @@ public static function validateWebformElementStates(&$element, FormStateInterfac $form_state->setValueForElement($element, $states); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get unique key used to store the number of options for an element. @@ -759,9 +760,9 @@ protected static function getStorageKey(array $element, $name) { return 'webform_states__' . $element['#name'] . '__' . $name; } - /****************************************************************************/ + /* ************************************************************************ */ // Convert functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Convert Form API #states to states array. @@ -975,7 +976,7 @@ protected static function convertFormValuesToStatesArray(array $values = []) { $index++; $states[$index] = [ 'state' => $value['state'], - 'operator' => (isset($value['operator'])) ? $value['operator'] : 'and', + 'operator' => $value['operator'] ?? 'and', 'conditions' => [], ]; } diff --git a/web/modules/webform/src/Element/WebformEmailConfirm.php b/web/modules/webform/src/Element/WebformEmailConfirm.php index 65fc760fc7..527f67a165 100644 --- a/web/modules/webform/src/Element/WebformEmailConfirm.php +++ b/web/modules/webform/src/Element/WebformEmailConfirm.php @@ -167,7 +167,7 @@ public static function processWebformEmailConfirm(&$element, FormStateInterface */ public static function validateWebformEmailConfirm(&$element, FormStateInterface $form_state, &$complete_form) { if (isset($element['flexbox'])) { - $mail_element = &$element['flexbox']; + $mail_element = &$element['flexbox']; // phpcs:ignore } else { $mail_element = &$element; @@ -184,7 +184,7 @@ public static function validateWebformEmailConfirm(&$element, FormStateInterface // NOTE: Only mail_1 needs to be validated since mail_2 is the same value. // Verify the required value. if ($mail_element['mail_1']['#required'] && empty($mail_1)) { - $required_error_title = (isset($mail_element['mail_1']['#title'])) ? $mail_element['mail_1']['#title'] : NULL; + $required_error_title = $mail_element['mail_1']['#title'] ?? NULL; WebformElementHelper::setRequiredError($element, $form_state, $required_error_title); } // Verify that the value is not longer than #maxlength. diff --git a/web/modules/webform/src/Element/WebformEntityTrait.php b/web/modules/webform/src/Element/WebformEntityTrait.php index 090e511396..524be70a2d 100644 --- a/web/modules/webform/src/Element/WebformEntityTrait.php +++ b/web/modules/webform/src/Element/WebformEntityTrait.php @@ -46,14 +46,14 @@ public static function setOptions(array &$element, array $settings = []) { return; } - $selection_settings = isset($element['#selection_settings']) ? $element['#selection_settings'] : []; + $selection_settings = $element['#selection_settings'] ?? []; $selection_handler_options = [ - 'target_type' => $element['#target_type'], - 'handler' => $element['#selection_handler'], - // Set '_webform_settings' used to limit and randomize options. - // @see webform_query_entity_reference_alter() - '_webform_settings' => $settings, - ] + $selection_settings; + 'target_type' => $element['#target_type'], + 'handler' => $element['#selection_handler'], + // Set '_webform_settings' used to limit and randomize options. + // @see webform_query_entity_reference_alter() + '_webform_settings' => $settings, + ] + $selection_settings; // Make sure settings has a limit. $settings += ['limit' => 0]; @@ -73,6 +73,7 @@ public static function setOptions(array &$element, array $settings = []) { // If the selection handler is not using views, then translate // the entity reference's options. if (!\Drupal::moduleHandler()->moduleExists('views') + // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing || !($handler instanceof \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection)) { $options = static::translateOptions($options, $element); } @@ -96,14 +97,14 @@ public static function setOptions(array &$element, array $settings = []) { } /** - * Set the corresponding entity cache tags on the element + * Set the corresponding entity cache tags on the element. * * @param array $element - * An element + * An element. * @param string $target_type - * The target type id + * The target type id. * @param array $target_bundles - * The target bundle ids + * The target bundle ids. */ protected static function setCacheTags(array &$element, $target_type, array $target_bundles = []) { $list_cache_tag = sprintf('%s_list', $target_type); diff --git a/web/modules/webform/src/Element/WebformExcludedColumns.php b/web/modules/webform/src/Element/WebformExcludedColumns.php index 71881d1379..dde6cdeea2 100644 --- a/web/modules/webform/src/Element/WebformExcludedColumns.php +++ b/web/modules/webform/src/Element/WebformExcludedColumns.php @@ -55,9 +55,9 @@ public static function getWebformExcludedOptions(array $element) { foreach ($elements as $key => $element) { $options[$key] = [ - 'title' => $element['#admin_title'] ?:$element['#title'] ?: $key, + 'title' => $element['#admin_title'] ?: $element['#title'] ?: $key, 'name' => $key, - 'type' => isset($element['#type']) ? $element['#type'] : '', + 'type' => $element['#type'] ?? '', ]; } return $options; diff --git a/web/modules/webform/src/Element/WebformExcludedElements.php b/web/modules/webform/src/Element/WebformExcludedElements.php index 830ed7bfae..7af2bef6e8 100644 --- a/web/modules/webform/src/Element/WebformExcludedElements.php +++ b/web/modules/webform/src/Element/WebformExcludedElements.php @@ -2,10 +2,12 @@ namespace Drupal\webform\Element; +use Drupal\Core\Form\FormStateInterface; use Drupal\user\Entity\Role; use Drupal\webform\Entity\Webform as WebformEntity; use Drupal\webform\Utility\WebformArrayHelper; use Drupal\webform\Plugin\WebformElement\WebformActions as WebformActionsWebformElement; +use Drupal\webform\WebformInterface; /** * Provides a webform element for webform excluded elements. @@ -20,9 +22,19 @@ class WebformExcludedElements extends WebformExcludedBase { public function getInfo() { return parent::getInfo() + [ '#exclude_markup' => TRUE, + '#exclude_composite' => TRUE, ]; } + /** + * {@inheritdoc} + */ + public static function processWebformExcluded(&$element, FormStateInterface $form_state, &$complete_form) { + parent::processWebformExcluded($element, $form_state, $complete_form); + $element['#attached']['library'][] = 'webform/webform.element.excluded_elements'; + return $element; + } + /** * Get header for the excluded tableselect element. * @@ -63,28 +75,13 @@ public static function getWebformExcludedHeader() { * tableselect element. */ public static function getWebformExcludedOptions(array $element) { - /** @var \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager */ - $element_manager = \Drupal::service('plugin.manager.webform.element'); - /** @var \Drupal\webform\WebformInterface $webform */ $webform = WebformEntity::load($element['#webform_id']) ?: \Drupal::service('webform.request')->getCurrentWebform(); $options = []; - if ($element['#exclude_markup']) { - $form_elements = $webform->getElementsInitializedFlattenedAndHasValue(); - } - else { - $form_elements = $webform->getElementsInitializedAndFlattened(); - } + $form_elements = static::getElements($element, $webform); foreach ($form_elements as $key => $form_element) { - $form_element_plugin = $element_manager->getElementInstance($form_element); - // Skip markup elements that are containers or actions. - if (!$element['#exclude_markup'] - && ($form_element_plugin->isContainer($form_element) || $form_element_plugin instanceof WebformActionsWebformElement)) { - continue; - } - if (!empty($form_element['#access_view_roles'])) { $roles = array_map(function ($item) { return $item->label(); @@ -95,17 +92,80 @@ public static function getWebformExcludedOptions(array $element) { } $options[$key] = [ - 'title' => $form_element['#admin_title'] ?:$form_element['#title'] ?: $key, + 'title' => $form_element['#admin_title'] ?: $form_element['#title'] ?: $key, 'key' => $key, - 'type' => isset($form_element['#type']) ? $form_element['#type'] : '', + 'type' => $form_element['#type'] ?? '', 'private' => empty($form_element['#private']) ? t('No') : t('Yes'), 'access' => $roles ? WebformArrayHelper::toString($roles) : t('All roles'), ]; + + // Add warning to private elements. if (!empty($form_element['#private']) || $roles) { $options[$key]['#attributes']['class'][] = 'color-warning'; } + + // Add composite attributes and classes to allow composite sub-element + // to be styled and enhanced. + if (!empty($form_element['#webform_composite'])) { + $options[$key]['#attributes']['data-composite'] = $form_element['#webform_key']; + } + if (isset($form_element['#webform_composite_key'])) { + $options[$key]['#attributes']['class'][] = 'webform-excluded-elements--child'; + $options[$key]['#attributes']['data-composite-parent'] = $form_element['#webform_composite_parent_key']; + } } return $options; } + /** + * Get elements with or without markup and composite sub elements. + * + * @param array $element + * The exclued elements form element. + * @param \Drupal\webform\WebformInterface $webform + * A webform. + * + * @return array + * An associative array of elements with or without markup and composite sub elements. + */ + protected static function getElements(array $element, WebformInterface $webform) { + if ($element['#exclude_markup']) { + $form_elements = $webform->getElementsInitializedFlattenedAndHasValue(); + } + else { + $form_elements = $webform->getElementsInitializedAndFlattened(); + + // Skip markup elements that are containers or actions. + /** @var \Drupal\webform\Plugin\WebformElementManagerInterface $element_manager */ + $element_manager = \Drupal::service('plugin.manager.webform.element'); + foreach ($form_elements as $key => $form_element) { + $form_element_plugin = $element_manager->getElementInstance($form_element); + if ($form_element_plugin->isContainer($form_element) || $form_element_plugin instanceof WebformActionsWebformElement) { + unset($form_elements[$key]); + } + } + } + + // If composite sub elements are excluded return the elements AS-IS. + if ($element['#exclude_composite']) { + return $form_elements; + } + + // Build array of all elements with composite sub elements. + $all_form_elements = []; + foreach ($form_elements as $key => $form_element) { + // Append the element. + $all_form_elements[$key] = $form_element; + + // Append composite elements. + $composite_elements = $form_element['#webform_composite_elements'] ?? []; + foreach ($composite_elements as $composite_element) { + $composite_key = $composite_element['#webform_composite_key']; + $all_form_elements[$composite_key] = $composite_element; + } + } + + return $all_form_elements; + } + } diff --git a/web/modules/webform/src/Element/WebformHeight.php b/web/modules/webform/src/Element/WebformHeight.php index e41ff0086c..bc1f5a3a7a 100644 --- a/web/modules/webform/src/Element/WebformHeight.php +++ b/web/modules/webform/src/Element/WebformHeight.php @@ -126,7 +126,7 @@ public static function processWebformHeight(&$element, FormStateInterface $form_ // Container. $element['container'] = [ '#type' => 'container', - '#attributes' => ['class' => ['form--inline']], + '#attributes' => ['class' => ['form--inline', 'clearfix']], ]; $t_args = [ @@ -158,13 +158,13 @@ public static function processWebformHeight(&$element, FormStateInterface $form_ switch ($element['#height_type']) { case 'select': $element['container']['feet'] += $select_element_defaults + [ - '#field_suffix' => $feet_plural, - '#options' => $feet_options, - ]; + '#field_suffix' => $feet_plural, + '#options' => $feet_options, + ]; $element['container']['inches'] += $select_element_defaults + [ - '#field_suffix' => $inches_plural, - '#options' => $inches_options, - ]; + '#field_suffix' => $inches_plural, + '#options' => $inches_options, + ]; break; case 'select_suffix': @@ -175,11 +175,11 @@ public static function processWebformHeight(&$element, FormStateInterface $form_ $inches_options[$option_value] .= ' ' . ($option_value === 1 ? $inches_singular : $inches_plural); } $element['container']['feet'] += $select_element_defaults + [ - '#options' => $feet_options, - ]; + '#options' => $feet_options, + ]; $element['container']['inches'] += $select_element_defaults + [ - '#options' => $inches_options, - ]; + '#options' => $inches_options, + ]; break; default: @@ -203,7 +203,7 @@ public static function processWebformHeight(&$element, FormStateInterface $form_ // Apply custom properties to feet and inches elements. foreach ($element as $key => $value) { if (strpos($key, '__') !== FALSE) { - list($element_key, $property_key) = explode('__', ltrim($key, '#')); + [$element_key, $property_key] = explode('__', ltrim($key, '#')); if (isset($element['container'][$element_key])) { $element['container'][$element_key]["#$property_key"] = $value; } diff --git a/web/modules/webform/src/Element/WebformHtmlEditor.php b/web/modules/webform/src/Element/WebformHtmlEditor.php index 2f1f2cfa07..504305420d 100644 --- a/web/modules/webform/src/Element/WebformHtmlEditor.php +++ b/web/modules/webform/src/Element/WebformHtmlEditor.php @@ -145,6 +145,7 @@ public static function processWebformHtmlEditor(array $element) { } } + // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing if (\Drupal::moduleHandler()->moduleExists('imce') && \Drupal\imce\Imce::access()) { $element['#attached']['library'][] = 'imce/drupal.imce.ckeditor'; $element['#attached']['drupalSettings']['webform']['html_editor']['ImceImageIcon'] = file_create_url(drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/icons/imceimage.png'); @@ -273,8 +274,7 @@ public static function checkMarkup($text, array $options = []) { * HTML text with dis-allowed HTML tags removed. */ public static function stripTags($text) { - $allowed_tags = '<' . implode('><', static::getAllowedTags()) . '>'; - return strip_tags($text, $allowed_tags); + return Xss::filter($text, static::getAllowedTags()); } } diff --git a/web/modules/webform/src/Element/WebformLikert.php b/web/modules/webform/src/Element/WebformLikert.php index cbfcaa9116..963d5b3211 100644 --- a/web/modules/webform/src/Element/WebformLikert.php +++ b/web/modules/webform/src/Element/WebformLikert.php @@ -65,7 +65,7 @@ public static function processWebformLikert(&$element, FormStateInterface $form_ } else { $answer_description_property_name = ($element['#answers_description_display'] === 'help') ? 'help' : 'description'; - list($answer_title, $answer_description) = WebformOptionsHelper::splitOption($answer); + [$answer_title, $answer_description] = WebformOptionsHelper::splitOption($answer); } $answers[$answer_key] = [ 'description_property_name' => $answer_description_property_name, @@ -123,10 +123,10 @@ public static function processWebformLikert(&$element, FormStateInterface $form_ } else { $question_description_property_name = ($element['#questions_description_display'] === 'help') ? '#help' : '#description'; - list($question_title, $question_description) = WebformOptionsHelper::splitOption($question); + [$question_title, $question_description] = WebformOptionsHelper::splitOption($question); } - $value = (isset($element['#value'][$question_key])) ? $element['#value'][$question_key] : NULL; + $value = $element['#value'][$question_key] ?? NULL; // Get question id. // @see \Drupal\Core\Form\FormBuilder::doBuildForm @@ -157,7 +157,7 @@ public static function processWebformLikert(&$element, FormStateInterface $form_ // Add required attributes to input without setting the <label> // to required. if ($element['#required']) { - $answer_attributes['required'] ='required'; + $answer_attributes['required'] = 'required'; $answer_attributes['aria-required'] = 'true'; } diff --git a/web/modules/webform/src/Element/WebformManagedFileBase.php b/web/modules/webform/src/Element/WebformManagedFileBase.php index 663a465dd1..cdbacc7fc3 100644 --- a/web/modules/webform/src/Element/WebformManagedFileBase.php +++ b/web/modules/webform/src/Element/WebformManagedFileBase.php @@ -40,7 +40,7 @@ public function getInfo() { public static function preRenderWebformManagedFile($element) { // Set accept and capture attributes. if (isset($element['upload']) && static::$accept) { - $element['upload']['#attributes']['accept'] = static::$accept;; + $element['upload']['#attributes']['accept'] = static::$accept; } // Add class name to wrapper attributes. diff --git a/web/modules/webform/src/Element/WebformMapping.php b/web/modules/webform/src/Element/WebformMapping.php index f395366b43..e20efc73cf 100644 --- a/web/modules/webform/src/Element/WebformMapping.php +++ b/web/modules/webform/src/Element/WebformMapping.php @@ -67,7 +67,7 @@ public static function processWebformMapping(&$element, FormStateInterface $form } else { $source_description_property_name = ($element['#source__description_display'] === 'help') ? 'help' : 'description'; - list($source_title, $source_description) = WebformOptionsHelper::splitOption($source); + [$source_title, $source_description] = WebformOptionsHelper::splitOption($source); } $sources[$source_key] = [ 'description_property_name' => $source_description_property_name, @@ -104,7 +104,7 @@ public static function processWebformMapping(&$element, FormStateInterface $form // Build rows. $rows = []; foreach ($sources as $source_key => $source) { - $default_value = (isset($element['#default_value'][$source_key])) ? $element['#default_value'][$source_key] : NULL; + $default_value = $element['#default_value'][$source_key] ?? NULL; // Source element. $source_element = ['data' => []]; diff --git a/web/modules/webform/src/Element/WebformMessage.php b/web/modules/webform/src/Element/WebformMessage.php index 826af585e4..1e3a07ccd4 100644 --- a/web/modules/webform/src/Element/WebformMessage.php +++ b/web/modules/webform/src/Element/WebformMessage.php @@ -158,16 +158,17 @@ public static function preRenderWebformMessage(array $element) { /** @var \Drupal\webform\WebformThemeManagerInterface $theme_manager */ $theme_manager = \Drupal::service('webform.theme_manager'); $is_gin_theme = $theme_manager->isActiveTheme('gin'); - if ($message_type === 'info' && !$is_gin_theme) { + $is_olivero_theme = $theme_manager->isActiveTheme('olivero'); + if ($message_type === 'info' && !$is_gin_theme && !$is_olivero_theme) { $element['#attached']['library'][] = 'webform/webform.element.message.info'; } return $element; } - /****************************************************************************/ + /* ************************************************************************ */ // Manage closed functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Is message closed via User Data, State API, or Custom. diff --git a/web/modules/webform/src/Element/WebformMultiple.php b/web/modules/webform/src/Element/WebformMultiple.php index d4d61c3ea5..043c39756b 100644 --- a/web/modules/webform/src/Element/WebformMultiple.php +++ b/web/modules/webform/src/Element/WebformMultiple.php @@ -509,7 +509,7 @@ protected static function buildElementHeader(array $element) { } else { $header['item'] = [ - 'data' => (isset($element['#element']['#title'])) ? $element['#element']['#title'] : '', + 'data' => $element['#element']['#title'] ?? '', 'class' => ["$table_id--item", "webform-multiple-table--item"], ]; } @@ -797,9 +797,9 @@ protected static function setElementRowParentsRecursive(array &$element, $elemen } } - /****************************************************************************/ + /* ************************************************************************ */ // Callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * Webform submission handler for adding more items. @@ -962,9 +962,9 @@ public static function validateWebformMultiple(&$element, FormStateInterface $fo $form_state->setValueForElement($element, $items); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get unique key used to store the number of items for an element. @@ -1084,7 +1084,7 @@ protected static function validateUniqueKeys(array $element, array $values) { if (isset($unique_keys[$key_value])) { $elements = WebformElementHelper::getFlattened($element['#element']); - $key_title = isset($elements[$key_name]['#title']) ? $elements[$key_name]['#title'] : $key_name; + $key_title = $elements[$key_name]['#title'] ?? $key_name; $t_args = ['@key' => $key_value, '%title' => $key_title]; return t("The %title '@key' is already in use. It must be unique.", $t_args); } diff --git a/web/modules/webform/src/Element/WebformOptions.php b/web/modules/webform/src/Element/WebformOptions.php index 73bc5ffce4..93a129ecba 100644 --- a/web/modules/webform/src/Element/WebformOptions.php +++ b/web/modules/webform/src/Element/WebformOptions.php @@ -29,8 +29,8 @@ public function getInfo() { return [ '#input' => TRUE, '#yaml' => FALSE, - '#label' => t('option'), - '#labels' => t('options'), + '#label' => $this->t('option'), + '#labels' => $this->t('options'), '#min_items' => 3, '#empty_items' => 1, '#add_more_items' => 1, @@ -210,9 +210,9 @@ public static function validateWebformOptions(&$element, FormStateInterface $for $form_state->setValueForElement($element, $options); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Convert values from yamform_multiple element to options. @@ -263,7 +263,7 @@ public static function convertOptionsToValues(array $options = [], $options_desc $values = []; foreach ($options as $value => $text) { if ($options_description && WebformOptionsHelper::hasOptionDescription($text)) { - list($text, $description) = WebformOptionsHelper::splitOption($text); + [$text, $description] = WebformOptionsHelper::splitOption($text); $values[$value] = ['text' => $text, 'description' => $description]; } else { diff --git a/web/modules/webform/src/Element/WebformOtherBase.php b/web/modules/webform/src/Element/WebformOtherBase.php index 95712414ec..560ce4ff42 100644 --- a/web/modules/webform/src/Element/WebformOtherBase.php +++ b/web/modules/webform/src/Element/WebformOtherBase.php @@ -247,7 +247,7 @@ public static function validateWebformOther(&$element, FormStateInterface $form_ // Display missing other or missing value error. if (Element::isVisibleElement($element)) { - $required_error_title = (isset($element['#title'])) ? $element['#title'] : NULL; + $required_error_title = $element['#title'] ?? NULL; if ($other_is_empty) { WebformElementHelper::setRequiredError($element['other'], $form_state, $required_error_title); } @@ -297,9 +297,9 @@ public static function processValue(array $element, array $value) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the element type. diff --git a/web/modules/webform/src/Element/WebformScale.php b/web/modules/webform/src/Element/WebformScale.php index 7b2695fe14..30ab308fd1 100644 --- a/web/modules/webform/src/Element/WebformScale.php +++ b/web/modules/webform/src/Element/WebformScale.php @@ -91,11 +91,11 @@ public static function processRadios(&$element, FormStateInterface $form_state, '#type' => 'radio', '#title' => $choice, '#return_value' => $key, - '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : FALSE, + '#default_value' => $element['#default_value'] ?? FALSE, '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], '#id' => HtmlUtility::getUniqueId('edit-' . implode('-', $parents_for_id)), - '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, + '#ajax' => $element['#ajax'] ?? NULL, '#error_no_message' => TRUE, '#prefix' => '<div class="webform-scale-option">', '#suffix' => '</div>', diff --git a/web/modules/webform/src/Element/WebformSignature.php b/web/modules/webform/src/Element/WebformSignature.php index 13f417e1a6..dfbaad266a 100644 --- a/web/modules/webform/src/Element/WebformSignature.php +++ b/web/modules/webform/src/Element/WebformSignature.php @@ -90,7 +90,7 @@ public static function preRenderWebformSignature(array $element) { public static function validateWebformSignature(&$element, FormStateInterface $form_state, &$complete_form) { $value = $element['#value']; if (!static::isSignatureValid($value)) { - $t_args = ['@title' => isset($element['#title']) ? $element['#title'] : t('Form')]; + $t_args = ['@title' => $element['#title'] ?? t('Form')]; $form_state->setError($element, t('@title contains an invalid signature.', $t_args)); } } diff --git a/web/modules/webform/src/Element/WebformSubmissionViews.php b/web/modules/webform/src/Element/WebformSubmissionViews.php index ad3f423567..a5c6492cdb 100644 --- a/web/modules/webform/src/Element/WebformSubmissionViews.php +++ b/web/modules/webform/src/Element/WebformSubmissionViews.php @@ -92,9 +92,11 @@ public static function processWebformMultiple(&$element, FormStateInterface $for $element['#element']['global_routes'] = [ '#type' => 'checkboxes', '#title' => t('Apply to global'), - '#help' => t('Display the selected view on the below paths') . - '<hr/><b>' . t('Submissions') . ':</b><br/>/admin/structure/webform/submissions/manage' . - '<hr/><b>' . t('User') . ':</b><br/>/user/{user}/submissions', + // phpcs:disable + '#help' => t('Display the selected view on the below paths') . + '<hr/><b>' . t('Submissions') . ':</b><br/>/admin/structure/webform/submissions/manage' . + '<hr/><b>' . t('User') . ':</b><br/>/user/{user}/submissions', + // phpcs:enable '#options' => $global_route_options, '#element_validate' => [['\Drupal\webform\Utility\WebformElementHelper', 'filterValues']], '#error_no_message' => TRUE, @@ -110,10 +112,12 @@ public static function processWebformMultiple(&$element, FormStateInterface $for $element['#element']['webform_routes'] = [ '#type' => 'checkboxes', '#title' => t('Apply to webform'), - '#help' => t('Display the selected view on the below paths') . - '<hr/><b>' . t('Submissions') . ':</b><br/>/admin/structure/webform/manage/{webform}/results/submissions' . - '<hr/><b>' . t('User drafts') . ':</b><br/>/webform/{webform}/drafts' . - '<hr/><b>' . t('User submissions') . ':</b><br/>/webform/{webform}/submissions', + // phpcs:disable + '#help' => t('Display the selected view on the below paths') . + '<hr/><b>' . t('Submissions') . ':</b><br/>/admin/structure/webform/manage/{webform}/results/submissions' . + '<hr/><b>' . t('User drafts') . ':</b><br/>/webform/{webform}/drafts' . + '<hr/><b>' . t('User submissions') . ':</b><br/>/webform/{webform}/submissions', + // phpcs:enable '#options' => $webform_route_options, '#element_validate' => [['\Drupal\webform\Utility\WebformElementHelper', 'filterValues']], '#error_no_message' => TRUE, @@ -129,11 +133,13 @@ public static function processWebformMultiple(&$element, FormStateInterface $for $element['#element']['node_routes'] = [ '#type' => 'checkboxes', '#title' => t('Apply to node'), + // phpcs:disable '#help' => t('Display the selected view on the below paths') . '<hr/><b>' . t('Submissions') . ':</b><br/>/node/{node}/webform/results/submissions' . '<hr/>' . '<b>' . t('User drafts') . ':</b><br/>/node/{node}/webform/drafts' . '<hr/>' . '<b>' . t('User submissions') . ':</b><br/>/node/{node}/webform/submissions', + // phpcs:enable '#options' => $node_route_options, '#element_validate' => [['\Drupal\webform\Utility\WebformElementHelper', 'filterValues']], '#error_no_message' => TRUE, diff --git a/web/modules/webform/src/Element/WebformTableSelectSort.php b/web/modules/webform/src/Element/WebformTableSelectSort.php index 7c6ed9920c..6867548fa6 100644 --- a/web/modules/webform/src/Element/WebformTableSelectSort.php +++ b/web/modules/webform/src/Element/WebformTableSelectSort.php @@ -219,7 +219,7 @@ public static function processWebformTableSelectSort(&$element, FormStateInterfa '#return_value' => $key, '#default_value' => isset($value[$key]) ? $key : NULL, '#attributes' => $element['#attributes'], - '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, + '#ajax' => $element['#ajax'] ?? NULL, ]; $element[$key]['weight'] = [ '#type' => 'weight', diff --git a/web/modules/webform/src/Entity/Webform.php b/web/modules/webform/src/Entity/Webform.php index eeb23dc50c..a95e70f4e9 100644 --- a/web/modules/webform/src/Entity/Webform.php +++ b/web/modules/webform/src/Entity/Webform.php @@ -987,7 +987,7 @@ public function setSettings(array $settings) { */ public function getSetting($key, $default = FALSE) { $settings = $this->getSettings(); - $value = (isset($settings[$key])) ? $settings[$key] : NULL; + $value = $settings[$key] ?? NULL; if ($default) { return $value ?: \Drupal::config('webform.settings')->get('settings.default_' . $key); } @@ -1828,7 +1828,7 @@ protected function initElementsRecursive(array &$elements, $parent = '', $depth */ public function getElement($key, $include_children = FALSE) { $elements_flattened = $this->getElementsInitializedAndFlattened(); - $element = (isset($elements_flattened[$key])) ? $elements_flattened[$key] : NULL; + $element = $elements_flattened[$key] ?? NULL; if ($element && $include_children) { $elements = $this->getElementsInitialized(); return NestedArray::getValue($elements, $element['#webform_parents']); @@ -1843,7 +1843,7 @@ public function getElement($key, $include_children = FALSE) { */ public function getElementDecoded($key) { $elements = $this->getElementsDecodedAndFlattened(); - return (isset($elements[$key])) ? $elements[$key] : NULL; + return $elements[$key] ?? NULL; } /** @@ -1851,7 +1851,7 @@ public function getElementDecoded($key) { */ public function getElementInitialized($key) { $elements = $this->getElementsInitializedAndFlattened(); - return (isset($elements[$key])) ? $elements[$key] : NULL; + return $elements[$key] ?? NULL; } /** @@ -2067,9 +2067,9 @@ protected function buildPages($operation = 'default') { $access_operation = (in_array($operation, ['default', 'add'])) ? 'create' : 'update'; if ($element_plugin->checkAccessRules($access_operation, $element)) { $pages[$key] = array_intersect_key($element, $wizard_properties) + [ - '#type' => 'page', - '#access' => TRUE, - ]; + '#type' => 'page', + '#access' => TRUE, + ]; } } } @@ -2111,7 +2111,7 @@ protected function buildPages($operation = 'default') { */ public function getPage($operation, $key) { $pages = $this->getPages($operation); - return (isset($pages[$key])) ? $pages[$key] : NULL; + return $pages[$key] ?? NULL; } /** @@ -2315,8 +2315,8 @@ public function preSave(EntityStorageInterface $storage) { public function postSave(EntityStorageInterface $storage, $update = TRUE) { // Because webform are not fieldable, when a webform is saved not all // config/content entity related caches need to be cleared. - // parent::postSave($storage, $update); - /**************************************************************************/ + // parent::postSave($storage, $update);. + /* ********************************************************************** */ $this->invalidateTagsOnSave($update); @@ -2339,7 +2339,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { $this->entityTypeBundleInfo()->clearCachedBundles(); } - /**************************************************************************/ + /* ********************************************************************** */ // Update paths. $this->updatePaths(); @@ -2503,9 +2503,9 @@ public function getPluginCollections() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Handler plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns the webform handler plugin manager. @@ -2789,9 +2789,9 @@ protected function invokeHandlerAlter(WebformHandlerInterface $handler, $method_ \Drupal::moduleHandler()->alter('webform_handler_invoke_' . $method_name, $handler, $args); } - /****************************************************************************/ + /* ************************************************************************ */ // Element plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -2806,9 +2806,9 @@ public function invokeElements($method, &$data, &$context1 = NULL, &$context2 = } } - /****************************************************************************/ + /* ************************************************************************ */ // Variant plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns the webform variant plugin manager. @@ -2931,11 +2931,7 @@ public function applyVariants(WebformSubmissionInterface $webform_submission = N if ($webform_submission) { // Make sure webform submission is associated with this webform. if ($webform_submission->getWebform()->id() !== $this->id()) { - $t_args = [ - '@sid' => $webform_submission->id(), - '@webform_id' => $this->id(), - ]; - throw new \Exception($this->t('Variants can not be applied because the #@sid submission was not created using @webform_id', $t_args)); + throw new \Exception("Variants can not be applied because the #{$webform_submission->id()} submission was not created using {$this->id()}."); } $variants += $this->getVariantsData($webform_submission); } @@ -3026,9 +3022,9 @@ public function applyVariant($element_key, $instance_id, $force = FALSE) { return $variant_plugin->applyVariant(); } - /****************************************************************************/ + /* ************************************************************************ */ // URL. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3037,8 +3033,15 @@ public function applyVariant($element_key, $instance_id, $force = FALSE) { * submission webform and not the back-end 'edit-form'. */ public function url($rel = 'canonical', $options = []) { + @trigger_error('Webform::url() function is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\webform\Entity\Webform::toUrl() instead. See https://www.drupal.org/project/webform/issues/3251189', E_USER_DEPRECATED); // Do not remove this override: the default value of $rel is different. - return parent::url($rel, $options); + if ($this->id() === NULL || !$this->hasLinkTemplate($rel)) { + return ''; + } + $uri = $this->toUrl($rel); + $options += $uri->getOptions(); + $uri->setOptions($options); + return $uri->toString(); } /** @@ -3058,7 +3061,8 @@ public function toUrl($rel = 'canonical', array $options = []) { * submission webform and not the back-end 'edit-form'. */ public function urlInfo($rel = 'canonical', array $options = []) { - return parent::urlInfo($rel, $options); + @trigger_error('Webform::urlInfo() function is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\webform\Entity\Webform::toUrl() instead. See https://www.drupal.org/project/webform/issues/3251189', E_USER_DEPRECATED); + return parent::toUrl($rel, $options); } /** @@ -3078,12 +3082,13 @@ public function toLink($text = NULL, $rel = 'canonical', array $options = []) { * webform and not the back-end 'edit-form'. */ public function link($text = NULL, $rel = 'canonical', array $options = []) { - return parent::link($text, $rel, $options); + @trigger_error('Webform::link() function is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\webform\Entity\Webform::toLink() instead. See https://www.drupal.org/project/webform/issues/3251189', E_USER_DEPRECATED); + return parent::toLink($text, $rel, $options)->toString(); } - /****************************************************************************/ + /* ************************************************************************ */ // Revisions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3092,9 +3097,9 @@ public function isDefaultRevision() { return TRUE; } - /****************************************************************************/ + /* ************************************************************************ */ // State. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3102,7 +3107,7 @@ public function isDefaultRevision() { public function getState($key, $default = NULL) { $namespace = 'webform.webform.' . $this->id(); $values = \Drupal::state()->get($namespace, []); - return (isset($values[$key])) ? $values[$key] : $default; + return $values[$key] ?? $default; } /** @@ -3134,9 +3139,9 @@ public function hasState($key) { return (isset($values[$key])) ? TRUE : FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // User data. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3146,7 +3151,7 @@ public function getUserData($key, $default = NULL) { /** @var \Drupal\user\UserDataInterface $user_data */ $user_data = \Drupal::service('user.data'); $values = $user_data->get('webform', $account->id(), $this->id()); - return (isset($values[$key])) ? $values[$key] : $default; + return $values[$key] ?? $default; } /** @@ -3184,9 +3189,9 @@ public function hasUserData($key) { return (isset($values[$key])) ? TRUE : FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // Third party settings. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3195,9 +3200,9 @@ public function unsetThirdPartySettings($module) { unset($this->third_party_settings[$module]); } - /****************************************************************************/ + /* ************************************************************************ */ // Dependency. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3234,9 +3239,9 @@ public function onDependencyRemoval(array $dependencies) { return $changed; } - /****************************************************************************/ + /* ************************************************************************ */ // Other. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Entity/WebformSubmission.php b/web/modules/webform/src/Entity/WebformSubmission.php index 1583279792..bcfc70aa41 100644 --- a/web/modules/webform/src/Entity/WebformSubmission.php +++ b/web/modules/webform/src/Entity/WebformSubmission.php @@ -398,7 +398,7 @@ public function getCurrentPageTitle() { */ public function getElementData($key) { $data = $this->getData(); - return (isset($data[$key])) ? $data[$key] : NULL; + return $data[$key] ?? NULL; } /** @@ -484,7 +484,7 @@ public function setOriginalData(array $data) { * {@inheritdoc} */ public function getElementOriginalData($key) { - return (isset($this->originalData[$key])) ? $this->originalData[$key] : NULL; + return $this->originalData[$key] ?? NULL; } /** diff --git a/web/modules/webform/src/EntitySettings/WebformEntitySettingsAssetsForm.php b/web/modules/webform/src/EntitySettings/WebformEntitySettingsAssetsForm.php index 83864a4491..021c7968ef 100644 --- a/web/modules/webform/src/EntitySettings/WebformEntitySettingsAssetsForm.php +++ b/web/modules/webform/src/EntitySettings/WebformEntitySettingsAssetsForm.php @@ -20,7 +20,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['description'] = [ '#type' => 'webform_message', - '#message_message' => $this->t('The below CSS and JavasScript will be loaded on all pages that references and loads this webform.'), + '#message_message' => $this->t('The below CSS and JavaScript will be loaded on all pages that reference and load this webform.'), '#message_type' => 'info', '#message_close' => TRUE, '#message_storage' => WebformMessage::STORAGE_SESSION, diff --git a/web/modules/webform/src/EntitySettings/WebformEntitySettingsConfirmationForm.php b/web/modules/webform/src/EntitySettings/WebformEntitySettingsConfirmationForm.php index 2437db4af7..c6eb4c2c8e 100644 --- a/web/modules/webform/src/EntitySettings/WebformEntitySettingsConfirmationForm.php +++ b/web/modules/webform/src/EntitySettings/WebformEntitySettingsConfirmationForm.php @@ -18,6 +18,7 @@ class WebformEntitySettingsConfirmationForm extends WebformEntitySettingsBaseFor * @var \Drupal\webform\WebformTokenManagerInterface */ protected $tokenManager; + /** * {@inheritdoc} */ @@ -141,7 +142,7 @@ public function form(array $form, FormStateInterface $form_state) { '#type' => 'textfield', '#title' => $this->t('Confirmation URL'), '#description' => $this->t('The URL or path to redirect the user to upon successful submission.') . - '<br/>' . t('Paths beginning with a forward slash (/) will redirect be treated as root-relative. Paths without a forward slash (/) will redirect be treated as Drupal relative path.'), + '<br/>' . $this->t('Paths beginning with a forward slash (/) will redirect be treated as root-relative. Paths without a forward slash (/) will redirect be treated as Drupal relative path.'), '#default_value' => $settings['confirmation_url'], '#maxlength' => NULL, '#states' => [ diff --git a/web/modules/webform/src/EntitySettings/WebformEntitySettingsFormForm.php b/web/modules/webform/src/EntitySettings/WebformEntitySettingsFormForm.php index 0e301f1c26..e8817ae286 100644 --- a/web/modules/webform/src/EntitySettings/WebformEntitySettingsFormForm.php +++ b/web/modules/webform/src/EntitySettings/WebformEntitySettingsFormForm.php @@ -196,7 +196,7 @@ public function form(array $form, FormStateInterface $form_state) { if ($settings['ajax']) { $form['form_behaviors']['form_submit_back']['#default'] = TRUE; $form['form_behaviors']['form_submit_back']['#disabled'] = TRUE; - $form['form_behaviors']['form_submit_back']['#description'] .= '<br/><br/><em>' . t('This behavior is not supoported when Ajax is enabled.') . '</em>'; + $form['form_behaviors']['form_submit_back']['#description'] .= '<br/><br/><em>' . $this->t('This behavior is not supoported when Ajax is enabled.') . '</em>'; } // Disable warning about drafts. if ($settings['draft'] !== WebformInterface::DRAFT_NONE) { @@ -619,8 +619,7 @@ public function form(array $form, FormStateInterface $form_state) { '#type' => 'select', '#title' => $this->t('Form method'), '#description' => $this->t('The HTTP method with which the form will be submitted.') - . '<br /><br />' - . '<em>' . $this->t('Selecting a custom POST or GET method will automatically disable wizards, previews, drafts, submissions, limits, purging, confirmations, emails, computed elements, and handlers.') . '</em>', + . '<br /><br /><em>' . $this->t('Selecting a custom POST or GET method will automatically disable wizards, previews, drafts, submissions, limits, purging, confirmations, emails, computed elements, and handlers.') . '</em>', '#options' => [ '' => $this->t('POST (Default)'), 'post' => $this->t('POST (Custom)'), diff --git a/web/modules/webform/src/EntitySettings/WebformEntitySettingsGeneralForm.php b/web/modules/webform/src/EntitySettings/WebformEntitySettingsGeneralForm.php index 2ade2d4ef9..6fd9d97385 100644 --- a/web/modules/webform/src/EntitySettings/WebformEntitySettingsGeneralForm.php +++ b/web/modules/webform/src/EntitySettings/WebformEntitySettingsGeneralForm.php @@ -569,6 +569,11 @@ public function save(array $form, FormStateInterface $form_state) { // Set settings. $webform->setSettings($values); + // Reset webform categories cache. + /** @var \Drupal\webform\WebformEntityStorageInterface $webform_storage */ + $webform_storage = $this->entityTypeManager->getStorage('webform'); + $webform_storage->resetCategoriesCache(); + parent::save($form, $form_state); } diff --git a/web/modules/webform/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php b/web/modules/webform/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php index f9691c8349..32d5e2d0c0 100644 --- a/web/modules/webform/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php +++ b/web/modules/webform/src/EntitySettings/WebformEntitySettingsSubmissionsForm.php @@ -728,6 +728,7 @@ public function form(array $form, FormStateInterface $form_state) { '#type' => 'webform_excluded_elements', '#webform_id' => $this->getEntity()->id(), '#default_value' => $settings['autofill_excluded_elements'], + '#exclude_composite' => FALSE, ]; $form['autofill_settings']['autofill_container']['token_tree_link'] = $this->tokenManager->buildTreeElement(); diff --git a/web/modules/webform/src/EntityStorage/WebformEntityStorageTrait.php b/web/modules/webform/src/EntityStorage/WebformEntityStorageTrait.php index bf64130935..017b3f11a6 100644 --- a/web/modules/webform/src/EntityStorage/WebformEntityStorageTrait.php +++ b/web/modules/webform/src/EntityStorage/WebformEntityStorageTrait.php @@ -86,6 +86,7 @@ public function __get($name) { if (isset($this->entityStorageToTypeMappings[$name])) { $entity_type = $this->entityStorageToTypeMappings[$name]; $class_name = get_class($this); + // phpcs:ignore Drupal.Semantics.FunctionTriggerError.TriggerErrorTextLayoutRelaxed @trigger_error("$class_name::$name is deprecated in Webform 6.x and is removed from Webform 7.x Use \$this->entityTypeManager->getStorage('$entity_type') instead", E_USER_DEPRECATED); return $this->entityTypeManager->getStorage($entity_type); } diff --git a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigBaseForm.php b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigBaseForm.php index 49f9186618..dad56b8469 100644 --- a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigBaseForm.php +++ b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigBaseForm.php @@ -10,12 +10,29 @@ use Drupal\webform\Plugin\WebformElementManagerInterface; use Drupal\webform\Plugin\WebformHandlerManager; use Drupal\webform\Utility\WebformElementHelper; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Base webform admin settings form. */ abstract class WebformAdminConfigBaseForm extends ConfigFormBase { + /** + * The entity type manager. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + $instance = parent::create($container); + $instance->entityTypeManager = $container->get('entity_type.manager'); + return $instance; + } + /** * {@inheritdoc} */ @@ -39,10 +56,11 @@ public function submitForm(array &$form, FormStateInterface $form_state) { * * @param array $settings * Webform settings. - * @param $entity_type_id + * @param string $entity_type_id * The entity type id. (webform or webform_submission) * * @return array + * Bulk operation settings. */ protected function buildBulkOperations(array $settings, $entity_type_id) { $element = [ @@ -72,7 +90,7 @@ protected function buildBulkOperations(array $settings, $entity_type_id) { $options = []; $default_actions = []; /** @var \Drupal\system\ActionConfigEntityInterface[] $actions */ - $actions = \Drupal::entityTypeManager()->getStorage('action')->loadMultiple(); + $actions = $this->entityTypeManager->getStorage('action')->loadMultiple(); foreach ($actions as $action) { if ($action->getType() === $entity_type_id) { $options[$action->id()] = ['label' => $action->label()]; @@ -108,7 +126,7 @@ protected function buildBulkOperations(array $settings, $entity_type_id) { return $element; } - /** + /** * Form API callback. Validate bulk form actions. */ public static function validateBulkFormActions(array &$element, FormStateInterface $form_state) { @@ -128,9 +146,9 @@ public static function validateBulkFormActions(array &$element, FormStateInterfa $form_state->setValueForElement($element, $actions_value); } - /****************************************************************************/ + /* ************************************************************************ */ // Exclude plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build excluded plugins element. diff --git a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigElementsForm.php b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigElementsForm.php index 5e5815a912..6a72cc4023 100644 --- a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigElementsForm.php +++ b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigElementsForm.php @@ -471,7 +471,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { // Item format. $item_formats = WebformOptionsHelper::appendValueToText($element_plugin->getItemFormats()); $item_default_format = $element_plugin->getItemDefaultFormat(); - $item_default_format_label = (isset($item_formats[$item_default_format])) ? $item_formats[$item_default_format] : $item_default_format; + $item_default_format_label = $item_formats[$item_default_format] ?? $item_default_format; $row['item'] = [ '#type' => 'select', '#title' => $this->t('Item format'), @@ -580,9 +580,11 @@ public static function validateExtensions($element, FormStateInterface $form_sta */ public static function validateMaxFilesize($element, FormStateInterface $form_state) { // Issue #2359675: File field's Maximum upload size always passes validation. + // phpcs:disable // if (class_exists('\Drupal\file\Plugin\Field\FieldType\FileItem')) { // FileItem::validateMaxFilesize($element, $form_state); // } + // phpcs:enable // @see \Drupal\file\Plugin\Field\FieldType\FileItem::validateMaxFilesize if (!empty($element['#value']) && !Bytes::toInt($element['#value'])) { $form_state->setError($element, t('The "@name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', ['@name' => $element['#title']])); diff --git a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php index 2ac78b416d..aa6d8f7b7a 100644 --- a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php +++ b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigFormsForm.php @@ -591,6 +591,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#title_display' => 'invisible', '#field_suffix' => 'px', '#error_no_message' => TRUE, + '#attributes' => ['style' => 'width: 6em'], ], 'height' => [ '#type' => 'number', @@ -598,6 +599,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#title_display' => 'invisible', '#field_suffix' => 'px', '#error_no_message' => TRUE, + '#attributes' => ['style' => 'width: 6em'], ], ], '#error_no_message' => TRUE, diff --git a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigLibrariesForm.php b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigLibrariesForm.php index 6d6c84e2fd..dca4312df4 100644 --- a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigLibrariesForm.php +++ b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigLibrariesForm.php @@ -58,14 +58,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['assets']['description'] = [ '#type' => 'webform_message', - '#message_message' => $this->t('The below CSS and JavasScript will be loaded on all webform pages.'), + '#message_message' => $this->t('The below CSS and JavaScript will be loaded on all webform pages.'), '#message_type' => 'info', ]; $form['assets']['css'] = [ '#type' => 'webform_codemirror', '#mode' => 'css', '#title' => $this->t('CSS'), - '#description' => $this->t('Enter custom CSS to be attached to the all webforms.') . '<br/>' . + '#description' => $this->t('Enter custom CSS to be attached to all webforms.') . '<br/>' . $this->t("To customize only webform specific elements, you should use the '.webform-submission-form' selector"), '#default_value' => $config->get('assets.css'), ]; @@ -228,7 +228,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $config->set('libraries.excluded_libraries', $excluded_libraries); parent::submitForm($form, $form_state); - // Reset libraries cached. + // Reset libraries cache. // @see webform_library_info_build() \Drupal::service('library.discovery')->clearCachedDefinitions(); } diff --git a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigSubmissionsForm.php b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigSubmissionsForm.php index c33a789d9e..6d9a37bbfa 100644 --- a/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigSubmissionsForm.php +++ b/web/modules/webform/src/Form/AdminConfig/WebformAdminConfigSubmissionsForm.php @@ -115,7 +115,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { 'default_submission_log' => [ 'title' => $this->t('Log all submission events for all webforms'), 'description' => $this->t('If checked, all submission events will be logged to dedicated submission log available to all webforms and submissions.') . '<br/><br/>' . - '<em>' . t('The webform submission log will track more detailed user information including email addresses and subjects.') . '</em>', + '<em>' . $this->t('The webform submission log will track more detailed user information including email addresses and subjects.') . '</em>', ], 'default_results_customize' => [ 'title' => $this->t('Allow users to customize the submission results table'), diff --git a/web/modules/webform/src/Form/WebformAjaxFormTrait.php b/web/modules/webform/src/Form/WebformAjaxFormTrait.php index 1d2d9962ac..cbcbf98dfa 100644 --- a/web/modules/webform/src/Form/WebformAjaxFormTrait.php +++ b/web/modules/webform/src/Form/WebformAjaxFormTrait.php @@ -190,7 +190,7 @@ protected function buildAjaxForm(array &$form, FormStateInterface $form_state, a * to a URL */ public function submitAjaxForm(array &$form, FormStateInterface $form_state) { - $scroll_top_target = (isset($form['#webform_ajax_scroll_top'])) ? $form['#webform_ajax_scroll_top'] : 'form'; + $scroll_top_target = $form['#webform_ajax_scroll_top'] ?? 'form'; if ($form_state->hasAnyErrors()) { // Display validation errors and scroll to the top of the page. @@ -388,14 +388,14 @@ protected function getFormStateRedirectUrl(FormStateInterface $form_state) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Drupal.announce handling. // // Announcements are stored in the user session because the $form_state // is already serialized (and can't be altered) when announcements // are added to Ajax response. // @see \Drupal\webform\Form\WebformAjaxFormTrait::submitAjaxForm - /****************************************************************************/ + /* ************************************************************************ */ /** * Queue announcement with Ajax response. diff --git a/web/modules/webform/src/Form/WebformBulkFormBase.php b/web/modules/webform/src/Form/WebformBulkFormBase.php index e87f45c92e..b9ed944ecf 100644 --- a/web/modules/webform/src/Form/WebformBulkFormBase.php +++ b/web/modules/webform/src/Form/WebformBulkFormBase.php @@ -66,7 +66,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $table = $form['#attributes']['class'][] = 'webform-bulk-form'; $options = $this->getBulkOptions(); - if (empty($options) ) { + if (empty($options)) { return ['items' => $table]; } @@ -168,7 +168,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { } /** - * Get the entity type's actions + * Get the entity type's actions. * * @return \Drupal\system\ActionConfigEntityInterface[] * An associative array of actions. diff --git a/web/modules/webform/src/Form/WebformDeleteMultipleFormBase.php b/web/modules/webform/src/Form/WebformDeleteMultipleFormBase.php index e45493d5f2..9695f41c99 100644 --- a/web/modules/webform/src/Form/WebformDeleteMultipleFormBase.php +++ b/web/modules/webform/src/Form/WebformDeleteMultipleFormBase.php @@ -15,7 +15,7 @@ */ abstract class WebformDeleteMultipleFormBase extends DeleteMultipleForm { - /** + /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL) { @@ -74,7 +74,6 @@ public function getDescription() { /** * Returns warning message to display. - * */ public function getWarning() { $message = $this->formatPlural(count($this->selection), 'Are you sure you want to delete this @item?', 'Are you sure you want to delete these @items?', [ @@ -82,7 +81,7 @@ public function getWarning() { '@items' => $this->entityType->getPluralLabel(), ]); - return[ + return [ '#type' => 'webform_message', '#message_type' => 'warning', '#message_message' => $message, diff --git a/web/modules/webform/src/Form/WebformDialogFormTrait.php b/web/modules/webform/src/Form/WebformDialogFormTrait.php index 825f5f824b..18ffbeaa72 100644 --- a/web/modules/webform/src/Form/WebformDialogFormTrait.php +++ b/web/modules/webform/src/Form/WebformDialogFormTrait.php @@ -112,9 +112,9 @@ protected function buildDialogDeleteAction(array &$form, FormStateInterface $for WebformDialogHelper::attachLibraries($form); } - /****************************************************************************/ + /* ************************************************************************ */ // Ajax submit callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Form/WebformEntityBulkForm.php b/web/modules/webform/src/Form/WebformEntityBulkForm.php index 0b809d96a1..3aac146948 100644 --- a/web/modules/webform/src/Form/WebformEntityBulkForm.php +++ b/web/modules/webform/src/Form/WebformEntityBulkForm.php @@ -7,7 +7,7 @@ */ class WebformEntityBulkForm extends WebformBulkFormBase { - /** + /** * {@inheritdoc} */ protected $entityTypeId = 'webform'; diff --git a/web/modules/webform/src/Form/WebformEntityDeleteMultipleForm.php b/web/modules/webform/src/Form/WebformEntityDeleteMultipleForm.php index 1ad74515d4..d7ed69aa29 100644 --- a/web/modules/webform/src/Form/WebformEntityDeleteMultipleForm.php +++ b/web/modules/webform/src/Form/WebformEntityDeleteMultipleForm.php @@ -24,7 +24,7 @@ public function getDescription() { $this->formatPlural(count($this->selection), 'Affect any fields or nodes which reference this webform', 'Affect any fields or nodes which reference these webform', [ '@item' => $this->entityType->getSingularLabel(), '@items' => $this->entityType->getPluralLabel(), - ]) + ]), ], ], ]; diff --git a/web/modules/webform/src/Form/WebformHandlerDeleteForm.php b/web/modules/webform/src/Form/WebformHandlerDeleteForm.php index 9ea7c88c87..bd5431c303 100644 --- a/web/modules/webform/src/Form/WebformHandlerDeleteForm.php +++ b/web/modules/webform/src/Form/WebformHandlerDeleteForm.php @@ -74,9 +74,9 @@ public function getDescription() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Form/WebformResultsCustomForm.php b/web/modules/webform/src/Form/WebformResultsCustomForm.php index 52f88a0b9f..a6e7368aab 100644 --- a/web/modules/webform/src/Form/WebformResultsCustomForm.php +++ b/web/modules/webform/src/Form/WebformResultsCustomForm.php @@ -91,7 +91,7 @@ public static function create(ContainerInterface $container) { $instance = parent::create($container); $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->requestHandler = $container->get('webform.request'); - list($instance->webform, $instance->sourceEntity) = $instance->requestHandler->getWebformEntities(); + [$instance->webform, $instance->sourceEntity] = $instance->requestHandler->getWebformEntities(); return $instance; } @@ -190,7 +190,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { foreach ($sort_columns as $column_name => $column) { if (!isset($column['sort']) || $column['sort'] === TRUE) { $sort_options[$column_name] = (string) $column['title']; - }; + } } asort($sort_options); @@ -239,9 +239,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#default_value' => ($limit !== NULL) ? $limit : 20, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Default settings only. - /**************************************************************************/ + /* ********************************************************************** */ if ($this->type === static::CUSTOMIZE_DEFAULT) { // Default configuration. @@ -372,7 +372,7 @@ protected function buildRow($column_name, array $column, $default_value, $weight '#markup' => $column['title'], ], 'key' => [ - '#markup' => (isset($column['key'])) ? $column['key'] : $column['name'], + '#markup' => $column['key'] ?? $column['name'], ], 'weight' => [ '#type' => 'weight', @@ -472,9 +472,9 @@ public function delete(array &$form, FormStateInterface $form_state) { $form_state->setRedirectUrl($redirect_url); } - /****************************************************************************/ + /* ************************************************************************ */ // Customize data methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the data method name depending of the custom type. diff --git a/web/modules/webform/src/Form/WebformSubmissionDeleteForm.php b/web/modules/webform/src/Form/WebformSubmissionDeleteForm.php index c16564606c..eeff29f13a 100644 --- a/web/modules/webform/src/Form/WebformSubmissionDeleteForm.php +++ b/web/modules/webform/src/Form/WebformSubmissionDeleteForm.php @@ -55,7 +55,7 @@ public static function create(ContainerInterface $container) { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { - list($this->webformSubmission, $this->sourceEntity) = $this->requestHandler->getWebformSubmissionEntities(); + [$this->webformSubmission, $this->sourceEntity] = $this->requestHandler->getWebformSubmissionEntities(); $this->webform = $this->webformSubmission->getWebform(); $form['warning'] = $this->getWarning(); diff --git a/web/modules/webform/src/Form/WebformSubmissionResendForm.php b/web/modules/webform/src/Form/WebformSubmissionResendForm.php index 83cb5fb129..98155eb384 100644 --- a/web/modules/webform/src/Form/WebformSubmissionResendForm.php +++ b/web/modules/webform/src/Form/WebformSubmissionResendForm.php @@ -181,9 +181,9 @@ protected function getMessageHandler(FormStateInterface $form_state) { return $this->webformSubmission->getWebform()->getHandler($message_handler_id); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get a webform submission's message handlers as options. @@ -228,9 +228,9 @@ protected function getMessageHandlerOptions(WebformSubmissionInterface $webform_ return $options; } - /****************************************************************************/ + /* ************************************************************************ */ // Change message ajax callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Form/WebformSubmissionsDeleteFormBase.php b/web/modules/webform/src/Form/WebformSubmissionsDeleteFormBase.php index d26a1ec3d2..c63c41c69a 100644 --- a/web/modules/webform/src/Form/WebformSubmissionsDeleteFormBase.php +++ b/web/modules/webform/src/Form/WebformSubmissionsDeleteFormBase.php @@ -64,7 +64,7 @@ public static function create(ContainerInterface $container) { $instance = parent::create($container); $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->requestHandler = $container->get('webform.request'); - list($instance->webform, $instance->sourceEntity) = $instance->requestHandler->getWebformEntities(); + [$instance->webform, $instance->sourceEntity] = $instance->requestHandler->getWebformEntities(); return $instance; } @@ -118,9 +118,9 @@ public function getFinishedMessage() { return $this->t('Webform submissions cleared.'); } - /****************************************************************************/ + /* ************************************************************************ */ // Batch API. - /****************************************************************************/ + /* ************************************************************************ */ /** * Batch API; Initialize batch operations. @@ -171,7 +171,7 @@ public function getBatchLimit() { * @param mixed|array $context * The batch current context. */ - public function batchProcess(WebformInterface $webform = NULL, EntityInterface $entity = NULL, $max_sid = NULL, array &$context = []) { + public function batchProcess(WebformInterface $webform = NULL, EntityInterface $entity = NULL, $max_sid = NULL, &$context = []) { if (empty($context['sandbox'])) { $context['sandbox']['progress'] = 0; $context['sandbox']['max'] = $this->getSubmissionStorage()->getTotal($webform, $entity, NULL, ['in_draft' => NULL]); diff --git a/web/modules/webform/src/Form/WebformVariantApplyForm.php b/web/modules/webform/src/Form/WebformVariantApplyForm.php index 6ff303e0b2..70b3057143 100644 --- a/web/modules/webform/src/Form/WebformVariantApplyForm.php +++ b/web/modules/webform/src/Form/WebformVariantApplyForm.php @@ -92,9 +92,9 @@ public function getDescription() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Form/WebformVariantDeleteForm.php b/web/modules/webform/src/Form/WebformVariantDeleteForm.php index 79a7c8308f..0cf53b3e59 100644 --- a/web/modules/webform/src/Form/WebformVariantDeleteForm.php +++ b/web/modules/webform/src/Form/WebformVariantDeleteForm.php @@ -73,9 +73,9 @@ public function getDescription() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Form/WebformVariantFormBase.php b/web/modules/webform/src/Form/WebformVariantFormBase.php index 86e11942c0..84850b65f6 100644 --- a/web/modules/webform/src/Form/WebformVariantFormBase.php +++ b/web/modules/webform/src/Form/WebformVariantFormBase.php @@ -352,9 +352,9 @@ protected function processVariantFormErrors(FormStateInterface $variant_state, F } } - /****************************************************************************/ + /* ************************************************************************ */ // Variant methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get key/value array of webform variant elements. diff --git a/web/modules/webform/src/Plugin/Action/WebformEntityDeleteAction.php b/web/modules/webform/src/Plugin/Action/WebformEntityDeleteAction.php index a05f4c7c65..265896bf46 100644 --- a/web/modules/webform/src/Plugin/Action/WebformEntityDeleteAction.php +++ b/web/modules/webform/src/Plugin/Action/WebformEntityDeleteAction.php @@ -14,4 +14,4 @@ * confirm_form_route_name = "entity.webform.multiple_delete_confirm" * ) */ -class WebformEntityDeleteAction extends DeleteAction { } +class WebformEntityDeleteAction extends DeleteAction {} diff --git a/web/modules/webform/src/Plugin/Action/WebformSubmissionDeleteAction.php b/web/modules/webform/src/Plugin/Action/WebformSubmissionDeleteAction.php index 1b575e8a6c..091dd6f5d5 100644 --- a/web/modules/webform/src/Plugin/Action/WebformSubmissionDeleteAction.php +++ b/web/modules/webform/src/Plugin/Action/WebformSubmissionDeleteAction.php @@ -14,4 +14,4 @@ * confirm_form_route_name = "webform_submission.multiple_delete_confirm" * ) */ -class WebformSubmissionDeleteAction extends DeleteAction { } +class WebformSubmissionDeleteAction extends DeleteAction {} diff --git a/web/modules/webform/src/Plugin/Block/WebformSubmissionLimitBlock.php b/web/modules/webform/src/Plugin/Block/WebformSubmissionLimitBlock.php index 63266dc72b..80355c02b1 100644 --- a/web/modules/webform/src/Plugin/Block/WebformSubmissionLimitBlock.php +++ b/web/modules/webform/src/Plugin/Block/WebformSubmissionLimitBlock.php @@ -306,9 +306,9 @@ public function getCacheMaxAge() { return 0; } - /****************************************************************************/ + /* ************************************************************************ */ // Replace [limit], [total], and [webform] tokens. - /****************************************************************************/ + /* ************************************************************************ */ /** * Replace tokens in text. @@ -393,9 +393,9 @@ protected function getTotal() { ); } - /****************************************************************************/ + /* ************************************************************************ */ // Get submission limit webform, source entity, and/or user. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the webform. @@ -474,9 +474,9 @@ protected function getCurrentUser() { return ($this->configuration['type'] === 'user') ? $this->currentUser : NULL; } - /****************************************************************************/ + /* ************************************************************************ */ // Ajax token callback. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get token refresh Ajax settings. diff --git a/web/modules/webform/src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php b/web/modules/webform/src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php index 6af7c815dd..5349813213 100644 --- a/web/modules/webform/src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php +++ b/web/modules/webform/src/Plugin/DevelGenerate/WebformSubmissionDevelGenerateTrait.php @@ -7,8 +7,6 @@ use Drupal\webform\EntityStorage\WebformEntityStorageTrait; use Drupal\webform\Utility\WebformArrayHelper; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\RequestStack; -use Drupal\Component\Datetime\TimeInterface; /** * Provides a WebformSubmissionDevelGenerate plugin. @@ -334,7 +332,7 @@ protected function generateSubmission(&$results) { /** * {@inheritdoc} */ - public function _validateDrushParams($args) { + public function _validateDrushParams($args) { // phpcs:ignore $webform_id = array_shift($args); $webform_ids = [$webform_id => $webform_id]; $values = [ diff --git a/web/modules/webform/src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php b/web/modules/webform/src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php index 642b0a71ba..738fac1b1b 100644 --- a/web/modules/webform/src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php +++ b/web/modules/webform/src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php @@ -74,7 +74,7 @@ public function settingsSummary() { $summary[] = $this->t('Label: @label', ['@label' => $this->getSetting('label')]); $dialog_option_name = $this->getSetting('dialog'); if ($dialog_option = $this->configFactory->get('webform.settings')->get('settings.dialog_options.' . $dialog_option_name)) { - $summary[] = $this->t('Dialog: @dialog', ['@dialog' => (isset($dialog_option['title']) ? $dialog_option['title'] : $dialog_option_name)]); + $summary[] = $this->t('Dialog: @dialog', ['@dialog' => ($dialog_option['title'] ?? $dialog_option_name)]); } return $summary; } @@ -106,7 +106,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) { if ($dialog_options) { $options = []; foreach ($dialog_options as $dialog_option_name => $dialog_option) { - $options[$dialog_option_name] = (isset($dialog_option['title'])) ? $dialog_option['title'] : $dialog_option_name; + $options[$dialog_option_name] = $dialog_option['title'] ?? $dialog_option_name; } $form['dialog'] = [ '#title' => $this->t('Dialog'), diff --git a/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceAutocompleteWidget.php b/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceAutocompleteWidget.php index a13cff27e8..bbbfd71f08 100644 --- a/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceAutocompleteWidget.php +++ b/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceAutocompleteWidget.php @@ -28,7 +28,7 @@ class WebformEntityReferenceAutocompleteWidget extends EntityReferenceAutocomple public function getTargetIdElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { // Get default value. $referenced_entities = $items->referencedEntities(); - $default_value = isset($referenced_entities[$delta]) ? $referenced_entities[$delta] : NULL; + $default_value = $referenced_entities[$delta] ?? NULL; // Append the match operation to the selection settings. $selection_settings = $this->getFieldSetting('handler_settings') + ['match_operator' => $this->getSetting('match_operator')]; diff --git a/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceSelectWidget.php b/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceSelectWidget.php index 022eca9811..18afdd2233 100644 --- a/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceSelectWidget.php +++ b/web/modules/webform/src/Plugin/Field/FieldWidget/WebformEntityReferenceSelectWidget.php @@ -43,7 +43,7 @@ public static function defaultSettings() { public function getTargetIdElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { // Get default value (webform ID). $referenced_entities = $items->referencedEntities(); - $default_value = isset($referenced_entities[$delta]) ? $referenced_entities[$delta] : NULL; + $default_value = $referenced_entities[$delta] ?? NULL; // Convert default_value's Webform to a simple entity_id. if ($default_value instanceof WebformInterface) { $default_value = $default_value->id(); diff --git a/web/modules/webform/src/Plugin/Menu/LocalAction/WebformDialogLocalAction.php b/web/modules/webform/src/Plugin/Menu/LocalAction/WebformDialogLocalAction.php index 9ddcda0712..a86cd4fd15 100644 --- a/web/modules/webform/src/Plugin/Menu/LocalAction/WebformDialogLocalAction.php +++ b/web/modules/webform/src/Plugin/Menu/LocalAction/WebformDialogLocalAction.php @@ -28,7 +28,7 @@ public function getOptions(RouteMatchInterface $route_match) { $attributes = []; } - $options['attributes'] = (isset($this->pluginDefinition['attributes'])) ? $this->pluginDefinition['attributes'] : []; + $options['attributes'] = $this->pluginDefinition['attributes'] ?? []; $options['attributes'] = NestedArray::mergeDeep($options['attributes'], $attributes); return $options; diff --git a/web/modules/webform/src/Plugin/WebformElement/Address.php b/web/modules/webform/src/Plugin/WebformElement/Address.php index b9b0cbe7a7..4a3164a2a3 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Address.php +++ b/web/modules/webform/src/Plugin/WebformElement/Address.php @@ -51,7 +51,7 @@ class Address extends WebformCompositeBase { /** * The address format repository service. * - * @var \CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $address_format_repository + * @var \CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterfacey */ protected $addressFormatRepository; @@ -111,7 +111,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -345,9 +345,10 @@ public function form(array $form, FormStateInterface $form_state) { '#title' => $this->t('Address settings'), ]; - /**************************************************************************/ - // Copied from: \Drupal\address\Plugin\Field\FieldType\AddressItem::fieldSettingsForm - /**************************************************************************/ + /* ********************************************************************** */ + // Copied from: AddressItem::fieldSettingsForm. + // @see \Drupal\address\Plugin\Field\FieldType\AddressItem::fieldSettingsForm + /* ********************************************************************** */ $languages = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL); $language_options = []; @@ -390,7 +391,7 @@ public function form(array $form, FormStateInterface $form_state) { '#access' => TRUE, ]; foreach (LabelHelper::getGenericFieldLabels() as $field_name => $label) { - $override = isset($field_overrides[$field_name]) ? $field_overrides[$field_name] : ''; + $override = $field_overrides[$field_name] ?? ''; $form['address']['field_overrides'][$field_name] = [ '#access' => TRUE, 'field_label' => [ diff --git a/web/modules/webform/src/Plugin/WebformElement/BooleanBase.php b/web/modules/webform/src/Plugin/WebformElement/BooleanBase.php index 9459493bd1..784bfb2356 100644 --- a/web/modules/webform/src/Plugin/WebformElement/BooleanBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/BooleanBase.php @@ -22,7 +22,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Captcha.php b/web/modules/webform/src/Plugin/WebformElement/Captcha.php index 29dd755416..e37ddd905c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Captcha.php +++ b/web/modules/webform/src/Plugin/WebformElement/Captcha.php @@ -61,7 +61,7 @@ protected function defineDefaultProperties() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Checkbox.php b/web/modules/webform/src/Plugin/WebformElement/Checkbox.php index 9f9ba4e4bd..55b08b08cb 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Checkbox.php +++ b/web/modules/webform/src/Plugin/WebformElement/Checkbox.php @@ -39,7 +39,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Checkboxes.php b/web/modules/webform/src/Plugin/WebformElement/Checkboxes.php index 89489c3483..160679fed8 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Checkboxes.php +++ b/web/modules/webform/src/Plugin/WebformElement/Checkboxes.php @@ -51,7 +51,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['options_all_text', 'options_none_text']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -137,7 +137,7 @@ protected function getElementSelectorInputsOptions(array $element) { $selectors = $element['#options']; foreach ($selectors as $index => $text) { // Remove description from text. - list($text) = WebformOptionsHelper::splitOption($text); + [$text] = WebformOptionsHelper::splitOption($text); // Append element type to text. $text .= ' [' . $this->t('Checkbox') . ']'; $selectors[$index] = $text; diff --git a/web/modules/webform/src/Plugin/WebformElement/Color.php b/web/modules/webform/src/Plugin/WebformElement/Color.php index 4d08be83a3..7be0e849de 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Color.php +++ b/web/modules/webform/src/Plugin/WebformElement/Color.php @@ -36,7 +36,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -45,7 +45,7 @@ public function prepare(array &$element, WebformSubmissionInterface $webform_sub parent::prepare($element, $webform_submission); // Set the color swatches size. - $color_size = (isset($element['#color_size'])) ? $element['#color_size'] : 'medium'; + $color_size = $element['#color_size'] ?? 'medium'; $element['#attributes']['class'][] = 'form-color-' . $color_size; // Add helpful attributes to better support older browsers. diff --git a/web/modules/webform/src/Plugin/WebformElement/ContainerBase.php b/web/modules/webform/src/Plugin/WebformElement/ContainerBase.php index 27b43fbf53..db2d5ecfbb 100644 --- a/web/modules/webform/src/Plugin/WebformElement/ContainerBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/ContainerBase.php @@ -43,7 +43,7 @@ protected function defineDefaultBaseProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -132,7 +132,7 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we } // Build format attributes. - $attributes = (isset($element['#format_attributes'])) ? $element['#format_attributes'] : []; + $attributes = $element['#format_attributes'] ?? []; $attributes += ['class' => []]; switch ($format) { diff --git a/web/modules/webform/src/Plugin/WebformElement/Date.php b/web/modules/webform/src/Plugin/WebformElement/Date.php index d4e0989725..d480de6eee 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Date.php +++ b/web/modules/webform/src/Plugin/WebformElement/Date.php @@ -48,7 +48,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -116,7 +116,7 @@ public function getItemFormat(array $element) { // Drupal's default date fallback includes the time so we need to fallback // to the specified or default date only format. if ($format === 'fallback') { - $format = (isset($element['#date_date_format'])) ? $element['#date_date_format'] : $this->getDefaultProperty('date_date_format'); + $format = $element['#date_date_format'] ?? $this->getDefaultProperty('date_date_format'); } return $format; } diff --git a/web/modules/webform/src/Plugin/WebformElement/DateBase.php b/web/modules/webform/src/Plugin/WebformElement/DateBase.php index f4e3871f1c..4d4cc09aa2 100644 --- a/web/modules/webform/src/Plugin/WebformElement/DateBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/DateBase.php @@ -52,9 +52,9 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ // Element rendering methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -179,9 +179,9 @@ public static function afterBuild(array $element, FormStateInterface $form_state return $element; } - /****************************************************************************/ + /* ************************************************************************ */ // Display submission value methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -231,9 +231,9 @@ public function getItemFormats() { return $formats; } - /****************************************************************************/ + /* ************************************************************************ */ // Export methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -243,9 +243,9 @@ public function buildExportRecord(array $element, WebformSubmissionInterface $we return [$this->formatText($element, $webform_submission, $export_options)]; } - /****************************************************************************/ + /* ************************************************************************ */ // Element configuration methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -430,9 +430,9 @@ protected function parseInputFormat(array &$element, $property) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Validation methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Validate GNU date input format. @@ -627,7 +627,7 @@ public static function validateDate(&$element, FormStateInterface $form_state, & public function getTestValues(array $element, WebformInterface $webform, array $options = []) { $format = DateFormat::load('html_datetime')->getPattern(); if (!empty($element['#date_year_range'])) { - list($min, $max) = static::datetimeRangeYears($element['#date_year_range']); + [$min, $max] = static::datetimeRangeYears($element['#date_year_range']); } else { $min = !empty($element['#date_date_min']) ? strtotime($element['#date_date_min']) : strtotime('-10 years'); @@ -655,7 +655,7 @@ public function getTestValues(array $element, WebformInterface $webform, array $ protected static function datetimeRangeYears($string, $date = NULL) { $datetime = new DrupalDateTime(); $this_year = $datetime->format('Y'); - list($min_year, $max_year) = explode(':', $string); + [$min_year, $max_year] = explode(':', $string); // Valid patterns would be -5:+5, 0:+1, 2008:2010. $plus_pattern = '@[\+|\-][0-9]{1,4}@'; diff --git a/web/modules/webform/src/Plugin/WebformElement/DateList.php b/web/modules/webform/src/Plugin/WebformElement/DateList.php index bdcf75bfca..135e16f25e 100644 --- a/web/modules/webform/src/Plugin/WebformElement/DateList.php +++ b/web/modules/webform/src/Plugin/WebformElement/DateList.php @@ -46,7 +46,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -70,7 +70,7 @@ public function prepare(array &$element, WebformSubmissionInterface $webform_sub * {@inheritdoc} */ protected function getElementSelectorInputsOptions(array $element) { - $date_parts = (isset($element['#date_part_order'])) ? $element['#date_part_order'] : ['year', 'month', 'day', 'hour', 'minute']; + $date_parts = $element['#date_part_order'] ?? ['year', 'month', 'day', 'hour', 'minute']; $t_args = ['@title' => $this->getAdminLabel($element)]; $selectors = [ diff --git a/web/modules/webform/src/Plugin/WebformElement/DateTime.php b/web/modules/webform/src/Plugin/WebformElement/DateTime.php index 51315ffed7..525872481e 100644 --- a/web/modules/webform/src/Plugin/WebformElement/DateTime.php +++ b/web/modules/webform/src/Plugin/WebformElement/DateTime.php @@ -71,7 +71,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['date_date_placeholder', 'date_time_placeholder']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -89,7 +89,7 @@ public function prepare(array &$element, WebformSubmissionInterface $webform_sub /* Date */ - $date_element = (isset($element['#date_date_element'])) ? $element['#date_date_element'] : 'date'; + $date_element = $element['#date_date_element'] ?? 'date'; // Unset unsupported date format for date elements that are not // text or datepicker. diff --git a/web/modules/webform/src/Plugin/WebformElement/Details.php b/web/modules/webform/src/Plugin/WebformElement/Details.php index f7496af2e7..0107876771 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Details.php +++ b/web/modules/webform/src/Plugin/WebformElement/Details.php @@ -37,7 +37,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Email.php b/web/modules/webform/src/Plugin/WebformElement/Email.php index 28a74c7926..98de3cfe93 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Email.php +++ b/web/modules/webform/src/Plugin/WebformElement/Email.php @@ -44,7 +44,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/EntityAutocomplete.php b/web/modules/webform/src/Plugin/WebformElement/EntityAutocomplete.php index 19b5a0b679..1374d8d654 100644 --- a/web/modules/webform/src/Plugin/WebformElement/EntityAutocomplete.php +++ b/web/modules/webform/src/Plugin/WebformElement/EntityAutocomplete.php @@ -36,7 +36,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Fieldset.php b/web/modules/webform/src/Plugin/WebformElement/Fieldset.php index adaf3ceed8..7f23eb3d93 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Fieldset.php +++ b/web/modules/webform/src/Plugin/WebformElement/Fieldset.php @@ -33,7 +33,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Hidden.php b/web/modules/webform/src/Plugin/WebformElement/Hidden.php index 1ac3157664..d6bb35b7f0 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Hidden.php +++ b/web/modules/webform/src/Plugin/WebformElement/Hidden.php @@ -39,7 +39,7 @@ protected function defineDefaultProperties() { ] + $access_properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Item.php b/web/modules/webform/src/Plugin/WebformElement/Item.php index 72253354ea..85df3e0d81 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Item.php +++ b/web/modules/webform/src/Plugin/WebformElement/Item.php @@ -41,7 +41,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Label.php b/web/modules/webform/src/Plugin/WebformElement/Label.php index 1f94a414d3..90a27f63fb 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Label.php +++ b/web/modules/webform/src/Plugin/WebformElement/Label.php @@ -31,7 +31,7 @@ protected function defineDefaultProperties() { ] + $this->defineDefaultBaseProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/LanguageSelect.php b/web/modules/webform/src/Plugin/WebformElement/LanguageSelect.php index 9f21dc8492..1d69b9629e 100644 --- a/web/modules/webform/src/Plugin/WebformElement/LanguageSelect.php +++ b/web/modules/webform/src/Plugin/WebformElement/LanguageSelect.php @@ -48,7 +48,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/MachineName.php b/web/modules/webform/src/Plugin/WebformElement/MachineName.php index ea48332a4c..9fc6bd9abe 100644 --- a/web/modules/webform/src/Plugin/WebformElement/MachineName.php +++ b/web/modules/webform/src/Plugin/WebformElement/MachineName.php @@ -31,7 +31,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Number.php b/web/modules/webform/src/Plugin/WebformElement/Number.php index 2ddbac5350..6c350e4192 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Number.php +++ b/web/modules/webform/src/Plugin/WebformElement/Number.php @@ -28,7 +28,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/NumericBase.php b/web/modules/webform/src/Plugin/WebformElement/NumericBase.php index a098ab649e..304cd92aea 100644 --- a/web/modules/webform/src/Plugin/WebformElement/NumericBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/NumericBase.php @@ -25,7 +25,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/OptionsBase.php b/web/modules/webform/src/Plugin/WebformElement/OptionsBase.php index 898c696e69..0aed4007a7 100644 --- a/web/modules/webform/src/Plugin/WebformElement/OptionsBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/OptionsBase.php @@ -79,7 +79,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -425,7 +425,7 @@ protected function formatHtmlItems(array &$element, WebformSubmissionInterface $ $format = $this->getItemsFormat($element); if (strpos($format, 'checklist:') === 0) { // Get checked/unchecked icons. - list(, $checked_type) = explode(':', $format); + [, $checked_type] = explode(':', $format); switch ($checked_type) { case 'crosses': $checked = '✖ '; @@ -448,7 +448,7 @@ protected function formatHtmlItems(array &$element, WebformSubmissionInterface $ $flattened_options = OptGroup::flattenOptions($element['#options']); foreach ($flattened_options as $option_value => $option_text) { if ($options_description && WebformOptionsHelper::hasOptionDescription($option_text)) { - list($option_text) = WebformOptionsHelper::splitOption($option_text); + [$option_text] = WebformOptionsHelper::splitOption($option_text); } $build[$option_value] = [ '#prefix' => isset($values[$option_value]) ? $checked : $unchecked, @@ -479,7 +479,7 @@ protected function formatTextItems(array &$element, WebformSubmissionInterface $ $format = $this->getItemsFormat($element); if (strpos($format, 'checklist:') === 0) { // Get checked/unchecked icons. - list(, $checked_type) = explode(':', $format); + [, $checked_type] = explode(':', $format); switch ($checked_type) { case 'crosses': $checked = '✖'; @@ -502,7 +502,7 @@ protected function formatTextItems(array &$element, WebformSubmissionInterface $ $flattened_options = OptGroup::flattenOptions($element['#options']); foreach ($flattened_options as $option_value => $option_text) { if ($options_description && WebformOptionsHelper::hasOptionDescription($option_text)) { - list($option_text) = WebformOptionsHelper::splitOption($option_text); + [$option_text] = WebformOptionsHelper::splitOption($option_text); } $list[] = ((isset($values[$option_value])) ? $checked : $unchecked) . ' ' . $option_text; unset($values[$option_value]); @@ -514,7 +514,7 @@ protected function formatTextItems(array &$element, WebformSubmissionInterface $ return implode(PHP_EOL, $list); } else { - return parent::formatTextItems($element, $webform_submission, $options); + return parent::formatTextItems($element, $webform_submission, $options); } } @@ -646,7 +646,7 @@ public function buildExportHeader(array $element, array $options) { * {@inheritdoc} */ public function buildExportRecord(array $element, WebformSubmissionInterface $webform_submission, array $export_options) { - $element_options = (isset($element['#options'])) ? $element['#options'] : []; + $element_options = $element['#options'] ?? []; $options_format = ($element['#webform_multiple'] ? $export_options['options_multiple_format'] : $export_options['options_single_format']); if ($options_format === 'separate') { $value = $this->getRawValue($element, $webform_submission); @@ -705,7 +705,7 @@ public static function validateMultipleOptions(array &$element, FormStateInterfa */ protected function getElementSelectorInputsOptions(array $element) { if ($other_type = $this->getOptionsOtherType()) { - list($type) = explode(' ', $this->getPluginLabel()); + [$type] = explode(' ', $this->getPluginLabel()); $title = $this->getAdminLabel($element); $name = $other_type; diff --git a/web/modules/webform/src/Plugin/WebformElement/PasswordConfirm.php b/web/modules/webform/src/Plugin/WebformElement/PasswordConfirm.php index 3e7e4d230d..47a198b5d0 100644 --- a/web/modules/webform/src/Plugin/WebformElement/PasswordConfirm.php +++ b/web/modules/webform/src/Plugin/WebformElement/PasswordConfirm.php @@ -28,7 +28,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/ProcessedText.php b/web/modules/webform/src/Plugin/WebformElement/ProcessedText.php index a76c37cc1f..59f10c2501 100644 --- a/web/modules/webform/src/Plugin/WebformElement/ProcessedText.php +++ b/web/modules/webform/src/Plugin/WebformElement/ProcessedText.php @@ -69,7 +69,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['text']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Radios.php b/web/modules/webform/src/Plugin/WebformElement/Radios.php index 4342b5c3b1..7eac2a05c2 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Radios.php +++ b/web/modules/webform/src/Plugin/WebformElement/Radios.php @@ -35,7 +35,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Range.php b/web/modules/webform/src/Plugin/WebformElement/Range.php index fd20d51e78..2b86b93477 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Range.php +++ b/web/modules/webform/src/Plugin/WebformElement/Range.php @@ -48,7 +48,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -67,7 +67,7 @@ public function prepare(array &$element, WebformSubmissionInterface $webform_sub return; } - $webform_key = (isset($element['#webform_key'])) ? $element['#webform_key'] : 'range'; + $webform_key = $element['#webform_key'] ?? 'range'; if (in_array($element['#output'], ['above', 'below'])) { $element += ['#output__attributes' => []]; diff --git a/web/modules/webform/src/Plugin/WebformElement/Select.php b/web/modules/webform/src/Plugin/WebformElement/Select.php index a0bf3662f6..9c9175669a 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Select.php +++ b/web/modules/webform/src/Plugin/WebformElement/Select.php @@ -40,7 +40,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Table.php b/web/modules/webform/src/Plugin/WebformElement/Table.php index 4c99b793b2..4077723ac0 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Table.php +++ b/web/modules/webform/src/Plugin/WebformElement/Table.php @@ -56,7 +56,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['header']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/TableSelect.php b/web/modules/webform/src/Plugin/WebformElement/TableSelect.php index 50c43b317c..98c107df75 100644 --- a/web/modules/webform/src/Plugin/WebformElement/TableSelect.php +++ b/web/modules/webform/src/Plugin/WebformElement/TableSelect.php @@ -30,7 +30,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Telephone.php b/web/modules/webform/src/Plugin/WebformElement/Telephone.php index fa7eadea40..b49705b34c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Telephone.php +++ b/web/modules/webform/src/Plugin/WebformElement/Telephone.php @@ -10,6 +10,8 @@ use Drupal\webform\WebformSubmissionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +// phpcs:disable Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing + /** * Provides a 'tel' element. * @@ -53,12 +55,12 @@ public static function create(ContainerInterface $container, array $configuratio */ protected function defineDefaultProperties() { $properties = [ - 'input_hide' => FALSE, - 'multiple' => FALSE, - 'international' => FALSE, - 'international_initial_country' => '', - 'international_preferred_countries' => [], - ] + parent::defineDefaultProperties() + $this->defineDefaultMultipleProperties(); + 'input_hide' => FALSE, + 'multiple' => FALSE, + 'international' => FALSE, + 'international_initial_country' => '', + 'international_preferred_countries' => [], + ] + parent::defineDefaultProperties() + $this->defineDefaultMultipleProperties(); // Add support for telephone_validation.module. if ($this->moduleHandler->moduleExists('telephone_validation')) { $properties += [ @@ -77,7 +79,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['international_initial_country']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -210,7 +212,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['telephone']['telephone_validation_countries'] = [ '#type' => 'select', '#title' => $this->t('Valid countries'), - '#description' => t('If no country selected all countries are valid.'), + '#description' => $this->t('If no country selected all countries are valid.'), '#options' => $this->telephoneValidator->getCountryList(), '#select2' => TRUE, '#multiple' => TRUE, @@ -270,18 +272,14 @@ public function getItemDefaultFormat() { * {@inheritdoc} */ public function getItemFormats() { - return parent::getItemFormats() + [ - 'link' => $this->t('Link'), - ]; + return parent::getItemFormats() + ['link' => $this->t('Link')]; } /** * {@inheritdoc} */ public function preview() { - return parent::preview() + [ - '#international' => TRUE, - ]; + return parent::preview() + ['#international' => TRUE]; } /** diff --git a/web/modules/webform/src/Plugin/WebformElement/TextBase.php b/web/modules/webform/src/Plugin/WebformElement/TextBase.php index 98d960e220..dbafc3ffe1 100644 --- a/web/modules/webform/src/Plugin/WebformElement/TextBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/TextBase.php @@ -40,7 +40,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['default_value', 'counter_minimum_message', 'counter_maximum_message', 'pattern_error']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -344,9 +344,9 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form } } - /****************************************************************************/ + /* ************************************************************************ */ // Input masks. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get input masks. diff --git a/web/modules/webform/src/Plugin/WebformElement/TextField.php b/web/modules/webform/src/Plugin/WebformElement/TextField.php index 1f7b4b8c67..bc2c09a6e4 100644 --- a/web/modules/webform/src/Plugin/WebformElement/TextField.php +++ b/web/modules/webform/src/Plugin/WebformElement/TextField.php @@ -34,7 +34,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties() + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/TextFormat.php b/web/modules/webform/src/Plugin/WebformElement/TextFormat.php index d19bbdad46..faa4eb9a91 100644 --- a/web/modules/webform/src/Plugin/WebformElement/TextFormat.php +++ b/web/modules/webform/src/Plugin/WebformElement/TextFormat.php @@ -52,7 +52,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -220,8 +220,8 @@ public function setDefaultValue(array &$element) { protected function formatHtmlItem(array $element, WebformSubmissionInterface $webform_submission, array $options = []) { $value = $this->getValue($element, $webform_submission, $options); - $format = (isset($value['format'])) ? $value['format'] : $this->getItemFormat($element); - $value = (isset($value['value'])) ? $value['value'] : $value; + $format = $value['format'] ?? $this->getItemFormat($element); + $value = $value['value'] ?? $value; switch ($format) { case 'raw': return $value; @@ -241,8 +241,8 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we protected function formatTextItem(array $element, WebformSubmissionInterface $webform_submission, array $options = []) { $value = $this->getValue($element, $webform_submission, $options); - $format = (isset($value['format'])) ? $value['format'] : $this->getItemFormat($element); - $value = (isset($value['value'])) ? $value['value'] : $value; + $format = $value['format'] ?? $this->getItemFormat($element); + $value = $value['value'] ?? $value; switch ($format) { case 'raw': return $value; diff --git a/web/modules/webform/src/Plugin/WebformElement/Textarea.php b/web/modules/webform/src/Plugin/WebformElement/Textarea.php index 4cae34097c..ecd39f5f36 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Textarea.php +++ b/web/modules/webform/src/Plugin/WebformElement/Textarea.php @@ -72,7 +72,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Url.php b/web/modules/webform/src/Plugin/WebformElement/Url.php index 0955449dac..4ba81f7569 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Url.php +++ b/web/modules/webform/src/Plugin/WebformElement/Url.php @@ -44,7 +44,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/Value.php b/web/modules/webform/src/Plugin/WebformElement/Value.php index 68550f1d67..4c9182a62c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/Value.php +++ b/web/modules/webform/src/Plugin/WebformElement/Value.php @@ -29,7 +29,7 @@ protected function defineDefaultProperties() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/VerticalTabs.php b/web/modules/webform/src/Plugin/WebformElement/VerticalTabs.php index ccd6f59aeb..60e6b60be7 100644 --- a/web/modules/webform/src/Plugin/WebformElement/VerticalTabs.php +++ b/web/modules/webform/src/Plugin/WebformElement/VerticalTabs.php @@ -59,7 +59,7 @@ protected function defineDefaultBaseProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/View.php b/web/modules/webform/src/Plugin/WebformElement/View.php index be2634500e..3c6255b7ad 100644 --- a/web/modules/webform/src/Plugin/WebformElement/View.php +++ b/web/modules/webform/src/Plugin/WebformElement/View.php @@ -32,7 +32,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformActions.php b/web/modules/webform/src/Plugin/WebformElement/WebformActions.php index 80742a27fc..14c58be84a 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformActions.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformActions.php @@ -41,7 +41,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformAutocomplete.php b/web/modules/webform/src/Plugin/WebformElement/WebformAutocomplete.php index 15932baf1d..71401b7fb5 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformAutocomplete.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformAutocomplete.php @@ -53,7 +53,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformCheckboxesOther.php b/web/modules/webform/src/Plugin/WebformElement/WebformCheckboxesOther.php index 26540911eb..224d3aa2b5 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformCheckboxesOther.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformCheckboxesOther.php @@ -32,7 +32,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformCodeMirror.php b/web/modules/webform/src/Plugin/WebformElement/WebformCodeMirror.php index 9379352545..b739ff209f 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformCodeMirror.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformCodeMirror.php @@ -45,7 +45,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['default_value']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -139,10 +139,10 @@ public function form(array $form, FormStateInterface $form_state) { 'yaml' => $this->t('YAML'), 'html' => $this->t('HTML'), 'htmlmixed' => $this->t('HTML (CSS & JavaScript)'), - 'css' => 'CSS', - 'javascript' => 'JavaScript', - 'php' => 'PHP', - 'twig' => 'Twig', + 'css' => $this->t('CSS'), + 'javascript' => $this->t('JavaScript'), + 'php' => $this->t('PHP'), + 'twig' => $this->t('Twig'), ], '#required' => TRUE, ]; diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformCompositeBase.php b/web/modules/webform/src/Plugin/WebformElement/WebformCompositeBase.php index f74ebca38a..600e370aab 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformCompositeBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformCompositeBase.php @@ -65,9 +65,9 @@ public static function create(ContainerInterface $container, array $configuratio return $instance; } - /****************************************************************************/ + /* ************************************************************************ */ // Property definitions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -131,9 +131,9 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['default_value']); } - /****************************************************************************/ + /* ************************************************************************ */ // Property methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -142,9 +142,9 @@ public function hasManagedFiles(array $element) { return ($this->getManagedFiles($element)) ? TRUE : FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // Element relationship methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -153,9 +153,9 @@ public function getRelatedTypes(array $element) { return []; } - /****************************************************************************/ + /* ************************************************************************ */ // Element rendering methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -220,9 +220,9 @@ protected function prepareMultipleWrapper(array &$element) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Table methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -280,9 +280,9 @@ public function formatTableColumn(array $element, WebformSubmissionInterface $we } } - /****************************************************************************/ + /* ************************************************************************ */ // #states API methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -329,9 +329,9 @@ public function getElementSelectorSourceValues(array $element) { return $source_values; } - /****************************************************************************/ + /* ************************************************************************ */ // Display submission value methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -444,7 +444,7 @@ protected function formatHtmlItems(array &$element, WebformSubmissionInterface $ $composite_element = $composite_elements[$composite_key]; $header[$composite_key] = [ - 'data' => (isset($composite_element['#title'])) ? $composite_element['#title'] : $composite_key, + 'data' => $composite_element['#title'] ?? $composite_key, 'bgcolor' => '#eee', ]; } @@ -687,8 +687,8 @@ protected function formatTextItemValue(array $element, WebformSubmissionInterfac */ public function getItemFormats() { return parent::getItemFormats() + [ - 'list' => $this->t('List'), - ]; + 'list' => $this->t('List'), + ]; } /** @@ -710,9 +710,9 @@ public function getItemsFormats() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Export methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -800,15 +800,15 @@ public function buildExportRecord(array $element, WebformSubmissionInterface $we $record[] = WebformOptionsHelper::getOptionText($value[$composite_key], $composite_element['#options']); } else { - $record[] = (isset($value[$composite_key])) ? $value[$composite_key] : NULL; + $record[] = $value[$composite_key] ?? NULL; } } return $record; } - /****************************************************************************/ + /* ************************************************************************ */ // Test methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -837,9 +837,9 @@ public function getTestValues(array $element, WebformInterface $webform, array $ return $values; } - /****************************************************************************/ + /* ************************************************************************ */ // Element configuration methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1017,8 +1017,8 @@ protected function buildCompositeElementsTable(array $form, FormStateInterface $ $rows = []; $composite_elements = $this->getCompositeElements(); foreach ($composite_elements as $composite_key => $composite_element) { - $title = (isset($composite_element['#title'])) ? $composite_element['#title'] : $composite_key; - $type = isset($composite_element['#type']) ? $composite_element['#type'] : NULL; + $title = $composite_element['#title'] ?? $composite_key; + $type = $composite_element['#type'] ?? NULL; $t_args = ['@title' => $title]; $state_disabled = [ 'disabled' => [ @@ -1098,7 +1098,7 @@ protected function buildCompositeElementsTable(array $form, FormStateInterface $ 'inline' => $this->t('Inline'), 'invisible' => $this->t('Invisible'), ], - '#empty_option' => $this->t('Select title display… '), + '#empty_option' => $this->t('Select title display…'), '#states' => $state_disabled, ], ], @@ -1183,7 +1183,7 @@ protected function buildCompositeElementsTable(array $form, FormStateInterface $ /** @var \Drupal\webform_ui\Form\WebformUiElementEditForm $form_object */ $form_object = $form_state->getFormObject(); $element = $form_object->getElement(); - $composite_options_default_value = (isset($element['#' . $composite_key . '__options'])) ? $element['#' . $composite_key . '__options'] : NULL; + $composite_options_default_value = $element['#' . $composite_key . '__options'] ?? NULL; if ($composite_options_default_value && (is_array($composite_options_default_value) || !isset($composite_options[$composite_options_default_value]))) { $webform = $form_object->getWebform(); if ($this->currentUser->hasPermission('edit webform source') @@ -1210,12 +1210,12 @@ protected function buildCompositeElementsTable(array $form, FormStateInterface $ '#required' => TRUE, '#attributes' => ['style' => 'width: 100%;'], '#states' => $state_disabled + [ - 'invisible' => [ - ':input[name="properties[' . $composite_key . '__type]"]' => [ - 'value' => 'textfield', - ], + 'invisible' => [ + ':input[name="properties[' . $composite_key . '__type]"]' => [ + 'value' => 'textfield', ], ], + ], ]; } else { @@ -1259,9 +1259,9 @@ public function getConfigurationFormProperties(array &$form, FormStateInterface return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ // Composite element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Initialize and cache #webform_composite_elements. @@ -1331,7 +1331,7 @@ public function getCompositeElements() { public function getInitializedCompositeElement(array $element, $composite_key = NULL) { $composite_elements = $element['#webform_composite_elements']; if (isset($composite_key)) { - return (isset($composite_elements[$composite_key])) ? $composite_elements[$composite_key] : NULL; + return $composite_elements[$composite_key] ?? NULL; } else { return $composite_elements; @@ -1359,9 +1359,9 @@ protected function getCompositeElementOptions($composite_key) { return $options; } - /****************************************************************************/ + /* ************************************************************************ */ // Composite managed file methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1464,9 +1464,9 @@ public function getManagedFiles(array $element) { return $this->elementsManagedFiles[$id]; } - /****************************************************************************/ + /* ************************************************************************ */ // Composite helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determine if element type is supported by custom composite elements. diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformComputedBase.php b/web/modules/webform/src/Plugin/WebformElement/WebformComputedBase.php index bfc53929aa..e69e61f95e 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformComputedBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformComputedBase.php @@ -67,7 +67,7 @@ protected function defineDefaultProperties() { ] + $this->defineDefaultBaseProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformComputedTwig.php b/web/modules/webform/src/Plugin/WebformElement/WebformComputedTwig.php index a564dcf1b3..b72c4fe2a8 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformComputedTwig.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformComputedTwig.php @@ -27,7 +27,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformCustomComposite.php b/web/modules/webform/src/Plugin/WebformElement/WebformCustomComposite.php index 00fd496134..b09737b997 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformCustomComposite.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformCustomComposite.php @@ -34,7 +34,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -73,7 +73,7 @@ public function prepare(array &$element, WebformSubmissionInterface $webform_sub foreach ($multiple_properties as $multiple_property => $multiple_value) { if (strpos($multiple_property, 'multiple__') === 0) { $property_name = str_replace('multiple__', '', $multiple_property); - $element["#$property_name"] = (isset($element["#$multiple_property"])) ? $element["#$multiple_property"] : $multiple_value; + $element["#$property_name"] = $element["#$multiple_property"] ?? $multiple_value; } } @@ -152,9 +152,9 @@ protected function buildCompositeElementsTable(array $form, FormStateInterface $ ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Preview method. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -182,9 +182,9 @@ public function preview() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Composite element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformDisplayOnTrait.php b/web/modules/webform/src/Plugin/WebformElement/WebformDisplayOnTrait.php index a5ddba0cd0..ffeabfdc9e 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformDisplayOnTrait.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformDisplayOnTrait.php @@ -57,7 +57,7 @@ public function buildText(array $element, WebformSubmissionInterface $webform_su * TRUE if the element should be displayed on the form or view. */ protected function isDisplayOn(array $element, $display_on) { - $element_display_on = (isset($element['#display_on'])) ? $element['#display_on'] : $this->getDefaultProperty('display_on'); + $element_display_on = $element['#display_on'] ?? $this->getDefaultProperty('display_on'); return ($element_display_on === WebformElementDisplayOnInterface::DISPLAY_ON_BOTH || $element_display_on === $display_on) ? TRUE : FALSE; } diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformElement.php b/web/modules/webform/src/Plugin/WebformElement/WebformElement.php index 543142bf6a..57b1289988 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformElement.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformElement.php @@ -24,7 +24,7 @@ protected function defineDefaultProperties() { return []; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformEmailConfirm.php b/web/modules/webform/src/Plugin/WebformElement/WebformEmailConfirm.php index c92cacc25c..fa8ea6385c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformEmailConfirm.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformEmailConfirm.php @@ -42,7 +42,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformEmailMultiple.php b/web/modules/webform/src/Plugin/WebformElement/WebformEmailMultiple.php index 1d5b56009e..f30ae3deb4 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformEmailMultiple.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformEmailMultiple.php @@ -47,7 +47,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformEntityOptionsTrait.php b/web/modules/webform/src/Plugin/WebformElement/WebformEntityOptionsTrait.php index b1097ac4b7..7d0bbd7542 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformEntityOptionsTrait.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformEntityOptionsTrait.php @@ -45,7 +45,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformEntityReferenceTrait.php b/web/modules/webform/src/Plugin/WebformElement/WebformEntityReferenceTrait.php index a4160b6601..4f5588cb67 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformEntityReferenceTrait.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformEntityReferenceTrait.php @@ -285,7 +285,7 @@ public static function validateEntityReferenceFormat(array &$element, FormStateI public function buildExportHeader(array $element, array $options) { if (!$this->hasMultipleValues($element)) { $default_options = $this->getExportDefaultOptions(); - $header = isset($options['entity_reference_items']) ? $options['entity_reference_items'] : $default_options['entity_reference_items']; + $header = $options['entity_reference_items'] ?? $default_options['entity_reference_items']; if ($options['header_format'] === 'label') { foreach ($header as $index => $column) { switch ($column) { @@ -316,7 +316,7 @@ public function buildExportHeader(array $element, array $options) { public function buildExportRecord(array $element, WebformSubmissionInterface $webform_submission, array $export_options) { $value = $this->getValue($element, $webform_submission); $default_options = $this->getExportDefaultOptions(); - $entity_reference_items = isset($export_options['entity_reference_items']) ? $export_options['entity_reference_items'] : $default_options['entity_reference_items']; + $entity_reference_items = $export_options['entity_reference_items'] ?? $default_options['entity_reference_items']; if (!$this->hasMultipleValues($element)) { $entity_type = $this->getTargetType($element); @@ -447,13 +447,13 @@ public function getTargetEntities(array $element, WebformSubmissionInterface $we public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); - /**************************************************************************/ + /* ********************************************************************** */ // IMPORTANT: Most of the below code and #ajax tweaks compensate for the // fact that the EntityReferenceSelection plugin specifically targets // entity references managed via the Field API. // @see \Drupal\webform\Plugin\WebformElementBase::setConfigurationFormDefaultValueRecursive // @see \Drupal\webform\Plugin\WebformElementBase::buildConfigurationForm - /**************************************************************************/ + /* ********************************************************************** */ // Get element properties. $element_properties = $form_state->get('element_properties'); @@ -506,7 +506,7 @@ public function form(array $form, FormStateInterface $form_state) { $element_properties['selection_settings'] = $selection_settings; $form_state->set('element_properties', $element_properties); - /**************************************************************************/ + /* ********************************************************************** */ // @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $selection_plugins = $this->selectionManager->getSelectionGroups($target_type); @@ -644,9 +644,9 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form $form_state->setValues($values); } - /****************************************************************************/ + /* ************************************************************************ */ // Form/Ajax helpers and callbacks. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build an ajax elements trigger. @@ -668,9 +668,9 @@ protected function buildAjaxElementTriggerRecursive($id, array &$element) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Display submission value methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformFlexbox.php b/web/modules/webform/src/Plugin/WebformElement/WebformFlexbox.php index be3f5f9107..bba52b712e 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformFlexbox.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformFlexbox.php @@ -29,7 +29,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformHorizontalRule.php b/web/modules/webform/src/Plugin/WebformElement/WebformHorizontalRule.php index df4df436f9..3c12498733 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformHorizontalRule.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformHorizontalRule.php @@ -35,7 +35,7 @@ protected function defineDefaultProperties() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformImageFile.php b/web/modules/webform/src/Plugin/WebformElement/WebformImageFile.php index c3ebc54309..4e5b49fdb5 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformImageFile.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformImageFile.php @@ -35,7 +35,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -97,7 +97,7 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we return parent::formatHtmlItem($element, $webform_submission, $options); } else { - list($style_name, $format) = explode(':', $format); + [$style_name, $format] = explode(':', $format); $theme = str_replace('webform_', 'webform_element_', $this->getPluginId()); if (strpos($theme, 'webform_') !== 0) { $theme = 'webform_element_' . $theme; diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformLikert.php b/web/modules/webform/src/Plugin/WebformElement/WebformLikert.php index 7e92529e62..ddcebb11a8 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformLikert.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformLikert.php @@ -75,7 +75,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['questions', 'answers', 'na_answer_text']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -103,7 +103,7 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we case 'raw': $items = []; foreach ($element['#questions'] as $question_key => $question_text) { - $answer_value = (isset($value[$question_key])) ? $value[$question_key] : NULL; + $answer_value = $value[$question_key] ?? NULL; $items[$question_key] = ['#markup' => "<b>$question_key:</b> $answer_value"]; } return [ @@ -116,12 +116,12 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we // HTML emails. $header = []; $header['likert_question'] = [ - 'data' => WebformAccessibilityHelper::buildVisuallyHidden(t('Questions')), + 'data' => WebformAccessibilityHelper::buildVisuallyHidden($this->t('Questions')), 'align' => 'left', 'width' => '40%', ]; foreach ($element['#answers'] as $answer_value => $answer_text) { - list($answer_title) = WebformOptionsHelper::splitOption($answer_text); + [$answer_title] = WebformOptionsHelper::splitOption($answer_text); $header[$answer_value] = [ 'data' => $answer_title, 'align' => 'center', @@ -133,9 +133,9 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we $rows = []; foreach ($element['#questions'] as $question_key => $question_text) { - list($question_title) = WebformOptionsHelper::splitOption($question_text); + [$question_title] = WebformOptionsHelper::splitOption($question_text); - $question_value = (isset($value[$question_key])) ? $value[$question_key] : NULL; + $question_value = $value[$question_key] ?? NULL; $row = []; $row['likert_question'] = [ 'data' => $question_title, @@ -167,8 +167,8 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we case 'list': $items = []; foreach ($element['#questions'] as $question_key => $question_text) { - list($question_title) = WebformOptionsHelper::splitOption($question_text); - $answer_value = (isset($value[$question_key])) ? $value[$question_key] : NULL; + [$question_title] = WebformOptionsHelper::splitOption($question_text); + $answer_value = $value[$question_key] ?? NULL; $answer_text = ($answer_value !== NULL) ? WebformOptionsHelper::getOptionText($answer_value, $element['#answers'], TRUE) : $this->t('[blank]'); $items[$question_key] = [ 'question' => [ @@ -200,7 +200,7 @@ protected function formatTextItem(array $element, WebformSubmissionInterface $we case 'raw': $list = []; foreach ($element['#questions'] as $question_key => $question_label) { - $answer_value = (isset($value[$question_key])) ? $value[$question_key] : NULL; + $answer_value = $value[$question_key] ?? NULL; $list[] = "$question_key: $answer_value"; } return implode(PHP_EOL, $list); @@ -211,7 +211,7 @@ protected function formatTextItem(array $element, WebformSubmissionInterface $we case 'list': $list = []; foreach ($element['#questions'] as $question_key => $question_label) { - $answer_value = (isset($value[$question_key])) ? $value[$question_key] : NULL; + $answer_value = $value[$question_key] ?? NULL; $answer_text = WebformOptionsHelper::getOptionText($answer_value, $element['#answers'], TRUE); $list[] = "$question_label: $answer_text"; } @@ -274,7 +274,7 @@ public function buildExportRecord(array $element, WebformSubmissionInterface $we $record = []; foreach ($element['#questions'] as $question_key => $question_label) { - $answer_value = (isset($value[$question_key])) ? $value[$question_key] : NULL; + $answer_value = $value[$question_key] ?? NULL; if ($export_options['likert_answers_format'] === 'key') { $record[] = $answer_value; } @@ -338,7 +338,7 @@ public function formatTableColumn(array $element, WebformSubmissionInterface $we if (isset($options['question_key'])) { $value = $this->getValue($element, $webform_submission); $question_key = $options['question_key']; - $question_value = (isset($value[$question_key])) ? $value[$question_key] : ''; + $question_value = $value[$question_key] ?? ''; return WebformOptionsHelper::getOptionText($question_value, $element['#answers'], TRUE); } else { diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformLink.php b/web/modules/webform/src/Plugin/WebformElement/WebformLink.php index bb4891ac91..55157be7bd 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformLink.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformLink.php @@ -49,7 +49,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformLocationBase.php b/web/modules/webform/src/Plugin/WebformElement/WebformLocationBase.php index 2a9f8a5c5c..62397cf76d 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformLocationBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformLocationBase.php @@ -56,7 +56,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -117,8 +117,8 @@ protected function buildCompositeElementsTable(array $form, FormStateInterface $ $rows = []; $composite_elements = $this->getCompositeElements(); foreach ($composite_elements as $composite_key => $composite_element) { - $title = (isset($composite_element['#title'])) ? $composite_element['#title'] : $composite_key; - $type = isset($composite_element['#type']) ? $composite_element['#type'] : NULL; + $title = $composite_element['#title'] ?? $composite_key; + $type = $composite_element['#type'] ?? NULL; $t_args = ['@title' => $title]; $attributes = ['style' => 'width: 100%; margin-bottom: 5px']; diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformLocationPlaces.php b/web/modules/webform/src/Plugin/WebformElement/WebformLocationPlaces.php index 19ba178e83..85fa8db059 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformLocationPlaces.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformLocationPlaces.php @@ -34,7 +34,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformManagedFileBase.php b/web/modules/webform/src/Plugin/WebformElement/WebformManagedFileBase.php index c452e36548..b9b3689132 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformManagedFileBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformManagedFileBase.php @@ -38,7 +38,7 @@ abstract class WebformManagedFileBase extends WebformElementBase implements Webf * * @var array */ - static protected $blacklistedMimeTypes = [ + protected static $blacklistedMimeTypes = [ 'application/pdf', 'application/xml', 'image/svg+xml', @@ -117,7 +117,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['file_placeholder']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -262,7 +262,7 @@ public function prepare(array &$element, WebformSubmissionInterface $webform_sub '#upload_validators' => $upload_validators, '#cardinality' => (empty($element['#multiple'])) ? 1 : $element['#multiple'], ]; - $file_help = (isset($element['#file_help'])) ? $element['#file_help'] : 'description'; + $file_help = $element['#file_help'] ?? 'description'; if ($file_help !== 'none') { if (isset($element["#$file_help"])) { if (is_array($element["#$file_help"])) { @@ -501,10 +501,10 @@ public function postSave(array &$element, WebformSubmissionInterface $webform_su $original_data = $webform_submission->getOriginalData(); $data = $webform_submission->getData(); - $value = isset($data[$key]) ? $data[$key] : []; + $value = $data[$key] ?? []; $fids = (is_array($value)) ? $value : [$value]; - $original_value = isset($original_data[$key]) ? $original_data[$key] : []; + $original_value = $original_data[$key] ?? []; $original_fids = (is_array($original_value)) ? $original_value : [$original_value]; // Delete the old file uploads. @@ -958,8 +958,7 @@ public function form(array $form, FormStateInterface $form_state) { '#type' => 'webform_message', '#message_message' => '<strong>' . $this->t('Saving of results is disabled.') . '</strong> ' . $this->t('Uploaded files will be temporarily stored on the server and referenced in the database for %interval.', ['%interval' => $temporary_interval]) . ' ' . - $this->t('Uploaded files should be attached to an email and/or remote posted to an external server.') - , + $this->t('Uploaded files should be attached to an email and/or remote posted to an external server.'), '#message_type' => 'warning', '#access' => TRUE, ]; diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformMapping.php b/web/modules/webform/src/Plugin/WebformElement/WebformMapping.php index 1a4822a506..81a034cacf 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformMapping.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformMapping.php @@ -93,7 +93,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['source', 'destination']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -137,7 +137,7 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we case 'raw': $items = []; foreach ($element['#source'] as $source_key => $source_title) { - $destination_value = (isset($value[$source_key])) ? $value[$source_key] : NULL; + $destination_value = $value[$source_key] ?? NULL; $items[$source_key] = ['#markup' => "$source_key $arrow $destination_value"]; } return [ @@ -159,8 +159,8 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we $rows = []; foreach ($element['#source'] as $source_key => $source_text) { - list($source_title) = WebformOptionsHelper::splitOption($source_text); - $destination_value = (isset($value[$source_key])) ? $value[$source_key] : NULL; + [$source_title] = WebformOptionsHelper::splitOption($source_text); + $destination_value = $value[$source_key] ?? NULL; $destination_title = ($destination_value) ? WebformOptionsHelper::getOptionText($destination_value, $element['#destination']) : $this->t('[blank]'); $rows[$source_key] = [ $source_title, @@ -182,8 +182,8 @@ protected function formatHtmlItem(array $element, WebformSubmissionInterface $we case 'list': $items = []; foreach ($element['#source'] as $source_key => $source_text) { - list($source_title) = WebformOptionsHelper::splitOption($source_text); - $destination_value = (isset($value[$source_key])) ? $value[$source_key] : NULL; + [$source_title] = WebformOptionsHelper::splitOption($source_text); + $destination_value = $value[$source_key] ?? NULL; $destination_title = ($destination_value) ? WebformOptionsHelper::getOptionText($destination_value, $element['#destination']) : $this->t('[blank]'); $items[$source_key] = ['#markup' => "$source_title $arrow $destination_title"]; } @@ -216,7 +216,7 @@ protected function formatTextItem(array $element, WebformSubmissionInterface $we case 'raw': $list = []; foreach ($element['#source'] as $source_key => $source_title) { - $destination_value = (isset($value[$source_key])) ? $value[$source_key] : NULL; + $destination_value = $value[$source_key] ?? NULL; $list[$source_key] = "$source_key $arrow $destination_value"; } return implode(PHP_EOL, $list); @@ -227,8 +227,8 @@ protected function formatTextItem(array $element, WebformSubmissionInterface $we case 'list': $list = []; foreach ($element['#source'] as $source_key => $source_text) { - list($source_title) = WebformOptionsHelper::splitOption($source_text); - $destination_value = (isset($value[$source_key])) ? $value[$source_key] : NULL; + [$source_title] = WebformOptionsHelper::splitOption($source_text); + $destination_value = $value[$source_key] ?? NULL; $destination_title = ($destination_value) ? WebformOptionsHelper::getOptionText($destination_value, $element['#destination']) : $this->t('[blank]'); $list[] = "$source_title $arrow $destination_title"; } @@ -274,7 +274,7 @@ public function buildExportRecord(array $element, WebformSubmissionInterface $we $record = []; foreach ($element['#source'] as $source_key => $source_title) { - $record[] = (isset($value[$source_key])) ? $value[$source_key] : NULL; + $record[] = $value[$source_key] ?? NULL; } return $record; } @@ -332,7 +332,7 @@ public function formatTableColumn(array $element, WebformSubmissionInterface $we if (isset($options['source_key'])) { $source_key = $options['source_key']; $value = $this->getValue($element, $webform_submission); - $question_value = (isset($value[$source_key])) ? $value[$source_key] : ''; + $question_value = $value[$source_key] ?? ''; return (isset($element['#destination'])) ? WebformOptionsHelper::getOptionText($question_value, $element['#destination']) : NULL; } else { @@ -347,7 +347,7 @@ public function getTestValues(array $element, WebformInterface $webform, array $ $form_state = new FormState(); $form_completed = []; $element += [ - '#name' => (isset($element['#webform_key'])) ? $element['#webform_key'] : '', + '#name' => $element['#webform_key'] ?? '', '#required' => FALSE, ]; $element = WebformMappingElement::processWebformMapping($element, $form_state, $form_completed); diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformMarkup.php b/web/modules/webform/src/Plugin/WebformElement/WebformMarkup.php index d7ae0e9f27..f98cea30f2 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformMarkup.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformMarkup.php @@ -31,7 +31,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformMarkupBase.php b/web/modules/webform/src/Plugin/WebformElement/WebformMarkupBase.php index ae13cc72c6..31ad2f3d9c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformMarkupBase.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformMarkupBase.php @@ -36,7 +36,7 @@ protected function defineDefaultBaseProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformMessage.php b/web/modules/webform/src/Plugin/WebformElement/WebformMessage.php index 69380c1a18..99f3ec8418 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformMessage.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformMessage.php @@ -43,7 +43,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['message_message']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformMore.php b/web/modules/webform/src/Plugin/WebformElement/WebformMore.php index 76dd8c85fd..5a1772b87f 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformMore.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformMore.php @@ -30,7 +30,7 @@ protected function defineDefaultProperties() { ] + $this->defineDefaultBaseProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformRating.php b/web/modules/webform/src/Plugin/WebformElement/WebformRating.php index 2f4d752d39..3b2da032ed 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformRating.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformRating.php @@ -41,7 +41,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformSame.php b/web/modules/webform/src/Plugin/WebformElement/WebformSame.php index 5dc3cbd3af..c01ec2c3da 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformSame.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformSame.php @@ -34,7 +34,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformSection.php b/web/modules/webform/src/Plugin/WebformElement/WebformSection.php index 91f28caa7e..106d2f74b4 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformSection.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformSection.php @@ -37,7 +37,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformSignature.php b/web/modules/webform/src/Plugin/WebformElement/WebformSignature.php index a19d78d3d1..b99e8c86fb 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformSignature.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformSignature.php @@ -57,7 +57,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -235,9 +235,9 @@ public function postDelete(array &$element, WebformSubmissionInterface $webform_ // @see \Drupal\webform\WebformEntityStorage::delete } - /****************************************************************************/ + /* ************************************************************************ */ // Signature image helpers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get a signature element's image URL. diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTable.php b/web/modules/webform/src/Plugin/WebformElement/WebformTable.php index bbac2200c8..9d754c740c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTable.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTable.php @@ -52,7 +52,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['header']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -90,7 +90,7 @@ protected function prepareTableHeader(array &$element) { foreach ($element['#header'] as $index => $header) { if (is_array($header) && isset($header['title'])) { - $attributes = (isset($header['attributes'])) ? $header['attributes'] : []; + $attributes = $header['attributes'] ?? []; $element['#header'][$index] = [ 'data' => ['#markup' => $header['title']], ] + $attributes; diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTableRow.php b/web/modules/webform/src/Plugin/WebformElement/WebformTableRow.php index 4e4153e407..3d43659c8a 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTableRow.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTableRow.php @@ -37,7 +37,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -82,7 +82,7 @@ public function buildHtml(array $element, WebformSubmissionInterface $webform_su $webform = $webform_submission->getWebform(); $parent_key = $element['#webform_parent_key']; $parent_element = $webform->getElement($parent_key); - $parent_format = (isset($parent_element['#format'])) ? $parent_element['#format'] : 'table'; + $parent_format = $parent_element['#format'] ?? 'table'; // Remove #states. unset($element['#states']); @@ -275,6 +275,7 @@ public function getConfigurationFormProperties(array &$form, FormStateInterface } // This is the only way to get the row key for a new element. + // phpcs:ignore DrupalPractice.Variables.GetRequestData.SuperglobalAccessedWithVar $key = $_POST['key']; $parent_key = \Drupal::request()->query->get('parent'); if (!$form_object->isNew() || !$parent_key) { @@ -306,9 +307,9 @@ public function getElementSelectorOptions(array $element) { return []; } - /****************************************************************************/ + /* ************************************************************************ */ // Helper function. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the parent table's next row increment. diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTableSelectSort.php b/web/modules/webform/src/Plugin/WebformElement/WebformTableSelectSort.php index 32ca04eca4..7f5ea6ad0d 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTableSelectSort.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTableSelectSort.php @@ -33,7 +33,7 @@ protected function defineDefaultProperties() { ] + parent::defineDefaultProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTableSort.php b/web/modules/webform/src/Plugin/WebformElement/WebformTableSort.php index 4e270b40dc..c908987652 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTableSort.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTableSort.php @@ -32,7 +32,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTableTrait.php b/web/modules/webform/src/Plugin/WebformElement/WebformTableTrait.php index a5b8cf911e..eeae25d898 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTableTrait.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTableTrait.php @@ -84,8 +84,8 @@ public function form(array $form, FormStateInterface $form_state) { ]; $form['form']['display_container']['title_display']['#options'] = [ - 'header' => $this->t('Header'), - ] + $form['form']['display_container']['title_display']['#options']; + 'header' => $this->t('Header'), + ] + $form['form']['display_container']['title_display']['#options']; return $form; } @@ -177,7 +177,7 @@ public static function processTableSelectOptions(array $element) { // checkboxes and radios. $element[$key]['#error_no_message'] = TRUE; - // Add required attribute to table select radios + // Add required attribute to table select radios. if (!empty($element['#required']) && empty($element['#multiple'])) { $element[$key]['#attributes']['required'] = TRUE; } diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTelephone.php b/web/modules/webform/src/Plugin/WebformElement/WebformTelephone.php index f913e16a93..efe0e8135f 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTelephone.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTelephone.php @@ -33,7 +33,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTermCheckboxes.php b/web/modules/webform/src/Plugin/WebformElement/WebformTermCheckboxes.php index 1b053f989d..7d572c059c 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTermCheckboxes.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTermCheckboxes.php @@ -43,7 +43,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTermSelect.php b/web/modules/webform/src/Plugin/WebformElement/WebformTermSelect.php index f1f50a7ed3..85588fe5ab 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTermSelect.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTermSelect.php @@ -41,7 +41,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTermsOfService.php b/web/modules/webform/src/Plugin/WebformElement/WebformTermsOfService.php index 7565369745..955cabdd3d 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTermsOfService.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTermsOfService.php @@ -47,7 +47,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['terms_title', 'terms_content']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformTime.php b/web/modules/webform/src/Plugin/WebformElement/WebformTime.php index 3e4dc75747..0c2e0c7c74 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformTime.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformTime.php @@ -35,7 +35,7 @@ protected function defineDefaultProperties() { + $this->defineDefaultMultipleProperties(); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -65,7 +65,7 @@ protected function formatTextItem(array $element, WebformSubmissionInterface $we $format = $this->getItemFormat($element); if ($format === 'value') { - $time_format = (isset($element['#time_format'])) ? $element['#time_format'] : 'H:i'; + $time_format = $element['#time_format'] ?? 'H:i'; return static::formatTime($time_format, strtotime($value)); } diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformVariant.php b/web/modules/webform/src/Plugin/WebformElement/WebformVariant.php index cc681f415f..21c0125e76 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformVariant.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformVariant.php @@ -64,7 +64,7 @@ protected function defineDefaultProperties() { return $properties; } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElement/WebformWizardPage.php b/web/modules/webform/src/Plugin/WebformElement/WebformWizardPage.php index e73b135c94..e7743bea6f 100644 --- a/web/modules/webform/src/Plugin/WebformElement/WebformWizardPage.php +++ b/web/modules/webform/src/Plugin/WebformElement/WebformWizardPage.php @@ -5,7 +5,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\webform\Plugin\WebformElementWizardPageInterface; use Drupal\webform\Utility\WebformElementHelper; -use Drupal\webform\WebformInterface; use Drupal\webform\WebformSubmissionInterface; /** @@ -49,7 +48,7 @@ protected function defineTranslatableProperties() { return array_merge(parent::defineTranslatableProperties(), ['prev_button_label', 'next_button_label']); } - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/Plugin/WebformElementAttachmentInterface.php b/web/modules/webform/src/Plugin/WebformElementAttachmentInterface.php index c1d76d46a9..c0be8e8da1 100644 --- a/web/modules/webform/src/Plugin/WebformElementAttachmentInterface.php +++ b/web/modules/webform/src/Plugin/WebformElementAttachmentInterface.php @@ -63,7 +63,7 @@ public function hasExportAttachments(); /** * Get attachment export batch limit. * - * @return int|NULL + * @return int|null * Batch limit or NULL if the batch limit should not be overidden. */ public function getExportAttachmentsBatchLimit(); diff --git a/web/modules/webform/src/Plugin/WebformElementBase.php b/web/modules/webform/src/Plugin/WebformElementBase.php index 420285f971..8bedd16103 100644 --- a/web/modules/webform/src/Plugin/WebformElementBase.php +++ b/web/modules/webform/src/Plugin/WebformElementBase.php @@ -153,9 +153,9 @@ public static function create(ContainerInterface $container, array $configuratio return $instance; } - /****************************************************************************/ + /* ************************************************************************ */ // Property definitions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Define an element's default properties. @@ -302,9 +302,9 @@ protected function defineTranslatableProperties() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Property methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -360,7 +360,7 @@ public function getDefaultProperty($property_name) { * {@inheritdoc} */ public function getElementProperty(array $element, $property_name) { - return (isset($element["#$property_name"])) ? $element["#$property_name"] : $this->getDefaultProperty($property_name); + return $element["#$property_name"] ?? $this->getDefaultProperty($property_name); } /** @@ -407,9 +407,9 @@ protected function getElementInfoDefaultProperty(array $element, $property_name) ?: $this->elementInfo->getInfoProperty("webform_$type", $property_name, NULL); } - /****************************************************************************/ + /* ************************************************************************ */ // Definition and meta data methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -466,7 +466,7 @@ public function getTypeName() { * {@inheritdoc} */ public function getDefaultKey() { - return (isset($this->pluginDefinition['default_key'])) ? $this->pluginDefinition['default_key'] : NULL; + return $this->pluginDefinition['default_key'] ?? NULL; } /** @@ -603,9 +603,9 @@ public function getInfo() { return $this->elementInfo->getInfo($this->getBaseId()); } - /****************************************************************************/ + /* ************************************************************************ */ // Element relationship methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -656,9 +656,9 @@ public function getRelatedTypes(array $element) { return $types; } - /****************************************************************************/ + /* ************************************************************************ */ // Element rendering methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1117,7 +1117,7 @@ public static function preRenderFixFlexboxWrapper(array $element) { return $element; } - $flex = (isset($element['#flex'])) ? $element['#flex'] : 1; + $flex = $element['#flex'] ?? 1; $element += ['#prefix' => '', '#suffix' => '']; $element['#prefix'] = '<div class="webform-flex webform-flex--' . $flex . '"><div class="webform-flex--container">' . $element['#prefix']; $element['#suffix'] = $element['#suffix'] . '</div></div>'; @@ -1171,7 +1171,7 @@ protected function prepareMultipleWrapper(array &$element) { foreach ($multiple_properties as $multiple_property => $multiple_value) { if (strpos($multiple_property, 'multiple__') === 0) { $property_name = str_replace('multiple__', '', $multiple_property); - $element["#$property_name"] = (isset($element["#$multiple_property"])) ? $element["#$multiple_property"] : $multiple_value; + $element["#$property_name"] = $element["#$multiple_property"] ?? $multiple_value; } } @@ -1241,9 +1241,9 @@ public function getKey(array $element) { return $element['#webform_key']; } - /****************************************************************************/ + /* ************************************************************************ */ // Display submission value methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1483,7 +1483,7 @@ protected function formatHtmlItems(array &$element, WebformSubmissionInterface $ 'comma' => ', ', 'space' => ' ', ]; - $delimiter = (isset($delimiters[$format])) ? $delimiters[$format] : $format; + $delimiter = $delimiters[$format] ?? $format; $total = count($items); @@ -1517,7 +1517,7 @@ protected function formatTextItems(array &$element, WebformSubmissionInterface $ // Get items. $items = []; foreach (array_keys($value) as $delta) { - $item = $this->formatTextItem($element, $webform_submission, ['delta' => $delta] + $options);; + $item = $this->formatTextItem($element, $webform_submission, ['delta' => $delta] + $options); if ($item) { $items[] = $item; } @@ -1561,7 +1561,7 @@ protected function formatTextItems(array &$element, WebformSubmissionInterface $ 'comma' => ', ', 'space' => ' ', ]; - $delimiter = (isset($delimiters[$format])) ? $delimiters[$format] : $format; + $delimiter = $delimiters[$format] ?? $format; return implode($delimiter, $items); } } @@ -1702,7 +1702,7 @@ public function getValue(array $element, WebformSubmissionInterface $webform_sub return $element['#value']; } - $webform_key = (isset($options['webform_key'])) ? $options['webform_key'] : $element['#webform_key']; + $webform_key = $options['webform_key'] ?? $element['#webform_key']; $value = $webform_submission->getElementData($webform_key); // Is value is NULL and there is a #default_value, then use it. if ($value === NULL && isset($element['#default_value'])) { @@ -1714,13 +1714,13 @@ public function getValue(array $element, WebformSubmissionInterface $webform_sub // Return $options['delta'] which is used by tokens. // @see _webform_token_get_submission_value() if (isset($options['delta'])) { - $value = (isset($value[$options['delta']])) ? $value[$options['delta']] : NULL; + $value = $value[$options['delta']] ?? NULL; } // Return $options['composite_key'] which is used by composite elements. // @see \Drupal\webform\Plugin\WebformElement\WebformCompositeBase::formatTableColumn if ($value && isset($options['composite_key'])) { - $value = (isset($value[$options['composite_key']])) ? $value[$options['composite_key']] : NULL; + $value = $value[$options['composite_key']] ?? NULL; } } @@ -1802,9 +1802,9 @@ public function getItemsFormat(array $element) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Preview method. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1816,9 +1816,9 @@ public function preview() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Test methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1827,9 +1827,9 @@ public function getTestValues(array $element, WebformInterface $webform, array $ return FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // Table methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1865,9 +1865,9 @@ public function isEmptyExcluded(array $element, array $options) { return !empty($options['exclude_empty']); } - /****************************************************************************/ + /* ************************************************************************ */ // Export methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1933,9 +1933,9 @@ public function buildExportRecord(array $element, WebformSubmissionInterface $we return [$this->formatText($element, $webform_submission, $export_options)]; } - /****************************************************************************/ + /* ************************************************************************ */ // Validation methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Form API callback. Validate element #minlength value. @@ -2111,9 +2111,9 @@ public static function validateMultiple(array &$element, FormStateInterface $for } } - /****************************************************************************/ + /* ************************************************************************ */ // #states API methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -2234,9 +2234,9 @@ public function getElementSelectorInputValue($selector, $trigger, array $element } } - /****************************************************************************/ + /* ************************************************************************ */ // Operation methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -2273,9 +2273,9 @@ public function preSave(array &$element, WebformSubmissionInterface $webform_sub */ public function postSave(array &$element, WebformSubmissionInterface $webform_submission, $update = TRUE) {} - /****************************************************************************/ + /* ************************************************************************ */ // Element configuration methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -2294,9 +2294,9 @@ public function form(array $form, FormStateInterface $form_state) { $element_properties = $form_state->get('element_properties'); - /**************************************************************************/ + /* ********************************************************************** */ // General. - /**************************************************************************/ + /* ********************************************************************** */ /* Element settings */ @@ -2754,9 +2754,9 @@ public function form(array $form, FormStateInterface $form_state) { '#options' => [0 => $this->t('0 (none)')] + array_combine($flex_range, $flex_range), ]; - /**************************************************************************/ + /* ********************************************************************** */ // Conditions. - /**************************************************************************/ + /* ********************************************************************** */ /* Conditional logic */ @@ -2794,9 +2794,9 @@ public function form(array $form, FormStateInterface $form_state) { ]; } - /**************************************************************************/ + /* ********************************************************************** */ // Advanced. - /**************************************************************************/ + /* ********************************************************************** */ /* Default value */ @@ -2963,9 +2963,11 @@ public function form(array $form, FormStateInterface $form_state) { 'form_element' => $this->t('Form element'), 'container' => $this->t('Container'), ], + // phpcs:disable '#description' => '<b>' . $this->t('Fieldset') . ':</b> ' . $this->t('Wraps inputs in a fieldset.') . ' <strong>' . $this->t('Recommended') . '</strong>' . '<br/><br/><b>' . $this->t('Form element') . ':</b> ' . $this->t('Wraps inputs in a basic form element with title and description.') . '<br/><br/><b>' . $this->t('Container') . ':</b> ' . $this->t('Wraps inputs in a basic div with no title or description.'), + // phpcs:enable ]; // Hide element description and display when using a container wrapper. if ($this->hasProperty('wrapper_type')) { @@ -3075,7 +3077,7 @@ public function form(array $form, FormStateInterface $form_state) { '#description' => $this->t('Select how a single value is displayed.'), '#options' => WebformOptionsHelper::appendValueToText($this->getItemFormats()), ]; - $format = isset($element_properties['format']) ? $element_properties['format'] : NULL; + $format = $element_properties['format'] ?? NULL; $format_custom = ($has_edit_twig_access || $format === 'custom'); if ($format_custom) { $form['display']['item']['format']['#options'] += ['custom' => $this->t('Custom…')]; @@ -3148,7 +3150,7 @@ public function form(array $form, FormStateInterface $form_state) { '#description' => $this->t('Select how multiple values are displayed.'), '#options' => WebformOptionsHelper::appendValueToText($this->getItemsFormats()), ]; - $format_items = isset($element_properties['format_items']) ? $element_properties['format_items'] : NULL; + $format_items = $element_properties['format_items'] ?? NULL; $format_items_custom = ($has_edit_twig_access || $format_items === 'custom'); if ($format_items_custom) { $form['display']['items']['format_items']['#options'] += ['custom' => $this->t('Custom…')]; @@ -3222,9 +3224,9 @@ public function form(array $form, FormStateInterface $form_state) { '#description' => $this->t("Admin notes/comments are display next to the element title in the form builder and visible in the form's YAML source"), ]; - /**************************************************************************/ + /* ********************************************************************** */ // Access. - /**************************************************************************/ + /* ********************************************************************** */ /* Access */ @@ -3261,7 +3263,7 @@ public function form(array $form, FormStateInterface $form_state) { ':input[name="properties[access]"]' => [ 'checked' => TRUE, ], - ] + ], ], ]; $form['access']['access_' . $operation]['access_' . $operation . '_roles'] = [ @@ -3287,7 +3289,7 @@ public function form(array $form, FormStateInterface $form_state) { '#return_value' => TRUE, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Disable #multiple if the element has submission data. if (!$form_object->isNew() && $this->hasProperty('multiple')) { @@ -3388,7 +3390,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#description' => $this->t('Properties do not have to be prepended with a hash (#) character, the hash character will be automatically added to the custom properties.') . '<br /><br />' . $this->t('These properties and callbacks are not allowed: @properties', ['@properties' => WebformArrayHelper::toString(WebformArrayHelper::addPrefix(WebformElementHelper::$ignoredProperties))]), - '#default_value' => $custom_properties , + '#default_value' => $custom_properties, '#parents' => ['properties', 'custom'], ]; @@ -3542,7 +3544,7 @@ protected function setConfigurationFormDefaultValueRecursive(array &$form, array */ protected function setConfigurationFormDefaultValue(array &$form, array &$element_properties, array &$property_element, $property_name) { $default_value = $element_properties[$property_name]; - $type = (isset($property_element['#type'])) ? $property_element['#type'] : NULL; + $type = $property_element['#type'] ?? NULL; switch ($type) { case 'entity_autocomplete': diff --git a/web/modules/webform/src/Plugin/WebformElementInterface.php b/web/modules/webform/src/Plugin/WebformElementInterface.php index 35c484fa18..48e7db9cd8 100644 --- a/web/modules/webform/src/Plugin/WebformElementInterface.php +++ b/web/modules/webform/src/Plugin/WebformElementInterface.php @@ -22,9 +22,9 @@ */ interface WebformElementInterface extends PluginInspectionInterface, PluginFormInterface, ContainerFactoryPluginInterface, WebformEntityInjectionInterface { - /****************************************************************************/ + /* ************************************************************************ */ // Property methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get default properties. @@ -79,9 +79,9 @@ public function getElementProperty(array $element, $property_name); */ public function hasProperty($property_name); - /****************************************************************************/ + /* ************************************************************************ */ // Definition and meta data methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the Webform element's form element class definition. @@ -289,9 +289,9 @@ public function hasManagedFiles(array $element); */ public function getInfo(); - /****************************************************************************/ + /* ************************************************************************ */ // Element relationship methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get related element types. @@ -304,9 +304,9 @@ public function getInfo(); */ public function getRelatedTypes(array $element); - /****************************************************************************/ + /* ************************************************************************ */ // Element rendering methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Initialize an element to be displayed, rendered, or exported. @@ -441,9 +441,9 @@ public function getAdminLabel(array $element); */ public function getKey(array $element); - /****************************************************************************/ + /* ************************************************************************ */ // Display submission value methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build an element as HTML element. @@ -617,9 +617,9 @@ public function getItemsFormat(array $element); */ public function isEmptyExcluded(array $element, array $options); - /****************************************************************************/ + /* ************************************************************************ */ // Preview method. - /****************************************************************************/ + /* ************************************************************************ */ /** * Generate a renderable preview of the element. @@ -629,9 +629,9 @@ public function isEmptyExcluded(array $element, array $options); */ public function preview(); - /****************************************************************************/ + /* ************************************************************************ */ // Test methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get test values for an element. @@ -648,9 +648,9 @@ public function preview(); */ public function getTestValues(array $element, WebformInterface $webform, array $options); - /****************************************************************************/ + /* ************************************************************************ */ // Table methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get element's table column(s) settings. @@ -678,9 +678,9 @@ public function getTableColumn(array $element); */ public function formatTableColumn(array $element, WebformSubmissionInterface $webform_submission, array $options = []); - /****************************************************************************/ + /* ************************************************************************ */ // Export methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an element's default export options. @@ -750,9 +750,9 @@ public function buildExportHeader(array $element, array $options); */ public function buildExportRecord(array $element, WebformSubmissionInterface $webform_submission, array $export_options); - /****************************************************************************/ + /* ************************************************************************ */ // #states API methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an element's supported states as options. @@ -805,9 +805,9 @@ public function getElementSelectorSourceValues(array $element); */ public function getElementSelectorInputValue($selector, $trigger, array $element, WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Operation methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Changes the values of an entity before it is created. @@ -873,9 +873,9 @@ public function postSave(array &$element, WebformSubmissionInterface $webform_su */ public function postDelete(array &$element, WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Element configuration methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get configuration form's off-canvas width. diff --git a/web/modules/webform/src/Plugin/WebformElementManager.php b/web/modules/webform/src/Plugin/WebformElementManager.php index 3757e6cac1..8c6390ad79 100644 --- a/web/modules/webform/src/Plugin/WebformElementManager.php +++ b/web/modules/webform/src/Plugin/WebformElementManager.php @@ -274,7 +274,7 @@ public function getElementInstance(array $element, EntityInterface $entity = NUL * {@inheritdoc} */ public function getSortedDefinitions(array $definitions = NULL, $sort_by = 'label') { - $definitions = isset($definitions) ? $definitions : $this->getDefinitions(); + $definitions = $definitions ?? $this->getDefinitions(); switch ($sort_by) { case 'category': @@ -298,7 +298,7 @@ public function getSortedDefinitions(array $definitions = NULL, $sort_by = 'labe */ public function getGroupedDefinitions(array $definitions = NULL, $label_key = 'label') { /** @var \Drupal\Core\Plugin\CategorizingPluginManagerTrait|\Drupal\Component\Plugin\PluginManagerInterface $this */ - $definitions = $this->getSortedDefinitions(isset($definitions) ? $definitions : $this->getDefinitions(), $label_key); + $definitions = $this->getSortedDefinitions($definitions ?? $this->getDefinitions(), $label_key); // Organize grouped definition with basic and advanced first and other last. $basic_category = (string) $this->t('Basic elements'); @@ -324,7 +324,7 @@ public function getGroupedDefinitions(array $definitions = NULL, $label_key = 'l * {@inheritdoc} */ public function removeExcludeDefinitions(array $definitions) { - $definitions = isset($definitions) ? $definitions : $this->getDefinitions(); + $definitions = $definitions ?? $this->getDefinitions(); $excluded = $this->configFactory->get('webform.settings')->get('element.excluded_elements'); return $excluded ? array_diff_key($definitions, $excluded) : $definitions; } diff --git a/web/modules/webform/src/Plugin/WebformExporter/TabularBaseWebformExporter.php b/web/modules/webform/src/Plugin/WebformExporter/TabularBaseWebformExporter.php index c46fbc4b77..bbabff3bf2 100644 --- a/web/modules/webform/src/Plugin/WebformExporter/TabularBaseWebformExporter.php +++ b/web/modules/webform/src/Plugin/WebformExporter/TabularBaseWebformExporter.php @@ -43,9 +43,9 @@ public static function create(ContainerInterface $container, array $configuratio return $instance; } - /****************************************************************************/ + /* ************************************************************************ */ // Header. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build export header using webform submission field definitions and webform element columns. @@ -78,9 +78,9 @@ protected function buildHeader() { return $header; } - /****************************************************************************/ + /* ************************************************************************ */ // Record. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build export record using a webform submission. @@ -166,9 +166,9 @@ protected function formatRecordFieldDefinitionValue(array &$record, WebformSubmi } } - /****************************************************************************/ + /* ************************************************************************ */ // Webform definitions and elements. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get a webform's field definitions. diff --git a/web/modules/webform/src/Plugin/WebformExporterBase.php b/web/modules/webform/src/Plugin/WebformExporterBase.php index 082ed44f77..bc074df0e8 100644 --- a/web/modules/webform/src/Plugin/WebformExporterBase.php +++ b/web/modules/webform/src/Plugin/WebformExporterBase.php @@ -327,9 +327,9 @@ public function getBatchLimit() { return $this->configFactory->get('webform.settings')->get('batch.default_batch_export_size') ?: 500; } - /****************************************************************************/ + /* ************************************************************************ */ // Archive helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Add file, directory, or content to Tar archive. @@ -389,7 +389,7 @@ protected function addToZipFile($path, $name, array $options = []) { if (is_dir($path)) { // Add directory to ZIP file. $options += ['add_path' => $name . '/']; - $this->archive->addPattern('/\.[a-z0-9]+$/', $path, $options); + $this->archive->addPattern('/\.[a-zA-Z0-9]+$/', $path, $options); } else { // Add file to ZIP file. diff --git a/web/modules/webform/src/Plugin/WebformExporterManager.php b/web/modules/webform/src/Plugin/WebformExporterManager.php index 13dc24cc97..6a0f1ff142 100644 --- a/web/modules/webform/src/Plugin/WebformExporterManager.php +++ b/web/modules/webform/src/Plugin/WebformExporterManager.php @@ -64,7 +64,7 @@ public function getSortedDefinitions(array $definitions = NULL, $sort_by = 'labe * {@inheritdoc} */ public function removeExcludeDefinitions(array $definitions) { - $definitions = isset($definitions) ? $definitions : $this->getDefinitions(); + $definitions = $definitions ?? $this->getDefinitions(); $excluded = $this->configFactory->get('webform.settings')->get('export.excluded_exporters'); return $excluded ? array_diff_key($definitions, $excluded) : $definitions; } diff --git a/web/modules/webform/src/Plugin/WebformHandler/ActionWebformHandler.php b/web/modules/webform/src/Plugin/WebformHandler/ActionWebformHandler.php index 1c9fb8bf42..4aedaa1835 100644 --- a/web/modules/webform/src/Plugin/WebformHandler/ActionWebformHandler.php +++ b/web/modules/webform/src/Plugin/WebformHandler/ActionWebformHandler.php @@ -178,7 +178,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta foreach ($elements as $element_key => $element) { $elements_rows[] = [ $element_key, - (isset($element['#title']) ? $element['#title'] : ''), + ($element['#title'] ?? ''), ]; } $form['actions']['elements'] = [ @@ -259,9 +259,9 @@ public function postSave(WebformSubmissionInterface $webform_submission, $update } } - /****************************************************************************/ + /* ************************************************************************ */ // Action helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Execute this action. diff --git a/web/modules/webform/src/Plugin/WebformHandler/DebugWebformHandler.php b/web/modules/webform/src/Plugin/WebformHandler/DebugWebformHandler.php index 9aa318346c..ef03e1eaeb 100644 --- a/web/modules/webform/src/Plugin/WebformHandler/DebugWebformHandler.php +++ b/web/modules/webform/src/Plugin/WebformHandler/DebugWebformHandler.php @@ -2,15 +2,10 @@ namespace Drupal\webform\Plugin\WebformHandler; -use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Logger\LoggerChannelFactoryInterface; -use Drupal\Core\Render\RendererInterface; use Drupal\webform\Plugin\WebformHandlerBase; use Drupal\webform\Utility\WebformElementHelper; use Drupal\webform\Utility\WebformYaml; -use Drupal\webform\WebformSubmissionConditionsValidatorInterface; use Drupal\webform\WebformSubmissionInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/web/modules/webform/src/Plugin/WebformHandler/EmailWebformHandler.php b/web/modules/webform/src/Plugin/WebformHandler/EmailWebformHandler.php index a71ebbefb9..62229572fc 100644 --- a/web/modules/webform/src/Plugin/WebformHandler/EmailWebformHandler.php +++ b/web/modules/webform/src/Plugin/WebformHandler/EmailWebformHandler.php @@ -894,7 +894,7 @@ public function getMessage(WebformSubmissionInterface $webform_submission) { foreach ($this->configuration as $configuration_key => $configuration_value) { // Get configuration name (to, cc, bcc, from, name, subject, mail) // and type (mail, options, or text). - list($configuration_name, $configuration_type) = (strpos($configuration_key, '_') !== FALSE) ? explode('_', $configuration_key) : [$configuration_key, 'text']; + [$configuration_name, $configuration_type] = (strpos($configuration_key, '_') !== FALSE) ? explode('_', $configuration_key) : [$configuration_key, 'text']; // Set options and continue. if ($configuration_type === 'options') { @@ -1135,6 +1135,7 @@ public function sendMessage(WebformSubmissionInterface $webform_submission, arra // Don't send the message if the From address is not valid. if (class_exists('\Symfony\Component\Mime\Address')) { try { + // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing \Symfony\Component\Mime\Address::create($from); } catch (\Exception $exception) { @@ -1508,7 +1509,7 @@ protected function getBodyDefaultValues($format = NULL) { * A select other element. */ protected function buildElement($name, $title, $label, $required = FALSE, array $element_options = [], array $options_options = NULL, array $role_options = NULL, array $other_options = NULL) { - list($element_name, $element_type) = (strpos($name, '_') !== FALSE) ? explode('_', $name) : [$name, 'text']; + [$element_name, $element_type] = (strpos($name, '_') !== FALSE) ? explode('_', $name) : [$name, 'text']; $default_option = $this->getDefaultConfigurationValue($name); @@ -1677,10 +1678,10 @@ protected function buildAttachments(array $attachments) { ]; if (!empty($attachment['_fileurl'])) { $t_args[':href'] = $attachment['_fileurl']; - $build[] = ['#markup' => $this->t('<strong><a href=":href">@filename</a></strong> (@filemime) - @filesize ', $t_args)]; + $build[] = ['#markup' => $this->t('<strong><a href=":href">@filename</a></strong> (@filemime) - @filesize', $t_args)]; } else { - $build[] = ['#markup' => $this->t('<strong>@filename</strong> (@filemime) - @filesize ', $t_args)]; + $build[] = ['#markup' => $this->t('<strong>@filename</strong> (@filemime) - @filesize', $t_args)]; } } return $build; diff --git a/web/modules/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php b/web/modules/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php index ec4ad24960..23d66950b4 100644 --- a/web/modules/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php +++ b/web/modules/webform/src/Plugin/WebformHandler/RemotePostWebformHandler.php @@ -273,12 +273,14 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#title' => $this->t('Method'), '#description' => $this->t('The <b>POST</b> request method requests that a web server accept the data enclosed in the body of the request message. It is often used when uploading a file or when submitting a completed webform. In contrast, the HTTP <b>GET</b> request method retrieves information from the server.'), '#required' => TRUE, + // phpcs:disable DrupalPractice.General.OptionsT.TforValue '#options' => [ 'POST' => 'POST', 'PUT' => 'PUT', 'PATCH' => 'PATCH', 'GET' => 'GET', ], + // phpcs:enable DrupalPractice.General.OptionsT.TforValue '#default_value' => $this->configuration['method'], ]; $form['additional']['type'] = [ @@ -420,7 +422,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta ]; $form['submission_data']['managed_file_message_no_data'] = [ '#type' => 'webform_message', - '#message_message' => $this->t('Upload files will include the file\'s id, name and uri.'), + '#message_message' => $this->t("Upload files will include the file's id, name and uri."), '#message_type' => 'warning', '#message_close' => TRUE, '#message_id' => 'webform_node.references', @@ -855,9 +857,9 @@ protected function isConvertEnabled() { return $this->isDraftEnabled() && ($this->getWebform()->getSetting('form_convert_anonymous') === TRUE); } - /****************************************************************************/ + /* ************************************************************************ */ // Debug and exception handlers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Display debugging information. diff --git a/web/modules/webform/src/Plugin/WebformHandler/SettingsWebformHandler.php b/web/modules/webform/src/Plugin/WebformHandler/SettingsWebformHandler.php index b6823d9f9e..e99ee70632 100644 --- a/web/modules/webform/src/Plugin/WebformHandler/SettingsWebformHandler.php +++ b/web/modules/webform/src/Plugin/WebformHandler/SettingsWebformHandler.php @@ -133,7 +133,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#type' => 'textfield', '#title' => $this->t('Confirmation URL'), '#description' => $this->t('The URL or path to redirect the user to upon successful submission.') . - '<br/>' . t('Paths beginning with a forward slash (/) will redirect be treated as root-relative. Paths without a forward slash (/) will redirect be treated as Drupal relative path.'), + '<br/>' . $this->t('Paths beginning with a forward slash (/) will redirect be treated as root-relative. Paths without a forward slash (/) will redirect be treated as Drupal relative path.'), '#default_value' => $this->configuration['confirmation_url'], '#access' => !empty($this->configuration['confirmation_url']) || $has_confirmation_url, '#maxlength' => NULL, @@ -270,9 +270,9 @@ public function overrideSettings(array &$settings, WebformSubmissionInterface $w $this->displayDebug($webform_submission); } - /****************************************************************************/ + /* ************************************************************************ */ // Debug handlers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Display debugging information about the current action. @@ -329,9 +329,9 @@ protected function displayDebug(WebformSubmissionInterface $webform_submission) $this->messenger()->addWarning($this->renderer->renderPlain($build)); } - /****************************************************************************/ + /* ************************************************************************ */ // Settings helpers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get webform setting definitions. diff --git a/web/modules/webform/src/Plugin/WebformHandlerBase.php b/web/modules/webform/src/Plugin/WebformHandlerBase.php index f3f5d8b11c..2ad9d2968f 100644 --- a/web/modules/webform/src/Plugin/WebformHandlerBase.php +++ b/web/modules/webform/src/Plugin/WebformHandlerBase.php @@ -115,7 +115,7 @@ abstract class WebformHandlerBase extends PluginBase implements WebformHandlerIn /** * The webform submission (server-side) conditions (#states) validator. * - * @var \Drupal\webform\WebformSubmissionConditionsValidator + * @var \Drupal\webform\WebformSubmissionConditionsValidatorInterface */ protected $conditionsValidator; @@ -136,7 +136,6 @@ abstract class WebformHandlerBase extends PluginBase implements WebformHandlerIn * "LogicException: The database connection is not serializable." exceptions * from being thrown when a form is serialized via an Ajax callback and/or * form build. - * */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $instance = new static($configuration, $plugin_id, $plugin_definition); @@ -490,9 +489,9 @@ protected function applyFormStateToConfiguration(FormStateInterface $form_state) } } - /****************************************************************************/ + /* ************************************************************************ */ // Webform methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -504,18 +503,18 @@ public function alterElements(array &$elements, WebformInterface $webform) {} */ public function alterElement(array &$element, FormStateInterface $form_state, array $context) {} - /****************************************************************************/ + /* ************************************************************************ */ // Webform submission methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} */ public function overrideSettings(array &$settings, WebformSubmissionInterface $webform_submission) {} - /****************************************************************************/ + /* ************************************************************************ */ // Submission form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -542,9 +541,9 @@ public function submitForm(array &$form, FormStateInterface $form_state, Webform */ public function confirmForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {} - /****************************************************************************/ + /* ************************************************************************ */ // Submission methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -598,18 +597,18 @@ public function access(WebformSubmissionInterface $webform_submission, $operatio return AccessResult::neutral(); } - /****************************************************************************/ + /* ************************************************************************ */ // Preprocessing methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} */ public function preprocessConfirmation(array &$variables) {} - /****************************************************************************/ + /* ************************************************************************ */ // Handler methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -626,9 +625,9 @@ public function updateHandler() {} */ public function deleteHandler() {} - /****************************************************************************/ + /* ************************************************************************ */ // Element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -652,9 +651,9 @@ public function updateElement($key, array $element, array $original_element) {} */ public function deleteElement($key, array $element) {} - /****************************************************************************/ + /* ************************************************************************ */ // Form helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set configuration settings parents. @@ -717,9 +716,9 @@ protected function setSettingsParentsRecursively(array &$elements) { return $elements; } - /****************************************************************************/ + /* ************************************************************************ */ // Token methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Replace tokens in text with no render context. @@ -776,9 +775,9 @@ protected function elementTokenValidate(array &$form, array $token_types = ['web return $this->tokenManager->elementValidate($form, $token_types); } - /****************************************************************************/ + /* ************************************************************************ */ // Logging methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get webform or webform_submission logger. diff --git a/web/modules/webform/src/Plugin/WebformHandlerInterface.php b/web/modules/webform/src/Plugin/WebformHandlerInterface.php index 2ac93902a8..32e7883cef 100644 --- a/web/modules/webform/src/Plugin/WebformHandlerInterface.php +++ b/web/modules/webform/src/Plugin/WebformHandlerInterface.php @@ -304,9 +304,9 @@ public function hasAnonymousSubmissionTracking(); */ public function checkConditions(WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Webform methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Alter webform submission webform elements. @@ -336,9 +336,9 @@ public function alterElements(array &$elements, WebformInterface $webform); */ public function alterElement(array &$element, FormStateInterface $form_state, array $context); - /****************************************************************************/ + /* ************************************************************************ */ // Webform submission methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Alter/override a webform submission webform settings. @@ -353,9 +353,9 @@ public function alterElement(array &$element, FormStateInterface $form_state, ar */ public function overrideSettings(array &$settings, WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Submission form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get configuration form's off-canvas width. @@ -430,9 +430,9 @@ public function submitForm(array &$form, FormStateInterface $form_state, Webform */ public function confirmForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Submission methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Changes the values of an entity before it is created. @@ -533,9 +533,9 @@ public function postDelete(WebformSubmissionInterface $webform_submission); */ public function access(WebformSubmissionInterface $webform_submission, $operation, AccountInterface $account = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Preprocessing methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Prepares variables for webform confirmation templates. @@ -550,9 +550,9 @@ public function access(WebformSubmissionInterface $webform_submission, $operatio */ public function preprocessConfirmation(array &$variables); - /****************************************************************************/ + /* ************************************************************************ */ // Handler methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Acts on handler after it has been created and added to webform. @@ -569,9 +569,9 @@ public function updateHandler(); */ public function deleteHandler(); - /****************************************************************************/ + /* ************************************************************************ */ // Element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Controls entity operation access to webform submission element. diff --git a/web/modules/webform/src/Plugin/WebformHandlerManager.php b/web/modules/webform/src/Plugin/WebformHandlerManager.php index 5319a62b75..20d0491e8e 100644 --- a/web/modules/webform/src/Plugin/WebformHandlerManager.php +++ b/web/modules/webform/src/Plugin/WebformHandlerManager.php @@ -75,7 +75,7 @@ public function getGroupedDefinitions(array $definitions = NULL) { * {@inheritdoc} */ public function removeExcludeDefinitions(array $definitions) { - $definitions = isset($definitions) ? $definitions : $this->getDefinitions(); + $definitions = $definitions ?? $this->getDefinitions(); // Exclude 'broken' handler. unset($definitions['broken']); diff --git a/web/modules/webform/src/Plugin/WebformPluginSettingsInterface.php b/web/modules/webform/src/Plugin/WebformPluginSettingsInterface.php index 9a8f7764bd..521f14919f 100644 --- a/web/modules/webform/src/Plugin/WebformPluginSettingsInterface.php +++ b/web/modules/webform/src/Plugin/WebformPluginSettingsInterface.php @@ -26,7 +26,7 @@ public function getSettings(); public function setSettings(array $settings); /** - * Returns the plugin setting for given key + * Returns the plugin setting for given key. * * @param string $key * The key of the plugin setting to retrieve. diff --git a/web/modules/webform/src/Plugin/WebformPluginSettingsTrait.php b/web/modules/webform/src/Plugin/WebformPluginSettingsTrait.php index 6e915c81e5..1277f550de 100644 --- a/web/modules/webform/src/Plugin/WebformPluginSettingsTrait.php +++ b/web/modules/webform/src/Plugin/WebformPluginSettingsTrait.php @@ -30,7 +30,7 @@ public function setSettings(array $settings) { */ public function getSetting($key) { $configuration = $this->getConfiguration(); - return (isset($configuration['settings'][$key])) ? $configuration['settings'][$key] : NULL; + return $configuration['settings'][$key] ?? NULL; } /** diff --git a/web/modules/webform/src/Plugin/WebformSourceEntityManager.php b/web/modules/webform/src/Plugin/WebformSourceEntityManager.php index 80ddc2adf1..06721db05e 100644 --- a/web/modules/webform/src/Plugin/WebformSourceEntityManager.php +++ b/web/modules/webform/src/Plugin/WebformSourceEntityManager.php @@ -66,6 +66,7 @@ protected function alterDefinitions(&$definitions) { */ public static function getMainSourceEntity(EntityInterface $source_entity) { if (\Drupal::moduleHandler()->moduleExists('paragraphs')) { + // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing while ($source_entity instanceof \Drupal\paragraphs\Entity\Paragraph) { $source_entity = $source_entity->getParentEntity(); } diff --git a/web/modules/webform/src/Plugin/WebformVariant/OverrideWebformVariant.php b/web/modules/webform/src/Plugin/WebformVariant/OverrideWebformVariant.php index d03cc7dced..0eb7f2c8d5 100644 --- a/web/modules/webform/src/Plugin/WebformVariant/OverrideWebformVariant.php +++ b/web/modules/webform/src/Plugin/WebformVariant/OverrideWebformVariant.php @@ -245,9 +245,9 @@ public function applyVariant() { return TRUE; } - /****************************************************************************/ + /* ************************************************************************ */ // Debug and exception handlers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Display debugging information. diff --git a/web/modules/webform/src/Plugin/WebformVariantInterface.php b/web/modules/webform/src/Plugin/WebformVariantInterface.php index f6cd1ff29c..699d6a008a 100644 --- a/web/modules/webform/src/Plugin/WebformVariantInterface.php +++ b/web/modules/webform/src/Plugin/WebformVariantInterface.php @@ -46,7 +46,7 @@ public function description(); /** * Returns the webform variant machine name replacement pattern. * - * @return string|NULL + * @return string|null * The webform variant machine name replacement pattern. */ public function getMachineNameReplacePattern(); @@ -54,7 +54,7 @@ public function getMachineNameReplacePattern(); /** * Returns the webform variant machine name replacement character. * - * @return string|NULL + * @return string|null * The webform variant machine name replacement character. */ public function getMachineNameReplace(); diff --git a/web/modules/webform/src/Plugin/WebformVariantManager.php b/web/modules/webform/src/Plugin/WebformVariantManager.php index 60cc083543..f4e27303f8 100644 --- a/web/modules/webform/src/Plugin/WebformVariantManager.php +++ b/web/modules/webform/src/Plugin/WebformVariantManager.php @@ -75,7 +75,7 @@ public function getGroupedDefinitions(array $definitions = NULL) { * {@inheritdoc} */ public function removeExcludeDefinitions(array $definitions) { - $definitions = isset($definitions) ? $definitions : $this->getDefinitions(); + $definitions = $definitions ?? $this->getDefinitions(); // Exclude 'broken' variant. unset($definitions['broken']); diff --git a/web/modules/webform/src/Twig/WebformTwigExtension.php b/web/modules/webform/src/Twig/WebformTwigExtension.php index 63a1781962..dbda433c3a 100644 --- a/web/modules/webform/src/Twig/WebformTwigExtension.php +++ b/web/modules/webform/src/Twig/WebformTwigExtension.php @@ -17,6 +17,11 @@ */ class WebformTwigExtension extends \Twig_Extension { + /** + * Twig options. + * + * @var string[] + */ protected static $options = [ 'html' => 'webform_token_options_html', 'email' => 'webform_token_options_email', @@ -138,12 +143,12 @@ public function webformToken($token, EntityInterface $entity = NULL, array $data return (WebformHtmlHelper::containsHtml($value)) ? ['#markup' => $value, '#allowed_tags' => WebformXss::getAdminTagList()] : $value; } - /****************************************************************************/ + /* ************************************************************************ */ // Token methods used by the 'WebformComputedTwig' and 'EmailWebformHandler'. // // @see \Drupal\webform\Plugin\WebformElement\WebformComputedTwig // @see \Drupal\webform\Plugin\WebformHandler\EmailWebformHandler - /****************************************************************************/ + /* ************************************************************************ */ /** * Build reusable Twig help. diff --git a/web/modules/webform/src/Utility/WebformDateHelper.php b/web/modules/webform/src/Utility/WebformDateHelper.php index 593c26ebdd..16bb765db8 100644 --- a/web/modules/webform/src/Utility/WebformDateHelper.php +++ b/web/modules/webform/src/Utility/WebformDateHelper.php @@ -149,7 +149,7 @@ public static function getIntervalOptionsFlattened() { public static function getIntervalText($interval) { $interval = ((string) $interval) ?: ''; $intervals = self::getIntervalOptionsFlattened(); - return (isset($intervals[$interval])) ? $intervals[$interval] : $intervals['']; + return $intervals[$interval] ?? $intervals['']; } /** @@ -252,7 +252,7 @@ protected static function convertDateStringToEnglish($format, $value) { } - // M = A short textual representation of a month, three letters. + // M = A short textual representation of a month, three letters. if (strpos($format, 'M') !== FALSE) { $month_names_abbr_untranslated = DateHelper::monthNamesAbbrUntranslated(); $month_names_abbr_translated = DateHelper::monthNamesAbbr(); diff --git a/web/modules/webform/src/Utility/WebformDialogHelper.php b/web/modules/webform/src/Utility/WebformDialogHelper.php index 40a5ae1257..0d45c4e4c6 100644 --- a/web/modules/webform/src/Utility/WebformDialogHelper.php +++ b/web/modules/webform/src/Utility/WebformDialogHelper.php @@ -65,6 +65,7 @@ public static function attachLibraries(array &$build) { $build['#attached']['library'][] = 'webform/webform.admin.off_canvas'; } // @see \Drupal\webform\Element\WebformHtmlEditor::preRenderWebformHtmlEditor + // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing if (\Drupal::moduleHandler()->moduleExists('imce') && \Drupal\imce\Imce::access()) { $build['#attached']['library'][] = 'imce/drupal.imce.ckeditor'; $build['#attached']['drupalSettings']['webform']['html_editor']['ImceImageIcon'] = file_create_url(drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/icons/imceimage.png'); @@ -92,7 +93,7 @@ public static function getModalDialogAttributes($width = self::DIALOG_NORMAL, ar static::DIALOG_NORMAL => 800, static::DIALOG_NARROW => 700, ]; - $width = (isset($dialog_widths[$width])) ? $dialog_widths[$width] : $width; + $width = $dialog_widths[$width] ?? $width; $class[] = 'webform-ajax-link'; return [ @@ -133,7 +134,7 @@ public static function getOffCanvasDialogAttributes($width = self::DIALOG_NORMAL static::DIALOG_NORMAL => 600, static::DIALOG_NARROW => 550, ]; - $width = (isset($dialog_widths[$width])) ? $dialog_widths[$width] : $width; + $width = $dialog_widths[$width] ?? $width; $class[] = 'webform-ajax-link'; return [ diff --git a/web/modules/webform/src/Utility/WebformElementHelper.php b/web/modules/webform/src/Utility/WebformElementHelper.php index 8389fe8caa..ea9a4658db 100644 --- a/web/modules/webform/src/Utility/WebformElementHelper.php +++ b/web/modules/webform/src/Utility/WebformElementHelper.php @@ -84,6 +84,27 @@ public static function property($key) { return ($key && is_string($key) && $key[0] == '#'); } + /** + * Gets properties of a structured array element (keys beginning with '#'). + * + * @param array $element + * An element array to return properties for. + * + * @return array + * An array of property keys for the element. + */ + public static function properties(array $element) { + // Prevent "Exception: Notice: Trying to access array offset on value + // of type int" by removing all numeric keys. + // This issue is trigged when an element's YAML #option have numeric keys. + foreach ($element as $key => $value) { + if (is_int($key)) { + unset($element[$key]); + } + } + return Element::properties($element); + } + /** * Determine if an element and its key is a renderable array. * @@ -663,18 +684,18 @@ public static function convertToString($element) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Validate callbacks to trigger or suppress validation. - /****************************************************************************/ + /* ************************************************************************ */ - /****************************************************************************/ + /* ************************************************************************ */ // ISSUE: Hidden elements still need to call #element_validate because // certain elements, including managed_file, checkboxes, password_confirm, // etc…, will also massage the submitted values via #element_validate. // // SOLUTION: Call #element_validate for all hidden elements but suppresses // #element_validate errors. - /****************************************************************************/ + /* ************************************************************************ */ /** * Set element validate callback. diff --git a/web/modules/webform/src/Utility/WebformLogicHelper.php b/web/modules/webform/src/Utility/WebformLogicHelper.php index 73d51d86ed..fbb25b9fbe 100644 --- a/web/modules/webform/src/Utility/WebformLogicHelper.php +++ b/web/modules/webform/src/Utility/WebformLogicHelper.php @@ -12,7 +12,7 @@ class WebformLogicHelper { * * @var array */ - static private $recursionTracker = []; + private static $recursionTracker = []; /** * Track recursions by counting how many times a value is called. diff --git a/web/modules/webform/src/Utility/WebformOptionsHelper.php b/web/modules/webform/src/Utility/WebformOptionsHelper.php index a8244fd73a..a729970289 100644 --- a/web/modules/webform/src/Utility/WebformOptionsHelper.php +++ b/web/modules/webform/src/Utility/WebformOptionsHelper.php @@ -130,7 +130,7 @@ public static function getOptionText($value, array $options, $options_descriptio } elseif ($value !== NULL && (string) $value === (string) $option_value) { if ($options_description && strpos($option_text, static::DESCRIPTION_DELIMITER) !== FALSE) { - list($option_text) = static::splitOption($option_text); + [$option_text] = static::splitOption($option_text); return $option_text; } else { @@ -163,7 +163,7 @@ public static function getOptionDescription($value, array $options, $options_des } elseif ($value !== NULL && (string) $value === (string) $option_value) { if ($options_description && strpos($option_text, static::DESCRIPTION_DELIMITER) !== FALSE) { - list($option_text, $option_description) = static::splitOption($option_text); + [$option_text, $option_description] = static::splitOption($option_text); return $option_description; } else { diff --git a/web/modules/webform/src/Utility/WebformYaml.php b/web/modules/webform/src/Utility/WebformYaml.php index cf04717ca8..986559e817 100644 --- a/web/modules/webform/src/Utility/WebformYaml.php +++ b/web/modules/webform/src/Utility/WebformYaml.php @@ -96,9 +96,9 @@ public static function tidy($yaml) { return self::encode(self::decode($yaml)); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Convert \r\n to \n inside data. diff --git a/web/modules/webform/src/WebformAccessRulesManager.php b/web/modules/webform/src/WebformAccessRulesManager.php index feae2f058c..5d2f8dea76 100644 --- a/web/modules/webform/src/WebformAccessRulesManager.php +++ b/web/modules/webform/src/WebformAccessRulesManager.php @@ -73,9 +73,9 @@ public function checkWebformSubmissionAccess($operation, AccountInterface $accou return WebformAccessResult::neutral($webform_submission, $cache_per_user); } - /****************************************************************************/ + /* ************************************************************************ */ // Get access rules methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -125,9 +125,9 @@ public function getAccessRules(WebformInterface $webform) { return $webform->getAccessRules() + $this->getDefaultAccessRules(); } - /****************************************************************************/ + /* ************************************************************************ */ // Check access rules methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/WebformAccessRulesManagerInterface.php b/web/modules/webform/src/WebformAccessRulesManagerInterface.php index ce5bc6b1d0..20cd7e266d 100644 --- a/web/modules/webform/src/WebformAccessRulesManagerInterface.php +++ b/web/modules/webform/src/WebformAccessRulesManagerInterface.php @@ -39,9 +39,9 @@ public function checkWebformAccess($operation, AccountInterface $account, Webfor */ public function checkWebformSubmissionAccess($operation, AccountInterface $account, WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Get access rules methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns the webform default access rules. @@ -68,9 +68,9 @@ public function getDefaultAccessRules(); */ public function getAccessRules(WebformInterface $webform); - /****************************************************************************/ + /* ************************************************************************ */ // Check access rules methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Check access for a given operation and set of access rules. diff --git a/web/modules/webform/src/WebformAddonsManager.php b/web/modules/webform/src/WebformAddonsManager.php index 7a0a0cbc15..bed95fa910 100644 --- a/web/modules/webform/src/WebformAddonsManager.php +++ b/web/modules/webform/src/WebformAddonsManager.php @@ -116,9 +116,9 @@ protected function initProjects() { $projects = []; - /**************************************************************************/ + /* ********************************************************************** */ // Applications. - /**************************************************************************/ + /* ********************************************************************** */ // Applications: Academic Applications. $projects['academic_applications'] = [ @@ -128,9 +128,9 @@ protected function initProjects() { 'category' => 'applications', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Element. - /**************************************************************************/ + /* ********************************************************************** */ // Element: Address. $projects['address'] = [ @@ -157,7 +157,7 @@ protected function initProjects() { 'category' => 'element', ]; - // Element: OpenLayers. + // Element: OpenLayers. $projects['openlayersd8'] = [ 'title' => $this->t('OpenLayers'), 'description' => $this->t('Provides an example that shows how to create a Webform composite.'), @@ -229,6 +229,14 @@ protected function initProjects() { 'category' => 'element', ]; + // Element: Dropzonejs Webform. + $projects['dropzonejs_webform'] = [ + 'title' => $this->t('Dropzonejs Webform'), + 'description' => $this->t('Creates a new DropzoneJS element that you can add to webforms. It provides a user-friendly way for users to upload multiple files in a form field.'), + 'url' => Url::fromUri('https://www.drupal.org/project/dropzonejs_webform'), + 'category' => 'element', + ]; + // Element: Webform Dynamic Autocomplete. $projects['webform_dynamic_autocomplete'] = [ 'title' => $this->t('Webform Dynamic Autocomplete'), @@ -245,6 +253,14 @@ protected function initProjects() { 'category' => 'element', ]; + // Element: Webform GMap Field. + $projects['webform_gmap_field'] = [ + 'title' => $this->t('Webform GMap Field'), + 'description' => $this->t('Adds a "Map location" component to a webform, which gives users the ability to pick a location from the map by dragging a marker.'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_gmap_field'), + 'category' => 'element', + ]; + // Element: Webform Handsontable. $projects['handsontable_yml_webform'] = [ 'title' => $this->t('Webform Handsontable'), @@ -285,6 +301,14 @@ protected function initProjects() { 'category' => 'element', ]; + // Element: Webform Location HTML5. + $projects['webform_location_html5'] = [ + 'title' => $this->t('Webform Location HTML5'), + 'description' => $this->t('Provides a webform field, that when the page loads it autofills with the user location, using the browser Geolocation API.'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_location_html5'), + 'category' => 'element', + ]; + // Element: Webform Node Element. $projects['webform_node_element'] = [ 'title' => $this->t('Webform Node Element'), @@ -373,9 +397,9 @@ protected function initProjects() { 'category' => 'element', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Enhancement. - /**************************************************************************/ + /* ********************************************************************** */ // Enhancement: Dopup. $projects['dopup'] = [ @@ -393,6 +417,14 @@ protected function initProjects() { 'category' => 'enhancement', ]; + // Enhancement: Webform Anonymizer. + $projects['webform_anonymizer'] = [ + 'title' => $this->t('Webform Anonymizer'), + 'description' => $this->t('Anonymizes submissions even when the user is logged in.'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_anonymizer'), + 'category' => 'enhancement', + ]; + // Enhancement: Webform Bulk Emails. $projects['webform_bulk_email'] = [ 'title' => $this->t('Webform Bulk Emails'), @@ -489,7 +521,6 @@ protected function initProjects() { 'category' => 'enhancement', ]; - // Enhancement: Webform GeoIP Restriction. $projects['webform_geoip_restriction'] = [ 'title' => $this->t('Webform GeoIP Restriction'), @@ -586,9 +617,9 @@ protected function initProjects() { 'category' => 'enhancement', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Integrations. - /**************************************************************************/ + /* ********************************************************************** */ // Integrations: Webform CiviCRM Integration. $projects['webform_civicrm'] = [ @@ -617,7 +648,7 @@ protected function initProjects() { 'recommended' => TRUE, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Integrations: Ansible. $projects['ansible'] = [ @@ -654,7 +685,7 @@ protected function initProjects() { // Integrations: Domain Webform. $projects['domain_webform'] = [ 'title' => $this->t('Domain Webform'), - 'description' => $this->t('Domain intergration for the Webform module.'), + 'description' => $this->t('Domain integration for the Webform module.'), 'url' => Url::fromUri('https://github.com/h3rj4n/domain_webform'), 'category' => 'integration', ]; @@ -1038,6 +1069,14 @@ protected function initProjects() { 'category' => 'integration', ]; + // Integrations: Webform Octoa. + $projects['webform_octoa'] = [ + 'title' => $this->t('OS Tickets Webform Handler'), + 'description' => $this->t('Sends webform submissions into the Octoa Lead API'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_octoa'), + 'category' => 'integration', + ]; + // Integrations: OS Tickets Webform Handler. $projects['ostickets'] = [ 'title' => $this->t('OS Tickets Webform Handler'), @@ -1111,6 +1150,14 @@ protected function initProjects() { 'category' => 'integration', ]; + // Integrations: Webform Paypal (Smart Buttons). + $projects['webform_paypal_smart'] = [ + 'title' => $this->t('Webform Paypal (Smart Buttons)'), + 'description' => $this->t('Enables Smart Paypal buttons on Webform submissions.'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_paypal_smart'), + 'category' => 'integration', + ]; + // Integrations: Webform User Registration. $projects['webform_user_registration'] = [ 'title' => $this->t('Webform User Registration'), @@ -1127,7 +1174,7 @@ protected function initProjects() { 'category' => 'integration', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Integrations: Salesforce Web-to-Lead Webform Data Integration. $projects['sfweb2lead_webform'] = [ @@ -1148,14 +1195,22 @@ protected function initProjects() { // Integrations: Salesforce: Webform to Salesforce Leads. $projects['webform_to_leads'] = [ 'title' => $this->t('Salesforce: Webform to Salesforce Leads'), - 'description' => $this->t('Extends the Webform module to allow the creation of a webform that feeds to your Salesforce.com Account'), + 'description' => $this->t('Extends the Webform module to allow the creation of a webform that feeds to your Salesforce.com Account.'), 'url' => Url::fromUri('https://www.drupal.org/project/webform_to_leads'), 'category' => 'integration', ]; - /**************************************************************************/ + // Integrations: Salesforce: Webform to Salesforce DEManager. + $projects['webform_sf_demanager'] = [ + 'title' => $this->t('Salesforce: Webform to Salesforce DEManager'), + 'description' => $this->t('Allows a webform to send information to Salesforce Marketing Cloud trough DEManager.'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_sf_demanager'), + 'category' => 'integration', + ]; + + /* ********************************************************************** */ // Mail. - /**************************************************************************/ + /* ********************************************************************** */ // Mail: Mail System. $projects['mailsystem'] = [ @@ -1261,9 +1316,9 @@ protected function initProjects() { 'category' => 'mail', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Multilingual. - /**************************************************************************/ + /* ********************************************************************** */ // Multilingual: Lingotek Translation. $projects['lingotek'] = [ @@ -1281,9 +1336,9 @@ protected function initProjects() { 'category' => 'multilingual', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Migrate. - /**************************************************************************/ + /* ********************************************************************** */ // Migrate: Webform Migrate. $projects['webform_migrate'] = [ @@ -1294,9 +1349,9 @@ protected function initProjects() { 'recommended' => TRUE, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Spam. - /**************************************************************************/ + /* ********************************************************************** */ // Spam: Antibot. $projects['antibot'] = [ @@ -1335,7 +1390,7 @@ protected function initProjects() { 'category' => 'spam', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Spam: CleanTalk. $projects['cleantalk'] = [ @@ -1385,9 +1440,9 @@ protected function initProjects() { 'category' => 'spam', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Submissions. - /**************************************************************************/ + /* ********************************************************************** */ // Submissions: Webform Analysis. $projects['webform_analysis'] = [ @@ -1410,7 +1465,7 @@ protected function initProjects() { // Submissions: Webform Views Integration. $projects['webform_views'] = [ 'title' => $this->t('Webform Views'), - 'description' => $this->t('Integrates Webform 8.x-5.x/6.x and Views modules.'), + 'description' => $this->t('Integrates Webform and Views modules.'), 'url' => Url::fromUri('https://www.drupal.org/project/webform_views'), 'category' => 'submission', 'recommended' => TRUE, @@ -1425,7 +1480,7 @@ protected function initProjects() { 'recommended' => TRUE, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Submissions: Protected Submissions. $projects['protected_submissions'] = [ @@ -1563,9 +1618,9 @@ protected function initProjects() { 'category' => 'submission', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Utility. - /**************************************************************************/ + /* ********************************************************************** */ // Utility: IMCE. $projects['imce'] = [ @@ -1596,7 +1651,7 @@ protected function initProjects() { 'recommended' => TRUE, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Utility: Calendar Links Token. $projects['calendar_links_token'] = [ @@ -1663,9 +1718,9 @@ protected function initProjects() { 'category' => 'utility', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Validation. - /**************************************************************************/ + /* ********************************************************************** */ // Validation: Clientside Validation. $projects['clientside_validation'] = [ @@ -1700,9 +1755,9 @@ protected function initProjects() { 'category' => 'validation', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Web services. - /**************************************************************************/ + /* ********************************************************************** */ // Web services: Decoupled Kit. $projects['decoupled_kit'] = [ @@ -1744,9 +1799,9 @@ protected function initProjects() { 'category' => 'web_services', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Workflow. - /**************************************************************************/ + /* ********************************************************************** */ // Workflow: Config Entity Revisions. $projects['config_entity_revisions'] = [ @@ -1775,15 +1830,22 @@ protected function initProjects() { // Workflow: Webform Workflows Element. $projects['webform_workflows_element'] = [ 'title' => $this->t('Webform Workflows Element'), - 'description' => $this->t('provides a new element type for Webforms (D8+) that uses the core Workflows functionality to move submissions through a webform.'), + 'description' => $this->t('Provides a new element type for Webforms (D8+) that uses the core Workflows functionality to move submissions through a webform.'), 'url' => Url::fromUri('https://www.drupal.org/project/webform_workflows_element'), 'category' => 'workflow', ]; + // Workflow: Webform Revision UI. + $projects['webform_revision_ui'] = [ + 'title' => $this->t('Webform Revision UI'), + 'description' => $this->t('Adds Webform Revision UI.'), + 'url' => Url::fromUri('https://www.drupal.org/project/webform_revision_ui'), + 'category' => 'workflow', + ]; - /**************************************************************************/ + /* ********************************************************************** */ // Development. - /**************************************************************************/ + /* ********************************************************************** */ // Devel: Maillog / Mail Developer. $projects['maillog'] = [ diff --git a/web/modules/webform/src/WebformEntityAccessControlHandler.php b/web/modules/webform/src/WebformEntityAccessControlHandler.php index 77e43cf21b..78ac24ccf9 100644 --- a/web/modules/webform/src/WebformEntityAccessControlHandler.php +++ b/web/modules/webform/src/WebformEntityAccessControlHandler.php @@ -151,8 +151,8 @@ public function checkAccess(EntityInterface $entity, $operation, AccountInterfac // Check submission_* operation. if (strpos($operation, 'submission_') === 0) { - // Grant user with administer webform submission access to do whatever he - // likes on the submission operations. + // Grant user with administer webform submission access to do whatever they + // like on the submission operations. if ($account->hasPermission('administer webform submission')) { return WebformAccessResult::allowed(); } diff --git a/web/modules/webform/src/WebformEntityAddForm.php b/web/modules/webform/src/WebformEntityAddForm.php index 2f53289501..d96f4a91c4 100644 --- a/web/modules/webform/src/WebformEntityAddForm.php +++ b/web/modules/webform/src/WebformEntityAddForm.php @@ -3,11 +3,9 @@ namespace Drupal\webform; use Drupal\Core\Entity\BundleEntityFormBase; -use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; use Drupal\webform\Form\WebformDialogFormTrait; -use Drupal\Core\Language\LanguageManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -184,6 +182,11 @@ public function submitForm(array &$form, FormStateInterface $form_state) { } } + // Reset webform categories cache. + /** @var \Drupal\webform\WebformEntityStorageInterface $webform_storage */ + $webform_storage = $this->entityTypeManager->getStorage('webform'); + $webform_storage->resetCategoriesCache(); + $form_state->setRedirectUrl(Url::fromRoute('entity.webform.edit_form', ['webform' => $this->getEntity()->id()])); } diff --git a/web/modules/webform/src/WebformEntityConditionsManager.php b/web/modules/webform/src/WebformEntityConditionsManager.php index 773818d452..8c519363f2 100644 --- a/web/modules/webform/src/WebformEntityConditionsManager.php +++ b/web/modules/webform/src/WebformEntityConditionsManager.php @@ -89,7 +89,7 @@ public function toText(WebformInterface $webform, array $states, array $options foreach ($states as $state => $conditions) { $t_args = [ '@name' => $options['name'], - '@state' => (isset($options['states'][$state])) ? $options['states'][$state] : $state, + '@state' => $options['states'][$state] ?? $state, ]; $build[$state] = [ 'state' => [ @@ -281,7 +281,7 @@ protected function buildConditionItem(WebformInterface $webform, $selector, arra ]; default: - $t_args['@value'] = isset($element_options[$trigger_value]) ? $element_options[$trigger_value] : $trigger_value; + $t_args['@value'] = $element_options[$trigger_value] ?? $trigger_value; return [ '#markup' => $this->t('<strong>@name</strong> @trigger <strong>@value</strong>.', $t_args), ]; diff --git a/web/modules/webform/src/WebformEntityElementsForm.php b/web/modules/webform/src/WebformEntityElementsForm.php index 540feadef9..ede3cbdfa3 100644 --- a/web/modules/webform/src/WebformEntityElementsForm.php +++ b/web/modules/webform/src/WebformEntityElementsForm.php @@ -160,9 +160,9 @@ public function save(array $form, FormStateInterface $form_state) { $this->messenger()->addStatus($this->t('Webform %label elements saved.', $t_args)); } - /****************************************************************************/ + /* ************************************************************************ */ // Webform type prefix add and remove methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get elements without 'webform_' #type prefix. diff --git a/web/modules/webform/src/WebformEntityElementsValidator.php b/web/modules/webform/src/WebformEntityElementsValidator.php index 1d2a708ad2..76963fb6b2 100644 --- a/web/modules/webform/src/WebformEntityElementsValidator.php +++ b/web/modules/webform/src/WebformEntityElementsValidator.php @@ -534,7 +534,7 @@ protected function validateHierarchy() { protected function validatePages() { if (strpos($this->elementsRaw, "'#type': webform_card") !== FALSE && strpos($this->elementsRaw, "'#type': webform_wizard_page") !== FALSE) { - return [$this->t('Pages and cards cannot be used in the same webform. Please remove or convert the pages/cards to the same element type.')]; + return [$this->t('Pages and cards cannot be used in the same webform. Please remove or convert the pages/cards to the same element type.')]; } else { return NULL; @@ -599,9 +599,9 @@ protected function validateRendering() { return $message; } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Recurse through elements and collect an associative array of deleted element keys. diff --git a/web/modules/webform/src/WebformEntityListBuilder.php b/web/modules/webform/src/WebformEntityListBuilder.php index e8b69e5e9f..78407d0fba 100644 --- a/web/modules/webform/src/WebformEntityListBuilder.php +++ b/web/modules/webform/src/WebformEntityListBuilder.php @@ -71,7 +71,23 @@ class WebformEntityListBuilder extends ConfigEntityListBuilder { protected $bulkOperations; /** - * {@inheritdoc} + * Associative array container total results for displayed webforms. + * + * @var array + */ + protected $totalNumberOfResults = []; + + /** + * The database object. + * + * @var object + */ + protected $database; + + /** + * The webform submission storage. + * + * @var \Drupal\webform\WebformSubmissionStorageInterface */ public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { /** @var \Drupal\webform\WebformEntityListBuilder $instance */ @@ -81,6 +97,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $instance->configFactory = $container->get('config.factory'); $instance->currentUser = $container->get('current_user'); $instance->entityTypeManager = $container->get('entity_type.manager'); + $instance->database = $container->get('database'); $instance->initialize(); return $instance; @@ -98,6 +115,10 @@ protected function initialize() { $this->state = ($query->has('state')) ? $query->get('state') : $config->get('form.filter_state'); $this->bulkOperations = $config->get('settings.webform_bulk_form') ?: FALSE; $this->limit = $config->get('form.limit') ?: 50; + + $this->submissionStorage = $this->entityTypeManager->getStorage('webform_submission'); + $this->userStorage = $this->entityTypeManager->getStorage('user'); + $this->roleStorage = $this->entityTypeManager->getStorage('user_role'); } /** @@ -245,7 +266,7 @@ public function buildHeader() { * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { - /* @var $entity \Drupal\webform\WebformInterface */ + /** @var \Drupal\webform\WebformInterface $entity */ // Title. // @@ -315,7 +336,7 @@ public function buildRow(EntityInterface $entity) { $row['owner'] = ($owner = $entity->getOwner()) ? $owner->toLink() : ''; // Results. - $result_total = $this->storage->getTotalNumberOfResults($entity->id()); + $result_total = $this->totalNumberOfResults[$entity->id()]; $results_disabled = $entity->isResultsDisabled(); $results_access = $entity->access('submission_view_any'); if ($results_disabled || !$results_access) { @@ -354,7 +375,7 @@ public function buildOperations(EntityInterface $entity) { * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity, $type = 'edit') { - /* @var $entity \Drupal\webform\WebformInterface */ + /** @var \Drupal\webform\WebformInterface $entity */ $operations = []; if ($entity->access('update')) { @@ -417,21 +438,34 @@ public function getDefaultOperations(EntityInterface $entity, $type = 'edit') { protected function getEntityIds() { $header = $this->buildHeader(); if ($this->request->query->get('order') === (string) $header['results']['data']) { - // Get results totals for all returned entity ids. - $results_totals = $this->getQuery($this->keys, $this->category, $this->state) + $entity_ids = $this->getQuery($this->keys, $this->category, $this->state) ->execute(); - foreach ($results_totals as $entity_id) { - $results_totals[$entity_id] = $this->storage->getTotalNumberOfResults($entity_id); + + // Make sure all entity ids have totals. + $this->totalNumberOfResults += array_fill_keys($entity_ids, 0); + + // Calculate totals. + // @see \Drupal\webform\WebformEntityStorage::getTotalNumberOfResults + if ($entity_ids) { + $query = $this->database->select('webform_submission', 'ws'); + $query->fields('ws', ['webform_id']); + $query->condition('webform_id', $entity_ids, 'IN'); + $query->addExpression('COUNT(sid)', 'results'); + $query->groupBy('webform_id'); + $totals = array_map('intval', $query->execute()->fetchAllKeyed()); + foreach ($totals as $entity_id => $total) { + $this->totalNumberOfResults[$entity_id] = $total; + } } - // Sort results totals. - asort($results_totals, SORT_NUMERIC); + // Sort totals. + asort($this->totalNumberOfResults, SORT_NUMERIC); if ($this->request->query->get('sort') === 'desc') { - $results_totals = array_reverse($results_totals, TRUE); + $this->totalNumberOfResults = array_reverse($this->totalNumberOfResults, TRUE); } - // Build an associative array of entity ids. - $entity_ids = array_keys($results_totals); + // Build an associative array of entity ids from totals. + $entity_ids = array_keys($this->totalNumberOfResults); $entity_ids = array_combine($entity_ids, $entity_ids); // Manually initialize and apply paging to the entity ids. @@ -446,7 +480,23 @@ protected function getEntityIds() { $query = $this->getQuery($this->keys, $this->category, $this->state); $query->tableSort($header); $query->pager($this->getLimit()); - return $query->execute(); + $entity_ids = $query->execute(); + + // Calculate totals. + // @see \Drupal\webform\WebformEntityStorage::getTotalNumberOfResults + if ($entity_ids) { + $query = $this->database->select('webform_submission', 'ws'); + $query->fields('ws', ['webform_id']); + $query->condition('webform_id', $entity_ids, 'IN'); + $query->addExpression('COUNT(sid)', 'results'); + $query->groupBy('webform_id'); + $this->totalNumberOfResults = array_map('intval', $query->execute()->fetchAllKeyed()); + } + + // Make sure all entity ids have totals. + $this->totalNumberOfResults += array_fill_keys($entity_ids, 0); + + return $entity_ids; } } @@ -559,7 +609,7 @@ protected function getQuery($keys = '', $category = '', $state = '') { */ public function load() { $entity_ids = $this->getEntityIds(); - /* @var $entities \Drupal\webform\WebformInterface[] */ + /** @var \Drupal\webform\WebformInterface[] $entities */ $entities = $this->storage->loadMultiple($entity_ids); // If the user is not a webform admin, check access to each webform. diff --git a/web/modules/webform/src/WebformEntityReferenceManager.php b/web/modules/webform/src/WebformEntityReferenceManager.php index abc8842eb8..f32025e4a4 100644 --- a/web/modules/webform/src/WebformEntityReferenceManager.php +++ b/web/modules/webform/src/WebformEntityReferenceManager.php @@ -95,9 +95,9 @@ public function __construct(RouteMatchInterface $route_match, AccountInterface $ $this->entityTypeManager = $entity_type_manager ?: \Drupal::entityTypeManager(); } - /****************************************************************************/ + /* ************************************************************************ */ // User data methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -159,9 +159,9 @@ public function deleteUserWebformId(EntityInterface $entity) { $this->userData->delete($module, NULL, $name); } - /****************************************************************************/ + /* ************************************************************************ */ // Field methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -265,9 +265,9 @@ public function getWebforms(EntityInterface $entity = NULL) { return $webforms; } - /****************************************************************************/ + /* ************************************************************************ */ // Paragraph methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get webform associate with a paragraph field from entity. @@ -338,9 +338,9 @@ protected function getParagraphFieldNames(EntityInterface $entity) { return $field_names; } - /****************************************************************************/ + /* ************************************************************************ */ // Table methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -355,7 +355,7 @@ public function getTableNames() { $webform_field_name = $field_storage_config->getName(); $tables[$webform_field_table . '__' . $webform_field_name] = $webform_field_name; $tables[$webform_field_table . '_revision__' . $webform_field_name] = $webform_field_name; - }; + } } return $tables; } diff --git a/web/modules/webform/src/WebformEntityReferenceManagerInterface.php b/web/modules/webform/src/WebformEntityReferenceManagerInterface.php index f1231f19c2..0c083ee033 100644 --- a/web/modules/webform/src/WebformEntityReferenceManagerInterface.php +++ b/web/modules/webform/src/WebformEntityReferenceManagerInterface.php @@ -9,9 +9,9 @@ */ interface WebformEntityReferenceManagerInterface { - /****************************************************************************/ + /* ************************************************************************ */ // User data methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Is the current request a webform route where the user can specify a webform. @@ -54,9 +54,9 @@ public function getUserWebformId(EntityInterface $entity); */ public function deleteUserWebformId(EntityInterface $entity); - /****************************************************************************/ + /* ************************************************************************ */ // Field methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determine if the entity has a webform entity reference field. @@ -113,9 +113,9 @@ public function getWebform(EntityInterface $entity = NULL); */ public function getWebforms(EntityInterface $entity = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Table methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the table names for all webform field instances. diff --git a/web/modules/webform/src/WebformEntityStorage.php b/web/modules/webform/src/WebformEntityStorage.php index 5fb55f9705..a75e59bc2f 100644 --- a/web/modules/webform/src/WebformEntityStorage.php +++ b/web/modules/webform/src/WebformEntityStorage.php @@ -35,6 +35,20 @@ class WebformEntityStorage extends ConfigEntityStorage implements WebformEntityS */ protected $fileSystem; + /** + * The cache backend service. + * + * @var \Drupal\Core\Cache\CacheBackendInterface + */ + protected $cacheBackend; + + /** + * The language manager. + * + * @var \Drupal\Core\Language\LanguageManagerInterface + */ + protected $languageManager; + /** * Associative array container total results for all webforms. * @@ -50,6 +64,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $instance->database = $container->get('database'); $instance->entityTypeManager = $container->get('entity_type.manager'); $instance->fileSystem = $container->get('file_system'); + $instance->cacheBackend = $container->get('cache.default'); + $instance->languageManager = $container->get('language_manager'); return $instance; } @@ -147,12 +163,33 @@ public function delete(array $entities) { } } } + + $this->resetCategoriesCache(); } /** * {@inheritdoc} */ public function getCategories($template = NULL) { + // Get categories cache key which includes langcode and template type. + $cache_key = $this->languageManager->getCurrentLanguage()->getId(); + if ($template === FALSE) { + $cache_key .= '.forms'; + } + elseif ($template === TRUE) { + $cache_key .= '.templates'; + } + else { + $cache_key .= '.all'; + } + + // Get categories cached data. + $cache = $this->cacheBackend->get('webform.categories'); + $cache_data = ($cache) ? $cache->data : []; + if (isset($cache_data[$cache_key])) { + return $cache_data[$cache_key]; + } + $webforms = $this->loadMultiple(); $categories = []; foreach ($webforms as $webform) { @@ -164,9 +201,20 @@ public function getCategories($template = NULL) { } } ksort($categories); + + // Add to categories cached data. + $this->cacheBackend->set('webform.categories', [$cache_key => $categories] + $cache_data); + return $categories; } + /** + * {@inheritdoc} + */ + public function resetCategoriesCache() { + $this->cacheBackend->delete('webform.categories'); + } + /** * {@inheritdoc} */ @@ -246,6 +294,7 @@ public function getSerial(WebformInterface $webform) { // The transaction will commit when $transaction goes out-of-scope. // // @see \Drupal\Core\Database\Transaction + // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable $transaction = $this->database->startTransaction(); // Get the next_serial value. @@ -291,19 +340,18 @@ public function getMaxSerial(WebformInterface $webform) { * results for specified webform */ public function getTotalNumberOfResults($webform_id = NULL) { - if (!isset($this->totals)) { + if ($webform_id) { $query = $this->database->select('webform_submission', 'ws'); - $query->fields('ws', ['webform_id']); + $query->condition('webform_id', $webform_id); $query->addExpression('COUNT(sid)', 'results'); - $query->groupBy('webform_id'); - $this->totals = array_map('intval', $query->execute()->fetchAllKeyed()); - } - - if ($webform_id) { - return (isset($this->totals[$webform_id])) ? $this->totals[$webform_id] : 0; + return $query->execute()->fetchField() ?: 0; } else { - return $this->totals; + $query = $this->database->select('webform_submission', 'ws'); + $query->fields('ws', ['webform_id']); + $query->addExpression('COUNT(sid)', 'results'); + $query->groupBy('webform_id'); + return array_map('intval', $query->execute()->fetchAllKeyed()); } } diff --git a/web/modules/webform/src/WebformEntityStorageInterface.php b/web/modules/webform/src/WebformEntityStorageInterface.php index a52ca1e10a..089158e29c 100644 --- a/web/modules/webform/src/WebformEntityStorageInterface.php +++ b/web/modules/webform/src/WebformEntityStorageInterface.php @@ -23,6 +23,11 @@ interface WebformEntityStorageInterface extends ConfigEntityStorageInterface, Im */ public function getCategories($template = NULL); + /** + * Resets the internal, categories cache. + */ + public function resetCategoriesCache(); + /** * Get all webforms grouped by category. * diff --git a/web/modules/webform/src/WebformEntityViewBuilder.php b/web/modules/webform/src/WebformEntityViewBuilder.php index ebb7556bf7..1953cf53e2 100644 --- a/web/modules/webform/src/WebformEntityViewBuilder.php +++ b/web/modules/webform/src/WebformEntityViewBuilder.php @@ -14,7 +14,7 @@ class WebformEntityViewBuilder extends EntityViewBuilder { * {@inheritdoc} */ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = NULL) { - /* @var $entity \Drupal\webform\WebformInterface */ + /** @var \Drupal\webform\WebformInterface $entity */ return $entity->getSubmissionForm(); } diff --git a/web/modules/webform/src/WebformHelpManager.php b/web/modules/webform/src/WebformHelpManager.php index 30682971a0..9151a9c4e9 100644 --- a/web/modules/webform/src/WebformHelpManager.php +++ b/web/modules/webform/src/WebformHelpManager.php @@ -1,5 +1,8 @@ <?php +// phpcs:disable Drupal.Semantics.FunctionT.ConcatString +// phpcs:disable Drupal.Strings.UnnecessaryStringConcat.Found + namespace Drupal\webform; use Drupal\Component\Utility\Xss; @@ -149,7 +152,7 @@ public function __construct(AccountInterface $current_user, ConfigFactoryInterfa */ public function getGroup($id = NULL) { if ($id !== NULL) { - return (isset($this->groups[$id])) ? $this->groups[$id] : NULL; + return $this->groups[$id] ?? NULL; } else { return $this->groups; @@ -161,7 +164,7 @@ public function getGroup($id = NULL) { */ public function getHelp($id = NULL) { if ($id !== NULL) { - return (isset($this->help[$id])) ? $this->help[$id] : NULL; + return $this->help[$id] ?? NULL; } else { return $this->help; @@ -173,7 +176,7 @@ public function getHelp($id = NULL) { */ public function getVideo($id = NULL) { if ($id !== NULL) { - return (isset($this->videos[$id])) ? $this->videos[$id] : NULL; + return $this->videos[$id] ?? NULL; } else { return $this->videos; @@ -220,7 +223,7 @@ public function addNotification($id, $message, $type = 'status') { public function getNotifications($type = NULL) { $notifications = $this->state->get('webform_help_notifications', []); if ($type) { - return (isset($notifications[$type])) ? $notifications[$type] : []; + return $notifications[$type] ?? []; } else { return $notifications; @@ -328,9 +331,9 @@ public function buildIndex() { return $build; } - /***************************************************************************/ + /* *********************************************************************** */ // Index sections. - /***************************************************************************/ + /* *********************************************************************** */ /** * {@inheritdoc} @@ -362,7 +365,7 @@ public function buildVideos($docs = FALSE) { // Content. $row['content'] = ['data' => []]; $row['content']['data']['title'] = [ - '#markup' => $video['title'] . ' | ' . (isset($video['owner']) ? $video['owner'] : $this->t('Jacob Rockowitz')), + '#markup' => $video['title'] . ' | ' . ($video['owner'] ?? $this->t('Jacob Rockowitz')), '#prefix' => '<h3>', '#suffix' => '</h3>', ]; @@ -754,7 +757,7 @@ public function buildComparison($docs = FALSE) { '#markup' => '<div class="note-warning"><p>' . $this->t('Please post comments and feedback to this <a href=":href">Google Sheet</a>.', [':href' => 'https://docs.google.com/spreadsheets/d/1zNt3WsKxDq2ZmMHeYAorNUUIx5_yiDtDVUIKXtXaq4s/edit?usp=sharing']) . '</p></div>', ], 'description' => [ - '#markup' => '<p>' . $this->t("Here is a detailed feature-comparison of Webform 8.x-5.x and Contact Storage 8.x-1.x. It's worth noting that Contact Storage relies on the Contact module which in turn relies on the Field UI; Contact Storage out of the box is a minimalistic solution with limited (but useful!) functionality. This means it can be extended with core mechanisms such as CRUD entity hooks and overriding services; also there's a greater chance that a general purpose module will play nicely with it (eg. the Conditional Fields module is for entity form displays in general, not the Contact module).") . '</p>' . + '#markup' => '<p>' . $this->t("Here is a detailed feature-comparison of Webform and Contact Storage 8.x-1.x. It's worth noting that Contact Storage relies on the Contact module which in turn relies on the Field UI; Contact Storage out of the box is a minimalistic solution with limited (but useful!) functionality. This means it can be extended with core mechanisms such as CRUD entity hooks and overriding services; also there's a greater chance that a general purpose module will play nicely with it (eg. the Conditional Fields module is for entity form displays in general, not the Contact module).") . '</p>' . '<p>' . $this->t("Webform is much heavier; it has a great deal of functionality enabled right within the one module, and that's on top of supplying all the normal field elements (because it doesn't just use the Field API)") . '</p>', ], 'table' => ['#markup' => $html], @@ -762,9 +765,9 @@ public function buildComparison($docs = FALSE) { ]; } - /***************************************************************************/ + /* *********************************************************************** */ // Module. - /***************************************************************************/ + /* *********************************************************************** */ /** * Get the current version number of the Webform module. @@ -792,9 +795,9 @@ protected function isUpdated() { return ($this->getVersion() !== $this->state->get('webform.version')) ? TRUE : FALSE; } - /***************************************************************************/ + /* *********************************************************************** */ // Groups. - /***************************************************************************/ + /* *********************************************************************** */ /** * Initialize group. @@ -826,9 +829,9 @@ protected function initGroups() { ]; } - /***************************************************************************/ + /* *********************************************************************** */ // Videos. - /***************************************************************************/ + /* *********************************************************************** */ /** * Initialize videos. @@ -1524,9 +1527,9 @@ protected function initVideos() { return $videos; } - /****************************************************************************/ + /* ************************************************************************ */ // Help. - /****************************************************************************/ + /* ************************************************************************ */ /** * Initialize help. @@ -1537,9 +1540,9 @@ protected function initVideos() { protected function initHelp() { $help = []; - /**************************************************************************/ + /* ********************************************************************** */ // Notifications. - /**************************************************************************/ + /* ********************************************************************** */ if ($this->currentUser->hasPermission('administer webform')) { $notifications = $this->getNotifications(); @@ -1562,11 +1565,11 @@ protected function initHelp() { } } - /**************************************************************************/ + /* ********************************************************************** */ // Promotions. // Disable promotions via Webform admin settings. // (/admin/structure/webform/config/advanced). - /**************************************************************************/ + /* ********************************************************************** */ // Promotions: Webform. $t_args = [ @@ -1591,9 +1594,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Installation. - /**************************************************************************/ + /* ********************************************************************** */ // Installation. $t_args = [ @@ -1621,9 +1624,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Forms. - /**************************************************************************/ + /* ********************************************************************** */ // Webforms. $help['webforms_manage'] = [ @@ -1637,9 +1640,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Addons. - /**************************************************************************/ + /* ********************************************************************** */ // Addons. $help['addons'] = [ @@ -1653,9 +1656,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Help. - /**************************************************************************/ + /* ********************************************************************** */ $help['help'] = [ 'group' => 'help', @@ -1667,9 +1670,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Configuration. - /**************************************************************************/ + /* ********************************************************************** */ // Configuration: Forms. $help['config_forms'] = [ @@ -1776,6 +1779,7 @@ protected function initHelp() { '@webform-libraries-download' => 'webform-libraries-download', '@webform-composer-update' => 'webform-composer-update', ]; + // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing $drush_version = (class_exists('\Drush\Drush')) ? \Drush\Drush::getMajorVersion() : 8; if ($drush_version >= 9) { foreach ($t_args as $command_name => $command) { @@ -1783,7 +1787,6 @@ protected function initHelp() { } } $t_args += [ - ':href_5x' => 'https://git.drupalcode.org/sandbox/jrockowitz-2941983/-/raw/8.x-5.x/libraries.zip', ':href_6x' => 'https://git.drupalcode.org/sandbox/jrockowitz-2941983/-/raw/6.x/libraries.zip', ]; $help['config_libraries_help'] = [ @@ -1797,14 +1800,14 @@ protected function initHelp() { '<p>' . $this->t('There are several ways to download the needed third-party libraries.') . '</p>' . '<p><strong>' . $this->t('Recommended') . '</strong></p>' . '<ul>' . - '<li>' . $this->t('Use the <a href="https://github.com/wikimedia/composer-merge-plugin">Composer Merge plugin</a> to include the Webform module\'s <a href="https://cgit.drupalcode.org/webform/tree/composer.libraries.json">composer.libraries.json</a> or generate a custom file using <code>drush @webform-libraries-composer > DRUPAL_ROOT/composer.libraries.json</code>.', $t_args) . '<br/><strong>' . $this->t('<a href="https://www.drupal.org/node/3003140">Learn more »</a>') . '</strong>'. '</li>' . + '<li>' . $this->t('Use the <a href="https://github.com/wikimedia/composer-merge-plugin">Composer Merge plugin</a> to include the Webform module\'s <a href="https://cgit.drupalcode.org/webform/tree/composer.libraries.json">composer.libraries.json</a> or generate a custom file using <code>drush @webform-libraries-composer > DRUPAL_ROOT/composer.libraries.json</code>.', $t_args) . '<br/><strong>' . $this->t('<a href="https://www.drupal.org/node/3003140">Learn more »</a>') . '</strong>' . '</li>' . '</ul>' . '<p><strong>' . $this->t('Alternatives') . '</strong></p>' . '<ul>' . '<li>' . $this->t('Generate a composer.json file using <code>drush @webform-libraries-composer</code>.', $t_args) . '</li>' . '<li>' . $this->t('Execute <code>drush @webform-libraries-download</code>, to download third-party libraries required by the Webform module. (OSX/Linux)', $t_args) . '</li>' . '<li>' . $this->t("Execute <code>drush @webform-composer-update</code>, to update your Drupal installation's composer.json to include the Webform module's selected libraries as repositories.", $t_args) . '</li>' . - '<li>' . $this->t('Download and extract a zipped archive containing all webform libraries (<a href=":href_5x">8.x-5.x</a> and <a href=":href_6x">6.x</a>) and extract the directories and files to /libraries or /web/libraries', $t_args) . '</li>' . + '<li>' . $this->t('Download and extract a zipped archive containing all webform libraries (<a href=":href_6x">6.x</a>) and extract the directories and files to /libraries or /web/libraries', $t_args) . '</li>' . '</ul>', 'message_type' => 'info', 'message_close' => TRUE, @@ -1839,9 +1842,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Plugins. - /**************************************************************************/ + /* ********************************************************************** */ // Plugins: Elements. $help['plugins_elements'] = [ @@ -1894,9 +1897,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Webform. - /**************************************************************************/ + /* ********************************************************************** */ // Webform: Source. $help['webform_source'] = [ @@ -1951,9 +1954,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Elements. - /**************************************************************************/ + /* ********************************************************************** */ // Elements. $help['elements'] = [ @@ -1967,9 +1970,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Handlers. - /**************************************************************************/ + /* ********************************************************************** */ // Handlers. $help['handlers'] = [ @@ -1984,9 +1987,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Variants. - /**************************************************************************/ + /* ********************************************************************** */ // Variants. $help['variants'] = [ @@ -2000,9 +2003,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Settings. - /**************************************************************************/ + /* ********************************************************************** */ // Settings. $help['settings'] = [ @@ -2076,9 +2079,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Submissions/Results. - /**************************************************************************/ + /* ********************************************************************** */ // Submissions. $help['submissions'] = [ @@ -2115,9 +2118,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Submission. - /**************************************************************************/ + /* ********************************************************************** */ $help['submission'] = [ 'group' => 'submission', @@ -2222,9 +2225,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Export. - /**************************************************************************/ + /* ********************************************************************** */ // Export: Config. $config_import_href = ($this->moduleHandler->moduleExists('config') && $this->currentUser->hasPermission('import configuration')) @@ -2243,9 +2246,9 @@ protected function initHelp() { ], ]; - /**************************************************************************/ + /* ********************************************************************** */ // Modules. - /**************************************************************************/ + /* ********************************************************************** */ // Webform Entity Print (PDF). $help['webform_entity_print'] = [ @@ -2323,9 +2326,9 @@ protected function initHelp() { 'weight' => -10, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Messages. - /**************************************************************************/ + /* ********************************************************************** */ // Webform: Elements -- Warning. $help['message_webform_ui'] = [ @@ -2349,7 +2352,7 @@ protected function initHelp() { $help += $this->moduleHandler->invokeAll('webform_help_info'); $this->moduleHandler->alter('webform_help_info', $help); - /**************************************************************************/ + /* ********************************************************************** */ // Initialize help. foreach ($help as $id => &$help_info) { diff --git a/web/modules/webform/src/WebformInterface.php b/web/modules/webform/src/WebformInterface.php index 465befdba7..cf31d140c9 100644 --- a/web/modules/webform/src/WebformInterface.php +++ b/web/modules/webform/src/WebformInterface.php @@ -332,14 +332,13 @@ public function setOverride($override = TRUE); */ public function isOverridden(); - /** * Sets the webform updating state. * * Setting the updating state to TRUE ensure that translated elements are - * not overridden + * not overridden. * - * @param bool $override + * @param bool $updating * The updating state of the Webform. * * @return $this @@ -900,9 +899,9 @@ public function updatePaths(); */ public function deletePaths(); - /****************************************************************************/ + /* ************************************************************************ */ // Handler plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determine if the webform has any message handlers. @@ -1004,9 +1003,9 @@ public function deleteWebformHandler(WebformHandlerInterface $handler); */ public function invokeHandlers($method, &$data, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Element plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * Invoke elements method. @@ -1022,9 +1021,9 @@ public function invokeHandlers($method, &$data, &$context1 = NULL, &$context2 = */ public function invokeElements($method, &$data, &$context1 = NULL, &$context2 = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Variant plugins. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determine if a specific webform variant exists. @@ -1124,9 +1123,9 @@ public function applyVariants(WebformSubmissionInterface $webform_submission = N */ public function getVariantsData(WebformSubmissionInterface $webform_submission); - /****************************************************************************/ + /* ************************************************************************ */ // Revisions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Required to allow webform which are config entities to have an EntityViewBuilder. @@ -1144,9 +1143,9 @@ public function getVariantsData(WebformSubmissionInterface $webform_submission); */ public function isDefaultRevision(); - /****************************************************************************/ + /* ************************************************************************ */ // State data. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns the stored value for a given key in the webform's state. @@ -1190,9 +1189,9 @@ public function deleteState($key); */ public function hasState($key); - /****************************************************************************/ + /* ************************************************************************ */ // User data. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns the stored value for a given key in the webform's user data. @@ -1236,9 +1235,9 @@ public function deleteUserData($key); */ public function hasUserData($key); - /****************************************************************************/ + /* ************************************************************************ */ // Third party settings. - /****************************************************************************/ + /* ************************************************************************ */ /** * Unsets all third-party settings of a given module. diff --git a/web/modules/webform/src/WebformLibrariesManager.php b/web/modules/webform/src/WebformLibrariesManager.php index 83f7ecc4af..5deaaecb2b 100644 --- a/web/modules/webform/src/WebformLibrariesManager.php +++ b/web/modules/webform/src/WebformLibrariesManager.php @@ -88,7 +88,7 @@ public function requirements($cli = FALSE) { $libraries = $this->getLibraries(); // Defined REQUIREMENT constants which may not be loaded. - // @see /private/var/www/sites/d8_webform/web/core/includes/install.inc + // @see ~/Sites/drupal_webfor/mweb/core/includes/install.inc if (!defined('REQUIREMENT_OK')) { define('REQUIREMENT_INFO', -1); define('REQUIREMENT_OK', 0); @@ -212,13 +212,7 @@ public function requirements($cli = FALSE) { } /** - * Determine if a library's directory exist. - * - * @param string $name - * The library's directory name. - * - * @return bool - * TRUE if the library's directory exist. + * {@inheritdoc} */ public function exists($name) { // @todo Inject dependency once Drupal 8.9.x is only supported. @@ -231,16 +225,8 @@ public function exists($name) { } /** - * Finds files that are located in the supported 'libraries' directories. - * - * @param string $path - * The path for the library file to find. - * - * @return string|false - * The real path to the library file relative to the root directory. If the - * library cannot be found then FALSE. + * {@inheritdoc} */ - public function find($name) { if (\Drupal::hasService('library.libraries_directory_file_finder')) { return \Drupal::service('library.libraries_directory_file_finder')->find($name); @@ -475,7 +461,7 @@ protected function initLibraries() { 'description' => $this->t("Tabby provides lightweight, accessible vanilla JS toggle tabs."), 'notes' => $this->t('Tabby is used to display tabs in the administrative UI'), 'homepage_url' => Url::fromUri('https://github.com/cferdinandi/tabby'), - 'download_url' => Url::fromUri('https://github.com/cferdinandi/tabby/archive/v12.0.3.zip'), + 'download_url' => Url::fromUri('https://github.com/cferdinandi/tabby/archive/v12.0.3.zip'), 'version' => '12.0.3', ]; // Drupal 8 and 9 supports different version of PopperJS which is a @@ -486,7 +472,7 @@ protected function initLibraries() { 'description' => $this->t("Tippy.js is the complete tooltip, popover, dropdown, and menu solution for the web, powered by Popper."), 'notes' => $this->t('Tippy.js is used to provide a tooltips. Tippy.js 5.x is compatible with Drupal 8.x.'), 'homepage_url' => Url::fromUri('https://github.com/atomiks/tippyjs'), - 'download_url' => Url::fromUri('https://unpkg.com/tippy.js@5.2.1/dist/tippy-bundle.iife.min.js'), + 'download_url' => Url::fromUri('https://unpkg.com/tippy.js@5.2.1/dist/tippy-bundle.iife.min.js'), 'version' => '5.2.1', 'core' => 8, ]; @@ -495,7 +481,7 @@ protected function initLibraries() { 'description' => $this->t("Tippy.js is the complete tooltip, popover, dropdown, and menu solution for the web, powered by Popper."), 'notes' => $this->t('Tippy.js is used to provide a tooltips. Tippy.js 6.x is compatible with Drupal 9.x.'), 'homepage_url' => Url::fromUri('https://github.com/atomiks/tippyjs'), - 'download_url' => Url::fromUri('https://unpkg.com/tippy.js@6.2.6/dist/tippy-bundle.umd.min.js'), + 'download_url' => Url::fromUri('https://unpkg.com/tippy.js@6.2.6/dist/tippy-bundle.umd.min.js'), 'version' => '6.2.6', 'core' => 9, ]; diff --git a/web/modules/webform/src/WebformLibrariesManagerInterface.php b/web/modules/webform/src/WebformLibrariesManagerInterface.php index 07926ac61d..2aee8be107 100644 --- a/web/modules/webform/src/WebformLibrariesManagerInterface.php +++ b/web/modules/webform/src/WebformLibrariesManagerInterface.php @@ -29,8 +29,8 @@ public function exists($name); /** * Finds files that are located in the supported 'libraries' directories. * - * @param string $path - * The path for the library file to find. + * @param string $name + * The library's directory name. * * @return string|false * The real path to the library file relative to the root directory. If the diff --git a/web/modules/webform/src/WebformMessageManagerInterface.php b/web/modules/webform/src/WebformMessageManagerInterface.php index 9fbb53539a..204bf854b4 100644 --- a/web/modules/webform/src/WebformMessageManagerInterface.php +++ b/web/modules/webform/src/WebformMessageManagerInterface.php @@ -9,9 +9,9 @@ */ interface WebformMessageManagerInterface { - /****************************************************************************/ + /* ************************************************************************ */ // Hardcode message or custom messages with arguments constants. - /****************************************************************************/ + /* ************************************************************************ */ /** * Admin closed. @@ -58,11 +58,11 @@ interface WebformMessageManagerInterface { */ const HANDLER_SUBMISSION_REQUIRED = 'handler_submission_required'; - /****************************************************************************/ + /* ************************************************************************ */ // Configurable custom message constants with :href argument. // Values corresponds to admin config and webform settings // with *_message appended. - /****************************************************************************/ + /* ************************************************************************ */ /** * Submission previous. @@ -84,10 +84,10 @@ interface WebformMessageManagerInterface { */ const DRAFT_PENDING_MULTIPLE = 'draft_pending_multiple'; - /****************************************************************************/ + /* ************************************************************************ */ // Configurable custom message constants. // Values corresponds to admin config and webform settings. - /****************************************************************************/ + /* ************************************************************************ */ /** * Webform exception. diff --git a/web/modules/webform/src/WebformOptionsForm.php b/web/modules/webform/src/WebformOptionsForm.php index b0112a6677..f4b350743d 100644 --- a/web/modules/webform/src/WebformOptionsForm.php +++ b/web/modules/webform/src/WebformOptionsForm.php @@ -106,7 +106,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['likert'] = [ '#type' => 'checkbox', '#title' => $this->t('Use as likert'), - '#description' => $this->t("If checked, options will be available as answers to Likert elements. The 'Likert:' prefix will be removed from the option's label when listed as answers for a Likert elment."), + '#description' => $this->t("If checked, options will be available as answers to Likert elements. The 'Likert:' prefix will be removed from the option's label when listed as answers for a Likert element."), '#default_value' => $webform_options->get('likert'), '#return_value' => TRUE, ]; diff --git a/web/modules/webform/src/WebformOptionsStorage.php b/web/modules/webform/src/WebformOptionsStorage.php index fa394c1cfb..019a8b4c49 100644 --- a/web/modules/webform/src/WebformOptionsStorage.php +++ b/web/modules/webform/src/WebformOptionsStorage.php @@ -96,7 +96,7 @@ public function getLikerts() { $likert_options = []; foreach ($webform_options as $id => $webform_option) { - $likert_options[$id] = str_replace(t('Likert') . ': ', '', $webform_option->label()); + $likert_options[$id] = str_replace($this->t('Likert') . ': ', '', $webform_option->label()); } return $likert_options; } @@ -170,7 +170,7 @@ public function getUsedByWebforms(WebformOptionsInterface $webform_options) { } $options_id = $webform_options->id(); - return (isset($this->usedByWebforms[$options_id])) ? $this->usedByWebforms[$options_id] : []; + return $this->usedByWebforms[$options_id] ?? []; } } diff --git a/web/modules/webform/src/WebformRequest.php b/web/modules/webform/src/WebformRequest.php index 466150e6b8..b1757d695f 100644 --- a/web/modules/webform/src/WebformRequest.php +++ b/web/modules/webform/src/WebformRequest.php @@ -137,7 +137,7 @@ public function isWebformAdminRoute() { * {@inheritdoc} */ public function getCurrentSourceEntity($ignored_types = NULL) { - // TODO: Can we refactor this method away altogether and let all its callers + // @todo Can we refactor this method away altogether and let all its callers // work directly with webform source entity manager? return $this->webformSourceEntityManager->getSourceEntity(is_null($ignored_types) ? [] : $ignored_types); } @@ -212,9 +212,9 @@ public function getWebformSubmissionEntities() { return [$webform_submission, $source_entity]; } - /****************************************************************************/ - // Routing helpers - /****************************************************************************/ + /* ************************************************************************ */ + // Routing helpers. + /* ************************************************************************ */ /** * {@inheritdoc} diff --git a/web/modules/webform/src/WebformSubmissionConditionsValidator.php b/web/modules/webform/src/WebformSubmissionConditionsValidator.php index 6291254de1..7891e66857 100644 --- a/web/modules/webform/src/WebformSubmissionConditionsValidator.php +++ b/web/modules/webform/src/WebformSubmissionConditionsValidator.php @@ -60,9 +60,9 @@ public function __construct(WebformElementManagerInterface $element_manager) { $this->elementManager = $element_manager; } - /****************************************************************************/ + /* ************************************************************************ */ // Build pages methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -86,9 +86,9 @@ public function buildPages(array $pages, WebformSubmissionInterface $webform_sub return $pages; } - /****************************************************************************/ + /* ************************************************************************ */ // Build form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -290,9 +290,9 @@ public function replaceCrossPageTargets(array $conditions, WebformSubmissionInte return $cross_page_conditions; } - /****************************************************************************/ + /* ************************************************************************ */ // Validate form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -383,9 +383,9 @@ protected function validateFormElement(array $element, FormStateInterface $form_ } } - /****************************************************************************/ + /* ************************************************************************ */ // Submit form method. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -394,9 +394,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->processForm($form, $form_state); } - /****************************************************************************/ + /* ************************************************************************ */ // Process form methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Process form and unset submission data for form elements that are hidden. @@ -436,10 +436,10 @@ protected function processForm(array &$form, FormStateInterface $form_state) { * @param array $data * A webform submission's data. * @param bool $check_access - * Flag that determine if the currrent form element's access + * Flag that determine if the current form element's access * should be checked. * @param bool $visible - * Flag that determine if the currrent form elements are visible. + * Flag that determine if the current form elements are visible. */ protected function processFormRecursive(array $elements, WebformSubmissionInterface $webform_submission, array &$data, $check_access, $visible = TRUE) { foreach ($elements as $key => &$element) { @@ -470,9 +470,9 @@ protected function processFormRecursive(array $elements, WebformSubmissionInterf } } - /****************************************************************************/ + /* ************************************************************************ */ // Element hide/show validation methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Webform element #after_build callback: Wrap #element_validate so that we suppress element validation errors. @@ -506,9 +506,9 @@ public static function elementValidate(array &$element, FormStateInterface $form } } - /****************************************************************************/ + /* ************************************************************************ */ // Element state methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -576,9 +576,9 @@ public function isElementEnabled(array $element, WebformSubmissionInterface $web return $enabled; } - /****************************************************************************/ + /* ************************************************************************ */ // Validate state methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -599,9 +599,9 @@ public function validateState($state, array $conditions, WebformSubmissionInterf return ($negate) ? !$result : $result; } - /****************************************************************************/ + /* ************************************************************************ */ // Validate condition methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -861,9 +861,9 @@ protected function checkConditionTrigger($trigger, $trigger_value, $element_valu } } - /****************************************************************************/ + /* ************************************************************************ */ // State methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Process state by mapping aliases and negation. @@ -890,9 +890,9 @@ protected function processState($state) { return [$state, $negate]; } - /****************************************************************************/ + /* ************************************************************************ */ // Element methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build and get visible elements from a form. @@ -905,7 +905,7 @@ protected function processState($state) { */ protected function &getBuildElements(array &$form) { if (isset($form['#webform_id']) && isset($form['elements'])) { - $form_elements = &$form['elements']; + $form_elements = &$form['elements']; // phpcs:ignore } else { $form_elements = &$form; @@ -1118,10 +1118,10 @@ protected function addStatesHiddenToElement(array &$element) { $element[$attributes_property]['class'][] = 'js-webform-states-hidden'; } - /****************************************************************************/ + /* ************************************************************************ */ // Static input and selector methods. // @see \Drupal\webform\Plugin\WebformElementBase::getElementSelectorInputValue - /****************************************************************************/ + /* ************************************************************************ */ /** * Get input name from CSS :input[name="*"] selector. @@ -1155,7 +1155,7 @@ public static function getInputNameAsArray($name, $index = NULL) { $name = str_replace(['][', '[', ']'], ['|', '|', ''], $name); $array = explode('|', $name); if ($index !== NULL) { - return isset($array[$index]) ? $array[$index] : NULL; + return $array[$index] ?? NULL; } else { return $array; diff --git a/web/modules/webform/src/WebformSubmissionExporter.php b/web/modules/webform/src/WebformSubmissionExporter.php index 9a3c9d5d5d..476bf5aa77 100644 --- a/web/modules/webform/src/WebformSubmissionExporter.php +++ b/web/modules/webform/src/WebformSubmissionExporter.php @@ -235,9 +235,9 @@ public function getExportOptions() { return $this->getExporter()->getConfiguration(); } - /****************************************************************************/ + /* ************************************************************************ */ // Default options and webform. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -776,9 +776,9 @@ protected function appendExporterToStates(array &$states, $plugin_id) { $states[$state][] = [':input[name="exporter"]' => ['value' => $plugin_id]]; } - /****************************************************************************/ + /* ************************************************************************ */ // Generate and write. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -952,7 +952,7 @@ public function getQuery() { } // Filter by UID. - if ($export_options['uid'] !== '') { + if (!is_null($export_options['uid']) && $export_options['uid'] !== '') { $query->condition('uid', $export_options['uid'], '='); } @@ -986,8 +986,8 @@ public function getQuery() { } else { // Sort by created and sid in ASC or DESC order. - $query->sort('created', isset($export_options['order']) ? $export_options['order'] : 'ASC'); - $query->sort('sid', isset($export_options['order']) ? $export_options['order'] : 'ASC'); + $query->sort('created', $export_options['order'] ?? 'ASC'); + $query->sort('sid', $export_options['order'] ?? 'ASC'); } // Do not check access to submission since the exporter UI and Drush @@ -1063,9 +1063,9 @@ protected function hasWebformExportAttachmentElements() { return ($this->getWebformExportAttachmentElements()) ? TRUE : FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // Summary and download. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1095,9 +1095,8 @@ public function getBatchLimit() { /** @var \Drupal\webform\Plugin\WebformElementAttachmentInterface $attachment_element_plugin */ $attachment_element_plugin = $this->elementManager->getElementInstance($attachment_element); $attachment_batch_limit = $attachment_element_plugin->getExportAttachmentsBatchLimit(); - if ($attachment_batch_limit - && $attachment_batch_limit < $batch_limit) { - $batch_limit = $attachment_batch_limit; + if ($attachment_batch_limit && $attachment_batch_limit < $batch_limit) { + $batch_limit = $attachment_batch_limit; } } } diff --git a/web/modules/webform/src/WebformSubmissionForm.php b/web/modules/webform/src/WebformSubmissionForm.php index d608e70464..c03188ee45 100644 --- a/web/modules/webform/src/WebformSubmissionForm.php +++ b/web/modules/webform/src/WebformSubmissionForm.php @@ -10,12 +10,12 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\ContentEntityForm; use Drupal\Core\Entity\FieldableEntityInterface; -use Drupal\Core\Form\FormBuilderInterface; use Drupal\Core\Form\FormState; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Render\Element; use Drupal\Core\Routing\TrustedRedirectResponse; +use Drupal\Core\Session\AccountInterface; use Drupal\Core\Template\Attribute; use Drupal\Core\Url; use Drupal\webform\Cache\WebformBubbleableMetadata; @@ -347,12 +347,13 @@ public function setEntity(EntityInterface $entity) { // This allows the webform's public facing URL to be used instead of // the admin URL of the webform. $webform_submission_token = $this->getStorage()->loadFromToken($token, $webform, $source_entity, $account); + $request_token = $this->requestStack->getCurrentRequest()->request->get('webform_submission_token'); if ($webform_submission_token && $webform_submission_token->isDraft()) { $entity = $webform_submission_token; $data = $entity->getRawData(); } - elseif (isset($_POST['webform_submission_token'])) { - $webform_submission_token = $this->getStorage()->loadFromToken($_POST['webform_submission_token'], $webform, $source_entity, $account); + elseif ($request_token) { + $webform_submission_token = $this->getStorage()->loadFromToken($request_token, $webform, $source_entity, $account); if ($webform_submission_token && $webform_submission_token->isDraft()) { $entity = $webform_submission_token; $data = $entity->getRawData(); @@ -413,11 +414,7 @@ public function setEntity(EntityInterface $entity) { if ($this->operation === 'add' && $entity->isNew() && $webform->getSetting('autofill')) { - if ($last_submission = $this->getStorage()->getLastSubmission($webform, $source_entity, $account, ['in_draft' => FALSE, 'access_check' => FALSE])) { - $excluded_elements = $webform->getSetting('autofill_excluded_elements') ?: []; - $last_submission_data = array_diff_key($last_submission->getRawData(), $excluded_elements); - $data = $last_submission_data + $data; - } + $data = $this->getLastSubmissionData($webform, $source_entity, $account) + $data; } // Get default data and append it to the submission's data. @@ -439,6 +436,52 @@ public function setEntity(EntityInterface $entity) { return parent::setEntity($entity); } + /** + * Get last submission data with excluded elements. + * + * @param \Drupal\webform\WebformInterface $webform + * A webform. + * @param \Drupal\Core\Entity\EntityInterface|null $source_entity + * (optional) A webform submission source entity. + * @param \Drupal\Core\Session\AccountInterface|null $account + * The current user account. + * + * @return array + * An associative array containing last submission data + * with excluded elements. + */ + protected function getLastSubmissionData(WebformInterface $webform, EntityInterface $source_entity = NULL, AccountInterface $account = NULL) { + $last_submission = $this->getStorage()->getLastSubmission($webform, $source_entity, $account, ['in_draft' => FALSE, 'access_check' => FALSE]); + if (!$last_submission) { + return []; + } + + $data = $last_submission->getRawData(); + $excluded_elements = $webform->getSetting('autofill_excluded_elements') ?: []; + foreach ($excluded_elements as $excluded_element_key) { + // Unset excluded element. + unset($data[$excluded_element_key]); + + // Unset excluded composite sub-element. + if (strpos($excluded_element_key, '__') !== FALSE) { + [$excluded_parent_key, $excluded_composite_key] = explode('__', $excluded_element_key); + if (isset($data[$excluded_parent_key]) && is_array($data[$excluded_parent_key])) { + if (WebformArrayHelper::isSequential($data[$excluded_parent_key])) { + // Multi-value composite. + foreach (array_keys($data[$excluded_parent_key]) as $delta) { + unset($data[$excluded_parent_key][$delta][$excluded_composite_key]); + } + } + else { + // Single-value composite. + unset($data[$excluded_parent_key][$excluded_composite_key]); + } + } + } + } + return $data; + } + /** * {@inheritdoc} */ @@ -506,7 +549,7 @@ protected function overrideSettings(WebformSubmissionInterface $webform_submissi public 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 */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $entity; $webform = $webform_submission->getWebform(); @@ -545,7 +588,7 @@ public function copyFormValuesToEntity(EntityInterface $entity, array $form, For * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { - /* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $this->getEntity(); $webform = $this->getWebform(); @@ -561,8 +604,11 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; } - // Only prepopulate data when a webform is initially loaded. - if (!$form_state->isRebuilding()) { + // Only prepopulate data when a webform is initially loaded or ajax is + // triggering a restart. + if (!$form_state->isRebuilding() || $form_state->get('is_ajax_restart')) { + $form_state->set('is_ajax_restart', FALSE); + $data = $webform_submission->getData(); $this->prepopulateData($data); $webform_submission->setData($data); @@ -634,12 +680,11 @@ public function buildForm(array $form, FormStateInterface $form_state) { return $form; } - /** * {@inheritdoc} */ public function form(array $form, FormStateInterface $form_state) { - /* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $this->getEntity(); $source_entity = $webform_submission->getSourceEntity(); $webform = $this->getWebform(); @@ -845,7 +890,7 @@ public function form(array $form, FormStateInterface $form_state) { * elements should be built. */ protected function getCustomForm(array &$form, FormStateInterface $form_state) { - /* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $this->getEntity(); $webform = $this->getWebform(); @@ -989,7 +1034,7 @@ protected function getCustomForm(array &$form, FormStateInterface $form_state) { * The current state of the form. */ protected function displayMessages(array $form, FormStateInterface $form_state) { - /* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $this->getEntity(); $webform = $this->getWebform(); $source_entity = $this->getSourceEntity(); @@ -1090,9 +1135,9 @@ protected function displayMessages(array $form, FormStateInterface $form_state) } } - /****************************************************************************/ + /* ************************************************************************ */ // Webform libraries and behaviors. - /****************************************************************************/ + /* ************************************************************************ */ /** * Attach libraries to the form. @@ -1207,9 +1252,9 @@ protected function attachBehaviors(array &$form, FormStateInterface $form_state) } } - /****************************************************************************/ + /* ************************************************************************ */ // Webform actions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1327,12 +1372,11 @@ protected function actionsElement(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ protected function actions(array $form, FormStateInterface $form_state) { - /* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $this->entity; $element = parent::actions($form, $form_state); - /* @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $preview_mode = $this->getWebformSetting('preview'); // Mark the submit action as the primary action, when it appears. @@ -1566,6 +1610,8 @@ public function submit(array &$form, FormStateInterface $form_state) { * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. + * @param bool $skip_preview + * Skips the preview page. */ public function next(array &$form, FormStateInterface $form_state, $skip_preview = FALSE) { if ($form_state->getErrors()) { @@ -1855,6 +1901,11 @@ public function confirmForm(array &$form, FormStateInterface $form_state) { // Rebuild or reset the form if reloading the current form via AJAX. if ($this->isAjax()) { + // Track that Ajax is restarting the form so that the submission + // can be prepopulated. + // @see \Drupal\webform\WebformSubmissionForm::buildForm + $form_state->set('is_ajax_restart', TRUE); + // On update, rebuild and display message unless ?destination= is set. // @see \Drupal\webform\WebformSubmissionForm::setConfirmation if ($state === WebformSubmissionInterface::STATE_UPDATED) { @@ -1978,9 +2029,9 @@ public function reset(array &$form, FormStateInterface $form_state) { $this->rebuild($form, $form_state); } - /****************************************************************************/ + /* ************************************************************************ */ // Validate functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Validate uploaded managed file limits. @@ -2069,9 +2120,9 @@ protected function getUploadedManagedFileIds() { return $fids; } - /****************************************************************************/ - // Webform functions - /****************************************************************************/ + /* ************************************************************************ */ + // Webform functions. + /* ************************************************************************ */ /** * Set the webform properties from the elements. @@ -2104,9 +2155,9 @@ protected function setFormPropertiesFromElements(array &$form, array &$elements) } } - /****************************************************************************/ - // Wizard page functions - /****************************************************************************/ + /* ************************************************************************ */ + // Wizard page functions. + /* ************************************************************************ */ /** * Determine if this is a multi-step wizard form. @@ -2292,9 +2343,9 @@ protected function displayCurrentPage(array &$form, FormStateInterface $form_sta } } - /****************************************************************************/ - // Webform state functions - /****************************************************************************/ + /* ************************************************************************ */ + // Webform state functions. + /* ************************************************************************ */ /** * Set webform state to redirect to a trusted redirect response. @@ -2368,6 +2419,7 @@ protected function setConfirmation(FormStateInterface $form_state) { if ($confirmation_type === WebformInterface::CONFIRMATION_URL_MESSAGE) { $this->getMessageManager()->display(WebformMessageManagerInterface::SUBMISSION_CONFIRMATION_MESSAGE); } + $redirect_url->mergeOptions($route_options); $this->setTrustedRedirectUrl($form_state, $redirect_url); } else { @@ -2408,7 +2460,7 @@ protected function setConfirmation(FormStateInterface $form_state) { } /** - * Get the webform's confrmation URL. + * Get the webform's confirmation URL. * * @return \Drupal\Core\Url|false * The url object, or FALSE if the path is not valid. @@ -2431,7 +2483,7 @@ protected function getConfirmationUrl() { // Get redirect URL from special paths: '<front>' and '<none>'. $redirect_url = $this->pathValidator->getUrlIfValid($confirmation_url); } - else { + else { // Get redirect URL by validating the Drupal relative path which does not // begin with a forward slash (/). $confirmation_url = $this->aliasManager->getPathByAlias('/' . $confirmation_url); @@ -2471,9 +2523,9 @@ public static function removeConfirmationModal(&$element, FormStateInterface $fo unset($complete_form['webform_confirmation_modal']); } - /****************************************************************************/ - // Elements functions - /****************************************************************************/ + /* ************************************************************************ */ + // Elements functions. + /* ************************************************************************ */ /** * Prepare webform elements. @@ -2722,9 +2774,9 @@ protected function populateElements(array &$elements, array $values) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Cache related functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Add cache dependency to the form's render array. @@ -2733,7 +2785,7 @@ protected function populateElements(array &$elements, array $values) { * The form's render array to update. */ protected function addCacheableDependency(array &$form) { - /* @var $webform_submission \Drupal\webform\WebformSubmissionInterface */ + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $this->getEntity(); // All anonymous submissions are tracked in the $_SESSION. @@ -2767,9 +2819,9 @@ protected function addCacheableDependency(array &$form) { } } - /****************************************************************************/ - // Account related functions - /****************************************************************************/ + /* ************************************************************************ */ + // Account related functions. + /* ************************************************************************ */ /** * Check webform submission total limits. @@ -2954,9 +3006,9 @@ protected function isWebformEntityReferenceFromSourceEntity() { return ($webform->id() === $this->getWebform()->id()) ? TRUE : FALSE; } - /****************************************************************************/ - // Helper functions - /****************************************************************************/ + /* ************************************************************************ */ + // Helper functions. + /* ************************************************************************ */ /** * Get the webform submission's webform. @@ -3044,9 +3096,9 @@ protected function getWebformSetting($name, $default_value = NULL) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Share functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Determine if the submission form is being embedded in a share page. @@ -3058,10 +3110,10 @@ protected function isSharePage() { return (strpos($this->getRouteMatch()->getRouteName(), 'entity.webform.share_page') === 0); } - /****************************************************************************/ + /* ************************************************************************ */ // Ajax functions. // @see \Drupal\webform\Form\WebformAjaxFormTrait - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -3099,9 +3151,9 @@ public function validateAjaxForm(array &$form, FormStateInterface $form_state) { } } - /****************************************************************************/ + /* ************************************************************************ */ // API helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Programmatically check that a webform is open to new submissions. diff --git a/web/modules/webform/src/WebformSubmissionGenerate.php b/web/modules/webform/src/WebformSubmissionGenerate.php index 3f8d37d529..705b2b15c1 100644 --- a/web/modules/webform/src/WebformSubmissionGenerate.php +++ b/web/modules/webform/src/WebformSubmissionGenerate.php @@ -219,7 +219,7 @@ protected function getTestValues(WebformInterface $webform, $name, array $elemen } // Return default values. - return (isset($this->names['default'])) ? $this->names['default'] : NULL; + return $this->names['default'] ?? NULL; } } diff --git a/web/modules/webform/src/WebformSubmissionListBuilder.php b/web/modules/webform/src/WebformSubmissionListBuilder.php index 2cf427da6d..76d32530e0 100644 --- a/web/modules/webform/src/WebformSubmissionListBuilder.php +++ b/web/modules/webform/src/WebformSubmissionListBuilder.php @@ -301,7 +301,7 @@ protected function initialize() { $this->state = $this->request->query->get('state'); $this->sourceEntityTypeId = $this->request->query->get('entity'); - list($this->webform, $this->sourceEntity) = $this->requestHandler->getWebformEntities(); + [$this->webform, $this->sourceEntity] = $this->requestHandler->getWebformEntities(); $this->messageManager->setWebform($this->webform); $this->messageManager->setSourceEntity($this->sourceEntity); @@ -469,7 +469,7 @@ protected function buildSubmissionViews() { $settings = $this->submissionViews[$this->submissionView]; // Get view name and display id. - list($name, $display_id) = explode(':', $settings['view']); + [$name, $display_id] = explode(':', $settings['view']); // Load the view and set custom property used to fix the exposed // filter action. @@ -566,7 +566,7 @@ protected function buildEntityList() { && !$this->account && $this->webform && $this->webform->access('submission_update_any')) { - $build['table'] = \Drupal::formBuilder()->getForm('\Drupal\webform\Form\WebformSubmissionBulkForm', $build['table'], $this->webform->access('submission_delete_any')); + $build['table'] = \Drupal::formBuilder()->getForm('\Drupal\webform\Form\WebformSubmissionBulkForm', $build['table'], $this->webform->access('submission_delete_any')); } // Must preload libraries required by (modal) dialogs. @@ -660,7 +660,7 @@ protected function buildFilterForm() { elseif ($this->sourceEntityTypeId && strpos($this->sourceEntityTypeId, ':') !== FALSE) { $source_entity_options = $this->webform; try { - list($source_entity_type, $source_entity_id) = explode(':', $this->sourceEntityTypeId); + [$source_entity_type, $source_entity_id] = explode(':', $this->sourceEntityTypeId); $source_entity = $this->entityTypeManager->getStorage($source_entity_type)->load($source_entity_id); $source_entity_default_value = $source_entity->label() . " ($source_entity_type:$source_entity_id)"; } @@ -733,9 +733,9 @@ protected function buildInfo() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Header functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -786,7 +786,7 @@ public function buildHeader() { protected function buildHeaderColumn(array $column) { $name = $column['name']; if ($this->format['header_format'] === 'key') { - $title = isset($column['key']) ? $column['key'] : $column['name']; + $title = $column['key'] ?? $column['name']; } else { $title = $column['title']; @@ -817,9 +817,9 @@ protected function buildHeaderColumn(array $column) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Row functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -974,7 +974,7 @@ public function buildRowColumn(array $column, EntityInterface $entity) { ]; case 'uid': - return ($is_raw) ? $entity->getOwner()->id() : ($entity->getOwner()->getAccountName() ?: t('Anonymous')); + return ($is_raw) ? $entity->getOwner()->id() : ($entity->getOwner()->getAccountName() ?: $this->t('Anonymous')); case 'uuid': return $entity->uuid(); @@ -998,9 +998,9 @@ public function buildRowColumn(array $column, EntityInterface $entity) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Operations. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1124,9 +1124,9 @@ public function getDefaultOperations(EntityInterface $entity) { return $operations; } - /****************************************************************************/ + /* ************************************************************************ */ // Route functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get submission route name based on the current route. @@ -1166,9 +1166,9 @@ protected function getRouteParameters(WebformSubmissionInterface $webform_submis return $route_parameters; } - /****************************************************************************/ + /* ************************************************************************ */ // Submission views functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get the submission view type for the current route. @@ -1261,7 +1261,7 @@ protected function getSubmissionViews() { continue; } - list($view_name, $view_display_id) = explode(':', $submission_view['view']); + [$view_name, $view_display_id] = explode(':', $submission_view['view']); $view = Views::getView($view_name); if (!$view || !$view->access($view_display_id)) { unset($submission_views[$name]); @@ -1272,9 +1272,9 @@ protected function getSubmissionViews() { return $submission_views; } - /****************************************************************************/ + /* ************************************************************************ */ // Query functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1415,7 +1415,7 @@ protected function getQuery($keys = '', $state = '', $source_entity = '') { // Filter by source entity. if ($source_entity && strpos($source_entity, ':') !== FALSE) { - list($entity_type, $entity_id) = explode(':', $source_entity); + [$entity_type, $entity_id] = explode(':', $source_entity); $query->condition('entity_type', $entity_type); $query->condition('entity_id', $entity_id); } diff --git a/web/modules/webform/src/WebformSubmissionNotesForm.php b/web/modules/webform/src/WebformSubmissionNotesForm.php index 75070560b9..b4b7322b35 100644 --- a/web/modules/webform/src/WebformSubmissionNotesForm.php +++ b/web/modules/webform/src/WebformSubmissionNotesForm.php @@ -34,9 +34,9 @@ public static function create(ContainerInterface $container) { * {@inheritdoc} */ public function form(array $form, FormStateInterface $form_state) { - // @var \Drupal\webform\WebformSubmissionInterface $webform_submission. - // @var \Drupal\Core\Entity\EntityInterface $source_entity. - list($webform_submission, $source_entity) = $this->requestHandler->getWebformSubmissionEntities(); + /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ + /** @var \Drupal\Core\Entity\EntityInterface $source_entity */ + [$webform_submission, $source_entity] = $this->requestHandler->getWebformSubmissionEntities(); $form['navigation'] = [ '#type' => 'webform_submission_navigation', diff --git a/web/modules/webform/src/WebformSubmissionStorage.php b/web/modules/webform/src/WebformSubmissionStorage.php index 45e23677e3..1917277f2f 100644 --- a/web/modules/webform/src/WebformSubmissionStorage.php +++ b/web/modules/webform/src/WebformSubmissionStorage.php @@ -315,9 +315,9 @@ public function hasSubmissionValue(WebformInterface $webform, $element_key) { return $result->fetchAssoc() ? TRUE : FALSE; } - /****************************************************************************/ + /* ************************************************************************ */ // Source entity methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -380,9 +380,9 @@ public function getSourceEntitiesAsOptions(WebformInterface $webform) { return (count($options) === 1) ? reset($options) : $options; } - /****************************************************************************/ + /* ************************************************************************ */ // Query methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Add condition to submission query. @@ -454,9 +454,9 @@ public function addQueryConditions($query, WebformInterface $webform = NULL, Ent } } - /****************************************************************************/ + /* ************************************************************************ */ // Paging methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -600,9 +600,9 @@ protected function getSiblingSubmission(WebformSubmissionInterface $webform_subm return $submission; } - /****************************************************************************/ + /* ************************************************************************ */ // WebformSubmissionEntityList methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -874,9 +874,9 @@ protected function filterColumns(array $column_names, array $columns) { return $filtered_columns; } - /****************************************************************************/ + /* ************************************************************************ */ // Custom settings methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -917,9 +917,9 @@ public function getCustomSetting($name, $default, WebformInterface $webform = NU } } - /****************************************************************************/ + /* ************************************************************************ */ // Invoke WebformElement and WebformHandler plugin methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1191,16 +1191,16 @@ public function delete(array $entities) { $this->loggerFactory->get('webform') ->notice('Deleted @form: Submission #@id.', [ '@id' => $entity->id(), - '@form' => ($webform) ? $webform->label() : '[' . t('Webform') . ']', + '@form' => ($webform) ? $webform->label() : '[' . $this->t('Webform') . ']', ]); } return $return; } - /****************************************************************************/ + /* ************************************************************************ */ // Invoke methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1222,9 +1222,9 @@ public function invokeWebformElements($method, WebformSubmissionInterface $webfo } } - /****************************************************************************/ + /* ************************************************************************ */ // Purge methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1281,9 +1281,9 @@ public function purge($count) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Data handlers. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1299,7 +1299,7 @@ public function saveData(WebformSubmissionInterface $webform_submission, $delete $rows = []; foreach ($data as $name => $item) { - $element = (isset($elements[$name])) ? $elements[$name] : ['#webform_multiple' => FALSE, '#webform_composite' => FALSE]; + $element = $elements[$name] ?? ['#webform_multiple' => FALSE, '#webform_composite' => FALSE]; // Check if this is a computed element which is not // stored in the database. @@ -1394,7 +1394,7 @@ protected function loadData(array &$webform_submissions) { /** @var \Drupal\webform\WebformInterface $webform */ $webform = $webform_submissions[$sid]->getWebform(); $elements = ($webform) ? $webform->getElementsInitializedFlattenedAndHasValue() : []; - $element = (isset($elements[$name])) ? $elements[$name] : ['#webform_multiple' => FALSE, '#webform_composite' => FALSE]; + $element = $elements[$name] ?? ['#webform_multiple' => FALSE, '#webform_composite' => FALSE]; if ($element['#webform_composite']) { if ($element['#webform_multiple']) { @@ -1437,9 +1437,9 @@ protected function deleteData(array $webform_submissions) { ->execute(); } - /****************************************************************************/ + /* ************************************************************************ */ // Draft methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1464,9 +1464,9 @@ public function loadDraft(WebformInterface $webform, EntityInterface $source_ent return ($sids = $query->execute()) ? $this->load(reset($sids)) : NULL; } - /****************************************************************************/ + /* ************************************************************************ */ // Anonymous submission methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -1518,8 +1518,8 @@ public function getAnonymousSubmissionIds(AccountInterface $account) { // Cleanup sids because drafts could have been purged or the webform // submission could have been deleted. $_SESSION['webform_submissions'] = $this->getQuery() - // Disable access check because user having 'sid' in his $_SESSION already - // implies he has access to it. + // Disable access check because user having 'sid' in their $_SESSION already + // implies they have access to it. ->accessCheck(FALSE) ->condition('sid', $_SESSION['webform_submissions'], 'IN') ->sort('sid') diff --git a/web/modules/webform/src/WebformSubmissionStorageInterface.php b/web/modules/webform/src/WebformSubmissionStorageInterface.php index d62d8febbe..7302c6751d 100644 --- a/web/modules/webform/src/WebformSubmissionStorageInterface.php +++ b/web/modules/webform/src/WebformSubmissionStorageInterface.php @@ -174,9 +174,9 @@ public function getMaxSubmissionId(WebformInterface $webform = NULL, EntityInter */ public function hasSubmissionValue(WebformInterface $webform, $element_key); - /****************************************************************************/ + /* ************************************************************************ */ // Source entity methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get total number of source entities. @@ -213,9 +213,9 @@ public function getSourceEntities(WebformInterface $webform); */ public function getSourceEntitiesAsOptions(WebformInterface $webform); - /****************************************************************************/ + /* ************************************************************************ */ // Query methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Add condition to submission query. @@ -238,9 +238,9 @@ public function getSourceEntitiesAsOptions(WebformInterface $webform); */ public function addQueryConditions($query, WebformInterface $webform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, array $options = []); - /****************************************************************************/ + /* ************************************************************************ */ // Paging methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get a webform's first submission. @@ -335,9 +335,9 @@ public function getSourceEntityTypes(WebformInterface $webform); */ public function getSourceEntityAsOptions(WebformInterface $webform, $entity_type); - /****************************************************************************/ + /* ************************************************************************ */ // WebformSubmissionEntityList methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get customized submission columns used to display custom table. @@ -457,9 +457,9 @@ public function getUserDefaultColumnNames(WebformInterface $webform = NULL, Enti */ public function getDefaultColumnNames(WebformInterface $webform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE); - /****************************************************************************/ + /* ************************************************************************ */ // Custom settings methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get customize setting. @@ -478,9 +478,9 @@ public function getDefaultColumnNames(WebformInterface $webform = NULL, EntityIn */ public function getCustomSetting($name, $default, WebformInterface $webform = NULL, EntityInterface $source_entity = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Custom CRUD methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Resaves the entity without triggering any hooks or handlers. @@ -497,9 +497,9 @@ public function getCustomSetting($name, $default, WebformInterface $webform = NU */ public function resave(EntityInterface $entity); - /****************************************************************************/ + /* ************************************************************************ */ // Invoke methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Invoke a webform submission's webform's handlers method. @@ -532,9 +532,9 @@ public function invokeWebformHandlers($method, WebformSubmissionInterface $webfo */ public function invokeWebformElements($method, WebformSubmissionInterface $webform_submission, &$context1 = NULL, &$context2 = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Purge methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Purge webform submissions. @@ -544,9 +544,9 @@ public function invokeWebformElements($method, WebformSubmissionInterface $webfo */ public function purge($count); - /****************************************************************************/ + /* ************************************************************************ */ // Data handlers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Save webform submission data to the 'webform_submission_data' table. @@ -563,9 +563,9 @@ public function purge($count); */ public function saveData(WebformSubmissionInterface $webform_submission, $delete_first = TRUE); - /****************************************************************************/ + /* ************************************************************************ */ // Draft methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get webform submission draft. @@ -582,9 +582,9 @@ public function saveData(WebformSubmissionInterface $webform_submission, $delete */ public function loadDraft(WebformInterface $webform, EntityInterface $source_entity = NULL, AccountInterface $account = NULL); - /****************************************************************************/ + /* ************************************************************************ */ // Anonymous submission methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * React to an event when a user logs in. diff --git a/web/modules/webform/src/WebformSubmissionViewBuilder.php b/web/modules/webform/src/WebformSubmissionViewBuilder.php index a0fe4b27e9..3d3f9894fa 100644 --- a/web/modules/webform/src/WebformSubmissionViewBuilder.php +++ b/web/modules/webform/src/WebformSubmissionViewBuilder.php @@ -197,7 +197,7 @@ public function buildElements(array $elements, WebformSubmissionInterface $webfo $build[$key] = $build_element; if (!$this->isElementVisible($element, $webform_submission, $options)) { $build[$key]['#access'] = FALSE; - }; + } } } diff --git a/web/modules/webform/src/WebformSubmissionViewsData.php b/web/modules/webform/src/WebformSubmissionViewsData.php index baa950f252..9aeb9dce89 100644 --- a/web/modules/webform/src/WebformSubmissionViewsData.php +++ b/web/modules/webform/src/WebformSubmissionViewsData.php @@ -17,8 +17,8 @@ public function getViewsData() { // Disable hook_webform_submission_query_access_alter() to remove // performance issues related to loading all webforms. + // phpcs:ignore Drupal.Commenting.InlineComment.InvalidEndChar // $data['webform_submission']['table']['base']['access query tag'] = 'webform_submission_access'; - $data['webform_submission']['webform_submission_bulk_form'] = [ 'title' => $this->t('Webform submission operations bulk form'), 'help' => $this->t('Add a form element that lets you run operations on multiple submissions.'), diff --git a/web/modules/webform/src/WebformThirdPartySettingsManager.php b/web/modules/webform/src/WebformThirdPartySettingsManager.php index 06e33533f9..d19315acc6 100644 --- a/web/modules/webform/src/WebformThirdPartySettingsManager.php +++ b/web/modules/webform/src/WebformThirdPartySettingsManager.php @@ -109,7 +109,7 @@ public function setThirdPartySetting($module, $key, $value) { */ public function getThirdPartySetting($module, $key, $default = NULL) { $value = $this->config->get("third_party_settings.$module.$key"); - return (isset($value)) ? $value : $default; + return $value ?? $default; } /** diff --git a/web/modules/webform/src/WebformTokenManager.php b/web/modules/webform/src/WebformTokenManager.php index 1150414075..755a3684dc 100644 --- a/web/modules/webform/src/WebformTokenManager.php +++ b/web/modules/webform/src/WebformTokenManager.php @@ -64,7 +64,7 @@ class WebformTokenManager implements WebformTokenManagerInterface { * * @see webform_token_info_alter() */ - static protected $suffixes = [ + protected static $suffixes = [ // Removes the token when not replaced. 'clear', // Decodes HTML entities. @@ -210,9 +210,9 @@ protected function setTokenOptions(array &$options, EntityInterface $entity) { $options += $token_options; } - /****************************************************************************/ + /* ************************************************************************ */ // Token elements. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -283,9 +283,9 @@ public function buildTreeElement(array $token_types = ['webform', 'webform_submi } } - /****************************************************************************/ + /* ************************************************************************ */ // Token validation. - /****************************************************************************/ + /* ************************************************************************ */ /** * {@inheritdoc} @@ -337,7 +337,7 @@ public function elementValidate(array &$form, array $token_types = ['webform', ' * Element is not being based by reference since the #value is being altered. */ public static function validateElement($element, FormStateInterface $form_state, &$complete_form) { - $value = isset($element['#value']) ? $element['#value'] : $element['#default_value']; + $value = $element['#value'] ?? $element['#default_value']; if (!mb_strlen($value)) { return $element; @@ -358,9 +358,9 @@ public static function validateElement($element, FormStateInterface $form_state, token_element_validate($element, $form_state); } - /****************************************************************************/ + /* ************************************************************************ */ // Suffix handling. - /****************************************************************************/ + /* ************************************************************************ */ /** * Get an array of supported token suffixes. diff --git a/web/modules/webform/src/WebformTranslationConfigManager.php b/web/modules/webform/src/WebformTranslationConfigManager.php index 009e496beb..c0d3ae1917 100644 --- a/web/modules/webform/src/WebformTranslationConfigManager.php +++ b/web/modules/webform/src/WebformTranslationConfigManager.php @@ -93,7 +93,7 @@ class WebformTranslationConfigManager implements WebformTranslationConfigManager * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager * The typed config manager. */ - public function __construct(ModuleHandlerInterface $module_handler, FormBuilderInterface $form_builder, WebformElementManagerInterface $element_manager, WebformTranslationManagerInterface $translation_manager, TypedConfigManagerInterface $typed_config_manager = null) { + public function __construct(ModuleHandlerInterface $module_handler, FormBuilderInterface $form_builder, WebformElementManagerInterface $element_manager, WebformTranslationManagerInterface $translation_manager, TypedConfigManagerInterface $typed_config_manager = NULL) { $this->formBuilder = $form_builder; $this->moduleHandler = $module_handler; $this->elementManager = $element_manager; @@ -201,7 +201,7 @@ protected function alterConfigOptionsForm($config_name, array &$config_element) $this->alterTypedConfigElements($config_element, "webform.webform_options.*"); } - /** + /** * Alter the webform options custom configuration form. * * @param string $config_name @@ -213,7 +213,6 @@ protected function alterConfigOptionsCustomForm($config_name, array &$config_ele $this->alterTypedConfigElements($config_element, "webform_options_custom.webform_options_custom.*"); } - /** * Alter the webform image select configuration form. * @@ -233,12 +232,12 @@ protected function alterConfigImageSelectForm($config_name, array &$config_eleme * The webform configuration name. * @param array $config_element * The webform configuration element. - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function alterConfigWebformForm($config_name, &$config_element, &$form, $form_state) { + protected function alterConfigWebformForm($config_name, array &$config_element, array &$form, FormStateInterface $form_state) { $this->alterConfigWebformFormElements($config_name, $config_element, $form, $form_state); $this->alterConfigWebformFormHandlers($config_name, $config_element, $form, $form_state); @@ -285,7 +284,7 @@ public static function validateWebformForm(&$form, FormStateInterface $form_stat $translation_elements[$key] = WebformArrayHelper::addPrefix($element); // Handle composite elements. if (isset($translation_elements[$key]['#element'])) { - foreach ($translation_elements[$key]['#element'] as $composite_key => $composite_element) { + foreach ($translation_elements[$key]['#element'] as $composite_key => $composite_element) { $translation_elements[$key]['#element'][$composite_key] = WebformArrayHelper::addPrefix($composite_element); } } @@ -308,9 +307,9 @@ public static function validateWebformForm(&$form, FormStateInterface $form_stat $form_state->setValues($values); } - /****************************************************************************/ + /* ************************************************************************ */ // Handler alteration methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Alter the webform configuration form handlers. @@ -319,15 +318,15 @@ public static function validateWebformForm(&$form, FormStateInterface $form_stat * The webform configuration name. * @param array $config_element * The webform configuration element. - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function alterConfigWebformFormHandlers($config_name, &$config_element, &$form, $form_state) { + protected function alterConfigWebformFormHandlers($config_name, array &$config_element, array &$form, FormStateInterface $form_state) { $handlers = &$config_element['handlers']; // Verify if the webform has any handler. - if(!isset($handlers)){ + if (!isset($handlers)) { return; } @@ -358,9 +357,9 @@ protected function alterConfigWebformFormHandlers($config_name, &$config_element } } - /****************************************************************************/ + /* ************************************************************************ */ // Form and element alteration methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Alter the webform configuration form elements. @@ -369,12 +368,12 @@ protected function alterConfigWebformFormHandlers($config_name, &$config_element * The webform configuration name. * @param array $config_element * The webform configuration element. - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - protected function alterConfigWebformFormElements($config_name, &$config_element, &$form, $form_state) { + protected function alterConfigWebformFormElements($config_name, array &$config_element, array &$form, FormStateInterface $form_state) { $webform = $this->loadWebform($config_name); $translation_langcode = $form_state->get('config_translation_language')->getId(); @@ -443,7 +442,7 @@ protected function buildConfigWebformFormElements(array $element, array $transla // NOTE: It is possible that all the below code could be moved into // the WebformElement plugin but this would create more abstraction. // For now, it is easier to keep all the logic in this one class/service. - if (is_array($property_value) && !WebformArrayHelper::isMultidimensional($property_value) && !Element::properties($property_value)) { + if (is_array($property_value) && !WebformArrayHelper::isMultidimensional($property_value) && !WebformElementHelper::properties($property_value)) { // Options. $elements[$property_key] = $this->buildConfigWebformFormOptionsPropertyElement( $element, @@ -492,13 +491,13 @@ protected function buildConfigWebformFormElements(array $element, array $transla * The Webform element's translated properties. * @param array $source_element * The Webform element's source properties. - * @param array $parents + * @param array $property_parents * The Webform element's parents. * * @return array * A render array containing config webform form options property element. */ - protected function buildConfigWebformFormOptionsPropertyElement(array $element, array $translation_element, array $source_element, $property_parents) { + protected function buildConfigWebformFormOptionsPropertyElement(array $element, array $translation_element, array $source_element, array $property_parents) { $property_key = end($property_parents); $property_name = '#' . $property_key; @@ -506,18 +505,18 @@ protected function buildConfigWebformFormOptionsPropertyElement(array $element, $element_property = $this->getWebformElementProperty($webform_element->getPluginId(), $property_name); $property_value = $translation_element[$property_name]; - $property_title = (isset($element_property['#title'])) ? $element_property['#title'] : $property_name; + $property_title = $element_property['#title'] ?? $property_name; // Options (key/value pairs). $translation_options = $property_value; $source_options = $source_element[$property_name]; - $t_args = ['@label' => isset($element['#label']) ? Unicode::ucfirst($element['#label']) : t('Options')]; + $t_args = ['@label' => isset($element['#label']) ? Unicode::ucfirst($element['#label']) : $this->t('Options')]; if (!empty($element['#options_description'])) { - $options_title = t('@label text', $t_args); + $options_title = $this->t('@label text', $t_args); } else { - $options_title = t('@label text -- description', $t_args); + $options_title = $this->t('@label text -- description', $t_args); } // Header. @@ -568,13 +567,13 @@ protected function buildConfigWebformFormOptionsPropertyElement(array $element, * The Webform element's translated properties. * @param array $source_element * The Webform element's source properties. - * @param array $parents + * @param array $property_parents * The Webform element's parents. * * @return array * A render array containing config webform form image select property element. */ - protected function buildConfigWebformFormImageSelectPropertyElement(array $element, array $translation_element, array $source_element, $property_parents) { + protected function buildConfigWebformFormImageSelectPropertyElement(array $element, array $translation_element, array $source_element, array $property_parents) { $property_key = end($property_parents); $property_name = '#' . $property_key; @@ -582,7 +581,7 @@ protected function buildConfigWebformFormImageSelectPropertyElement(array $eleme $element_property = $this->getWebformElementProperty($webform_element->getPluginId(), $property_name); $property_value = $translation_element[$property_name]; - $property_title = (isset($element_property['#title'])) ? $element_property['#title'] : $property_name; + $property_title = $element_property['#title'] ?? $property_name; // Images. $translation_images = $property_value; @@ -666,19 +665,19 @@ protected function buildConfigWebformFormImageSelectPropertyElement(array $eleme * The Webform element's translated properties. * @param array $source_element * The Webform element's source properties. - * @param array $parents + * @param array $property_parents * The Webform element's parents. * * @return array * A render array containing config webform form composite property element. */ - protected function buildConfigWebformFormCompositePropertyElement(array $element, array $translation_element, array $source_element, $property_parents) { + protected function buildConfigWebformFormCompositePropertyElement(array $element, array $translation_element, array $source_element, array $property_parents) { $property_key = end($property_parents); $property_name = '#' . $property_key; - $webform_element = $this->elementManager->getElementInstance($element); /** @var \Drupal\webform\Plugin\WebformElement\WebformCustomComposite $webform_element */ - $webform_element->initializeCompositeElements($element);; + $webform_element = $this->elementManager->getElementInstance($element); + $webform_element->initializeCompositeElements($element); $composite_elements = $element['#webform_composite_elements']; $property_value = $translation_element[$property_name]; @@ -713,13 +712,13 @@ protected function buildConfigWebformFormCompositePropertyElement(array $element * The Webform element's translated properties. * @param array $source_element * The Webform element's source properties. - * @param array $parents + * @param array $property_parents * The Webform element's parents. * * @return array * A render array containing config webform form default property element. */ - protected function buildConfigWebformFormDefaultPropertyElement(array $element, array $translation_element, array $source_element, $property_parents) { + protected function buildConfigWebformFormDefaultPropertyElement(array $element, array $translation_element, array $source_element, array $property_parents) { $property_key = end($property_parents); $property_name = '#' . $property_key; @@ -727,8 +726,8 @@ protected function buildConfigWebformFormDefaultPropertyElement(array $element, $element_property = $this->getWebformElementProperty($webform_element->getPluginId(), $property_name); $property_value = $translation_element[$property_name]; - $property_title = (isset($element_property['#title'])) ? $element_property['#title'] : $property_name; - $property_type = (isset($element_property['#type'])) ? $element_property['#type'] : NULL; + $property_title = $element_property['#title'] ?? $property_name; + $property_type = $element_property['#type'] ?? NULL; $property_translation_element = [ '#title' => $property_title, @@ -829,7 +828,7 @@ protected function alterElements(array &$elements, array $element_alterations) { } } - /****************************************************************************/ + /* ************************************************************************ */ /** * Alter the webform configuration form using type config schema. @@ -892,7 +891,7 @@ protected function alterHtmlEditorElement(array &$element) { // Undo nl2br() so that the HTML markup's spacing is correct. // @see \Drupal\config_translation\FormElement\FormElementBase::getSourceElement // @see https://stackoverflow.com/questions/2494754/opposite-of-nl2br-is-it-str-replace - $element['source']['#markup'] = preg_replace("#<br />$#m","", (string) $element['source']['#markup']); + $element['source']['#markup'] = preg_replace("#<br />$#m", "", (string) $element['source']['#markup']); $element['translation']['#type'] = 'webform_html_editor'; } @@ -901,7 +900,7 @@ protected function alterHtmlEditorElement(array &$element) { * * @param array $element * A element containing 'source' and 'translation'. - * @param string $mode. + * @param string $mode * Codemirror editor mode. Default to 'yaml'. */ protected function alterTextareaElement(array &$element, $mode = 'yaml') { @@ -944,9 +943,9 @@ protected function alterTextareaElement(array &$element, $mode = 'yaml') { $element['#attached']['library'][] = 'webform/webform.admin.translation'; } - /****************************************************************************/ + /* ************************************************************************ */ // Utility methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Flatten a nested array of elements. @@ -976,6 +975,8 @@ protected function getElementsFlattened(array $elements) { * * @param string $type * The webform element type. + * @param string $property_name + * The webform element property name. * * @return array * The webform element type's properties from as a flattened @@ -984,7 +985,7 @@ protected function getElementsFlattened(array $elements) { protected function getWebformElementProperty($type, $property_name) { $property_key = ltrim($property_name, '#'); $properties = $this->getWebformElementProperties($type); - return (isset($properties[$property_key])) ? $properties[$property_key] : NULL; + return $properties[$property_key] ?? NULL; } diff --git a/web/modules/webform/src/WebformTranslationConfigManagerInterface.php b/web/modules/webform/src/WebformTranslationConfigManagerInterface.php index feb653f607..244fc8cebe 100644 --- a/web/modules/webform/src/WebformTranslationConfigManagerInterface.php +++ b/web/modules/webform/src/WebformTranslationConfigManagerInterface.php @@ -12,21 +12,21 @@ interface WebformTranslationConfigManagerInterface { /** * Alter config translation form. * - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public function alterForm(&$form, FormStateInterface $form_state); + public function alterForm(array &$form, FormStateInterface $form_state); /** * Validate the webform config translation form. * - * @param $form + * @param array $form * Nested array of form elements that comprise the form. - * @param $form_state + * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ - public static function validateWebformForm(&$form, FormStateInterface $form_state); + public static function validateWebformForm(array &$form, FormStateInterface $form_state); } diff --git a/web/modules/webform/src/WebformTranslationLingotekManager.php b/web/modules/webform/src/WebformTranslationLingotekManager.php index eef8f981bc..44f1f9dcd6 100644 --- a/web/modules/webform/src/WebformTranslationLingotekManager.php +++ b/web/modules/webform/src/WebformTranslationLingotekManager.php @@ -65,7 +65,7 @@ public function configEntityDocumentUpload(array &$source_data, ConfigEntityInte case 'webform_options'; case 'webform_options_custom'; // Convert options YAML string to an associative array. - $options = Yaml::decode($source_data['options']);; + $options = Yaml::decode($source_data['options']); // Extract optgroups from the options and append them as '_optgroups_' // to the options so that the optgroups can be translated. @@ -179,9 +179,9 @@ public function configObjectTranslationPresave(array &$data, $config_name) { $data['webform.settings']['test.names'] = Yaml::encode($data['webform.settings']['test.names']); } - /******************************************************************************/ + /* ************************************************************************** */ // Lingotek decode/encode token functions. - /******************************************************************************/ + /* ************************************************************************** */ /** * Encode all tokens so that they won't be translated. diff --git a/web/modules/webform/src/WebformTranslationLingotekManagerInterface.php b/web/modules/webform/src/WebformTranslationLingotekManagerInterface.php index b647a45876..a8adcf8d1a 100644 --- a/web/modules/webform/src/WebformTranslationLingotekManagerInterface.php +++ b/web/modules/webform/src/WebformTranslationLingotekManagerInterface.php @@ -20,7 +20,7 @@ interface WebformTranslationLingotekManagerInterface { * @param string &$url * The url which will be associated to this document, e.g. for context review. * - * @see hook_lingotek_config_entity_document_upload(). + * @see hook_lingotek_config_entity_document_upload() */ public function configEntityDocumentUpload(array &$source_data, ConfigEntityInterface &$entity, &$url); @@ -34,9 +34,9 @@ public function configEntityDocumentUpload(array &$source_data, ConfigEntityInte * @param array &$data * Data returned from the Lingotek service when asking for the translation. * - * @see hook_lingotek_config_entity_translation_presave(). + * @see hook_lingotek_config_entity_translation_presave() */ - public function configEntityTranslationPresave(ConfigEntityInterface &$translation, $langcode, &$data); + public function configEntityTranslationPresave(ConfigEntityInterface &$translation, $langcode, array &$data); /** * Implements hook_lingotek_config_object_document_upload(). @@ -46,7 +46,7 @@ public function configEntityTranslationPresave(ConfigEntityInterface &$translati * @param string $config_name * The simple configuration name. * - * @see hook_lingotek_config_object_document_upload(). + * @see hook_lingotek_config_object_document_upload() */ public function configObjectDocumentUpload(array &$data, $config_name); @@ -58,7 +58,7 @@ public function configObjectDocumentUpload(array &$data, $config_name); * @param string $config_name * The simple configuration name. * - * @see hook_lingotek_config_object_translation_presave(). + * @see hook_lingotek_config_object_translation_presave() */ public function configObjectTranslationPresave(array &$data, $config_name); diff --git a/web/modules/webform/src/WebformTranslationManager.php b/web/modules/webform/src/WebformTranslationManager.php index 26409cea89..96e503bb2d 100644 --- a/web/modules/webform/src/WebformTranslationManager.php +++ b/web/modules/webform/src/WebformTranslationManager.php @@ -197,9 +197,9 @@ public function getOriginalLangcode(WebformInterface $webform) { return $mapper->getLangcode(); } - /****************************************************************************/ + /* ************************************************************************ */ // Translatable properties helpers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Remove untranslatable properties form an element. @@ -209,7 +209,7 @@ public function getOriginalLangcode(WebformInterface $webform) { */ protected function removeUnTranslatablePropertiesFromElement(array &$element) { - $element_type = (isset($element['#type'])) ? $element['#type'] : NULL; + $element_type = $element['#type'] ?? NULL; $translatable_properties = $this->getTranslatableProperties($element_type); $element_plugin = $this->elementManager->getElementInstance($element); foreach ($element as $property_key => $property_value) { diff --git a/web/modules/webform/templates/webform-access-denied.html.twig b/web/modules/webform/templates/webform-access-denied.html.twig new file mode 100644 index 0000000000..4715dac371 --- /dev/null +++ b/web/modules/webform/templates/webform-access-denied.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation of a webform access denied. + * + * Available variables + * - attributes: A list of HTML attributes. + * - message: The access denied message. + * + * @ingroup themeable + */ +#} +<div{{ attributes }}> + {{ message }} +</div> diff --git a/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_excluded_elements.yml b/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_excluded_elements.yml index 21d2b94e8d..1a3ce2ddbd 100644 --- a/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_excluded_elements.yml +++ b/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_excluded_elements.yml @@ -22,6 +22,9 @@ elements: | markup: '#type': markup '#markup': markup + telephone: + '#type': webform_telephone + '#title': webform_telephone details: '#type': details '#title': details @@ -38,7 +41,14 @@ elements: | '#default_value': webform_excluded_elements: webform_excluded_elements webform_excluded_elements_markup: webform_excluded_elements_markup - + webform_excluded_elements_telephone: + '#type': webform_excluded_elements + '#title': webform_excluded_elements_telephone + '#exclude_composite': false + '#default_value': + telephone__phone: telephone__phone + telephone__ext: telephone__ext + css: '' javascript: '' settings: diff --git a/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_help.yml b/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_help.yml index 432640a965..93d811acc9 100644 --- a/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_help.yml +++ b/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_element_help.yml @@ -37,7 +37,8 @@ elements: | help_xss: '#type': textfield '#title': help_xss - '#help': '{This is an example of help with <b>XSS <script>alert("XSS")</b>}' + '#help_title': '{This is an example of help title with <b>XSS <script>alert("XSS")</script></b> <img src="x" onerror="confirm(document.domain)" />}' + '#help': '{This is an example of help content with <b>XSS <script>alert("XSS")</script></b> <img src="x" onerror="confirm(document.domain)" />}' help_empty: '#type': textfield '#title': help_empty @@ -137,7 +138,7 @@ elements: | '#help_display': element_after help_after_details: '#markup': '{This is markup}' - + css: '' javascript: '' settings: diff --git a/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_form_autofill.yml b/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_form_autofill.yml index c87cdc6cdd..544d964840 100644 --- a/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_form_autofill.yml +++ b/web/modules/webform/tests/modules/webform_test/config/install/webform.webform.test_form_autofill.yml @@ -16,13 +16,25 @@ title: 'Test: Webform: Autofill' description: 'Test autofill with previous submission data.' category: 'Test: Webform' elements: | - textfield_autofill: - '#type': textfield - '#title': textfield_autofill textfield_excluded: '#type': textfield '#title': textfield_excluded - + textfield_autofill: + '#type': textfield + '#title': textfield_autofill + telephone_excluded: + '#type': webform_telephone + '#title': telephone_excluded + telephone_autofill: + '#type': webform_telephone + '#title': telephone_autofill + telephone_autofill_partial: + '#type': webform_telephone + '#title': telephone_autofill_partial + telephone_autofill_partial_multiple: + '#type': webform_telephone + '#title': telephone_autofill_partial_multiple + '#multiple': true css: '' javascript: '' settings: @@ -93,6 +105,11 @@ settings: autofill_message: '' autofill_excluded_elements: textfield_excluded: textfield_excluded + telephone_excluded: telephone_excluded + telephone_autofill_partial__phone: telephone_autofill_partial__phone + telephone_autofill_partial__ext: telephone_autofill_partial__ext + telephone_autofill_partial_multiple__phone: telephone_autofill_partial_multiple__phone + telephone_autofill_partial_multiple__ext: telephone_autofill_partial_multiple__ext wizard_progress_bar: true wizard_progress_pages: false wizard_progress_percentage: false diff --git a/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_element_format.inc b/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_element_format.inc index 486a18869a..9084b85e9e 100644 --- a/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_element_format.inc +++ b/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_element_format.inc @@ -51,13 +51,13 @@ function webform_test_test_element_format(WebformInterface $webform, $composite 'advanced_elements' => [], ]; foreach ($definitions as $element_type => $definition) { - if (in_array($element_type, $skipped_element_types)) { + if (in_array($element_type, $skipped_element_types) || !isset($elements[$element_type])) { continue; } $webform_element = $elements[$element_type]; $element = _webform_test_get_element_preview($element_type, ['issues' => FALSE]); - if (!$element || !$webform_element->isInput($element)) { + if (!$element || !$webform_element || !$webform_element->isInput($element)) { continue; } diff --git a/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_states.inc b/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_states.inc index ed2d201974..2babb93b47 100644 --- a/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_states.inc +++ b/web/modules/webform/tests/modules/webform_test/includes/webform_test.test_states.inc @@ -83,9 +83,9 @@ function _webform_test_states($type, array $default_properties = []) { return $data['containers'] + $data['elements']; } -/******************************************************************************/ +/* ************************************************************************** */ // Generate #states API issues webform as Markdown for docs/issues.md. -/******************************************************************************/ +/* ************************************************************************** */ /** * Get #states API issues as Markdown. diff --git a/web/modules/webform/tests/modules/webform_test/webform_test.info.yml b/web/modules/webform/tests/modules/webform_test/webform_test.info.yml index 7cd6914452..a969e8b34c 100644 --- a/web/modules/webform/tests/modules/webform_test/webform_test.info.yml +++ b/web/modules/webform/tests/modules/webform_test/webform_test.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test/webform_test.module b/web/modules/webform/tests/modules/webform_test/webform_test.module index 9f0f4628da..0db9fb00e9 100644 --- a/web/modules/webform/tests/modules/webform_test/webform_test.module +++ b/web/modules/webform/tests/modules/webform_test/webform_test.module @@ -12,10 +12,7 @@ /** * Test element callback that should be ignored. * - * @param array $element - * An element. - * - * @return array + * @param mixed $element * An element. */ function webform_test_ignored_element_callback($element = NULL) { @@ -31,14 +28,15 @@ function webform_test_ignored_element_callback($element = NULL) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Generate elements. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_preprocess_HOOK(). */ function webform_test_preprocess_page(&$variables) { + // phpcs:ignore if (!isset($_GET['generate']) && in_array(\Drupal::routeMatch()->getRouteName(), ['entity.webform.canonical', 'entity.webform.edit_form', 'entity.webform.source_form']) && _webform_test_load_include(\Drupal::routeMatch()->getRawParameter('webform')) @@ -82,6 +80,7 @@ function webform_test_preprocess_webform_confirmation(array &$variables) { function webform_test_webform_load(array $entities) { // If ?generate is passed to the current pages URL the test webform's elements // will get rebuilt. + // phpcs:ignore if (!isset($_GET['generate'])) { return; } diff --git a/web/modules/webform/tests/modules/webform_test_ajax/webform_test_ajax.info.yml b/web/modules/webform/tests/modules/webform_test_ajax/webform_test_ajax.info.yml index d0fd9dc0fa..dce5a0a25e 100644 --- a/web/modules/webform/tests/modules/webform_test_ajax/webform_test_ajax.info.yml +++ b/web/modules/webform/tests/modules/webform_test_ajax/webform_test_ajax.info.yml @@ -7,7 +7,7 @@ dependencies: - 'drupal:block' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.info.yml b/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.info.yml index ac2cce1ea5..29fb204cbc 100644 --- a/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.info.yml +++ b/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.module b/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.module index 159a905527..106b8bac13 100644 --- a/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.module +++ b/web/modules/webform/tests/modules/webform_test_alter_hooks/webform_test_alter_hooks.module @@ -7,9 +7,9 @@ use Drupal\Core\Form\FormStateInterface; -/******************************************************************************/ +/* ************************************************************************** */ // Form hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_form_alter(). @@ -69,9 +69,9 @@ function webform_test_alter_hooks_webform_submission_form_alter(array &$form, Fo \Drupal::messenger()->addStatus(t("@hook: '@form_id' executed.", ['@hook' => 'hook_webform_submission_form_alter()', '@form_id' => $form_id]), TRUE); } -/******************************************************************************/ +/* ************************************************************************** */ // Element hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_webform_element_alter(). diff --git a/web/modules/webform/tests/modules/webform_test_block_context/webform_test_block_context.info.yml b/web/modules/webform/tests/modules/webform_test_block_context/webform_test_block_context.info.yml index 9da168fc77..247f6911f1 100644 --- a/web/modules/webform/tests/modules/webform_test_block_context/webform_test_block_context.info.yml +++ b/web/modules/webform/tests/modules/webform_test_block_context/webform_test_block_context.info.yml @@ -7,7 +7,7 @@ dependencies: - 'drupal:block' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_block_custom/webform_test_block_custom.info.yml b/web/modules/webform/tests/modules/webform_test_block_custom/webform_test_block_custom.info.yml index 1b493bfbfd..9ee4fbc7e9 100644 --- a/web/modules/webform/tests/modules/webform_test_block_custom/webform_test_block_custom.info.yml +++ b/web/modules/webform/tests/modules/webform_test_block_custom/webform_test_block_custom.info.yml @@ -8,7 +8,7 @@ dependencies: - 'drupal:block_content' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_block_submission_limit/webform_test_block_submission_limit.info.yml b/web/modules/webform/tests/modules/webform_test_block_submission_limit/webform_test_block_submission_limit.info.yml index 77094c2550..951ef1f213 100644 --- a/web/modules/webform/tests/modules/webform_test_block_submission_limit/webform_test_block_submission_limit.info.yml +++ b/web/modules/webform/tests/modules/webform_test_block_submission_limit/webform_test_block_submission_limit.info.yml @@ -7,7 +7,7 @@ dependencies: - 'drupal:block' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_config_performance/webform_test_config_performance.info.yml b/web/modules/webform/tests/modules/webform_test_config_performance/webform_test_config_performance.info.yml index 36a70f290d..e3fd01338d 100644 --- a/web/modules/webform/tests/modules/webform_test_config_performance/webform_test_config_performance.info.yml +++ b/web/modules/webform/tests/modules/webform_test_config_performance/webform_test_config_performance.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_editorial/src/Controller/WebformTestEditorialController.php b/web/modules/webform/tests/modules/webform_test_editorial/src/Controller/WebformTestEditorialController.php index 8d6b2836c6..8651b76f77 100644 --- a/web/modules/webform/tests/modules/webform_test_editorial/src/Controller/WebformTestEditorialController.php +++ b/web/modules/webform/tests/modules/webform_test_editorial/src/Controller/WebformTestEditorialController.php @@ -98,9 +98,9 @@ public function index() { ]; } - /****************************************************************************/ + /* ************************************************************************ */ // Help. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns webform help editorial. @@ -115,7 +115,7 @@ public function help() { $groups[$group_name] = []; } foreach ($help as $name => $info) { - $group_name = (isset($info['group'])) ? $info['group'] : (string) $this->t('General'); + $group_name = $info['group'] ?? (string) $this->t('General'); $groups[$group_name][$name] = $info; } $groups = array_filter($groups); @@ -195,9 +195,9 @@ public function help() { return $this->response($build); } - /****************************************************************************/ + /* ************************************************************************ */ // Videos. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns webform videos editorial. @@ -236,9 +236,9 @@ public function videos() { return $this->response($build); } - /****************************************************************************/ + /* ************************************************************************ */ // Elements. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns webform elements editorial. @@ -285,9 +285,9 @@ public function elements() { return $this->response($build); } - /****************************************************************************/ + /* ************************************************************************ */ // Libraries. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns webform libraries. @@ -322,9 +322,9 @@ public function libraries() { return $this->response($build); } - /****************************************************************************/ + /* ************************************************************************ */ // Schema. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns webform schema. @@ -357,9 +357,9 @@ public function schema() { return $this->response($build); } - /****************************************************************************/ + /* ************************************************************************ */ // Drush. - /****************************************************************************/ + /* ************************************************************************ */ /** * Returns webform drush. @@ -417,9 +417,9 @@ public function drush() { return $this->response($build); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper methods. - /****************************************************************************/ + /* ************************************************************************ */ /** * Build a reusable and styled table for inputs, outputs, and publications. diff --git a/web/modules/webform/tests/modules/webform_test_editorial/webform_test_editorial.info.yml b/web/modules/webform/tests/modules/webform_test_editorial/webform_test_editorial.info.yml index df0f02d88f..8784aad1d1 100644 --- a/web/modules/webform/tests/modules/webform_test_editorial/webform_test_editorial.info.yml +++ b/web/modules/webform/tests/modules/webform_test_editorial/webform_test_editorial.info.yml @@ -7,7 +7,7 @@ configure: webform_test_editorial.index dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_element/webform_test_element.info.yml b/web/modules/webform/tests/modules/webform_test_element/webform_test_element.info.yml index 9ae0eb6fe0..cd2a8bb9d7 100644 --- a/web/modules/webform/tests/modules/webform_test_element/webform_test_element.info.yml +++ b/web/modules/webform/tests/modules/webform_test_element/webform_test_element.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_element_input_masks/webform_test_element_input_masks.info.yml b/web/modules/webform/tests/modules/webform_test_element_input_masks/webform_test_element_input_masks.info.yml index b298473eb0..8c760a4b43 100644 --- a/web/modules/webform/tests/modules/webform_test_element_input_masks/webform_test_element_input_masks.info.yml +++ b/web/modules/webform/tests/modules/webform_test_element_input_masks/webform_test_element_input_masks.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_entity_reference_views/webform_test_entity_reference_views.info.yml b/web/modules/webform/tests/modules/webform_test_entity_reference_views/webform_test_entity_reference_views.info.yml index e86cdb2200..aebae1967d 100644 --- a/web/modules/webform/tests/modules/webform_test_entity_reference_views/webform_test_entity_reference_views.info.yml +++ b/web/modules/webform/tests/modules/webform_test_entity_reference_views/webform_test_entity_reference_views.info.yml @@ -9,7 +9,7 @@ dependencies: - 'drupal:views' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_exporter/webform_test_exporter.info.yml b/web/modules/webform/tests/modules/webform_test_exporter/webform_test_exporter.info.yml index b89779792f..0044fb4035 100644 --- a/web/modules/webform/tests/modules/webform_test_exporter/webform_test_exporter.info.yml +++ b/web/modules/webform/tests/modules/webform_test_exporter/webform_test_exporter.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestEntityMappingWebformHandler.php b/web/modules/webform/tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestEntityMappingWebformHandler.php index 36acb2d2a3..d521a6f293 100644 --- a/web/modules/webform/tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestEntityMappingWebformHandler.php +++ b/web/modules/webform/tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestEntityMappingWebformHandler.php @@ -85,9 +85,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta 'wrapper' => 'webform-test-ajax-container', ]; - /**************************************************************************/ + /* ********************************************************************** */ // Entity type. - /**************************************************************************/ + /* ********************************************************************** */ // Get entity type options. $entity_type_options = []; @@ -109,9 +109,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#ajax' => $ajax, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Bundles. - /**************************************************************************/ + /* ********************************************************************** */ // Get entity type bundle options. /** @var \Drupal\Core\Entity\ContentEntityInterface $entity_type */ @@ -147,15 +147,15 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#access' => $access, ]; - /**************************************************************************/ + /* ********************************************************************** */ // Fields. - /**************************************************************************/ + /* ********************************************************************** */ // Get elements options. $element_options = []; $elements = $this->webform->getElementsInitializedFlattenedAndHasValue(); foreach ($elements as $element_key => $element) { - $element_options[$element_key] = (isset($element['#title'])) ? $element['#title'] : $element_key; + $element_options[$element_key] = $element['#title'] ?? $element_key; } // Get field options. diff --git a/web/modules/webform/tests/modules/webform_test_handler/webform_test_handler.info.yml b/web/modules/webform/tests/modules/webform_test_handler/webform_test_handler.info.yml index 0601760a45..8c29732cca 100644 --- a/web/modules/webform/tests/modules/webform_test_handler/webform_test_handler.info.yml +++ b/web/modules/webform/tests/modules/webform_test_handler/webform_test_handler.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_handler_invoke_alter/webform_test_handler_invoke_alter.info.yml b/web/modules/webform/tests/modules/webform_test_handler_invoke_alter/webform_test_handler_invoke_alter.info.yml index 712eaa2a2a..d467323df1 100644 --- a/web/modules/webform/tests/modules/webform_test_handler_invoke_alter/webform_test_handler_invoke_alter.info.yml +++ b/web/modules/webform/tests/modules/webform_test_handler_invoke_alter/webform_test_handler_invoke_alter.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_handler_remote_post/src/WebformTestHandlerRemotePostClient.php b/web/modules/webform/tests/modules/webform_test_handler_remote_post/src/WebformTestHandlerRemotePostClient.php index b0f79ab698..a5b3f7b13e 100644 --- a/web/modules/webform/tests/modules/webform_test_handler_remote_post/src/WebformTestHandlerRemotePostClient.php +++ b/web/modules/webform/tests/modules/webform_test_handler_remote_post/src/WebformTestHandlerRemotePostClient.php @@ -25,10 +25,10 @@ public function request($method, $uri = '', array $options = []) { parse_str(parse_url($uri, PHP_URL_QUERY), $params); } else { - $params = (isset($options['json'])) ? $options['json'] : $options['form_params']; + $params = $options['json'] ?? $options['form_params']; } - $response_type = (isset($params['response_type'])) ? $params['response_type'] : 200; + $response_type = $params['response_type'] ?? 200; $operation = ltrim(parse_url($uri, PHP_URL_PATH), '/'); $random = new Random(); // Handle 404 errors. diff --git a/web/modules/webform/tests/modules/webform_test_handler_remote_post/webform_test_handler_remote_post.info.yml b/web/modules/webform/tests/modules/webform_test_handler_remote_post/webform_test_handler_remote_post.info.yml index 004deaee4e..6f5215306a 100644 --- a/web/modules/webform/tests/modules/webform_test_handler_remote_post/webform_test_handler_remote_post.info.yml +++ b/web/modules/webform/tests/modules/webform_test_handler_remote_post/webform_test_handler_remote_post.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_markup/webform_test_markup.info.yml b/web/modules/webform/tests/modules/webform_test_markup/webform_test_markup.info.yml index 829c05f14e..866b1c9b67 100644 --- a/web/modules/webform/tests/modules/webform_test_markup/webform_test_markup.info.yml +++ b/web/modules/webform/tests/modules/webform_test_markup/webform_test_markup.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_message_custom/webform_test_message_custom.info.yml b/web/modules/webform/tests/modules/webform_test_message_custom/webform_test_message_custom.info.yml index 75e2f0c98b..45e6f02151 100644 --- a/web/modules/webform/tests/modules/webform_test_message_custom/webform_test_message_custom.info.yml +++ b/web/modules/webform/tests/modules/webform_test_message_custom/webform_test_message_custom.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_options/webform_test_options.info.yml b/web/modules/webform/tests/modules/webform_test_options/webform_test_options.info.yml index 4929c5981c..074e8c2d20 100644 --- a/web/modules/webform/tests/modules/webform_test_options/webform_test_options.info.yml +++ b/web/modules/webform/tests/modules/webform_test_options/webform_test_options.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_paragraphs/webform_test_paragraphs.info.yml b/web/modules/webform/tests/modules/webform_test_paragraphs/webform_test_paragraphs.info.yml index 3cd9e999aa..07d57dfc5d 100644 --- a/web/modules/webform/tests/modules/webform_test_paragraphs/webform_test_paragraphs.info.yml +++ b/web/modules/webform/tests/modules/webform_test_paragraphs/webform_test_paragraphs.info.yml @@ -7,7 +7,7 @@ dependencies: - 'paragraphs:paragraphs' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_rest/webform_test_rest.info.yml b/web/modules/webform/tests/modules/webform_test_rest/webform_test_rest.info.yml index 8807882125..b8e76ca56c 100644 --- a/web/modules/webform/tests/modules/webform_test_rest/webform_test_rest.info.yml +++ b/web/modules/webform/tests/modules/webform_test_rest/webform_test_rest.info.yml @@ -9,7 +9,7 @@ dependencies: - 'drupal:serialization' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_states/webform_test_states.info.yml b/web/modules/webform/tests/modules/webform_test_states/webform_test_states.info.yml index 18b2c93014..ef5f40d7ab 100644 --- a/web/modules/webform/tests/modules/webform_test_states/webform_test_states.info.yml +++ b/web/modules/webform/tests/modules/webform_test_states/webform_test_states.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_submissions/webform_test_submissions.info.yml b/web/modules/webform/tests/modules/webform_test_submissions/webform_test_submissions.info.yml index a909c0c6ff..d0f6d17d9e 100644 --- a/web/modules/webform/tests/modules/webform_test_submissions/webform_test_submissions.info.yml +++ b/web/modules/webform/tests/modules/webform_test_submissions/webform_test_submissions.info.yml @@ -7,7 +7,7 @@ dependencies: - 'drupal:node' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.info.yml b/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.info.yml index 363649df4c..237caefcb8 100644 --- a/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.info.yml +++ b/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.webform.inc b/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.webform.inc index ac985237ff..e1f5890ff7 100644 --- a/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.webform.inc +++ b/web/modules/webform/tests/modules/webform_test_third_party_settings/webform_test_third_party_settings.webform.inc @@ -87,6 +87,7 @@ function _webform_test_third_party_settings_form_validate(&$form, FormStateInter * Implements hook_webform_submission_form_alter(). */ function webform_test_third_party_settings_webform_submission_form_alter(&$form, FormStateInterface $form_state, $form_id) { + // phpcs:ignore DrupalPractice.Variables.GetRequestData.SuperglobalAccessed if (!empty($_POST)) { return; } diff --git a/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.info.yml b/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.info.yml index 917af9b1d4..1aa9615b03 100644 --- a/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.info.yml +++ b/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.info.yml @@ -10,7 +10,7 @@ dependencies: - 'webform:webform' - 'webform:webform_image_select' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.install b/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.install index dc3f42fb5a..bb4e727120 100644 --- a/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.install +++ b/web/modules/webform/tests/modules/webform_test_translation/webform_test_translation.install @@ -4,7 +4,7 @@ * @file * Install, update and uninstall functions for the Webform test translation module. * - * drush php-eval 'module_load_include('install', 'webform_test_translation'); webform_test_translation_install()'; drush cr; + * `drush php-eval 'module_load_include('install', 'webform_test_translation'); webform_test_translation_install()'; drush cr;` */ use Drupal\Core\Serialization\Yaml; diff --git a/web/modules/webform/tests/modules/webform_test_translation_lingotek/webform_test_translation_lingotek.info.yml b/web/modules/webform/tests/modules/webform_test_translation_lingotek/webform_test_translation_lingotek.info.yml index 919b5b173f..073e446398 100644 --- a/web/modules/webform/tests/modules/webform_test_translation_lingotek/webform_test_translation_lingotek.info.yml +++ b/web/modules/webform/tests/modules/webform_test_translation_lingotek/webform_test_translation_lingotek.info.yml @@ -10,7 +10,7 @@ dependencies: - 'lingotek:lingotek' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_validate/webform_test_validate.info.yml b/web/modules/webform/tests/modules/webform_test_validate/webform_test_validate.info.yml index 15a13b65b2..dffdf39a7a 100644 --- a/web/modules/webform/tests/modules/webform_test_validate/webform_test_validate.info.yml +++ b/web/modules/webform/tests/modules/webform_test_validate/webform_test_validate.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_variant/src/Plugin/WebformVariant/TestWebformVariant.php b/web/modules/webform/tests/modules/webform_test_variant/src/Plugin/WebformVariant/TestWebformVariant.php index cdd7c92e3f..06b1e4c25a 100644 --- a/web/modules/webform/tests/modules/webform_test_variant/src/Plugin/WebformVariant/TestWebformVariant.php +++ b/web/modules/webform/tests/modules/webform_test_variant/src/Plugin/WebformVariant/TestWebformVariant.php @@ -80,9 +80,9 @@ public function applyVariant() { return TRUE; } - /****************************************************************************/ + /* ************************************************************************ */ // Debug and exception handlers. - /****************************************************************************/ + /* ************************************************************************ */ /** * Display debugging information. diff --git a/web/modules/webform/tests/modules/webform_test_variant/webform_test_variant.info.yml b/web/modules/webform/tests/modules/webform_test_variant/webform_test_variant.info.yml index 2823513a99..94123bf81d 100644 --- a/web/modules/webform/tests/modules/webform_test_variant/webform_test_variant.info.yml +++ b/web/modules/webform/tests/modules/webform_test_variant/webform_test_variant.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_views/webform_test_views.info.yml b/web/modules/webform/tests/modules/webform_test_views/webform_test_views.info.yml index e04cea017f..a44a766ad4 100644 --- a/web/modules/webform/tests/modules/webform_test_views/webform_test_views.info.yml +++ b/web/modules/webform/tests/modules/webform_test_views/webform_test_views.info.yml @@ -9,7 +9,7 @@ dependencies: - 'drupal:views' - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/modules/webform_test_wizard_custom/webform_test_wizard_custom.info.yml b/web/modules/webform/tests/modules/webform_test_wizard_custom/webform_test_wizard_custom.info.yml index 37f0ae0d86..07e05bfc6e 100644 --- a/web/modules/webform/tests/modules/webform_test_wizard_custom/webform_test_wizard_custom.info.yml +++ b/web/modules/webform/tests/modules/webform_test_wizard_custom/webform_test_wizard_custom.info.yml @@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9 dependencies: - 'webform:webform' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityJsonApiTest.php b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityJsonApiTest.php index e774599a8a..38376a3516 100644 --- a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityJsonApiTest.php +++ b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityJsonApiTest.php @@ -32,7 +32,7 @@ public function testRestAccess() { 'access any webform configuration', ]); - /**************************************************************************/ + /* ********************************************************************** */ // Check anonymous access denied to webform. $this->drupalGet("jsonapi/webform/webform/$uuid"); diff --git a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityPermissionsTest.php b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityPermissionsTest.php index ad502edbc7..d7c426819b 100644 --- a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityPermissionsTest.php +++ b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityPermissionsTest.php @@ -36,7 +36,7 @@ public function testAccessControlHandler() { 'delete any webform', ]); - /**************************************************************************/ + /* ********************************************************************** */ // Login as user who can access own webform. $this->drupalLogin($own_account); diff --git a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRestTest.php b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRestTest.php index a5527bf991..6fa976993d 100644 --- a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRestTest.php +++ b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRestTest.php @@ -31,7 +31,7 @@ public function testRestAccess() { 'access any webform configuration', ]); - /**************************************************************************/ + /* ********************************************************************** */ // Check anonymous access denied to webform via _format=hal_json. $this->drupalGet('/webform/contact', ['query' => ['_format' => 'hal_json']]); diff --git a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRulesTest.php b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRulesTest.php index 933f886bc2..6c31d8b7d6 100644 --- a/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRulesTest.php +++ b/web/modules/webform/tests/src/Functional/Access/WebformAccessEntityRulesTest.php @@ -49,9 +49,9 @@ public function testAccessRules() { $uid = $account->id(); $rid = $account->getRoles(TRUE)[0]; - /**************************************************************************/ + /* ********************************************************************** */ // Test. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($account); @@ -73,9 +73,9 @@ public function testAccessRules() { $this->drupalGet("webform/$webform_id/test"); $this->assertResponse(200, 'Webform setting access for test rule.'); - /**************************************************************************/ + /* ********************************************************************** */ // Administer. - /**************************************************************************/ + /* ********************************************************************** */ // Check that user cannot access form settings. $this->drupalGet("admin/structure/webform/manage/$webform_id/settings"); @@ -99,9 +99,9 @@ public function testAccessRules() { $this->drupalGet("admin/structure/webform/manage/$webform_id/results/submissions"); $this->assertResponse(200, 'Webform submissions access allowed for administer rule.'); - /**************************************************************************/ + /* ********************************************************************** */ // Create. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogout(); @@ -124,9 +124,9 @@ public function testAccessRules() { $this->drupalGet('/webform/' . $webform->id()); $this->assertResponse(403, 'Webform returns access denied'); - /**************************************************************************/ + /* ********************************************************************** */ // Any. - /**************************************************************************/ + /* ********************************************************************** */ $any_tests = [ 'webform/{webform}' => 'create', @@ -203,9 +203,9 @@ public function testAccessRules() { $this->assertResponse(200, "Webform allows access via permission access rules"); } - /**************************************************************************/ + /* ********************************************************************** */ // Own. - /**************************************************************************/ + /* ********************************************************************** */ // Check own / user specific access rules. $access_rules = [ diff --git a/web/modules/webform/tests/src/Functional/Access/WebformAccessSubmissionPermissionsTest.php b/web/modules/webform/tests/src/Functional/Access/WebformAccessSubmissionPermissionsTest.php index 017e153223..6aa67e5453 100644 --- a/web/modules/webform/tests/src/Functional/Access/WebformAccessSubmissionPermissionsTest.php +++ b/web/modules/webform/tests/src/Functional/Access/WebformAccessSubmissionPermissionsTest.php @@ -48,9 +48,9 @@ public function testPermissions() { $webform_id = 'contact'; $webform = Webform::load('contact'); - /**************************************************************************/ + /* ********************************************************************** */ // Create submission permissions (anonymous). - /**************************************************************************/ + /* ********************************************************************** */ $edit = ['subject' => '{subject}', 'message' => '{message}']; $sid_1 = $this->postSubmission($webform, $edit); @@ -68,9 +68,9 @@ public function testPermissions() { $this->drupalGet("webform/{$webform_id}/submissions/{$sid_1}"); $this->assertResponse(403); - /**************************************************************************/ + /* ********************************************************************** */ // Own submission permissions (authenticated). - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($own_submission_account); @@ -125,9 +125,9 @@ public function testPermissions() { $this->drupalGet("/admin/structure/webform/manage/{$webform_id}/results/submissions"); $this->assertResponse(403); - /**************************************************************************/ + /* ********************************************************************** */ // Any submission permissions. - /**************************************************************************/ + /* ********************************************************************** */ // Login as any user. $this->drupalLogin($any_submission_account); @@ -157,9 +157,9 @@ public function testPermissions() { $this->drupalGet('/admin/structure/webform/submissions/manage'); $this->assertResponse(200); - /**************************************************************************/ + /* ********************************************************************** */ // Own submission permissions (anonymous). - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\user\RoleInterface $anonymous_role */ $anonymous_role = Role::load('anonymous'); @@ -202,9 +202,9 @@ public function testPermissions() { $this->assertLinkByHref("{$base_path}webform/{$webform_id}/submissions/{$sid_4}"); $this->assertLinkByHref("{$base_path}webform/{$webform_id}/submissions/{$sid_5}"); - /**************************************************************************/ + /* ********************************************************************** */ // Administer webform or webform submission permission. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($admin_webform_account); $uid = $own_submission_account->id(); diff --git a/web/modules/webform/tests/src/Functional/Block/WebformBlockTest.php b/web/modules/webform/tests/src/Functional/Block/WebformBlockTest.php index 699ca4bb0b..6afde61b14 100644 --- a/web/modules/webform/tests/src/Functional/Block/WebformBlockTest.php +++ b/web/modules/webform/tests/src/Functional/Block/WebformBlockTest.php @@ -35,33 +35,33 @@ public function testBlock() { ]); // Check contact webform. - $this->drupalGet('/<front>'); + $this->drupalGet('<front>'); $this->assertRaw('webform-submission-contact-add-form'); // Check contact webform with default data. $block->getPlugin()->setConfigurationValue('default_data', "name: 'John Smith'"); $block->save(); - $this->drupalGet('/<front>'); + $this->drupalGet('<front>'); $this->assertRaw('webform-submission-contact-add-form'); $this->assertFieldByName('name', 'John Smith'); // Check confirmation inline webform. $block->getPlugin()->setConfigurationValue('webform_id', 'test_confirmation_inline'); $block->save(); - $this->drupalPostForm('/<front>', [], 'Submit'); + $this->drupalPostForm('<front>', [], 'Submit'); $this->assertRaw('This is a custom inline confirmation message.'); // Check confirmation message webform displayed on front page. $block->getPlugin()->setConfigurationValue('webform_id', 'test_confirmation_message'); $block->save(); - $this->drupalPostForm('/<front>', [], 'Submit'); + $this->drupalPostForm('<front>', [], 'Submit'); $this->assertRaw('This is a <b>custom</b> confirmation message.'); $this->assertUrl('/user/login'); // Check confirmation message webform display on webform URL. $block->getPlugin()->setConfigurationValue('redirect', TRUE); $block->save(); - $this->drupalPostForm('/<front>', [], 'Submit'); + $this->drupalPostForm('<front>', [], 'Submit'); $this->assertRaw('This is a <b>custom</b> confirmation message.'); $this->assertUrl('webform/test_confirmation_message'); diff --git a/web/modules/webform/tests/src/Functional/Cache/WebformCacheTest.php b/web/modules/webform/tests/src/Functional/Cache/WebformCacheTest.php index 8cd84472cb..32fd67c7ea 100644 --- a/web/modules/webform/tests/src/Functional/Cache/WebformCacheTest.php +++ b/web/modules/webform/tests/src/Functional/Cache/WebformCacheTest.php @@ -27,13 +27,13 @@ public function testCache() { /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = WebformSubmission::create(['webform_id' => 'contact']); - /**************************************************************************/ + /* ********************************************************************** */ $form = $entity_form_builder->getForm($webform_submission, 'add'); // Check that the form includes 'user.roles:authenticated' because the // '[current-user:mail]' token. - $this->assertEqual($form['#cache'], [ + $this->assertEqualsCanonicalizing($form['#cache'], [ 'contexts' => [ 'user.roles:authenticated', ], @@ -48,7 +48,7 @@ public function testCache() { // Check that the name element does not have #cache because the // '[current-user:mail]' is set via - // \Drupal\webform\WebformSubmissionForm::setEntity + // \Drupal\webform\WebformSubmissionForm::setEntity. $this->assertFalse(isset($form['elements']['email']['#cache'])); $this->assertEqual($form['elements']['email']['#default_value'], ''); @@ -66,7 +66,7 @@ public function testCache() { // Check that the form includes 'user.roles:authenticated' because the // '[current-user:mail]' token. - $this->assertEqual($form['#cache'], [ + $this->assertEqualsCanonicalizing($form['#cache'], [ 'contexts' => [ 'user', 'user.roles:authenticated', @@ -85,7 +85,7 @@ public function testCache() { // Add the '[current-user:mail]' to the name elements' description. $element = $webform->getElementDecoded('email') - + ['#description' => '[current-user:mail]']; + + ['#description' => '[current-user:mail]']; // phpcs:ignore $webform ->setElementProperties('email', $element) ->save(); @@ -94,7 +94,7 @@ public function testCache() { // Check that the 'email' element does have '#cache' property because the // '#description' is using the '[current-user:mail]' token. - $this->assertEqual($form['elements']['email']['#cache'], [ + $this->assertEqualsCanonicalizing($form['elements']['email']['#cache'], [ 'contexts' => [ 'user', ], diff --git a/web/modules/webform/tests/src/Functional/Composite/WebformCompositeCustomFileTest.php b/web/modules/webform/tests/src/Functional/Composite/WebformCompositeCustomFileTest.php index 1875fbb641..847309b334 100644 --- a/web/modules/webform/tests/src/Functional/Composite/WebformCompositeCustomFileTest.php +++ b/web/modules/webform/tests/src/Functional/Composite/WebformCompositeCustomFileTest.php @@ -29,7 +29,7 @@ public function testCustom() { $first_file = $this->files[0]; - /**************************************************************************/ + /* ********************************************************************** */ // Upload file while adding a new row to the composite element. $edit = [ diff --git a/web/modules/webform/tests/src/Functional/Composite/WebformCompositeFormatTest.php b/web/modules/webform/tests/src/Functional/Composite/WebformCompositeFormatTest.php index 0f5ac77468..44536d7c78 100644 --- a/web/modules/webform/tests/src/Functional/Composite/WebformCompositeFormatTest.php +++ b/web/modules/webform/tests/src/Functional/Composite/WebformCompositeFormatTest.php @@ -34,9 +34,9 @@ class WebformCompositeFormatTest extends WebformBrowserTestBase { */ public function testFormat() { - /**************************************************************************/ + /* ********************************************************************** */ /* Format composite element as HTML and text */ - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_composite_format'); @@ -136,9 +136,9 @@ public function testFormat() { $this->assertStringContainsString($value, $body, new FormattableMarkup('Found @value', ['@value' => $value])); } - /**************************************************************************/ + /* ********************************************************************** */ /* Format composite multiple element as HTML and text */ - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_composite_format_multiple'); diff --git a/web/modules/webform/tests/src/Functional/Composite/WebformCompositePluginFileTest.php b/web/modules/webform/tests/src/Functional/Composite/WebformCompositePluginFileTest.php index 2533f5a7c0..bc7d7534ad 100644 --- a/web/modules/webform/tests/src/Functional/Composite/WebformCompositePluginFileTest.php +++ b/web/modules/webform/tests/src/Functional/Composite/WebformCompositePluginFileTest.php @@ -37,9 +37,9 @@ public function testPlugin() { $first_file = $this->files[0]; $second_file = $this->files[1]; - /**************************************************************************/ + /* ********************************************************************** */ // Single composite with file upload. - /**************************************************************************/ + /* ********************************************************************** */ // Create submission with file. $edit = [ @@ -68,9 +68,9 @@ public function testPlugin() { // Check that test file exists. $this->assertFileExists($file->getFileUri()); - /**************************************************************************/ + /* ********************************************************************** */ // Multiple composite with file upload. - /**************************************************************************/ + /* ********************************************************************** */ // Create submission with file. $edit = [ diff --git a/web/modules/webform/tests/src/Functional/Composite/WebformCompositeTest.php b/web/modules/webform/tests/src/Functional/Composite/WebformCompositeTest.php index 23531c79b2..6e3e7b6aa4 100644 --- a/web/modules/webform/tests/src/Functional/Composite/WebformCompositeTest.php +++ b/web/modules/webform/tests/src/Functional/Composite/WebformCompositeTest.php @@ -34,7 +34,7 @@ public function testComposite() { $this->drupalGet('/webform/test_composite'); // Check webform contact basic. - $this->assertRaw('<fieldset data-drupal-selector="edit-contact-basic" id="edit-contact-basic--wrapper" class="webform-contact--wrapper fieldgroup form-composite webform-composite-hidden-title required js-webform-type-webform-contact webform-type-webform-contact js-form-item form-item js-form-wrapper form-wrapper" aria-required="true">'); + $this->assertRaw('<fieldset data-drupal-selector="edit-contact-basic" id="edit-contact-basic--wrapper" class="webform-contact--wrapper fieldgroup form-composite webform-composite-hidden-title required js-webform-type-webform-contact webform-type-webform-contact js-form-item form-item js-form-wrapper form-wrapper">'); $this->assertRaw('<span class="visually-hidden fieldset-legend js-form-required form-required">Contact basic</span>'); $this->assertRaw('<label for="edit-contact-basic-name" class="js-form-required form-required">Name</label>'); $this->assertRaw('<input data-drupal-selector="edit-contact-basic-name" type="text" id="edit-contact-basic-name" name="contact_basic[name]" value="John Smith" size="60" maxlength="255" class="form-text required" required="required" aria-required="true" />'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementAccessTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementAccessTest.php index 41fddedd8f..9d76c4b690 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementAccessTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementAccessTest.php @@ -52,7 +52,7 @@ public function testAccess() { $webform = Webform::load('test_element_access'); - /**************************************************************************/ + /* ********************************************************************** */ // Check user from USER:1 to admin submission user. $elements = $webform->get('elements'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementActionsTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementActionsTest.php index 4aa972d213..b455e5d114 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementActionsTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementActionsTest.php @@ -26,9 +26,9 @@ public function testActions() { $webform = Webform::load('test_element_actions'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform actions */ - /**************************************************************************/ + /* ********************************************************************** */ // Get form. $this->drupalGet('/webform/test_element_actions'); @@ -80,9 +80,9 @@ public function testActions() { $this->assertRaw('<a href="' . $base_path . 'admin/structure/webform/manage/test_element_actions/submission/' . $sid . '/delete?destination=' . $base_path . 'webform/test_element_actions" class="button button--danger custom-delete" style="font-weight: bold" data-custom-delete data-drupal-selector="edit-actions-custom-delete" id="edit-actions-custom-delete" hreflang="en">{Custom delete}</a>'); $this->assertCssSelect('[id="edit-actions-delete"]'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test actions buttons */ - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_element_actions_buttons'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementAddressTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementAddressTest.php index f7a37592c4..3c764c39a4 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementAddressTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementAddressTest.php @@ -34,9 +34,9 @@ public function testAddress() { $webform = Webform::load('test_element_address'); - /**************************************************************************/ + /* ********************************************************************** */ // Rendering. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_address'); @@ -54,9 +54,9 @@ public function testAddress() { $this->assertRaw('<div class="description"><div id="edit-address-advanced--wrapper--description" class="webform-element-description">This is a description</div>'); } - /**************************************************************************/ + /* ********************************************************************** */ // Processing. - /**************************************************************************/ + /* ********************************************************************** */ // Check submitted value. $sid = $this->postSubmission($webform); @@ -125,9 +125,9 @@ public function testAddress() { Mountain View, CA 94043 United States'); - /**************************************************************************/ + /* ********************************************************************** */ // Schema. - /**************************************************************************/ + /* ********************************************************************** */ $field_storage = FieldStorageConfig::create([ 'entity_type' => 'node', diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementCodeMirrorTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementCodeMirrorTest.php index 55cf55c230..31246b3e5b 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementCodeMirrorTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementCodeMirrorTest.php @@ -21,9 +21,9 @@ class WebformElementCodeMirrorTest extends WebformElementBrowserTestBase { */ public function testCodeMirror() { - /**************************************************************************/ - // code:text - /**************************************************************************/ + /* ********************************************************************** */ + // code:text. + /* ********************************************************************** */ // Check Text. $this->drupalGet('/webform/test_element_codemirror'); @@ -35,9 +35,9 @@ public function testCodeMirror() { $this->assertRaw('<label for="edit-text-basic-no-wrap">text_basic_no_wrap</label>'); $this->assertRaw('<textarea data-drupal-selector="edit-text-basic-no-wrap" wrap="off" class="js-webform-codemirror webform-codemirror text form-textarea" data-webform-codemirror-mode="text/plain" id="edit-text-basic-no-wrap" name="text_basic_no_wrap" rows="5" cols="60">'); - /**************************************************************************/ - // code:yaml - /**************************************************************************/ + /* ********************************************************************** */ + // code:yaml. + /* ********************************************************************** */ // Check YAML. $this->drupalGet('/webform/test_element_codemirror'); @@ -72,9 +72,9 @@ public function testCodeMirror() { $this->drupalPostForm('/webform/test_element_codemirror', $edit, 'Submit'); $this->assertNoRaw('<em class="placeholder">yaml_basic</em> is not valid.'); - /**************************************************************************/ - // code:html - /**************************************************************************/ + /* ********************************************************************** */ + // code:html. + /* ********************************************************************** */ // Check HTML. $this->drupalGet('/webform/test_element_codemirror'); @@ -97,9 +97,9 @@ public function testCodeMirror() { $this->assertNoRaw('<em class="placeholder">html_basic</em> is not valid.'); $this->assertNoRaw('expected '>''); - /**************************************************************************/ - // code:twig - /**************************************************************************/ + /* ********************************************************************** */ + // code:twig. + /* ********************************************************************** */ // Check disabled Twig editor. $this->drupalGet('/webform/test_element_codemirror'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementCompositeTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementCompositeTest.php index 0c14f0e5c9..4d03f228c5 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementCompositeTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementCompositeTest.php @@ -26,9 +26,9 @@ class WebformElementCompositeTest extends WebformElementBrowserTestBase { */ public function testComposite() { - /**************************************************************************/ + /* ********************************************************************** */ // Builder. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_element_composite'); @@ -111,17 +111,17 @@ public function testComposite() { '#min': 1 '#max': 125"); - /**************************************************************************/ + /* ********************************************************************** */ // Wrapper. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_composite_wrapper'); // Check fieldset wrapper. - $this->assertRaw('<fieldset data-drupal-selector="edit-radios-wrapper-fieldset" id="edit-radios-wrapper-fieldset--wrapper" class="radios--wrapper fieldgroup form-composite webform-composite-visible-title required js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" aria-required="true">'); + $this->assertRaw('<fieldset data-drupal-selector="edit-radios-wrapper-fieldset" id="edit-radios-wrapper-fieldset--wrapper" class="radios--wrapper fieldgroup form-composite webform-composite-visible-title required js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" aria-required="true" role="radiogroup" aria-labelledby="edit-radios-wrapper-fieldset--wrapper-legend">'); // Check fieldset wrapper with hidden title. - $this->assertRaw('<fieldset data-drupal-selector="edit-radios-wrapper-fieldset-hidden-title" id="edit-radios-wrapper-fieldset-hidden-title--wrapper" class="radios--wrapper fieldgroup form-composite webform-composite-hidden-title required js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" aria-required="true">'); + $this->assertRaw('<fieldset data-drupal-selector="edit-radios-wrapper-fieldset-hidden-title" id="edit-radios-wrapper-fieldset-hidden-title--wrapper" class="radios--wrapper fieldgroup form-composite webform-composite-hidden-title required js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" aria-required="true" role="radiogroup" aria-labelledby="edit-radios-wrapper-fieldset-hidden-title--wrapper-legend">'); // Check form element wrapper. $this->assertRaw('<div class="js-form-item form-item js-form-type-radios form-item-radios-wrapper-form-element js-form-item-radios-wrapper-form-element">'); @@ -139,14 +139,16 @@ public function testComposite() { } // Check wrapper with #states. - $this->assertRaw('<fieldset data-drupal-selector="edit-states-fieldset" class="js-webform-states-hidden radios--wrapper fieldgroup form-composite webform-composite-visible-title js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" id="edit-states-fieldset--wrapper" data-drupal-states="{"visible":{".webform-submission-test-element-composite-wrapper-add-form :input[name=\u0022states_checkbox\u0022]":{"checked":true}}}">'); + $this->assertRaw('<fieldset data-drupal-selector="edit-states-fieldset" class="js-webform-states-hidden radios--wrapper fieldgroup form-composite webform-composite-visible-title js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" id="edit-states-fieldset--wrapper" data-drupal-states="{"visible":{".webform-submission-test-element-composite-wrapper-add-form :input[name=\u0022states_checkbox\u0022]":{"checked":true}}}" role="radiogroup" aria-labelledby="edit-states-fieldset--wrapper-legend">'); $this->assertRaw('<div class="js-webform-states-hidden js-form-item form-item js-form-type-radios form-item-states-form-item js-form-item-states-form-item" data-drupal-states="{"visible":{".webform-submission-test-element-composite-wrapper-add-form :input[name=\u0022states_checkbox\u0022]":{"checked":true}}}">'); $this->assertRaw('<div data-drupal-selector="edit-states-container" class="js-webform-states-hidden radios--wrapper fieldgroup form-composite js-form-wrapper form-wrapper" id="edit-states-container--wrapper" data-drupal-states="{"visible":{".webform-submission-test-element-composite-wrapper-add-form :input[name=\u0022states_checkbox\u0022]":{"checked":true}}}">'); // Below tests are only failing on Drupal.org and pass locally. // Check radios 'aria-describedby' with individual descriptions. + // phpcs:disable // $this->assertRaw('<input data-drupal-selector="edit-radios-wrapper-fieldset-element-descriptions-one" aria-describedby="edit-radios-wrapper-fieldset-element-descriptions-one--description" type="radio" id="edit-radios-wrapper-fieldset-element-descriptions-one" name="radios_wrapper_fieldset_element_descriptions" value="One" class="form-radio" />'); // $this->assertRaw('<div id="edit-radios-wrapper-fieldset-element-descriptions-one--description" class="webform-element-description">This is a radio description</div>'); + // phpcs:enable } } diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementDateTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementDateTest.php index 79cd04b3a9..436387237e 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementDateTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementDateTest.php @@ -31,9 +31,9 @@ class WebformElementDateTest extends WebformElementBrowserTestBase { public function testDateElement() { $webform = Webform::load('test_element_date'); - /**************************************************************************/ + /* ********************************************************************** */ // Render date elements. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_date'); @@ -79,9 +79,9 @@ public function testDateElement() { $default_value = \Drupal::service('date.formatter')->format(strtotime('now'), 'html_date'); $this->assertRaw('<input min="' . $min . '" data-min-year="' . $min_year . '" max="' . $max . '" data-max-year="' . $max_year . '" type="date" data-drupal-selector="edit-date-min-max-dynamic" aria-describedby="edit-date-min-max-dynamic--description" data-drupal-date-format="Y-m-d" id="edit-date-min-max-dynamic" name="date_min_max_dynamic" value="' . $default_value . '" class="form-date" />'); - /**************************************************************************/ + /* ********************************************************************** */ // Format date elements. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalPostForm('/webform/test_element_date', [], 'Preview'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementEntityAutocompleteTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementEntityAutocompleteTest.php index cc7930ecb5..d729406867 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementEntityAutocompleteTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementEntityAutocompleteTest.php @@ -32,7 +32,6 @@ class WebformElementEntityAutocompleteTest extends WebformElementBrowserTestBase */ public function testEntityReferenceTest() { $node_1 = $this->drupalCreateNode(['title' => 'node 01']); - $node_2 = $this->drupalCreateNode(['title' => 'node 02']); $vocabulary = Vocabulary::create([ 'vid' => 'tags', @@ -45,7 +44,7 @@ public function testEntityReferenceTest() { ]); $term_1->save(); - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_element_entity_autocomplete'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementExcludedElementsTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementExcludedElementsTest.php index d36b4787c5..016ce8b3b2 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementExcludedElementsTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementExcludedElementsTest.php @@ -19,7 +19,7 @@ class WebformElementExcludedElementsTest extends WebformElementBrowserTestBase { /** * Test excluded elements element. */ - public function testExcluedElements() { + public function testExcludedElements() { $this->drupalGet('/webform/test_element_excluded_elements'); // Check markup is not listed via '#exclude_markup': TRUE. @@ -27,6 +27,15 @@ public function testExcluedElements() { // Check markup is listed via '#exclude_markup': FALSE. $this->assertFieldByName('webform_excluded_elements_markup[tableselect][markup]'); + + // Check composite sub element is listed via '#exclude_composite': TRUE. + $this->assertNoFieldByName('webform_excluded_elements[tableselect][telephone__type]'); + + // Check composite sub element is listed via '#exclude_composite': FALSE. + $this->assertFieldByName('webform_excluded_elements_telephone[tableselect][telephone__type]'); + + // Check composite sub element title is prepended with the element's title. + $this->assertRaw('<td>Type</td>'); } } diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementFieldsetTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementFieldsetTest.php index e928ab6a04..74c5b7c33a 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementFieldsetTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementFieldsetTest.php @@ -25,7 +25,7 @@ public function testFieldset() { // Check fieldset with help, field prefix, field suffix, description, // and more. Also, check that invalid 'required' and 'aria-required' // attributes are removed. - $this->assertRaw('<fieldset class="webform-has-field-prefix webform-has-field-suffix required webform-element-help-container--title webform-element-help-container--title-after js-webform-type-fieldset webform-type-fieldset js-form-item form-item js-form-wrapper form-wrapper" data-drupal-selector="edit-fieldset" aria-describedby="edit-fieldset--description" id="edit-fieldset" aria-required="true">'); + $this->assertRaw('<fieldset class="webform-has-field-prefix webform-has-field-suffix required webform-element-help-container--title webform-element-help-container--title-after js-webform-type-fieldset webform-type-fieldset js-form-item form-item js-form-wrapper form-wrapper" data-drupal-selector="edit-fieldset" aria-describedby="edit-fieldset--description" id="edit-fieldset">'); $this->assertRaw('<span class="fieldset-legend js-form-required form-required">fieldset<span class="webform-element-help js-webform-element-help" role="tooltip" tabindex="0" aria-label="fieldset" data-webform-help="<div class="webform-element-help--title">fieldset</div><div class="webform-element-help--content">This is help text.</div>"><span aria-hidden="true">?</span></span>'); $this->assertRaw('<span class="field-prefix">prefix</span>'); $this->assertRaw('<span class="field-suffix">suffix</span>'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementFormatCustomTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementFormatCustomTest.php index 7e6117c069..c443d4926a 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementFormatCustomTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementFormatCustomTest.php @@ -52,9 +52,9 @@ public function testFormatCustom() { $file_size = $file->getSize(); $file_url = file_create_url($file->getFileUri()); - /**************************************************************************/ + /* ********************************************************************** */ // Custom HTML. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet("admin/structure/webform/manage/test_element_format_custom/submission/$sid"); @@ -89,7 +89,10 @@ public function testFormatCustom() { $this->assertRaw("item['raw']: $file_url<br/>"); $this->assertRaw("item['link']:"); // @todo Remove once Drupal 9.1.x is only supported. - if (floatval(\Drupal::VERSION) >= 9.1) { + if (floatval(\Drupal::VERSION) >= 9.3) { + $this->assertRaw('<span class="file file--mime-image-png file--image"><a href="' . $file->createFileUrl() . '" type="image/png">' . $file_name . '</a></span>'); + } + elseif (floatval(\Drupal::VERSION) >= 9.1) { $this->assertRaw('<span class="file file--mime-image-png file--image"><a href="' . $file_url . '" type="image/png">' . $file_name . '</a></span>'); } else { @@ -126,9 +129,9 @@ public function testFormatCustom() { // Check container custom HTML format. $this->assertRaw('<h3>fieldset_custom_children</h3>' . PHP_EOL . '<hr />'); - /**************************************************************************/ + /* ********************************************************************** */ // Custom Text. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet("admin/structure/webform/manage/test_element_format_custom/submission/$sid/text"); $this->assertRaw("textfield_custom: /{textfield_custom}/ diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementFormatTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementFormatTest.php index 059d347b1c..7cc9439fa6 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementFormatTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementFormatTest.php @@ -35,9 +35,9 @@ class WebformElementFormatTest extends WebformElementBrowserTestBase { public function testFormat() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ /* Format (single) element as HTML and text */ - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_element_format'); @@ -71,11 +71,13 @@ public function testFormat() { 'Date (Default short date)' => '06/18/1942 - 00:00', 'Time (Value)' => '09:00', 'Time (Raw value)' => '09:00:00', +// phpcs:disable // 'Entity autocomplete (Raw value)' => 'user:1', // 'Entity autocomplete (Link)' => '<a href="http://localhost/webform/user/1" hreflang="en">admin</a>', // 'Entity autocomplete (Entity ID)' => '1', // 'Entity autocomplete (Label)' => 'admin', // 'Entity autocomplete (Label (ID))' => 'admin (1)', +// phpcs:enable ]; foreach ($elements as $label => $value) { $this->assertStringContainsString('<b>' . $label . '</b><br />' . $value, $body, new FormattableMarkup('Found @label: @value', ['@label' => $label, '@value' => $value])); @@ -111,9 +113,9 @@ public function testFormat() { $this->assertStringContainsString($value, $body, new FormattableMarkup('Found @value', ['@value' => $value])); } - /**************************************************************************/ + /* ********************************************************************** */ /* Format managed file element as HTML and text */ - /**************************************************************************/ + /* ********************************************************************** */ $sid = $this->postSubmissionTest($webform); /** @var \Drupal\webform\WebformSubmissionInterface $submission */ @@ -124,8 +126,8 @@ public function testFormat() { $elements = [ 'File (Value)' => $this->getSubmissionFileUrl($submission, 'managed_file_value'), 'File (Raw value)' => $this->getSubmissionFileUrl($submission, 'managed_file_raw'), - 'File (File)' => '<div><span class="file file--mime-text-plain file--text"><a href="' . $this->getSubmissionFileUrl($submission, 'managed_file_file') . '" type="text/plain; length=43">managed_file_file.txt</a></span>', - 'File (Link)' => '<span class="file file--mime-text-plain file--text"><a href="' . $this->getSubmissionFileUrl($submission, 'managed_file_link') . '" type="text/plain; length=43">managed_file_link.txt</a></span>', + 'File (File)' => '<div><span class="file file--mime-text-plain file--text"><a href="' . $this->getSubmissionFileUrl($submission, 'managed_file_file', floatval(\Drupal::VERSION) >= 9.3) . '" type="text/plain; length=43">managed_file_file.txt</a></span>', + 'File (Link)' => '<span class="file file--mime-text-plain file--text"><a href="' . $this->getSubmissionFileUrl($submission, 'managed_file_link', floatval(\Drupal::VERSION) >= 9.3) . '" type="text/plain; length=43">managed_file_link.txt</a></span>', 'File (File ID)' => $submission->getElementData('managed_file_id'), 'File (File name)' => 'managed_file_name.txt', 'File (File base name (no extension))' => 'managed_file_basename', @@ -151,17 +153,17 @@ public function testFormat() { 'File (File ID): ' . $submission->getElementData('managed_file_id'), 'File (File name): managed_file_name.txt', 'File (URL): ' . $this->getSubmissionFileUrl($submission, 'managed_file_url'), - 'File (File mime type)' => 'text/plain', - 'File (File size (Bytes))' => '43', - 'File (File content (Base64))' => 'dGhpcyBpcyBhIHNhbXBsZSB0eHQgZmlsZQppdCBoYXMgdHdvIGxpbmVzCg==', + 'File (File mime type): text/plain', + 'File (File size (Bytes)): 43', + 'File (File content (Base64)): dGhpcyBpcyBhIHNhbXBsZSB0eHQgZmlsZQppdCBoYXMgdHdvIGxpbmVzCg==', ]; foreach ($elements as $value) { $this->assertStringContainsString($value, $body, new FormattableMarkup('Found @value', ['@value' => $value])); } - /**************************************************************************/ + /* ********************************************************************** */ /* Format multiple element as HTML and text */ - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webforms */ $webforms = Webform::load('test_element_format_multiple'); @@ -224,9 +226,9 @@ public function testFormat() { $this->assertStringContainsString($value, $body, new FormattableMarkup('Found @value', ['@value' => $value])); } - /**************************************************************************/ + /* ********************************************************************** */ /* Format element using tokens */ - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform_format_token */ $webform_format_token = Webform::load('test_element_format_token'); @@ -308,13 +310,19 @@ protected function getMessageBody(WebformSubmissionInterface $submission, $handl * A webform submission. * @param string $element_key * The element key. + * @param bool $relative + * Whether to return a relative. Used for testing on Drupal 9.3 due to + * https://www.drupal.org/node/3223515. * * @return string * A submission element's file URL. */ - protected function getSubmissionFileUrl(WebformSubmissionInterface $submission, $element_key) { + protected function getSubmissionFileUrl(WebformSubmissionInterface $submission, $element_key, $relative = FALSE) { $fid = $submission->getElementData($element_key); $file = File::load($fid); + if ($relative) { + return $file->createFileUrl(); + } return file_create_url($file->getFileUri()); } diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePrivateTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePrivateTest.php index 791660cec1..9d8da8d822 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePrivateTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePrivateTest.php @@ -31,7 +31,7 @@ public function testPrivateFiles() { $webform = Webform::load('test_element_managed_file'); - /**************************************************************************/ + /* ********************************************************************** */ $elements = $webform->getElementsDecoded(); $elements['managed_file_single']['#uri_scheme'] = 'private'; diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePublicTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePublicTest.php index 5b392a8912..a0f424e24b 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePublicTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFilePublicTest.php @@ -60,10 +60,10 @@ public function testPublicUpload() { $this->assertNoRaw('Public files upload destination is dangerous for webforms that are available to anonymous and/or untrusted users.'); $this->assertNoFieldById('edit-properties-uri-scheme-public', NULL); - /**************************************************************************/ + /* ********************************************************************** */ // NOTE: Unable to test private file upload warning because SimpleTest // automatically enables private file uploads. - /**************************************************************************/ + /* ********************************************************************** */ // Check managed_file element is enabled. $this->drupalGet('/admin/structure/webform/manage/test_element_managed_file/element/add'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFileTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFileTest.php index 7d7fc37296..89eb38473a 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFileTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementManagedFileTest.php @@ -91,6 +91,7 @@ public function testFileUpload() { $this->assertFieldByName('files[managed_file_multiple_two][]'); $this->assertFieldByName('managed_file_multiple_two_upload_button'); + // phpcs:disable // Check that only two files can be uploaded. // @todo Determine how to submit multiple files. /* @@ -108,6 +109,7 @@ public function testFileUpload() { $this->assertNoFieldByName('files[managed_file_multiple_two][]'); $this->assertNoFieldByName('managed_file_multiple_two_upload_button'); */ + // phpcs:enable /* File placeholder */ @@ -197,9 +199,9 @@ public function testFileManagement() { $webform = Webform::load('test_element_managed_file'); - /**************************************************************************/ + /* ********************************************************************** */ // Test immediately delete file. - /**************************************************************************/ + /* ********************************************************************** */ // Upload files. $sid = $this->postSubmissionTest($webform); @@ -217,9 +219,9 @@ public function testFileManagement() { $managed_file_single = $this->fileLoad($submission->getElementData('managed_file_single')); $this->assertNull($managed_file_single); - /**************************************************************************/ + /* ********************************************************************** */ // Test disabling immediately deleted temporary managed files. - /**************************************************************************/ + /* ********************************************************************** */ // Disable deleting of temporary files. $config = \Drupal::configFactory()->getEditable('webform.settings'); @@ -236,9 +238,9 @@ public function testFileManagement() { $this->assertNotNull($managed_file_single); $this->assertTrue($managed_file_single->isTemporary()); - /**************************************************************************/ + /* ********************************************************************** */ // Test disabling unused files marked temporary. - /**************************************************************************/ + /* ********************************************************************** */ // Disable deleting of temporary files. $config = \Drupal::configFactory()->getEditable('webform.settings'); @@ -284,9 +286,10 @@ public function testFileUploadWithDisabledResults() { $this->assertEqual(0, \Drupal::database()->query('SELECT COUNT(fid) AS total FROM {file_usage}')->fetchField()); } - /****************************************************************************/ - // Helper functions. From: \Drupal\file\Tests\FileFieldTestBase::getTestFile - /****************************************************************************/ + /* ************************************************************************ */ + // Helper functions. + // @see \Drupal\file\Tests\FileFieldTestBase::getTestFile + /* ************************************************************************ */ /** * Check file upload. @@ -337,7 +340,10 @@ protected function checkFileUpload($type, $first_file, $second_file) { $this->assertRaw('<ul>'); } // @todo Remove once Drupal 9.1.x is only supported. - if (floatval(\Drupal::VERSION) >= 9.1) { + if (floatval(\Drupal::VERSION) >= 9.3) { + $this->assertRaw('<span class="file file--mime-text-plain file--text"><a href="' . $file->createFileUrl() . '" type="text/plain">' . $file->getFilename() . '</a></span>'); + } + elseif (floatval(\Drupal::VERSION) >= 9.1) { $this->assertRaw('<span class="file file--mime-text-plain file--text"><a href="' . file_create_url($file->getFileUri()) . '" type="text/plain">' . $file->getFilename() . '</a></span>'); } else { diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementMediaFileTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementMediaFileTest.php index 913acf9e28..4cc4bbedfe 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementMediaFileTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementMediaFileTest.php @@ -67,9 +67,10 @@ public function testMediaFileUpload() { $this->assertRaw('<source src="' . $this->getAbsoluteUrl('/system/files/webform/test_element_media_file/_sid_/video_file_mp4.mp4') . '" type="video/mp4">'); } - /****************************************************************************/ - // Helper functions. From: \Drupal\file\Tests\FileFieldTestBase::getTestFile - /****************************************************************************/ + /* ************************************************************************ */ + // Helper functions. + // @see \Drupal\file\Tests\FileFieldTestBase::getTestFile + /* ************************************************************************ */ /** * Check file upload. diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementMultipleTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementMultipleTest.php index 678ab0037e..a7030615cb 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementMultipleTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementMultipleTest.php @@ -26,9 +26,9 @@ class WebformElementMultipleTest extends WebformElementBrowserTestBase { */ public function testMultiple() { - /**************************************************************************/ + /* ********************************************************************** */ // Processing. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_element_multiple'); @@ -118,9 +118,9 @@ public function testMultiple() { webform_multiple_no_items: { } webform_multiple_custom_attributes: { }"); - /**************************************************************************/ + /* ********************************************************************** */ // Rendering. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_multiple'); @@ -171,9 +171,9 @@ public function testMultiple() { $this->assertRaw('<div class="custom-wrapper js-form-item form-item'); $this->assertRaw('<input class="custom-element form-text"'); - /**************************************************************************/ + /* ********************************************************************** */ // Validation. - /**************************************************************************/ + /* ********************************************************************** */ // Check unique #key validation. $edit = [ @@ -182,9 +182,9 @@ public function testMultiple() { $this->drupalPostForm('/webform/test_element_multiple', $edit, 'Submit'); $this->assertRaw('The <em class="placeholder">Option value</em> \'one\' is already in use. It must be unique.'); - /**************************************************************************/ + /* ********************************************************************** */ // Processing. - /**************************************************************************/ + /* ********************************************************************** */ // Check populated 'webform_multiple_default'. $this->assertFieldByName('webform_multiple_default[items][0][_item_]', 'One'); @@ -246,9 +246,9 @@ public function testMultiple() { $this->drupalPostForm(NULL, $edit, 'webform_multiple_default_table_remove_0'); $this->assertNoRaw('No items entered. Please add items below.'); - /**************************************************************************/ + /* ********************************************************************** */ // Header. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_multiple_header'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementOtherTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementOtherTest.php index be4d48afa2..22604e8004 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementOtherTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementOtherTest.php @@ -24,9 +24,9 @@ class WebformElementOtherTest extends WebformElementBrowserTestBase { public function testBuildingOtherElements() { $this->drupalGet('/webform/test_element_other'); - /**************************************************************************/ - // select_other - /**************************************************************************/ + /* ********************************************************************** */ + // select_other. + /* ********************************************************************** */ // Check basic select_other. $this->assertRaw('<fieldset data-drupal-selector="edit-select-other-basic" class="js-webform-select-other webform-select-other webform-select-other--wrapper fieldgroup form-composite webform-composite-visible-title js-webform-type-webform-select-other webform-type-webform-select-other js-form-item form-item js-form-wrapper form-wrapper" id="edit-select-other-basic">'); @@ -53,9 +53,9 @@ public function testBuildingOtherElements() { $this->assertRaw('<select data-drupal-selector="edit-select-other-zero-select" id="edit-select-other-zero-select" name="select_other_zero[select]" class="form-select">'); $this->assertRaw('<input data-drupal-selector="edit-select-other-zero-other" type="text" id="edit-select-other-zero-other" name="select_other_zero[other]" value="0" size="60" maxlength="255" placeholder="Enter other…" class="form-text" />'); - /**************************************************************************/ - // checkboxes_other - /**************************************************************************/ + /* ********************************************************************** */ + // checkboxes_other. + /* ********************************************************************** */ // Check basic checkboxes. $this->assertRaw('<span class="fieldset-legend">Checkboxes other basic</span>'); @@ -70,9 +70,9 @@ public function testBuildingOtherElements() { $this->assertRaw('<div id="edit-checkboxes-other-advanced-other--description" class="webform-element-description">Other checkbox description</div>'); $this->assertRaw('<label for="edit-checkboxes-other-advanced-checkboxes-one" class="option">One<span class="webform-element-help js-webform-element-help"'); - /**************************************************************************/ - // radios_other - /**************************************************************************/ + /* ********************************************************************** */ + // radios_other. + /* ********************************************************************** */ // Check basic radios_other. $this->assertRaw('<span class="fieldset-legend">Radios other basic</span>'); @@ -87,9 +87,9 @@ public function testBuildingOtherElements() { $this->assertRaw('<div id="edit-radios-other-advanced-other--description" class="webform-element-description">Other radio description</div>'); $this->assertRaw('<label for="edit-radios-other-advanced-radios-one" class="option">One<span class="webform-element-help js-webform-element-help"'); - /**************************************************************************/ - // wrapper_type - /**************************************************************************/ + /* ********************************************************************** */ + // wrapper_type. + /* ********************************************************************** */ // Check form_item wrapper type. $this->assertRaw('<div class="js-webform-select-other webform-select-other js-form-item form-item js-form-type-webform-select-other form-item-wrapper-other-form-element js-form-item-wrapper-other-form-element" id="edit-wrapper-other-form-element">'); @@ -104,9 +104,9 @@ public function testBuildingOtherElements() { public function testProcessingOtherElements() { $webform = Webform::load('test_element_other'); - /**************************************************************************/ + /* ********************************************************************** */ // Basic input processing. - /**************************************************************************/ + /* ********************************************************************** */ $this->postSubmission($webform); $this->assertRaw("select_other_basic: Four @@ -130,9 +130,9 @@ public function testProcessingOtherElements() { wrapper_other_form_element: '' wrapper_other_container: ''"); - /**************************************************************************/ - // select_other - /**************************************************************************/ + /* ********************************************************************** */ + // select_other. + /* ********************************************************************** */ // Check select other is required when selected. $edit = [ @@ -207,9 +207,9 @@ public function testProcessingOtherElements() { $this->drupalPostForm('/webform/test_element_other', [], 'Submit'); $this->assertNoRaw('This is a custom required error message.'); - /**************************************************************************/ - // radios_other - /**************************************************************************/ + /* ********************************************************************** */ + // radios_other. + /* ********************************************************************** */ // Check radios other required when checked. $edit = [ @@ -253,9 +253,9 @@ public function testProcessingOtherElements() { $this->assertRaw('radios_other_advanced: One'); $this->assertNoRaw('radios_other_advanced: Five'); - /**************************************************************************/ - // checkboxes_other - /**************************************************************************/ + /* ********************************************************************** */ + // checkboxes_other. + /* ********************************************************************** */ // Check checkboxes other required when checked. $edit = [ diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementPluginDefinitionsTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementPluginDefinitionsTest.php index c11947ab7b..72a7879aca 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementPluginDefinitionsTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementPluginDefinitionsTest.php @@ -25,10 +25,7 @@ class WebformElementPluginDefinitionsTest extends WebformElementBrowserTestBase 'webform', 'webform_attachment', 'webform_cards', - // Issue #3110478: [Webform 8.x-6.x] Track the D9 readiness state of the - // Webform module's (optional) dependencies - // @see https://www.drupal.org/project/webform/issues/3110478 - // 'webform_entity_print_attachment', + 'webform_entity_print_attachment', 'webform_image_select', 'webform_location_geocomplete', 'webform_options_custom', @@ -49,12 +46,6 @@ public function testElementDefinitions() { // Comparing all element's expected and actual definitions ensures // that there are not unexpected changes to any element's definitions. $expected_definitions = $this->getExpectedElementDefinitions(); - - // Issue #3110478: [Webform 8.x-6.x] Track the D9 readiness state of the - // Webform module's (optional) dependencies - // @see https://www.drupal.org/project/webform/issues/3110478 - unset($expected_definitions['webform_entity_print_attachment:pdf']); - $actual_definitions = $this->getActualElementDefinitions(); $this->htmlOutput('<pre>' . htmlentities(Yaml::encode($actual_definitions)) . '</pre>'); foreach ($actual_definitions as $key => $actual_definition) { @@ -1165,6 +1156,26 @@ class: Drupal\webform\Plugin\WebformElement\WebformEntityCheckboxes container: false root: false multiple: true +'webform_entity_print_attachment:pdf': + dependencies: { } + default_key: '' + category: 'File attachment elements' + description: 'Generates a PDF attachment.' + hidden: false + multiline: false + composite: false + states_wrapper: false + deprecated: false + deprecated_message: '' + id: webform_entity_print_attachment + label: 'Attachment PDF' + deriver: \Drupal\webform_entity_print_attachment\Plugin\Derivative\WebformEntityPrintAttachmentDeriver + class: Drupal\webform_entity_print_attachment\Plugin\WebformElement\WebformEntityPrintAttachment + provider: webform_entity_print_attachment + input: true + container: false + root: false + multiple: false webform_entity_radios: dependencies: { } default_key: '' @@ -1868,7 +1879,7 @@ class: Drupal\webform_toggles\Plugin\WebformElement\WebformToggles deprecated: false deprecated_message: '' id: webform_variant - label: 'Variant' + label: Variant class: Drupal\webform\Plugin\WebformElement\WebformVariant provider: webform input: true diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementPluginTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementPluginTest.php index 04b3fd5476..4b8f81bd9e 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementPluginTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementPluginTest.php @@ -32,9 +32,9 @@ class WebformElementPluginTest extends WebformElementBrowserTestBase { public function testElementPlugin() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Dependencies. @see hook_webform_element_info_alter() - /**************************************************************************/ + /* ********************************************************************** */ // Check that managed_file and webform_term-select are not available when // dependent modules are not installed. @@ -51,9 +51,9 @@ public function testElementPlugin() { $this->assertRaw('<td><div class="webform-form-filter-text-source">managed_file</div></td>'); $this->assertRaw('<td><div class="webform-form-filter-text-source">webform_term_select</div></td>'); - /**************************************************************************/ + /* ********************************************************************** */ // Plugin hooks. - /**************************************************************************/ + /* ********************************************************************** */ // Get the webform test element. $webform_plugin_test = Webform::load('test_element_plugin'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementPrivateTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementPrivateTest.php index 15149dbd6a..e32acc7840 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementPrivateTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementPrivateTest.php @@ -26,7 +26,7 @@ public function testElementAccess() { $webform = Webform::load('test_element_private'); - /**************************************************************************/ + /* ********************************************************************** */ // Login as normal user. $this->drupalLogin($normal_user); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementSameTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementSameTest.php index 8f4ef8706d..33d4811922 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementSameTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementSameTest.php @@ -106,7 +106,7 @@ public function testSame() { $webform_submission = WebformSubmission::load($sid); - /**************************************************************************/ + /* ********************************************************************** */ // Check textfield source and destination are not equal. $this->assertNotEqual( diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementSignatureTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementSignatureTest.php index 0d2c9ed4a9..90fd9cce7a 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementSignatureTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementSignatureTest.php @@ -51,9 +51,9 @@ public function testSignature() { $this->assertFileExists("$signature_directory/$sid"); $this->assertCount(1, \Drupal::service('file_system')->scanDirectory($signature_directory, '/^signature-.*\.png$/')); - /**************************************************************************/ + /* ********************************************************************** */ // Validation. - /**************************************************************************/ + /* ********************************************************************** */ // Check valid signature. $this->assertSignature('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqkAAADjCAYAAACmeo3kAAAgAElEQVR4Xu19CfA3RXnmEw9QDlkRUTxwA8aoIKzitfHaNasYFUlKN4paIet9JOUmkUI3HokmitHo5lAxEYlZCVaihQca1C1dD7a8ool4lEZgVYJGVBIREY+49cB08n7v1/Obnp7umT7eqbL8+P/6fLqn5+n3/AnYYwgYAoaAIdAyAj8P4McA3tryJG1uhoAh0B4CP9HelGxGhoAhYAgYAgMClwC45fDvbwI4xJAxBAwBQ6AWBIyk1rJSNk5DwBAwBOYh8B8AfFJVuVSQ1nmtWWlDwBAwBFZGwEjqyoBbd4aAIWAIrITAkwC8xtPXnQH87UpjsG4MAUPAEIhGwEhqNHRW0RAwBAyBohF4AoA/9YzwrwE8uOiR2+AMAUPAEABgJNW2gSFgCBgCbSLwKABnj0ztvgA+2Oa0bVaGgCHQCgJGUltZSZuHIWAIGAJ7IvDvAVw8AsrrAfyyAWYIGAKGQMkIGEkteXVsbIaAIWAILEPgbQBO8DTxAwD7LGvaahsChoAhkBcBI6l58bXWDQFDwBDYGoELABztGcQvAHjL1oOz/g0BQ8AQGEPASKrtDUPAEDAE2kaAwfzP8UzxtwH8VttTt9kZAoZAzQgYSa159WzshoAhYAiEIfCfAPwugJ8Rxb8G4LCw6lbKEDAEDIH1ETCSuj7m1qMhYAgYAlsg4Iub+pMA/t8Wg7E+DQFDwBCYQsBI6hRC9rshYAgYAm0g4MtA9d8A/Fkb07NZGAKGQGsIGEltbUVtPoaAIWAIjCPwY/WThaKy3WIIGALFImAktdilsYEZAoaAIZAcgSsB7CdafT8A2qvaszcC/w7AicOf3wrgnwwkQ8AQWBcBI6nr4m29GQKGgCGwJQJfBXBzMYCvA7jZlgMquO9LhWPZZQAOLXisNjRDoEkEjKQ2uaw2KUPAEDAEvAj8TwDPEL9YUH//RvHZ7zLe7DG2rwwBQ2A9BIykroe19WQIGAKGwNYI+FKl2ndg71V5IYDneBaLTmZ0Nuv9MVOI3nfASvO3w2kloK0bQ8AQMAQKQYCq60PEWH4dwCsKGVspw3gwgHeMDIYhuxi6q+fnnwHcaADgcgB3sVBmPW+HfHM3kpoPW2vZECgNAUrRHgXgTgA+AeCMTpxBKPU5afiQct5ndzLvsf1HknUb8aORLj9S2slMlrozgL8t7QVfaTx0tHuf6usKQVpXGoZ10wMCRlJ7WGWboyFwLQLfBnCgAOPLiqy0ilOv8x5bT+08xXI9k64xnJ4G4JUjP14C4NatvjAT8xqTMv8aANo822MIJEPASGoyKK0hQ6BoBB4D4A2eEbZOTnqd967N+HEAx6kCfwDgvxe9g7cZ3LsBPGCka9qtPm+bYW3aK7Ux1Ebo5/sA9t10ZNZ5cwgYSW1uSW1ChoAXAX5Mf9vzy0MAvLNhzHqd964l/T8A7qcKMAbojRveB7FTG7vksL1eVdy77HUtg1nsTrN6XgSMpNrGMAT6QICquJd3SFJ/HsA5Hc57Lkll+ecC+J0+XodZs6SEmRc85ygkK58F4LGzWqu/8C6SytnxsmOJD+pf5yJmYCS1iGWwQRgC2RHwOTuw09YlqY8E8EYPuscC+FR21Mvs4MMA7uEZGm2UiYsRjL3B4WXnBYPTof71PwOgdLqXZ4qkng/g3r2AYfPMi4CR1Lz4WuuGQCkIjH1Y7gPgQ6UMMsM4xubd89n3RQBHDlhfrewIzTZ1fBMySgTDLennswCOyrB3S21yDAc5XosnW+rqVTaung/qypbKhjuCAMMqyfzaDKdjz94IjElSW5cojs2757NPSlIZRonZleRjdoXjJ8irATzF8/PLAJzS0cHzQwDXHeb7L8P/X0fN/y0AfqEjTGyqGRDo+aDOAKc1uQEC3wGw/9Av/y1DLG0wnGK7ZDrHv/OMjkHJWyb2PpLKD+z1i12p/AOTjlPvH+J9ylSpVPcz6kPL+yIWZV+6VLbFMGcnAyAx6+GR0vgLB1tmhp86SE3ewlL1sBsyztFIakZwrensCDwRwJ+oXp4E4E+z91xfB2Mf19adHBi0XpOtqwDsV98SJhuxJqm0t6REVQb4ZxnaWtqzJwK0tfzgCCgk98SshyD/tF92cWJJUm87hDDTmcu+O5hC2IXH3qQoBIykRsFmlQpBgF7b/MDKx1RM/sUZk6S2TlJ9ueopBfqpQvbwFsPQJJXSZuJEciUlYScAOHeLARbcp+/SI4dLDElUW3c+kyYjHwFwzwGEXwbwW54LD9X+rWNS8Latd2hGUutdOxs5QDuw31BA/D6AZxo4eyHgk6TSlszZlbUKmY+cM3f9oa1OOGBeuwjGmaI+CRfV/vb8GwIhTkOvB0Cy1vLju+i4+fLCczqA4wUA5pDX8m7IODcjqRnBtaazI/D84dYuO+It3he0PvtgCu/AR9Z6yBDjIxVfB3Czwtcr5/C0PSFVte55r1Lzt56RbC7Ovv1EQqadqSg5bNk+dRdJJabEiR7+zqmVf+stVNfcvWXlPQgYSbVtUTMCjwNwhprA4wG8ruZJZRq7T5LK8EM3yNRfSc2SLMiPZe+OU2OSVK6ZTn5g5jN77mTfe0TnQzoNyT1GKTSJaqu2mH8B4KQBGqZIfbTnhdcmJMSClx5T+5d0OhY+FiOphS+QDW8nAv8VwF+qEr8I4K8Mt70QGLNJ7eEM8KW2bN0Wd9crMCUF+xEAF06od6mzxtFn4+zSyb4bwN1EhZbNJT4pQpftmifNHqQJian97eM0C4EePlCzALHCVSHAQPQfUCO+7w7v26oml3iwY979vZwBP1Z4Gkm9FpC3epwPPw/gdgIvU/nvuXn0XnLvEAksLwAySkKrkugQSapDjSSW8Zj5/ADA3TuJgJD4CO+zuV4+UH2ubvuzvpcnW1LrweljV9VHUr8J4JDYBiuq57MjbD0+7K7lmSIYzFUvQwmZ9CuMpLKUlhzyby3aYtLelHFh+Uw5iulYxa0S94qOxHqGaiS1nrWyke6NwBM8MVFN6uPfKT6i9j0AN+xgY/lUtD2ffVOqWo0XbQlJ6u25FgFpDuGLkEH7VJkcocWYs3KOIZcY+gkwk5l7LMi/vU1BCPR8UAcBZIWKRoBetU9WIzSSGk5SrwRwQNErnG5wUkXLf+sUjul6Kr+ldwB48DDMdwJ4iGfIUkXLn3uWPGt4xtT9spzGj05Gbyx/awSPkFFUGF2FD6Op8L93Pbwkk6w7tT8vPpQwt+pYFgykFdyNgJFU2yE1I3ABgKPVBHq2NZz6SFzuKdDLGUCp8b5i/i2qYEPf5SnHKbajVf6UhDFyhj1ACEnVKu7WpKlzSSr3jY4cESKBtf3WOQK9fKA6X+Zmp8+Ue1pdbSTVv9w+df9nh5SFzW4QMbGLlMr674R3cg/zl3MMIala5U9nqtv3BtTIfKW6f1es4bcBYNYu97R0MZJ2zQwDSNOrkEfuPZY3zVcIah2XMZLa8eI3MHUt0eCUbE+PL6zG62ODp20DW2FyCn8/5Bd3Ba8CsN9krTYLSKLg8+53s34fAEoEWyRZS1Y2RJLK9jXR34X1kvFsUTdGkspxagfOlsN0bbEuzfVpH/TmlrSbCfmcYTh5k6T6t4BPksr4hUyI0MPzIQCMBiGfXu0sQ0mqVs+2RLKW7PlQkso+pBd8S+dTLEklBtqxjA5VxMkeQ2AvBIyk2qaoFQFfqBfOxfb0+Irqj2vrqRslElrNyN96/ThOhaCSuNGxRcb97JXYS0zmkFRtm9rKnltCUnlhpgTV7atvATjOnKhq/RTnHbd90PPia63nQ+AjI6pqk6SGk9SesPKR1BCv5Hw7eLuWp0JQyZGZA9Xe6zQVgkrXkES/FWn0EpJKfLTa32KnbnceFN2zkdSil8cGN4LAmKrfJKm7t4z8uPYWhslHUj8N4E4dvmUhIagcLNpMxByowrz75bbS6u0WvrtLSSrxeQGA5wqger00dngEhU+5hZclfLZWshUEeOs+cWQytqfHV5mBxx0+jIywfysbImAePpJKNeNNAuq2ViTEu1/OmTnpHyD+0JME3rf2c9T9PqlhCzFTU5BUXoB4lt9vAPmfANAEifvTHkPgGgTsg24boTYEtI0XiZcLzL4rHExt80w9Xq1e642kfhjAPTyg9mhjOZekavvvnmyZfe+hvOz5Mk756lwC4JbDDy3EB01BUgmHL7uZBflPffpX3J6R1IoXr9Oha4nY1wEcOmDRU9zPucuvVY6UWlAi1svzRQBHeibbY3rGUO9+B5e+GPaImdw6cyWprCtte1tIM5uKpBIb2Rb/m9JVOpjxjLKncwSMpHa+ASqbvpYGvn7IYnLQMI8vDTfzyqa1ynC1l3ZvcULHJKk92qXOJancoJKYnauC1K+ygQvpxBfKLcT8QRP92iX4rxUZyOYE8x9bRm3CZfaphWz4rYdhJHXrFbD+5yBwHoDjRQV+HEi+HEntTToYip0m96zXm7pfEjMSLnf29WiXOicEldtjMrvbl1VYqtB92EK5WJKqif5pAJ5dMSApJamEQYel4t96NyupeHukG7qR1HRYWkt5EdAfh9MBPHVQCRlJ3Y29DiPE0hcAOCbvkhXVuiSpVwPYdxjdPw8fyKIGm3kwc0JQuaHIiAA9XwZ9F77Q1J7cd/sMgNZumiTNh1LZ2Gpp8zcGhz3GVLWnUwSMpHa68BVOW2e/ORbAp4ag0Pw3n57zse9aUu2dzbIt2MXN2cZSnUgHO0cW2EZv5+CcEFQOY23THErM5qxRDWV94e9CVfcSd841tF6JuKSWpLo5aic9Xi5pn8rzyp4OEejtcO5wiZuZsvxISjLKW7aR1N3LfBmAQ1SR3qRhOg+9hKO3c1AS9tDg8loa36sqllmSNGEicaU9/NSjCVgqCeRUvzl+l+le6RvAuaV63g7goaIxElV6/NvTIQK9Hc4dLnEzU5ZkVHoXXwjgiGGWF414cDcDQuREtDcym/mmh7hGNl9FNc734GGkMmzZVwAcXsUM0g0yRlVrHv7X4r/EJpV1pQ19zdqMmD0UuoN1/FTWM6Iail5j5YykNragjU5Hq9ikqnFuzMdGIRqd1lh2rt4chiRRl+r+3nDgRomVgpmH/7WvmYyTOjdzm8SebVGVzb/V9uQkqcSC5xYFE87fgH/rVXpf295IOl4jqUnhtMYyIfC64TBn89ru1EjqbtC1BMyV7slxSmPw9wB+agCiJxzc2kvvfueAGPLqXgHggKEgna/uElKpwTIxcVIdDPrSGGpuURqMuUmqj6gyIQLTGK8VP5Vr9aihz08AYKittfoubb03G4+R1M2gt44DEdDqNR1I3EjqbiClw5lUc9esagzcOv9aTAcL554hcXVPb+fgOUN8Yc6f9qmUUIU8ktz2tH80NtJL/4cArh8CniijE5KExFmd2UX24lIinNO2Vl8w14qf6jPr6M2OP/smCumgt8M5BBMrUxYCkmD4YnsaSd29XlIK/SMA1x2K96Tm1ipWOnqcLGCrkSQseUtj4qSyP+3h3xtuDvOLVdKQud9RHankiQAYHL+mZw1JqsPjMQDesPL7+jQAr/QsCB24+M2xZyUE5r5cKw3LujEErkGAt1l+EPj/fHw3dmYMOmr4/TMAjjbs9kDgHwDcYvgLpT7XG/7dUzB/6dn/EQBMCvF8gVJvHx7p3T/HM1uTq95wc1uG8TtvMvzHt5XdZOjxI6WxZwN4dGjFQsrFSuNjhy8vmnOk/7H9PQ8Apbb66dnMJRbLRfWMpC6CzypnRkBLbnxxBWmndMthHObdv/eCSPu5ywFQ+sWHuN068/qV0jwzJLm5MhrE7wA4UwyuN4eMWMcpHchem96Ust65x0HHO6fij02rK8+2GtXIrwbwlAHoOXbNsWuj917uGLMvBvCskcHm7jsWoybrGUltclmbmBSN1nlrdVLUMYmPqfvHl3vMacrV6OX9p7TrwGHSlKTy48q95Z617NxKeTGXqGrlpefNAB5RyqRWGoeWJr8MwCkRfet3szapdK5g/rugjNUARCzPNXFf5UVWtmEkNQbRyDq9fKQi4bFqGyIQav9mJHV8kbTDkCxZo/Qmdjtyri6UzfsHpylJtuaovGPHUFK9WEkq5/BVADcfJtOj6jNEuxO61nJf1iaV3oKkSmJP7EgWc3nbPxLAG0cW0nhT6A5PUM7ATgCiNZEcAS1F3SXpMpI6Dr+UPJCc3QPADYbiVwHYL/nKldmgTAThvNIl2frogE2Zo08/qiUkVdYlroxZ3NMj7ZtjVf0OL7kva7sobUFSiZvELKcGxOfdz/4ZIcU5n/a07zebq5HUzaC3jncgcJZwJPhnofL3VZH2hj1mD9q1kaS0kJKa3xXEtCfHKXmRcRLknsmWlAbOtSfUksTeviHyvPkcgDsuOMnHUj0vaHK1qluRVJmelxFKjvOkqU0FgiTEss3e9nwqPKPaMbCjYLNKGRHQwa6n1GAy3WVPYZWmlkDbzlHida5wMvusiIow1Vbtv/tIqs5F31M4JRmCaq6ntLbV6wk3vgcfFlL3pTa5+h2t6Xu8FUnlGkgzCV42mbUrx/NsAC/yNFzTOuXAZdU2DexV4bbOAhCQKurLABw6UcfU/X6A3gbghOGnLw1xHanqvs3wt56Cscu4lp8HcPshmD3D6LinNseVgFdptMhpAE4dfp0b/qh2h58luLFuyvNGq5Rripe6JUnVFyWZJnvp+sr6XJ9/BLCP+KOp+1MiHNCWkdQAkKzIagjEhLiRKhmdMnW1gRfWkf74OZWulED05Dh1pTBzcCYhU5nMClvSpMORBMM5koV2oDUdvYXvkir6udj5MP4agJtFXhhC1yxHOSYfePzQMNOFPiFHJzvalOd+TttonQiEQzLetOJiG9grgm1dTSIgpRSU/pG0Tnlv9iod3AWm9uq/L4APAqA5hIuTSjOJQyZXpP4Cmoxyj1Fqyuc7APYf/r1UdVsTUlLNHEO0pK1zTueVEjF9E4CHJySV0uykpovjlpJUwr9WulSd7Yp992bisul7aCR1U/itc4GAlqKGfvxMkrrnNtJZupyqn6V6tN/VqkG5r6QTTE/hlOQHPoakXgrgsGHbvUYEde/hQKMt9x2Gib4HwAMXTlpLpmlfSeld6c/WJJX4SNMw/neu+KXyUsZ+almj0vdQ0PiMpAbBZIVWQEAeOFMe/XI4lhZ1z8XRDkHyQL1ApI09H8C9V1jXrbvQ6jppe6pDdJG89fAslaR+EcCRA1DvAvCgHkAb5vghAPca/v2SHVmJ5kAiNUi12IrLcyZUoDAHk5CyJPjEztnZv3WwNQ+pO6cMI6HcUFSwzIZz0FtY1kjqQgCtehIEYmxRXcdMc3nE8B92eOzp+SqlqISoR9MImWedGMgzr0ZykOKFW0owUttlppjTWm1Iu+5UEjUt7a/BznfpHkq1XvpSnkOaSmfL24kBXy3iTaeah7UzgoCRVNsaJSDwXmEnOEeKyrGn9LYtAYslY9AhbfRHtEfHqV151nvdO1IayJSeTO0556nVjnLOHH1ltX1zyogQ8gKZSyK4dP6yvjxrtpKkuvHItMd/AID7M+WjSSrbruEikRKDzdoykroZ9NbxgMASKaqR1D230XkAjh/+5CP7vSU+0PZ+Os96r6Yi0o47hmjpy1AvjiTaWSfl97O2+LMlkdTcMY/luelO3K2JeTcEIuVL1g1oNtGkCGibQRILqqlDn16lYRofLeU5E8DjVKHeHKem4ileIpIb9GIqovdJDMHUF8sYohv6fpdUTpKhHOHupETwpB2540vARL5bWxO23OHkPj5ktpK4u3jLJaxF02Mwktr08hY/OX24xOSvlrfcWpwOciyMlm65sFOyL6nm7cFxSs5X2+f2KoWX5MKHSejelB7Pvag+Xy0iGcScVVPYMsIELwB8cqitp/qf87vcR6lsc+f0r8vmTHMsBSGuX7NLXbJaM+oaSZ0BlhVNjoBW08RIZKR0MCRDVfJJFNKgPKTHyEdPjlP6AvR2AA9Ta9WjFF5GNFhCtKTJwNaStLVewY8CuNvQmTYdSTEGeR6Wbpf6hwB+dZj0rwN4RQoAFrShTTFSZqGSaYTlEFP2sWDqbVc1ktr2+pY+O0maYtVnPRIN37pKLMfIR0+OU1rV/1gAZ3VOUjVxXyIBlTnsS5f6pToHpWTet5+W9iOJVulaIRkndck+WoqZrC/PwJR7Ukq4ZX8p+0iJQ1NtGUltajmrmoxWT/8aAIa2mfv0JB0cwybUJusqETrlcgAHzwW7ovIhcXcvBkAbaD6fETFkK5rmrKFK4j43iobu6N0AHjD8sZdsXfKsibHlnVos7ehX8vdZhiGL0YBNYRHzu5REpyT58nIix7XEXCZmfl3WKfkl6HJBOpr0JwBQXeKe2EM/hTS2dtinHITc/GQOe6YEPbD2iY+MP9TWuTdTkVSqfsIuJWm9SJScHW6s1ifkdZO2vqWQP9+4pQarFLW3JvmpxuWzSSUmZpcasqMXljGSuhBAqx6FgD5MTgfw1KiWgH8AcIuh7lcAHB7ZTs3VphyE3Nykkxn/7TK11Dx339hDg6P3ZiqS0tlJktTS7SdT7G8Z0SDnfKVJTi0kNUcA/dg1k7bSsdo53bc8J6iNktmnjEPFrlRgPQM4ECgrlhQBHXbqWACfiuzhCgAHDHW/BeAmke3UXI03+n2GCdDI/zEjk5EkhR9DSq9bfD4C4O7DxHapteUHLad0rASMU8f4lCT1/QBaTym7VsilpTFs19prUoNVEo+QKv8ljoESR0lSv6eyTZVE0Nda+1X7KWlzrTpx62wzBKiKpS0g/5/PUnIg89Hz38dsNrNtOtbkY5dDhySpHG2L73+IV79bqZ7smV8HgKGC+KQglb2R1DNE3OFUamTfiSEJUcmSVHeWLLVtTn1qSol3KrvUXSS1xTM09Zosas8AXgSfVY5AQIedWhpjT6rHUh1KEdParIp0YJj6YEib1O8C2H+zUefrWKv6nwzgT0a660mSKs1iXgjgeQuXoDeSKu15c0rPaiCp8iKY4sKzcCvuVV2aNc1NDjN1cfgXANcRhYxDpV491Z4BnBlga34vBKT0ij/GOky5hqnid2rrHtX9IaGnHFafBXCH4T/476Ma3J8hXv1u2r2kRdXSZV+ih7lboTebVEcepy6Cc3HU5eX+LSW0kx6j1N7ktM+NxVLGNV0qBOEYZLg1SVJbvejH4p6lnpHULLBaoyMI6LBTKWyGepAOjm0oreqf+qi1rt4O9ep3ePaSFlW+d6lIlpTgp3iPSz80nXo7t+RQZrV6OoBXFQiMPHdKTOQg93uKvflFAEcO6/B9Yf/f6kW/qC1nJLWo5Wh6MCQQHwNwWzHLFLZdMt81Scetm0Zxz8mdB+D44U8h5KP1YP6hXv0OxV68+6WjYirJlySpZwp7zRZfPxmNJHe4rT8GQHLK5xQAzGxV2iPfs1Qe9CnnKC+rNOmRoQ5j+pGSVDqp7js00qN5WQx+i+oYSV0En1WegYC2RT0bwKNn1B8r2oMzkG/uWmoY8vH8hoh+0GK4rlCv/t5IqpSgpyIVbwLw8AHI1oP5S8lhCvXxrmNPSgFTrVWCY3aPJmRK1F0236n7ndOevJAv5TnyMvtDANcbBtJyhJQ5WGctu3Txsg7OGm8GAUoimFrOefRzYvcBwPieSx8eGtcdGvmBUMUsbbf0+jqMV4iDgAxe35r9ribtIcSpB0mqxiWF9oLvhrRJLVHlm/L9lXPN7XFfuipdr31uPGLXMWWILHlO8Btz/WFQLV70Y/HOVs9IajZorWGBgHQG4J9TqRzZVo+SVE36Q+2uZLiu8wHcu6FdKokEp/UQAO+cmF8PJFWSnhCTkNAtIdX9rZNUeX7l/mbKEEq57V9D11qXKzHbVM4xjklSW7vox+6HrPVyv3BZB2+NV4GAdpbioFNJc7SUiG0vjRZQA6iSIHC8oSFxWnacikmP24N3v4yPmvJyKPdgiKlJDe/V2BhdqLKlMZ1DMEhtTxnS59wykrSVet5KO9KTALxx7iRF+Y8DOG74b6aTdsljWrvoL4AoX1UjqfmwtZYBSvzoASnTyKWUuvRIUrUUdQ7xaNVxam6UA/duXgjgiOE/LhIevC29u6njozpselL3O23NnHdtyR6S2qESv9EpVelLcNpVl1JohlrjsyTtNuvLuKvSJnWNS0sufKppt8QXoBrwbKA7ESCBpB0qSZV7Ut88pdet6yNUqljr8r0bwAPE4OdIMiRhacme6m0AThgwmaPS7kHdLwkPMTo30caXNtGh5iaJul61GakJmgrxlmpgMsnEnPc7Vf9T7ZROojl+6ai79HIh40ubd//U7kj8u5HUxIBac/+KgFZJM77cPQDwAE75aJvUVKYEKceYqi1pr8Y253r/XiFUVS3ZUzGftgsLM0dq0jpJ1RLmlOd9LzapLwXwzOEFXusCXLrN51oxY5ecm/JysdQLX66HVPebJHXJCgXWTXloBXZpxTpAwGeHOpdQhcCkSRvrpIoaENL/2mWkhIWe+ow5ywM49JGOU/z3MaEVCy6nidixAD4VON7WSapUyaf+oPai7nd7hPGYDwrcV0uLSSl1ad7zNTh2EX+tZVsikZbnLi/ENxgW2OKkLt3pAfWNpAaAZEVmIUA1/xcA3FTUyuVYITMGue6WHEazJrpyYR1nNob0t+g4JSV6c4lY645T0is9tUq+F5Lq7LjX9LRfM+TV3GOs9JSocj7SBn+JqYa8zMqMU/8I4OZzAbTy8xAwkjoPLys9jYBW89MeiBlK5kj8pnu5tk1mupFPSGzMkLZLK6Pte0nG+LGYi2mLjlNLAtVfBuCQYbH570NLW/iF45HrHXOp2dX9aQBOHQq8BMCzFo61xOpSapjS4XNqrhLb0lKj1hDH1eEryeWS9ZORAihRv9HQwZoXl6k90+zvRlKbXdpNJqbV7zQyvz0AEonUjyQYbPtHAO6aweY19bhj2tPEP1YFKA6SNd0AACAASURBVL1UW3Cc0vttrs1gy+r+XEH83f6V6TuZupMpPFt75EU4d6YpiR1tYGkLy6e01Kilp0SVOMpzcwmh/KKI/HGViFazpM3W3pVs8zGSmg3aLhvWQfuX3F53Aejz6m9VmrMk5JTGsLWMUzIG6FxVP7GRtmYx9Ut+ybVdeOqzXqqkU0tpS8FV2obOvQAtmYNcuzXJcciYa0iJ6uaRynFQRlQxSWrILklYJvXBlXBo1lRlCOiP4pcAUNI1VyUdMm3dF1PVUVWbo6+Q8eQssyTklB5Xa45TlGo4J4YYotQySc0VxN/tqR5sUp0pyZywZinOAimtzHXRjx1nyfayvjnJ6C+xQf2l8IXfGJfe2ySpsbtoRj0jqTPAsqKjCFDaRwLkMnGwYAxpCIVYq79bPSy0JGAppi05TsmLCsnqLSIuKS2r+3MF8e+FpEpTktROZ1PnnNzbpZFU+c7Emh1NzT/l7zLGaawDr/zeGElNuToBbRlJDQDJiuxEgLfKcwZHHleQOdOZOz3Xo80KYg+fXONL1e7SkFN6HIyNyugHfC4FcMtUA92gHfmxjCURLZPUXEH8eyGpMprG2ir3kp2TSo/hqo8iuY68pDOO9lyN25sAPHxomLGmDxz+3ZqJ0AbH+HSXRlKnMbISuxHQUs2czlJuJNKQnX9bEl6k1PVNLUXlPK8EsN8wYQaldodtqRiMjWupw5Rrt1V1fypbvF37onV1vyRja9qjEvOSSarUxtQQ7k/7L8RIpqU0VjpOtZpKuajvgZHUopajusGsFbRfA0PjdUmwajgs5y6u/Biksu+Vhy3/fdTcQRVSXjq0LDH1uBDAEcOcWvrg5Azi34sk1Umit5CWlUxSa0iJqo8pbVPKS8ccaaq05WdUlFsPHSw5ewo5SssfhpHU8teo1BHyhvoxEWeS41xD7a6laCQazLzU0pMicL8PjxbipNK85GLhvLDELq5Vdb/8KOd6J1uWpMrL91I78JhzyUhqDGrjdZZqpSQx/zyAnzaSmnaBdrVmJHU9rFvqyWeHmitov8ZNEou1iPGaa0cSThtfXgL4UIrq/r10HPKwpdrKqf6Xtrtm/RcAeG6ij0SrJDVVpp1d69oyST0dwJOHydOGkWYhaz6lOk7J2LtbSJiXrIF8J+b4TGihCOfN1Mt8TJK6ZEUC6xpJDQTKiu2BgPxA8YdvALhbpqD9smOStc8ocrXFRyTXduBH4HwAdxQdLJEU6nFKm9TvAtg/10Qytstx33Bof6lDS4skdQ17VMLfcsYpZ6vMCAm3yriXx5oulaTKvVUbQZMmQjSloso/5NHvE+d9PyOpIdClKWMkNQ2OPbXCm+X7hLqVMQT5Iq8hbdBOWpcDOLgh8HMnQ7hEePTTrvegyrCTZhApSHaLJFXGR81JJJgRiZmR+LSUcUpKC3OZSky9dlubG4yNTxI2as44zloebUIV6scgBTL81vE7ZyR1xVU3kroi2I109SEA98ok6dsFkU7zyLJb2IvlWkYtnaaB/jEzDfynxiadsVi2tvdfjj827JTEqEWSKsOM/Q8AL57aFJG/t5pxShLErbQ0pWackuPaisBHbtc9IiawjVANlQw/xUsfHyOpsasQUa+2j1TEFK1KQgS06iMmnEfscM4A8DhRmbdaqv/neGnG9p27nr7lzzlE54xNBnivjaTqvZci7NjHARw3APg3AO46B8wCy+pwOzlJVqs2qU4tnNIWfO5WkRmnlpq0zO17V3l5Tq159qeYg7YtDT0/ZASQcwH8CMCJw4BqkyanwHH1Noykrg551R1Kux7mgadX/RokkVJUhgGR9mGtSFH5QXqFMJ/gBsklpWAgapcV7IcArl/RbpSmEKnSVH50sKUmDIxUcfeK8PANVZKIVBiNQdIqSXXS+lzvYMgWkxLLUDIV0u7SMlJQ8OvDubW0zTXrS8fRUPLP9+hGwyCpmfiPAE4Y/vvtAB625gR67MtIao+rHjdnHfpnzZu0VoUzDMg9VyLIcWiF1eLH6ExFUHPdzrWU7QsilErYaLcrpceeQtXP2chLV6o2t0MJkEQ+1z5y82uRpEppW04p9NQeeQyANwyFHgvgrKkKK/0u1zyU5K00tKBu5pJUbWJGE4HnDaYC7JC+GfcP6tkKRSNgJDUauu4qaqK4VhYWTY4JfKg9UcmLRPU1b+JOssmx0uaJxDWHdPo8AMcLQGoiZZJMplz/lmxS9Qc1t6ahRZJagqqf+1uatpR01slLUEnjCj3nZRiqkPdDmwjQ2YraiucPHa4pqAmdY3PljKQ2t6RZJqRjd+b0GtYT0LaotcXn8y2Itq9kGUq+eABS3Zj6oSTy0yrkVElqxF3z9YWA4d9SPC2RVGnHSGxyXyJbJKklqPpLJqnyfamRpH4YwD2GgyPEnMMXzq017UuKczRrG0ZSs8LbROMkOO9RWZ3WUoX5bFFrIVdji+9T8TMl589mIqgch5aC1xK6i+v/AQB3EmCm3HstkVQ5lzUucq2RVEnycxP8qQ9DqTapLZHUvwBAs4pdj9zjTjBjJHVq9yb+3UhqYkAbbE5neFpTxaG93ucEYS5xKXwElV7E/HuuOLM1h+7ScXFDpB9z1r0VkqrVkiGqzDk4+cq2RlKdKntNLdGuiyyzzvEp6VIu35eUl8WlezG0vtyzIeZOJLInDY278kZSQ9FOVM5IaiIgG2yGElQelPwAuueTg6F4DptJH4TShoi/16hicvMiET0bwA3ERElQqVLKoeJ33dQaussn/T0isb1uKyRVxy4ODVS+5NhqiaRKx7wSHIJKlaS6TFzcNzVyBykt51xItHc9MvoHk2Q8vkFnyyVnwCp1a9xoqwDTeSc6qxThWINQSdj/GMDTFaFLlcN+7eX14UmJDQ/NnASVeH2wwtBdvrixOSRKa3rD59pz2m4utbR5bNxyjdaQ3ObCj+0+DcArAVwG4NCcHQW2XWqcVOkdXyN30O/K1GVOXv74LXqVkdTAHZywWI0bLeH0rSkPAnyRKUGlmtg9uVXSehgkVyRxh4sfSpBwxGwY7XTGNnLboLpxanV5jixWMZjsquOLG5vLxORtIubhmwE8IvVkMrfHd5TaDXl547/5vuZ+TgNw6tBJzsxWuefB9p2EMNc+mzuHUiWpjqSuYfM8F7OQ8r6QUtSmjD2SlDstnqn7Q5BOWMZIakIwG2iKBJVxO+VHjwcSD82cEj8NnVZf1kCufMtPw/zfUXgyODSJa248dWxRjq90ou+TOOckDu8VMQ+ZTcYF6a7lVdb24mtJUYnPMwG8dADqFAAvqwU0NU75npTyPSyRpEopZAl2u7HbLTQMlSa0TuoqL/5rvm+x862+XikvZfVANjABHtb/F8BhYi5rqKQ1dFr6x99rs0XlAcdYelSJyocElR+gXbf3VFuJ0nD25Z4t0zyGzMkXRSInQeWYpF1lbR8cbRLB9SXJX8tevFSVdMhek2XcHihp/UskqTWnRJXrLVMhvwbAU0Y2jHZGdFzJSOrcN2xheSOpCwFsqLo0iue0GLeTH6K1Pnrs00dQc2fOSb2EPMyfoaSn7IMSaf62BkElSf4MgFuIyeWw6UyJnV77EO/bpf3LPmvaZ9qEhJcfSrpyRYjw4dwCSXWJQvgd5CVpzbNu196V2Jby3jLxyEOHQZeUBWvuGSC/c+8C8KCRBqTkWJo3tOQwOBe7TcobSd0E9uI61Z7UDPx+n5UPbZ1ViCAx1/wxK6jGUyzIcwA8WTkpuXYZ6/PkFeehA7vTXELa96aYb8o2tEPDpQCOWmH/SZJakwrzswDuIBZgCzOOFhyn3HtSkhSVy+ocufjvLdbW925Lcldj+Ck3p9CLqTxD5dlgJDXlyR/QlpHUAJAaL+LLfrR2MGup3nJwU33Jg2INyWPsElMSQ/LJD7Yv8gAlXDwU+b81pTTSa72kD90YzlqKv5Z5hy9Yd+xeWKuevlBuRbBa+FjTLpzvcElSVO4jae/Li++frLW5RvrR9pk184bQi6ksJ82OWricbbyd5nVf82abN1Mr7UPA5yi1xc39AgBHiwF+d8gGQrJV4vPgQdrxkJHBkZxSMsyDLreDlB6C/qBwLKV9hOWYNelaU6J5FoBHD4P5GwB3LXGziTHpyBtrSZx9sNROUt3FOLfdc8yWkoKDtS5su8Y5JlWMmdvWdaTGbtdZw9/uOwyW/gUvGP4tSeoW38qt8Vu9fyOpq0NeTIc+R6m17fLuPTgY/ReFSokvP8nfiYOzzVi81qsBMJTRb25ATh2ELwbwLIHnGradsZvaF+5sTSm+jCJRQ1idrSTOLZJUYsn3uMQLXGn2vlIzUyKpn3P+hJJUGTlDfo+eBIAOV3xKkHLPmXuVZY2kVrlsiwfNg/l9SkW9tqOUVkm7SZVGFogVHaH44ZCxY914KankXNz/Fi/Owga0vWIJkhjflHyXpLWDwss9uJXaPHS5tcR568uHHE+Jl8pduDpJZamES5o/bY2t1szUbI/KPRFDUuUZWpqUO/T8qLackdRqly564L5g6fxY8zBcy27yEgC39MyAan6q0Le2Q+XBTJx+DsADR5CmMxIDmjO/81q4TS26tu0ljjxgS3tKuCQREymZLJmkam/+tcNN+fZPzbZ5PO+4B0k4Snl3JcYlkVQp1S09jF3IOUfhDNedzy4TH5pp3WYoJ4l5aVLukDlXXcZIatXLN2vwJF6vGMiXrLi2NEFm+ZHjoESSB8BWdqj8aN1vOMD4kfBJTTleHtT8QG81zl2LXpI6eGycPhX/xwD84gYmEjKjzNrvwZyXt0TpeK0klWfM7wM4G8CvzFmEFctKkrr1vqxJ2xCyRB8FcLehIM+du49UkmeDTJ9aYgzbkHlXW8ZIarVLN2vgJAZ/CuC2otYWZEsHSOZwrho+GI+fNaPlhTmWnx2M4xnmaszO1PVEcwg6Qm0t5d1F/iglcE9pZhMcFzFnRjP+vxzn2hnN2LfOyFWqWYRW829NWty6PRvAi4b/qCUtqouLyv/fWo2+6wSTKuWt11uStdpV/cQ8NK2pnLfkSSXGsF3+NSy4BSOpBS9OgqHxMKY9JT908qFqk39bW9X1DQA3EQP5waBOz038iMOxg5SUHwCSpDFJqcSJedFfW5hKf2xb6BSZpX2EiTfTkPJD554t7Sp16DUpLUnw6iVpQqeJLSk9cI1pUSVBKXG93aYphaTKcVDTFXJmJtn4GRuR5+SYo/BYIH8OyySpGRfH17SR1JUBX7E7SoootXL2N65r2ny+c8VxuK40QeXfX6I80VMMix/2g4bDhBLSg5XkblcflC7zEKOKi/+/NomPnT8zwTAjjHtKlKKWEt/TYSQJy5UADogFP2O9ks03arPNk5LztaOYzN0ipZBU2tyfOgx+ywvlXPx2lZckdSwElcRfl6lt36fEbpO2jKRuAnv2Tn3OUSRgfPnWjtvJyX4LACUX8qEU9dCFRJDzoYSUHyCS01AJqSRzlE6dURkp1RtIS1FLU11rM4/zhxSLW14CpAPFhcoUJvsLGtCBtPlk8dJIQm3xIuU7snYUiYDl3qNIKST1E0Lz8XQAr5o7kQLLh5BUube1uYX8rZSUtQXCnG5IRlLTYVlCSyQDDDxMlYR8KFnbypPVR1A5thA7NpJPelhy7FQ18X+cIyMD3HQm4FRXUTLF//GgqklSumuqmsxQovqwmdjkLi4/DFwHruEWlyU5z5I9+33e/FtdMMf2Rk2OU/qStGYs3ph3qxSS2po9KtcihKTK+MmnAHiZWESTpMbs6AV1jKQuAK+gqrsyIG0pgRkjqAzb9JeDBJRkgYSFklZnN0qSdSCA6y/A+NMAvjrYk/Jg2poULZjKaFWSeNrNOluxUgigHLAm0Vs7grixlerZz7WkpPmOAsQSJTbSfKN0yaT0UF8zo1nsOy9J6lbYamLfClcIcZySF1itlTKb1NhdHVmvlY0XOf1qq/EAoYSR/8+bnc8znep9/pbbKWkMRKpyaRuqH6r5l5DPsf748WlNSjq1QeWBy7KlxfrUEsFSnC+0Z39JJFDmDOealkLq9V6sJS2qJlslrfXY+10CSZVkrEQb96mzcex3eWHxCXB08gLtYGckNRb5yHpGUvcEjh8vpr50kql/AUC7nO8ofEkA15DMOXU3X4xQJyAeKPzQkcBs9TCn+GEZO78IAEkpY65yHUhOe3u0d3oJAd7lGvjCTZVCEDR2pdjw6mQMJXnz10pSJSmpJRj9YwC8YQB8q9Sb8hKypTYu9bn+JgAPHxplCutHqA7kO+i7VFsIqtQrMtFe7ySVZPTkgZQywC893+c8jPF5MYBbDJUcuaUUkeTphsP/SKp8jyO6rM+6JHfS9nLOWErJgOSLhTpnHq4sLwZUe354wNKR0S2dbWLmkaMO98g5KnJDSSGnuAfoQX24mHxJUl4tgS7hHJQxPB1sJcelrEGSqiXmW6nO554BkihtdYGS5L5Uaf5cXFmeNvuMhsLnXAAnqEakJsNnGmKS1BjUF9Qp4XBeMPzFVeWtaHFjKzcgHYH40S1Fmqg/DGOw/BDA9YYfSfZJ0GmwznnwgFxDUr3ykiXrrmRnKV9kia3i8o4BLj37v5ZZ6h+66DrcVOnSqxocp84C8OhhAUoxNQnZD/ICsBVJleZaW40hBKu5ZaYuV/I99JFzKeV+LADuMXsyItA7SdXqtYxQRzdNFRVz3X8ZwLuFh3p0gytU5G2UIUscCZVdkpy+cjBJMCI6fzG0xK0UZylKT5l2V8flZfrJpy0MNTYfpd01ZF7uEiS8+tJRg1q69BBU2rawFikqd64kUltI01t1miK2UlLquwhKh0ofOZemQi2R99RnbLL2eiepBNLF1uShxniZDP4un6sBfE84AZEU8CPHv+07qKNZxj1sx5GvGwDYDwDV/b5sHfybU1+TvNEj3f0326idxFGqeisA3wZwnWFutc8p2csX2ZB2rNmaZI1lNeP0SpOgckylqYD50aPphjwfavj4lR6KR74n3xzi4NZiKiTDJG2RGUtiV3rig7nHqLwAaHW+tlX38SNZpiQTq7k4VFPeSOreS8WPmPOWp+i/loOtmk1nA41GgJJ/GvuT8PPZWoo6Jj3luChp29J5bwxkEkIZR3hLQshzhh9Kabtbi/0fpePUiPApLdB7zVJU4ikl/Vt8o2V2wNaI2C6SKrUDYxENjKRGf77iKm7xAsSN1GoZAn0jQEJDgkVi6J4tVZg87J8NYB+1LFSh8bAv9XL3dZEIgtE7rrvhttKZwmqSWj0TwEsH7LbyQB9bOikJrMF0Qs5DEuwtYrpqE7jSEx/MfX0lEaUQiuYU7pGe/2M24aUkWpg772rLG0mtduls4J0hoAkNnX/uvwEGJMtnemxP+UElcd0qLm8IFFrV/x4ADwypmKGMjjBAx8F7VWTiIz/WpYQW4zLpBBe1SQIfBYB23Hy22J9yX9ZG8ENe013xXy8AcPTQyOsAPN7ToJHUEJQTljGSmhBMa8oQyISAJjT8eGyRJpN2iEy7q5NH/BGA5xUsPXXLch6A48UabaVa90UV2cJBZsl2lR/7LSX6eg41S1E5F2onXjRBlJas2666+hK3tb17jnlKkqkl1TRTutHQ6VjabonRVudHDlyKbdNIarFLYwMzBK5BQNpQOUjWtqPkwUzPfWnLybGQLPNvpYQ/m/oA0zFxf1FoC2Loc5QqieSFvnaSpJbysa4xu9Qukr22FFifNVu8H6H7L7ac3LeapErP/jHspTlGTeY5sXhtXs9I6uZLYAMwBEYR8Enc1iQ0znOf0h1GspBPbVIWqcrjPC73RPLIvRV9jlK14egwKlHtKU1itrDnTLF/5BzWNqOQsVFbSoUq10XaUn8EwD2HH+dE/XBkttY9lmKfrtaGkdTVoLaODIFZCFAqRJu0Q0StNSVWJCGUnkpHLQ6lBttTDfTpAOjcI5+1pVTsW4cPK93JbNeGlSS1hMQD2uGnVingVJzOWYfIjML6QrzF+zFjuNFFXwDguUNt2v66ZA86/NQuYYAj80ZSo5chvKKR1HCsrKQhsBYCvrSna0ncxlT7zApGu9PXVmB7KteJ5IU2vQeJP24hJdIfQZoe3KcyLMckUr4c6Gu9K+yH78snha30Wu9K6jlqad6a32cZ9qqm7Fxz10BeFCUR1+/nLpMqk6TORX1B+TVfggXDtKqGQFcIaEcpX47p1IDwQ0+nKIZo0U/NEj/pDMF5XQHgmJW96DWJ4jhqlfS5vUHvZ37k+ayxP3ftd4bCohqXT80e6acBOFVMdK3vs5ZCr6mxSX2OTbUn055Kcwqd9S2EpJpN6hTaCX5f6yVIMFRrwhDoAgGtdqNKiR+RXHFHKb0hOWW/+mHfPLxrcIzybQ5N9llmbTs/mkswZJc0m2iBBEhs17ST1uusA/evvb4pDyWmvX7A0ODXAByWsvEdbX1CxAvlpY5nQq7zZqUpebvRkmoZA1Y7je3iRk6SWoKZy5Z4rtK3kdRVYLZODIEgBEhG/wrA9UTpXBI39vUMT7xTdk1ySrXYW4JGXWYhfpCo1nchZTjKNT8qJE8nA/g9lfCgFTs26eCzpf0i9+iJwxZ8O4CHlbkdg0YlVe5rmSxo4kb77acGjba+QrsySkkJ6y5zIAtBtfK6G0ldGXDrzhAYQYAHKCWaMod7aokbD1gSJ/Yl+3FD+gKAR1YsOZXQaskI1fxMP5pbQkSMSf4pmdYY12w2obetdPDJdZGaOixkyKmtUwRPjXXqd2mywLJrEX+tbTgWwKemBlvp7/ISoKX/V4vL5K5EKdI04iQAb6wUi2qGbSS1mqWygTaMgC8W6seGbEgpSNW9h+wpPpU+YaXkgMS15GxRc5dfhtNh3dwq6V02vez/jMFuMsV6zsUidXntZLLFd0Tb+eZe39QYyvYY4o3/O1D8cY10pDo7VytSft9a8fItCaXEV9vkngLgZSMLLsuusUY5910VbW9xuFQBjA3SEFgJAZLDlwOQ7yJJIw9D3vyXPLtU+pQ8UVVKSUpL5JR4/TGApwvgcjvTUKLHcF0kb/qp3a7Xt/92qU2X7Nc5daWaf00zjjljDCnru6B+ZZD6h9RfUkZLUdeS3i4Zc2xdOdd/BHBz0ZA0XZmyyZXrZSQ1djVm1DOSOgMsK2oIJEaAkgyqlmSaUZIaSjxjCSolTLTR42Gq05dy+CTAzt60BameXhISRmIobVFTm03IPklMGYLpYDUQEifiXKvT2a6tLgniWraTcjyaJHMNatzLfFcvVmYha2Vx09LwLcKyJT5OdzY3purXWcqmLjxy7xt/WmEFDeQVQLYuDIERBHTYk4sAHBf5wZ2yN70MwJMqd4aa2kg+0n8pgKMiMY3pj2FpeEFokZw6PKQpxdre9FTrU/PAZ0rqNbV+W/+uI3l8F8BDVtBskBx/HMCRAoC113FN7DURlTbU7wXAcFPuufHEWeEcrFo2jVhzbSb7MpI6CZEVMASyISA9StnJXAcUHr7MmPJzAI4eGSUlMyRNVHe1/PDDS6m0zpC1K97hUjykVIVtMYPN0zIR4qVjTVV/y4DzmtTVrm6Vamauz1pSaW1iMCU9TLV3tmpHzlea/ui9HIK/cxi0GKkrraaR1JWAtm4MAYWATM/Hn6bUbTxQ7zeQMBIxn/2j7MKRUxKpGlWhczeMLyZqbjU/SbF7cseznYtHrvKPGsg425e5z3P159rVBPW+AD6Yu9OM7fP9fQeA/UQfa0gzaafOuL0u8sTlAI5o/IyQqn5JyHWaYp6xPDfHHimRzXm2ZNx29TVtJLW+NbMR140AU2E+ReSMdrNx3sn8ePAwZCgYHpoPHZwo9gmcNm/4PHxbc4baNX3tncuyOSUd2qyg9vBHgVvrmmKvHvYv//2B4eI0p35MWS35q93Bx2eWQrKo7ZpjsNpVh+fKOcpWvXYspzDSXv3uIqCjQ4RIk+U5k1NDMzWnrn43ktrVcttkN0aAgbKf7BnDlQC+CeCmAG4YMUZ+4OjRTlu9HqSmEiLfBz8nQfVlkKo5/NHc7SYl1msQHG233YIES5v5cA1yY+nbtyHEbO7+KK28NMn5jgjzpS8+IaYjUvIaUr40LKocj5HUKpfNBl0ZAiQxJKc/nXDcNA+gtJSkoWUnnSnItMouZXxZ3TcJ00tUBqmchHhq7lv8Lu0oc6un9dq2QKp00H6uYW4nHJoWEDsms3BPD/t2zOZUX2xDsXBmA7lD2m3xXhfbp5HUYpfGBlYxAjwEKRl54OBZLoN0x0yLEoDzAZw3ENOeSamWojKEj3tyqd1pD8ksUtopix83/taT9Fpmmsqp8tRORS1gzXOBdrS3Ens2VUzksXOF+5MxfGX2s5Yyn+06T/UectJPXgpo0+yeEKmoJLwhDlYx57zV8SBgJNW2hSGQFgF+DKh+j31+AOCTAP56kJCSkMbGTI0dQy31tLNUyo/HVLzZHjz5fftAktSQj/vcvUTc6dhD+z/35JY0zh1jbHm9XxlU/p6Z3m/iSHKqs8z1sm8ZZeOVnj2kzUdCTXVkvblRWGL3i9VTWW4MEEPAEFiOgPZCnmrx+4O3NMko/9eTw9MUNrt+185SKaWodFZ7oUdyyvGwH36wWg/p5cNeX8BSCzl8BDVUFbtkL61RV8fqZJ+5yA6lfnSQ0pL/XiSo2imKWLtYqMTFSZWZ2euYQE2IsyM2Vf8ab4voI/Uhs/LwrTtDoDgEfB8j3yB/COB3hximxU2i8AH5VJgpHGr48Xr+QEJ9EPAjT4eLXiXbMksRybpUIS/dMj6C2oINqsNFx9TNNTefBz/HECoxXLqOJdTXtsy8+NN+mhoqmYUv1KbaVP0brqqR1A3Bt66bRUDbQsmJOslpqykzcy+qL9c545Xef0HHjpyS/GriRTJGqSnXq1dy6qBlxrLXDP+RMkaqj6CmNN1YsDWSVPWFSMthKsFLxNsBHCBGvVaa1SRAJWhEp3t1Emu+wwzr5545Enp58pJbdgAAESxJREFU5uSSfieYeptNGEltc11tVtsjwNv37QFcD8CnhUqpJyeb1KvwbAAvUo3yI8wPUwyBZL2TPXZ77MKF9XpdZNup515Ce1JC9S4AD0owKBJUShmZqMI9KaTiCYaWpAnuMaliZqM55qdtLdkPbXl58Yp5N5JMfoNGZOB+ds/LDv9G+1z38MygxDn0LOb5zdTKUwlXNphu+10aSW1/jW2GhkALCPjszGII6pRDFD/sJGMkTvbsiYCM75kqrqdWg7ekltZqZ6JJlTOl/qEEKWQP+uzgmWjhxMT9hIxlyzLcO4wVLcnos4YEFFJDMicqhTTfeiKA1245wR77NpLa46rbnA2B+hDQH+KLABw34yNMyTbtTal69dlS0kSDHzkL7+XfG88bJIDu16VqT5+Kn+vDdMEtPD6zlJhL1RQWPvV2S6YSU/OXv+skCbxIPXdI++rKzZViu4sGzX54hqS8XMyZW7dljaR2u/Q2cUOgKgS0xC1UGuLIqQ7F4yZPBxazD57eCl8GcOuhGO2q952usrOEDseUy5Fo4TCjqvMi9GYA1xG1c9iG+pyk5pKwqAkWWEnb/fLSyT3FcGbumWOHyjq8SDEOM/9/bt0CIapzSEZS61w3G7Uh0BsClGAcNEw6JAzMvQE8fsTelFIRElMSpZ7s9WL3jCYA7xkSVcS2pwlqSwTAZ5aSIxEB+2F2tduKRehVgkoItBSVwfr/XHjz0670PjMlodJcI/RSHPtOWL0RBIyk2tYwBAyB0hF4zhC31I1zl9SNklM6Schg8K4eyS3VsJTKmtoufNV1tIrQ0D2+HrSdJp1RqLJuZT20WUoMOQpZGV/KWDpPtYJjCAaujE5/yux8TIrCfcWHl1L+e44pjzSjaCWZxBxMiylrJLWYpbCBGAKGgAcBqjRJkpwUlUV8JGksww7Lkwg5yamBPA8BTQBCpNi+Hnzrkzsl6LyZpimtpcRLbXd9o9J2qDmcsdKgsU4r2v6X9upHiK7nOvlpaXiONVwHmQZ6MZLawCLaFAyBRhGgNJQ2ZdLR6aMA7iHmy98YRoofKu0QddngDHVWo/isMa2/AHCS6CjG5tEn3c7hRLQGHlN9yBBIsYR+qo+xnPRT9Vr9XWJOe+l9xERjokVI+/eeTSiK2C9GUotYBhuEIWAIKASouvx95Xyi1XYksfQI1+kf2VQMmbJF2BuBzwO4nfjzjWeqlCn1Y774m4s2Wo3fKZMdcLo5nMG0fXDv+/zBAN4x8uLGRIuQUmqLi1rAiWgktYBFsCEYAobAHgg8cwgdcyOFi1PbPRLArwCgc5R+WiVAW2wRSqaZ1MA9cxymxmyDKZmi1Ls120lf0P4ltru+9dbe/HOD0m+xh3L3+W4AD/B0EkPeud8ZX/ZOQ3vmLJV79QLaN5IaAJIVMQQMgVUQoFSEBJUfB/lcBeBxAG4GgBJWmX/blXNOUbQJtCcNAjFSu122wacBYNaw1h5fTFTaid4l4US553lJkN78c20tEw6niKZ4WX2jZySxuEinNzpf+S7BRUy8p0EYSe1ptW2uhkCZCJAM/R6An/IMj3al9JDWxFWSUzpF8X/2pEVAp9rcJRkkOX3GICXVo8gRIzTtTONao2STNtPa3CSHva22Q+3dVlJfoLiC3x6ybBGrmEfatpqzVAyCGeoYSc0AqjVpCBgCkwjQfu/uAB6hPPdlxR8DGDujKF1lFiSmKWxNdTwJ3koFtCr1J0fiylLKR7LmQv644bl4tLxAtLZGnCsD9h+s1iIm3NHUcmqCSinfQxvEdAoH9zuxfxuAA0WFbwE4cgEm0ha1pbi9oZgWW85IarFLYwMzBJpFgFlcfCr7kAlTSkWVfovEJ2T+a5YJyTJFFSmletJ+mESNa9Si7Snxp8nCqZ7LVeqg/ZROn6PIP7Gl5LbXJBRj0uuxC1To+yI9+lPbEoeOwcp5EDCSatvCEDAEciPAjy3DGNFGj/+/f0SHJAAkPvyY2JMfAR0f1ec0pQPKc1RcJ5LTOYHT888mXQ8++9OvAPilIZ5vqp58ZKx3gspz5F2DBkbivFTyKR0EibEOZZdqTa2dCASMpEaAZlUMAUMgGAEe+Bd61KKhDTBO5292LDkKxSl1ufMAHC8alfEmx5yj/mgwwWhNte9goNSY2cwkickRTYL2lv8LwAEC/1bteufsW20j7eoulaJKh6nebX3nrMcqZY2krgKzdWIIdIkAP+aUMsmPbQgQlGZQYtprmscQjHKW4bpdoiTejgjwN9qfyrSzXC9+6FuWclOySY99+VwK4KgFdpC+NdQZq1gmtRlBzr2Ts23p2OT6OR3AUxd2ag5TCwHMWd1Iak50rW1DoG8ErphJUEl2qE7lh7pVaVwNO0KrtHnROHyQIGobSc6nh3iSNF84Viwe9yqJeqwnud4HvuxqLHPGEJat9/fBd0ngGtAsZQk2MkpArgxhNbzzxY7RSGqxS2MDMwSqRkDnF981GX5sKDW1GKfbLzklpXRskyptxp0kSfOFW+qBoPpsb2OCxftWd8x0wt6JPdHy2QIvXQNifwGAWw1dxaRQ3f6NbXwERlIbX2CbniGwEQLa8WZsGEwdyQ9Qr97KGy3PaLeU3DFxgnsoXWLAdH7AZU70HLFAS8OC46GkjaGmriMGt9RRxzVF6SBtXHXorhx2riViGzomksnPqdS6KbJtycsHM6vpcGKh47NyGREwkpoRXGvaEOgcAZ99nYOkdS/wWpf+q4oM/AOAW6rJ9EKifI5SzOdOUrlExezIr885yhJT7P3mMNHHKerPSyX42nwgNktVre95NeM2klrNUtlADYEqEaAUhM4lNx4yR7mP+9KPfJVgFDxopqSlZ7NMu+kb7tkAnpaApBUMxTVD83mSXwTgZxNI/cdCd7FP0yjsuTN4fnwdwPXFnynZZhKQ2Idt0gnOxWqmNocXEnsKRMBIaoGLYkMyBAwBQ2BFBJh2lheJqacXmz2SxZerbGcpzBt6Dd01ta92/a4JfYpYsTJwf4r2lszP6k4gYCTVtoghYAgYAv0i8A0AN5mYPgkaJU2pPNlLRpuqfEYwkI5jKQjqWOrYXoh/zJoTs88rW+ilzlKa9Br+MSuzYh0jqSuCbV0ZAoaAIVAQAoyFqu1N9fBoAtBqelM9V5IiqoElQWX4rYctzKB1HwB/OKQzlX2aHeT4y8A1+CCAo0WRpc5SOkKAqfkLOozGhmIktYJFsiEaAoaAIZAYAZllx9c0CQHV3i0H6NfzpqT4fuKPVAVTshqb4pVE6xkDyZd99Yjt3O37AgDPVZV+YcF+lPFQ2WwqB7i587LyMxEwkjoTMCtuCBgChkADCJCA3WhkHgz3Q0eqnpx4fKRoiSqYpIjhpZxzjoOakRFI/mOJbwNbb3IK3HvvUKXePki0Jyt7CtCTnyYcbi2MoMaguFEdI6kbAW/dGgKGgCGwIgL8UDNsz74ATlUqbTmMXsJLyTkTG0pRDxJ/jI2FSumpLysXm+4lMsKSba0lnmxriXMT1+N8AHccBrWkrSXzsrqRCBhJjQTOqhkChoAhUAEC/Eh/HMCRAWMlQSVJ6Ck8GKVr71MST4aaOi4CBy2xc5CTGNG8oifTiYDttlcRX1YpFloi0daOUj/ZmYYgZh2KqmMktajlsMEYAoaAIZAUgUsBHBbQIp1IqIbuiaASllR2qCT3Ojg/ySlJEsmXPbsRGCOodFw7JnJfaqnsYwGcZQtRFwJGUutaLxutIWAIGAKhCOisOr563wFwQifhpfT8fUH1YzzufTib7WnoLr1Wen/miAlKbGYpHamBUSp4CbOnMgSMpFa2YDZcQ8AQMAQCEeCH+uIdZWmrR+lSTw5SDg4SI2Yuuo7AJ4bI+MJWfQDAiZHSv8ClbabYmIkEJ5jKLtgcpSreLkZSK148G7ohYAgYAhMI/BmAk0WZbwF44WAf2SM5JRQkRpTc8f/dQ8knw03NeXz2rLHEak6/rZQl3rwoHDwyoTtHRkHQpgOx0thWcK56HkZSq14+G7whYAgYApMI0HmKaU+vAPCpydJtF9B52znbjwF44EzJJwkWia4MMZUiM1Xb6P/b7HyZveTcY6TarM926QjnnqUZqnpZj2LnaSS12KWxgRkChoAhYAgkRkA7Ss0lliSlDNCv7RvZDk0ILP7p9IJRgk0iKTN7yVo0Q3nozEsD63NtKBE/fGjM1PzTa1F8CSOpxS+RDdAQMAQMAUMgAQI+R6lQlTKJFckpQ0npx5yk5i0OifyxI1XmXhpkMwzxRVtg91i4qXnrUmRpI6lFLosNyhAwBAwBQyAhAlQD/28A1xVthnjyP2GI0+mCweshvQ7Ab0RI/RJOraqmtI20HDxDdlEaTWn33Een+X06gFfNbcTKl4eAkdTy1sRGZAgYAoaAIZAOAaqVqV6WjlK7bBWd1JSEaUwlTVUyVf4xhCrdzOpqSduLytF/DcDPRZpL6BBgMU5wdSHZ0WiNpHa02DZVQ8AQMAQ6RECr+X02jySjVBWTeEoyqyV9VCmzPbM9nb+RrgSwn6caA/Y/LBJTEl+uiUxpG2rCMX8GVmN1BIykrg65dWgIGAKGgCGwEgI6jqnP5vE5AJ4M4FYjY/oegJcCeLmp9aNX7esAbuqpfTWAey4gqDrCgnnzRy9RmRWNpJa5LjYqQ8AQMAQMgeUIaCmqzAO/K9MRe6ZKn/VpR2lPPAK7Mp/Fpir1rV1MKLH4WVnNVRAwkroKzNaJIWAIGAKGwMoI6KxSlKKSMFG1/4rBScc3JAbkZ0B4U+mnWbCxzGcvAfCsiC7oJMX1k/bCXDOaavSaoCICxjqqGEmtY51slIaAIWAIGALhCPhicVKKesAO1f65AH7ViE44yDNKSq/+HwB40XARmNHENUVJRElQ5UNHKRJXI6hz0aygvJHUChbJhmgIGAKGgCEQjIAvm9HnABw24q1PtT5JjklOgyGOKugkn/8UUZt1aX9K6bh8uHZjjm4R3ViV0hAwklraith4DAFDwBAwBGIRoKTtZSoe6vcB7ONpkOp/Svio2renXARIQv8cwJ3UEKni5+UihvSWO1sb2R4IGEm1DWEIGAKGgCHQAgI+W8WxedHJ5kkmPS122Sk5PXkgoVpSyqD/vFjQqc2exhEwktr4Atv0DAFDwBDoAAGqgc8JmCcJDsmNSU8DwNqoCNfyDAAHe/q3y8VGi7JVt0ZSt0Le+jUEDAFDwBBYisCDAJy2Ixe8bJ8ONjQHMNvTpajnq+9zjHK90fGN5hmm3s+Hf3EtG0ktbklsQIaAIWAIGAITCFAd/B4Adw1AihmNfslSmAYgtW0RH0H9FoDfGLJKGTnddn026d1I6iawW6eGgCFgCBgCCxD4MoBbT9Snat85RhnBWQD2ClV9ERkstNQKwJfehZHU0lfIxmcIGAKGgCEgEdiVwYjl6M3/4sH21MhpuXuHQf4pEf+ZIe3sfmKoJKi0TbX1K3f9VhmZkdRVYLZODAFDwBAwBBIhMJbB6EODw81bjNwkQjpfM1yjE0eaZ+xTElQLzp8P/2paNpJazVLZQA0BQ8AQMAQGBGQGI/6JdqeHGzpVIDB2yeDgLwTwCHNuq2IdVxmkkdRVYLZODAFDwBAwBBIjQFUxiem3TeqWGNn8zVGNf5DqxmxQ8+NeXQ9GUqtbMhuwIWAIGAKGgCFQNQJMvEBvfj43BHA6gFdUPSMbfBYEjKRmgdUaNQQMAUPAEDAEDAFDwBBYgoCR1CXoWV1DwBAwBAwBQ8AQMAQMgSwIGEnNAqs1aggYAoaAIWAIGAKGgCGwBAEjqUvQs7qGgCFgCBgChoAhYAgYAlkQMJKaBVZr1BAwBAwBQ8AQMAQMAUNgCQJGUpegZ3UNAUPAEDAEDAFDwBAwBLIg8P8B48hP42lVITQAAAAASUVORK5CYII=', TRUE); @@ -65,9 +65,9 @@ public function testSignature() { $image = file_get_contents(drupal_get_path('module', 'webform') . '/tests/files/sample.png'); $this->assertSignature('data:image/png;base64,' . base64_encode($image), FALSE); - /**************************************************************************/ + /* ********************************************************************** */ // Delete. - /**************************************************************************/ + /* ********************************************************************** */ // Check deleting the submission deletes submission's signature directory. $webform_submission->delete(); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementStatesTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementStatesTest.php index 63c535bfd0..0154201a66 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementStatesTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementStatesTest.php @@ -21,9 +21,9 @@ class WebformElementStatesTest extends WebformElementBrowserTestBase { */ public function testElement() { - /**************************************************************************/ + /* ********************************************************************** */ // Processing. - /**************************************************************************/ + /* ********************************************************************** */ // Check default value handling. $this->drupalPostForm('/webform/test_element_states', [], 'Submit'); @@ -83,9 +83,9 @@ public function testElement() { value: pattern: '[a-z0-9]+'"); - /**************************************************************************/ + /* ********************************************************************** */ // Rendering. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_states'); @@ -104,9 +104,9 @@ public function testElement() { $this->assertFieldById('edit-states-empty-actions-add', NULL); $this->assertNoFieldById('edit-states-single-actions-add', NULL); - /**************************************************************************/ + /* ********************************************************************** */ // Validation. - /**************************************************************************/ + /* ********************************************************************** */ // Check duplicate states validation. $edit = ['states_basic[states][0][state]' => 'required']; @@ -118,9 +118,9 @@ public function testElement() { $this->drupalPostForm('/webform/test_element_states', $edit, 'Submit'); $this->assertRaw('The <em class="placeholder">Selector 02 (selector_02)</em> element is used more than once within the <em class="placeholder">Required</em> state. To use multiple values within a trigger try using the pattern trigger.'); - /**************************************************************************/ + /* ********************************************************************** */ // Processing. - /**************************************************************************/ + /* ********************************************************************** */ // Check setting first state and adding new state. $edit = [ @@ -171,9 +171,9 @@ public function testElement() { $this->assertNoFieldByName('states_empty[states][2][trigger]', 'value'); $this->assertNoFieldByName('states_empty[states][2][value]', '{value_02}'); - /**************************************************************************/ + /* ********************************************************************** */ // Edit source. - /**************************************************************************/ + /* ********************************************************************** */ // Check that 'Edit source' button is not available. $this->drupalGet('/webform/test_element_states'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementTableSelectSortTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementTableSelectSortTest.php index 4e5af14e3f..a2355a303f 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementTableSelectSortTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementTableSelectSortTest.php @@ -25,9 +25,9 @@ public function testTableSelectSort() { $webform = Webform::load('test_element_table_select_sort'); - /**************************************************************************/ + /* ********************************************************************** */ // Table select sort. - /**************************************************************************/ + /* ********************************************************************** */ // Check processing. $edit = [ @@ -50,9 +50,9 @@ public function testTableSelectSort() { - two - one"); - /**************************************************************************/ + /* ********************************************************************** */ // Table sort. - /**************************************************************************/ + /* ********************************************************************** */ // Check processing. $edit = [ @@ -70,9 +70,9 @@ public function testTableSelectSort() { - two - one"); - /**************************************************************************/ + /* ********************************************************************** */ // Export results. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementTableTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementTableTest.php index 06e8259fe7..78794d1ff2 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementTableTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementTableTest.php @@ -36,9 +36,9 @@ public function testTable() { $this->drupalGet('/webform/test_element_table'); - /**************************************************************************/ + /* ********************************************************************** */ // Rendering. - /**************************************************************************/ + /* ********************************************************************** */ // Check default table rendering. $this->assertRaw('<table class="js-form-wrapper responsive-enabled" data-drupal-selector="edit-table" id="edit-table" data-striping="1">'); @@ -60,9 +60,9 @@ public function testTable() { $this->assertRaw('<table data-drupal-selector="edit-table-states" class="webform-table responsive-enabled" id="edit-table-states" data-drupal-states="{"invisible":{".webform-submission-test-element-table-add-form :input[name=\u0022table_rows\u0022]":{"value":""}}}" data-striping="1">'); $this->assertRaw('<tr data-drupal-selector="edit-table-states-01" class="webform-table-row js-form-item" data-drupal-states="{"visible":{".webform-submission-test-element-table-add-form :input[name=\u0022table_rows\u0022]":{"value":{"greater":"0"}}}}">'); - /**************************************************************************/ + /* ********************************************************************** */ // Display. - /**************************************************************************/ + /* ********************************************************************** */ $edit = [ 'table_basic_01_first_name' => 'Ringo', @@ -111,9 +111,9 @@ public function testTable() { // Check states table display. $this->assertPattern('<div class="webform-element webform-element-type-webform-table js-form-item form-item js-form-type-item form-item-table-states js-form-item-table-states" id="test_element_table--table_states">'); - /**************************************************************************/ + /* ********************************************************************** */ // User interface. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementTermReferenceTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementTermReferenceTest.php index c7536b6f9c..4516a3cb6a 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementTermReferenceTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementTermReferenceTest.php @@ -42,9 +42,9 @@ protected function setUp() { public function testTermReference() { $webform = Webform::load('test_element_term_reference'); - /**************************************************************************/ - // Term checkboxes - /**************************************************************************/ + /* ********************************************************************** */ + // Term checkboxes. + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_term_reference'); @@ -95,12 +95,12 @@ public function testTermReference() { $this->assertRaw('<option value="3">Parent 1 › Parent 1: Child 2</option>'); $this->assertRaw('<option value="4">Parent 1 › Parent 1: Child 3</option>'); - // Publish term: 2 + // Publish term: 2. Term::load(2)->setPublished()->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Term select. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_term_reference'); diff --git a/web/modules/webform/tests/src/Functional/Element/WebformElementTextFormatTest.php b/web/modules/webform/tests/src/Functional/Element/WebformElementTextFormatTest.php index 5c26a5c172..2a114a61d6 100644 --- a/web/modules/webform/tests/src/Functional/Element/WebformElementTextFormatTest.php +++ b/web/modules/webform/tests/src/Functional/Element/WebformElementTextFormatTest.php @@ -174,9 +174,9 @@ public function testTextFormatFiles() { $this->assertTrue($images[2]->isTemporary()); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Reload images. diff --git a/web/modules/webform/tests/src/Functional/Field/WebformFieldTest.php b/web/modules/webform/tests/src/Functional/Field/WebformFieldTest.php index 2e52dc5a93..fcb7e2b18e 100644 --- a/web/modules/webform/tests/src/Functional/Field/WebformFieldTest.php +++ b/web/modules/webform/tests/src/Functional/Field/WebformFieldTest.php @@ -49,7 +49,7 @@ public function testWebformField() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Check that webform select menu is visible. $this->drupalGet('/node/add/page'); diff --git a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailAdvancedTest.php b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailAdvancedTest.php index f035f5e46e..0f759dd080 100644 --- a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailAdvancedTest.php +++ b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailAdvancedTest.php @@ -12,6 +12,11 @@ */ class WebformHandlerEmailAdvancedTest extends WebformBrowserTestBase { + /** + * Modules to enable. + * + * @var array + */ public static $modules = ['filter', 'file', 'webform']; /** @@ -46,7 +51,7 @@ public function testAdvancedEmailHandler() { /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_email_advanced'); - /**************************************************************************/ + /* ********************************************************************** */ // Generate a test submission with a file upload. $this->drupalLogin($this->rootUser); @@ -196,7 +201,7 @@ public function testAdvancedEmailHandler() { // Include empty. $email_handler->setSettings([ 'exclude_empty' => FALSE, - 'exclude_empty_checkbox' => FALSE + 'exclude_empty_checkbox' => FALSE, ]); $webform->save(); diff --git a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailBasicTest.php b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailBasicTest.php index 782d537b3e..2895ca907d 100644 --- a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailBasicTest.php +++ b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailBasicTest.php @@ -32,7 +32,7 @@ public function testBasicEmailHandler() { /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_email'); - /**************************************************************************/ + /* ********************************************************************** */ // Create a submission using the test webform's default values. $this->postSubmission($webform); diff --git a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailStatesTest.php b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailStatesTest.php index 6fdc1e4cc3..f655f8fa7a 100644 --- a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailStatesTest.php +++ b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerEmailStatesTest.php @@ -42,10 +42,10 @@ public function testEmailStates() { // Check updated email. $this->drupalPostForm("/admin/structure/webform/manage/test_handler_email_states/submission/$sid/edit", [], 'Save'); - /**************************************************************************/ + /* ********************************************************************** */ // @todo Fix random test failure that can't be reproduced locally. // $this->assertRaw('Debug: Email: Submission updated'); - /**************************************************************************/ + /* ********************************************************************** */ // Check that custom (aka no states) is only visible on the 'Resend' tab. $this->drupalGet("/admin/structure/webform/manage/test_handler_email_states/submission/$sid/resend"); diff --git a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerRemotePostTest.php b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerRemotePostTest.php index 2c896d9cd2..33b78af4c5 100644 --- a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerRemotePostTest.php +++ b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerRemotePostTest.php @@ -42,9 +42,9 @@ public function testRemotePostHandler() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // POST. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_remote_post'); @@ -210,9 +210,9 @@ public function testRemotePostHandler() { $this->assertRaw('This is a custom 404 not found message.'); $this->assertUrl($webform->toUrl('canonical', ['query' => ['error' => '1']])->setAbsolute()->toString()); - /**************************************************************************/ + /* ********************************************************************** */ // PUT. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_remote_put'); @@ -233,9 +233,9 @@ public function testRemotePostHandler() { first_name: John last_name: Smith"); - /**************************************************************************/ + /* ********************************************************************** */ // GET. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_remote_get'); @@ -260,9 +260,9 @@ public function testRemotePostHandler() { preg_match('/"confirmation_number":"([a-zA-z0-9]+)"/', $this->getRawContent(), $match); $this->assertRaw('Your confirmation number is ' . $match[1] . '.'); - /**************************************************************************/ + /* ********************************************************************** */ // POST File. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_remote_post_file'); @@ -305,7 +305,7 @@ public function testRemotePostHandler() { $handler = $webform->getHandler('remote_post'); $handler->setSetting('file_data', FALSE); $webform->save(); - $this->drupalPostForm("/admin/structure/webform/manage/test_handler_remote_post_file/submission/$sid/edit", [], t('Save')); + $this->drupalPostForm("/admin/structure/webform/manage/test_handler_remote_post_file/submission/$sid/edit", [], 'Save'); $this->assertRaw("form_params: file: 1 files: @@ -324,9 +324,9 @@ public function testRemotePostHandler() { mime: text/plain uuid: $files_uuid"); - /**************************************************************************/ + /* ********************************************************************** */ // POST cast. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_remote_post_cast'); @@ -368,9 +368,9 @@ public function testRemotePostHandler() { checkbox: true number: 20.5"); - /**************************************************************************/ + /* ********************************************************************** */ // POST error. - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_handler_remote_post_error'); diff --git a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerTest.php b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerTest.php index 5e1cce895c..cc6ee51240 100644 --- a/web/modules/webform/tests/src/Functional/Handler/WebformHandlerTest.php +++ b/web/modules/webform/tests/src/Functional/Handler/WebformHandlerTest.php @@ -203,9 +203,9 @@ public function testWebformHandler() { // Check that post load is not executed when saving results is disabled. $this->assertNoRaw('Invoked test: Drupal\webform_test_handler\Plugin\WebformHandler\TestWebformHandler:postLoad'); - /**************************************************************************/ + /* ********************************************************************** */ // Handler. - /**************************************************************************/ + /* ********************************************************************** */ // Check update handler. $this->drupalPostForm('/admin/structure/webform/manage/test_handler_test/handlers/test/edit', [], 'Save'); @@ -221,9 +221,9 @@ public function testWebformHandler() { $this->assertRaw('The webform handler was successfully added.'); $this->assertRaw('Invoked test: Drupal\webform_test_handler\Plugin\WebformHandler\TestWebformHandler:createHandler'); - /**************************************************************************/ + /* ********************************************************************** */ // Single handler. - /**************************************************************************/ + /* ********************************************************************** */ // Check test handler is executed. $this->drupalGet('/webform/test_handler_test/test'); @@ -258,9 +258,9 @@ public function testWebformHandler() { $this->assertResponse(403); $this->assertRaw('The <em class="placeholder">missing</em> email/handler for the <em class="placeholder">Test: Handler: Test invoke methods</em> webform does not exist.'); - /**************************************************************************/ + /* ********************************************************************** */ // Off-canvas width. - /**************************************************************************/ + /* ********************************************************************** */ // Check add off-canvas element width is 800. $this->drupalGet('/admin/structure/webform/manage/test_handler_test/handlers/add'); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAccessDeniedTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAccessDeniedTest.php index 4aab78d842..3e6a18e0ba 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAccessDeniedTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAccessDeniedTest.php @@ -47,9 +47,9 @@ public function testWebformAccessDenied() { 'webform' => $webform->id(), ]); - /**************************************************************************/ + /* ********************************************************************** */ // Redirect. - /**************************************************************************/ + /* ********************************************************************** */ // Set access denied to redirect with message. $webform->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_LOGIN); @@ -65,9 +65,9 @@ public function testWebformAccessDenied() { ]; $this->assertUrl(Url::fromRoute('user.login', [], $route_options)); - /**************************************************************************/ + /* ********************************************************************** */ // Default. - /**************************************************************************/ + /* ********************************************************************** */ // Set default access denied page. $webform->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_DEFAULT); @@ -78,9 +78,9 @@ public function testWebformAccessDenied() { $this->assertRaw('You are not authorized to access this page.'); $this->assertNoRaw('Please login to access <b>Test: Webform: Access Denied</b>.'); - /**************************************************************************/ + /* ********************************************************************** */ // Page. - /**************************************************************************/ + /* ********************************************************************** */ // Set access denied to display a dedicated page. $webform->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_PAGE); @@ -91,11 +91,12 @@ public function testWebformAccessDenied() { // Check custom access denied page. $this->drupalGet('/admin/structure/webform/manage/test_form_access_denied'); $this->assertRaw('<h1>Webform: Access denied</h1>'); - $this->assertRaw('<div style="border: 1px solid red" class="webform-access-denied">Please login to access <b>Test: Webform: Access Denied</b>.</div>'); + $this->assertRaw('<div style="border: 1px solid red" class="webform-access-denied">'); + $this->assertRaw('Please login to access <b>Test: Webform: Access Denied</b>.'); - /**************************************************************************/ + /* ********************************************************************** */ // Message via a block. - /**************************************************************************/ + /* ********************************************************************** */ // Place block. $this->drupalPlaceBlock('webform_block', [ @@ -107,23 +108,26 @@ public function testWebformAccessDenied() { $webform->save(); // Check block does not displays access denied message. - $this->drupalGet('/<front>'); - $this->assertNoRaw('<div style="border: 1px solid red" class="webform-access-denied">Please login to access <b>Test: Webform: Access Denied</b>.</div>'); + $this->drupalGet('<front>'); + $this->assertNoRaw('<div style="border: 1px solid red" class="webform-access-denied">'); + $this->assertNoRaw('Please login to access <b>Test: Webform: Access Denied</b>.'); // Set access denied to display a message. $webform->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_MESSAGE); $webform->save(); // Check block displays access denied message. - $this->drupalGet('/<front>'); - $this->assertRaw('<div style="border: 1px solid red" class="webform-access-denied">Please login to access <b>Test: Webform: Access Denied</b>.</div>'); + $this->drupalGet('<front>'); + $this->assertRaw('<div style="border: 1px solid red" class="webform-access-denied">'); + $this->assertRaw('Please login to access <b>Test: Webform: Access Denied</b>.'); // Login. $this->drupalLogin($this->rootUser); // Check block displays wth webform. - $this->drupalGet('/<front>'); - $this->assertNoRaw('<div class="webform-access-denied">Please login to access <b>Test: Webform: Access Denied</b>.</div>'); + $this->drupalGet('<front>'); + $this->assertNoRaw('<div class="webform-access-denied">'); + $this->assertNoRaw('Please login to access <b>Test: Webform: Access Denied</b>.'); $this->assertRaw('id="webform-submission-test-form-access-denied-user-1-add-form"'); } @@ -137,17 +141,17 @@ public function testWebformSubmissionAccessDenied() { $sid = $this->postSubmission($webform); $this->drupalLogout(); - /**************************************************************************/ + /* ********************************************************************** */ // Redirect. - /**************************************************************************/ + /* ********************************************************************** */ // Check submission message is displayed. $this->drupalGet("admin/structure/webform/manage/test_form_access_denied/submission/$sid"); $this->assertRaw("Please login to access <b>Test: Webform: Access Denied: Submission #$sid</b>."); - /**************************************************************************/ + /* ********************************************************************** */ // Default. - /**************************************************************************/ + /* ********************************************************************** */ // Set default access denied page. $webform->setSetting('submission_access_denied', WebformInterface::ACCESS_DENIED_DEFAULT); @@ -158,9 +162,9 @@ public function testWebformSubmissionAccessDenied() { $this->assertRaw('You are not authorized to access this page.'); $this->assertNoRaw("Please login to access <b>Test: Webform: Access Denied: Submission #$sid</b>."); - /**************************************************************************/ + /* ********************************************************************** */ // Page. - /**************************************************************************/ + /* ********************************************************************** */ // Set access denied to display a dedicated page. $webform->setSetting('submission_access_denied', WebformInterface::ACCESS_DENIED_PAGE); @@ -172,7 +176,8 @@ public function testWebformSubmissionAccessDenied() { $this->drupalGet("admin/structure/webform/manage/test_form_access_denied/submission/$sid"); $this->assertNoRaw('You are not authorized to access this page.'); $this->assertRaw('<h1>Webform submission: Access denied</h1>'); - $this->assertRaw('<div style="border: 1px solid red" class="webform-submission-access-denied">Please login to access <b>Test: Webform: Access Denied: Submission #' . $sid . '</b>.</div>'); + $this->assertRaw('<div style="border: 1px solid red" class="webform-submission-access-denied">'); + $this->assertRaw('Please login to access <b>Test: Webform: Access Denied: Submission #' . $sid . '</b>.'); } } diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAutofillTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAutofillTest.php index d1fb2dd0c3..a3e5d92cbc 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAutofillTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsAutofillTest.php @@ -28,26 +28,85 @@ public function testAutofill() { $webform = Webform::load('test_form_autofill'); - // Check that elements are both blank. + // Check that elements are empty. $this->drupalGet('/webform/test_form_autofill'); $this->assertNoRaw('This submission has been autofilled with your previous submission.'); - $this->assertFieldByName('textfield_autofill', ''); + + // Check that 'textfield_excluded' is empty. $this->assertFieldByName('textfield_excluded', ''); + // Check that 'textfield_autofill' is empty. + $this->assertFieldByName('textfield_autofill', ''); + + // Check that 'telephone_excluded' is empty. + $this->assertFieldByName('telephone_excluded[type]', ''); + $this->assertFieldByName('telephone_excluded[phone]', ''); + $this->assertFieldByName('telephone_excluded[ext]', ''); + + // Check that 'telephone_autofill' is empty. + $this->assertFieldByName('telephone_autofill[type]', ''); + $this->assertFieldByName('telephone_autofill[phone]', ''); + $this->assertFieldByName('telephone_autofill[ext]', ''); + + // Check that 'telephone_autofill_partial' is empty. + $this->assertFieldByName('telephone_autofill_partial[type]', ''); + $this->assertFieldByName('telephone_autofill_partial[phone]', ''); + $this->assertFieldByName('telephone_autofill_partial[ext]', ''); + + // Check that 'telephone_autofill_partial_multiple' is empty. + $this->assertFieldByName('telephone_autofill_partial_multiple[items][0][_item_][type]', ''); + $this->assertFieldByName('telephone_autofill_partial_multiple[items][0][_item_][phone]', ''); + $this->assertFieldByName('telephone_autofill_partial_multiple[items][0][_item_][ext]', ''); + // Create a submission. $edit = [ - 'textfield_autofill' => '{textfield_autofill}', 'textfield_excluded' => '{textfield_excluded}', + 'textfield_autofill' => '{textfield_autofill}', + 'telephone_excluded[type]' => 'Cell', + 'telephone_excluded[phone]' => '+1 111-111-1111', + 'telephone_excluded[ext]' => '111', + 'telephone_autofill[type]' => 'Cell', + 'telephone_autofill[phone]' => '+1 222-222-2222', + 'telephone_autofill[ext]' => '222', + 'telephone_autofill_partial[type]' => 'Cell', + 'telephone_autofill_partial[phone]' => '+1 333-333-3333', + 'telephone_autofill_partial[ext]' => '333', + 'telephone_autofill_partial_multiple[items][0][_item_][type]' => 'Cell', + 'telephone_autofill_partial_multiple[items][0][_item_][phone]' => '+1 444-444-4444', + 'telephone_autofill_partial_multiple[items][0][_item_][ext]' => '444', ]; $this->postSubmission($webform, $edit); - // Check that 'textfield_autofill' is autofilled and 'textfield_excluded' - // is empty. + // Get autofilled submission form. $this->drupalGet('/webform/test_form_autofill'); - $this->assertFieldByName('textfield_autofill', '{textfield_autofill}'); - $this->assertNoFieldByName('textfield_autofill', '{textfield_excluded}'); + + // Check that 'textfield_excluded' is empty. + $this->assertNoFieldByName('textfield_excluded', '{textfield_excluded}'); $this->assertFieldByName('textfield_excluded', ''); + // Check that 'textfield_autofill' is autofilled. + $this->assertFieldByName('textfield_autofill', '{textfield_autofill}'); + + // Check that 'telephone_excluded[' is empty. + $this->assertFieldByName('telephone_excluded[type]', ''); + $this->assertFieldByName('telephone_excluded[phone]', ''); + $this->assertFieldByName('telephone_excluded[ext]', ''); + + // Check that 'telephone__autofill' is autofilled. + $this->assertFieldByName('telephone_autofill[type]', 'Cell'); + $this->assertFieldByName('telephone_autofill[phone]', '+1 222-222-2222'); + $this->assertFieldByName('telephone_autofill[ext]', '222'); + + // Check that 'telephone__autofill_partial' is partially autofilled. + $this->assertFieldByName('telephone_autofill_partial[type]', 'Cell'); + $this->assertFieldByName('telephone_autofill_partial[phone]', ''); + $this->assertFieldByName('telephone_autofill_partial[ext]', ''); + + // Check that 'telephone__autofill_partial_multiple' is partially autofilled. + $this->assertFieldByName('telephone_autofill_partial_multiple[items][0][_item_][type]', 'Cell'); + $this->assertFieldByName('telephone_autofill_partial_multiple[items][0][_item_][phone]', ''); + $this->assertFieldByName('telephone_autofill_partial_multiple[items][0][_item_][ext]', ''); + // Check that default configuration message is displayed. $this->drupalGet('/webform/test_form_autofill'); $this->assertFieldByName('textfield_autofill', '{textfield_autofill}'); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsBehaviorsTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsBehaviorsTest.php index 3110d43b31..f128119f70 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsBehaviorsTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsBehaviorsTest.php @@ -45,9 +45,9 @@ protected function setUp() { public function testSettings() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform submit once (form_submit_once) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_submit_once = Webform::load('test_form_submit_once'); @@ -81,9 +81,9 @@ public function testSettings() { $this->drupalGet('/webform/test_form_submit_once'); $this->assertRaw('webform.form.submit_once.js'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform disable back button (form_disable_back) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_disable_back = Webform::load('test_form_disable_back'); @@ -117,9 +117,9 @@ public function testSettings() { $this->drupalGet('/webform/test_form_disable_back'); $this->assertRaw('webform.form.disable_back.js'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform submit back button (test_form_submit_back) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_submit_back = Webform::load('test_form_submit_back'); @@ -162,9 +162,9 @@ public function testSettings() { $this->drupalGet('/webform/test_form_submit_back'); $this->assertNoRaw('webform.form.submit_back.js'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform (client-side) unsaved (form_unsaved) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_unsaved = Webform::load('test_form_unsaved'); @@ -198,17 +198,17 @@ public function testSettings() { $this->drupalGet('/webform/test_form_unsaved'); $this->assertCssSelect('form.js-webform-unsaved', 'Form has .js-webform-unsaved class.'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform disable autocomplete (form_disable_autocomplete) */ - /**************************************************************************/ + /* ********************************************************************** */ // Check webform has autocomplete=off attribute. $this->drupalGet('/webform/test_form_disable_autocomplete'); $this->assertCssSelect('form[autocomplete="off"]', 'Form has autocomplete=off attribute.'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform (client-side) novalidate (form_novalidate) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_novalidate = Webform::load('test_form_novalidate'); @@ -244,9 +244,9 @@ public function testSettings() { $this->drupalGet('/webform/test_form_novalidate'); $this->assertCssSelect('form[novalidate="novalidate"]', 'Form has the proper novalidate attribute.'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test required indicator (form_required) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_required = Webform::load('test_form_required'); @@ -286,17 +286,17 @@ public function testSettings() { $this->drupalGet('/webform/test_form_required'); $this->assertNoRaw('Custom required field'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test autofocus (form_autofocus) */ - /**************************************************************************/ + /* ********************************************************************** */ // Check webform has autofocus class. $this->drupalGet('/webform/test_form_autofocus'); $this->assertCssSelect('.js-webform-autofocus'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform details toggle (form_details_toggle) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_details_toggle = Webform::load('test_form_details_toggle'); @@ -331,9 +331,9 @@ public function testSettings() { $this->drupalGet('/webform/test_form_details_toggle'); $this->assertNoCssSelect('webform.webform-details-toggle', 'Webform does not have the .webform-details-toggle class.'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform disable inline form errors (test_form_disable_inline_errors) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_form_inline_errors = Webform::load('test_form_disable_inline_errors'); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfidentialTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfidentialTest.php index 3a3b8dd94f..ff2d17d96d 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfidentialTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfidentialTest.php @@ -32,7 +32,7 @@ public function testConfidential() { ->grantPermission('delete own webform submission') ->save(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfirmationTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfirmationTest.php index 9f7e9c5c6f..aa21361307 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfirmationTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsConfirmationTest.php @@ -149,8 +149,10 @@ public function testConfirmation() { $this->postSubmission($webform_confirmation_page); $this->assertUrl('webform/test_confirmation_page/confirmation'); - // TODO: (TESTING) Figure out why the inline confirmation link is not including the query string parameters. + // phpcs:disable + // @todo (TESTING) Figure out why the inline confirmation link is not including the query string parameters. // $this->assertRaw('<a href="' . $webform_confirmation_page->toUrl()->toString() . '?custom=param">Back to form</a>');. + // phpcs:enable /* Test confirmation page custom (confirmation_type=page) */ @@ -191,6 +193,26 @@ public function testConfirmation() { $this->postSubmission($webform_confirmation_url); $this->assertUrl('/some-absolute-path'); + // Check confirmation URL using absolute path with querystring. + $webform_confirmation_url + ->setSetting('confirmation_url', '/some-absolute-path?some=parameter') + ->setSetting('confirmation_exclude_token', TRUE) + ->save(); + $this->postSubmission($webform_confirmation_url); + $this->assertEqual(parse_url($this->getSession()->getCurrentUrl(), PHP_URL_QUERY), 'some=parameter'); + $this->postSubmission($webform_confirmation_url, [], NULL, ['query' => ['test' => 'parameter']]); + $this->assertEqual(parse_url($this->getSession()->getCurrentUrl(), PHP_URL_QUERY), 'some=parameter&test=parameter'); + + // Check confirmation URL using relative path with querystring. + $webform_confirmation_url + ->setSetting('confirmation_url', 'webform/test_confirmation_url?some=parameter') + ->setSetting('confirmation_exclude_token', TRUE) + ->save(); + $this->postSubmission($webform_confirmation_url); + $this->assertEqual(parse_url($this->getSession()->getCurrentUrl(), PHP_URL_QUERY), 'some=parameter'); + $this->postSubmission($webform_confirmation_url, [], NULL, ['query' => ['test' => 'parameter']]); + $this->assertEqual(parse_url($this->getSession()->getCurrentUrl(), PHP_URL_QUERY), 'some=parameter&test=parameter'); + // Check confirmation URL using invalid path. $webform_confirmation_url ->setSetting('confirmation_url', 'invalid') diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsDraftTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsDraftTest.php index 7860e5bc64..a68f658df2 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsDraftTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsDraftTest.php @@ -35,9 +35,9 @@ public function testDraft() { 'administer webform submission', ]); - /**************************************************************************/ + /* ********************************************************************** */ // Draft access. - /**************************************************************************/ + /* ********************************************************************** */ // Check access denied to review drafts when disabled. $this->drupalGet('/webform/contact/drafts'); @@ -51,9 +51,9 @@ public function testDraft() { $this->drupalGet('/webform/test_form_draft_anonymous/drafts'); $this->assertResponse(200); - /**************************************************************************/ + /* ********************************************************************** */ // Autosave for anonymous draft to authenticated draft. - /**************************************************************************/ + /* ********************************************************************** */ $webform_ids = [ 'test_form_draft_authenticated' => 'Test: Webform: Draft authenticated', @@ -144,9 +144,9 @@ public function testDraft() { $this->assertFieldByName('comment', ''); } - /**************************************************************************/ + /* ********************************************************************** */ // Convert anonymous draft to authenticated draft. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_form_draft_anonymous'); @@ -214,9 +214,9 @@ public function testDraft() { // Check that submission is still anonymous. $this->assertEqual($webform_submission->getOwnerId(), 0); - /**************************************************************************/ + /* ********************************************************************** */ // Export. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($admin_submission_user); @@ -241,9 +241,9 @@ public function testDraft() { $this->assertRaw('You have an existing draft'); $this->assertRaw('<label>Name</label>' . PHP_EOL . ' John Smith'); - /**************************************************************************/ + /* ********************************************************************** */ // Test webform draft multiple. - /**************************************************************************/ + /* ********************************************************************** */ $config = \Drupal::configFactory()->getEditable('webform.settings'); $this->drupalLogin($normal_user); @@ -353,9 +353,9 @@ public function testDraft() { $total = $webform_submission_storage->getTotal($webform, NULL, NULL, ['in_draft' => TRUE]); $this->assertEqual($total_drafts + 1, $total); - /**************************************************************************/ + /* ********************************************************************** */ // Test webform submission form reset draft. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsFormTitleTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsFormTitleTest.php index 4a09679bfe..aa9b405ec3 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsFormTitleTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsFormTitleTest.php @@ -43,7 +43,7 @@ public function testTitle() { $options = ['query' => ['source_entity_type' => 'node', 'source_entity_id' => $node->id()]]; - /**************************************************************************/ + /* ********************************************************************** */ // Check webform title. $this->drupalGet('/webform/test_webform'); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitUniqueTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitUniqueTest.php index ab99b9089f..22366db9f3 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitUniqueTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitUniqueTest.php @@ -43,9 +43,9 @@ public function testLimitUnique() { $manage_own_user = $this->drupalCreateUser(['view own webform submission', 'edit own webform submission']); $edit_user_only = $this->drupalCreateUser(['edit own webform submission']); - /**************************************************************************/ + /* ********************************************************************** */ // Total unique. (webform) - /**************************************************************************/ + /* ********************************************************************** */ // Check that access is denied for anonymous users. $this->drupalGet('/webform/test_form_limit_total_unique'); @@ -99,9 +99,9 @@ public function testLimitUnique() { $this->assertFieldByName('name', 'John Smith'); $this->assertRaw("<div><b>Submission ID:</b> $sid</div>"); - /**************************************************************************/ + /* ********************************************************************** */ // Total unique. (node) - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogout(); @@ -154,9 +154,9 @@ public function testLimitUnique() { $this->assertFieldByName('name', 'John Lennon'); $this->assertRaw("<div><b>Submission ID:</b> $sid</div>"); - /**************************************************************************/ + /* ********************************************************************** */ // User unique. (webform) - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogout(); @@ -217,7 +217,7 @@ public function testLimitUnique() { $this->drupalGet('/webform/test_form_limit_user_unique'); $this->assertFieldByName('name', ''); - /**************************************************************************/ + /* ********************************************************************** */ // Check that name is still empty for new submission for root user. $this->drupalLogin($this->rootUser); @@ -243,7 +243,7 @@ public function testLimitUnique() { // Check that the delete submission link does not include the ?destination. $this->assertLinkByHref(base_path() . 'admin/structure/webform/manage/test_form_limit_user_unique/submission/' . $sid . '/delete'); - /**************************************************************************/ + /* ********************************************************************** */ // Check that access is allowed for manage own submission user. $this->drupalLogin($manage_own_user); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitsTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitsTest.php index e1ad82cb19..6e4f92c229 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitsTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsLimitsTest.php @@ -50,7 +50,7 @@ public function testFormLimits() { $webform_limit = Webform::load('test_form_limit'); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_form_limit'); @@ -180,9 +180,9 @@ public function testFormLimits() { $this->assertRaw('0 user submission(s)'); $this->assertRaw('0 webform submission(s)'); - /**************************************************************************/ + /* ********************************************************************** */ // Wait. - /**************************************************************************/ + /* ********************************************************************** */ $webform_limit_wait = Webform::load('test_form_limit_wait'); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPathTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPathTest.php index 5a2183b6fb..e4d916f35f 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPathTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPathTest.php @@ -14,6 +14,11 @@ */ class WebformSettingsPathTest extends WebformBrowserTestBase { + /** + * Modules to enable. + * + * @var array + */ public static $modules = ['path', 'webform', 'node']; /** @@ -25,9 +30,9 @@ public function testPaths() { $node = $this->drupalCreateNode(); - /**************************************************************************/ + /* ********************************************************************** */ // With paths. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::create([ 'langcode' => 'en', @@ -116,7 +121,7 @@ public function testPaths() { // Check custom base path. $webform->setSettings(['page_submit_path' => '', 'page_confirm_path' => ''])->save(); $this->drupalLogin($this->rootUser); - $this->drupalPostForm('/admin/structure/webform/config', ['page_settings[default_page_base_path]' => '/base/path'], t('Save configuration')); + $this->drupalPostForm('/admin/structure/webform/config', ['page_settings[default_page_base_path]' => '/base/path'], 'Save configuration'); $this->drupalGet('/base/path/' . str_replace('_', '-', $webform->id())); $this->assertResponse(200, 'Submit URL alias with custom base path exists'); $this->drupalGet('/base/path/' . str_replace('_', '-', $webform->id()) . '/confirmation'); @@ -134,9 +139,9 @@ public function testPaths() { ->set('settings.default_page_base_path', '') ->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Without paths. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::create([ 'langcode' => 'en', @@ -159,9 +164,9 @@ public function testPaths() { $this->drupalGet($form_path); $this->assertResponse(404, 'Submit URL alias does not exist'); - /**************************************************************************/ + /* ********************************************************************** */ // Page theme. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPrepopulateTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPrepopulateTest.php index 61f93654b5..4250687e69 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPrepopulateTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPrepopulateTest.php @@ -41,9 +41,9 @@ protected function setUp() { */ public function testPrepopulate() { - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform prepopulate (form_prepopulate) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_prepopulate = Webform::load('test_form_prepopulate'); @@ -66,9 +66,9 @@ public function testPrepopulate() { $this->drupalGet('/webform/test_form_prepopulate', ['query' => ['name' => 'John']]); $this->assertFieldByName('name', ''); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform prepopulate source entity (form_prepopulate_source_entity) */ - /**************************************************************************/ + /* ********************************************************************** */ // Check prepopulating source entity. $this->drupalPostForm('/webform/test_form_prepopulate', [], 'Submit', ['query' => ['source_entity_type' => 'webform', 'source_entity_id' => 'contact']]); @@ -131,9 +131,9 @@ public function testPrepopulate() { $this->drupalGet('/webform/test_form_prepopulate', ['query' => ['source_entity_type' => 'webform', 'source_entity_id' => 'contact']]); $this->assertNoRaw('This webform is not available. Please contact the site administrator.'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform_menu_local_tasks_alter() */ - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPreviousTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPreviousTest.php index 282e0e1d05..0056f36fb6 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPreviousTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsPreviousTest.php @@ -22,9 +22,9 @@ public function testPrevious() { $webform = Webform::load('contact'); - /**************************************************************************/ + /* ********************************************************************** */ // Previous submission message. - /**************************************************************************/ + /* ********************************************************************** */ // Create single submission. $sid_1 = $this->postSubmissionTest($webform); @@ -47,12 +47,12 @@ public function testPrevious() { $this->drupalGet('/webform/contact'); $this->assertRaw('{custom_previous_submission}'); - /**************************************************************************/ + /* ********************************************************************** */ // Previous submissions message. - /**************************************************************************/ + /* ********************************************************************** */ // Create second submission. - $sid_2 = $this->postSubmissionTest($webform); + $this->postSubmissionTest($webform); // Check default global previous submissions message. $this->drupalGet('/webform/contact'); diff --git a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsScheduleTest.php b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsScheduleTest.php index 2909838c59..b42181b6fb 100644 --- a/web/modules/webform/tests/src/Functional/Settings/WebformSettingsScheduleTest.php +++ b/web/modules/webform/tests/src/Functional/Settings/WebformSettingsScheduleTest.php @@ -29,9 +29,9 @@ class WebformSettingsScheduleTest extends WebformBrowserTestBase { */ public function testSchedule() { - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform opening (status=scheduled) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_opening = Webform::load('test_form_opening'); @@ -67,9 +67,9 @@ public function testSchedule() { $this->assertNoRaw('This form has not yet been opened to submissions.'); $this->assertNoRaw('Only submission administrators are allowed to access this webform and create new submissions.'); - /**************************************************************************/ + /* ********************************************************************** */ /* Test webform closed (status=closed) */ - /**************************************************************************/ + /* ********************************************************************** */ $webform_closed = Webform::load('test_form_closed'); diff --git a/web/modules/webform/tests/src/Functional/States/WebformStatesHiddenTest.php b/web/modules/webform/tests/src/Functional/States/WebformStatesHiddenTest.php index a6b3935996..a9641e4404 100644 --- a/web/modules/webform/tests/src/Functional/States/WebformStatesHiddenTest.php +++ b/web/modules/webform/tests/src/Functional/States/WebformStatesHiddenTest.php @@ -51,7 +51,7 @@ public function testFormStatesHidden() { $this->assertRaw('<div class="js-webform-states-hidden js-form-item form-item js-form-type-checkbox form-item-dependent-checkbox js-form-item-dependent-checkbox">'); // Radios. - $this->assertRaw('<fieldset data-drupal-selector="edit-dependent-radios" class="js-webform-states-hidden radios--wrapper fieldgroup form-composite webform-composite-visible-title js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" id="edit-dependent-radios--wrapper" data-drupal-states="{"visible":{".webform-submission-test-states-server-hidden-add-form :input[name=\u0022trigger_checkbox\u0022]":{"checked":true}}}">'); + $this->assertRaw('<fieldset data-drupal-selector="edit-dependent-radios" class="js-webform-states-hidden radios--wrapper fieldgroup form-composite webform-composite-visible-title js-webform-type-radios webform-type-radios js-form-item form-item js-form-wrapper form-wrapper" id="edit-dependent-radios--wrapper" data-drupal-states="{"visible":{".webform-submission-test-states-server-hidden-add-form :input[name=\u0022trigger_checkbox\u0022]":{"checked":true}}}" role="radiogroup" aria-labelledby="edit-dependent-radios--wrapper-legend">'); // Select other. $this->assertRaw('<fieldset data-drupal-selector="edit-dependent-select-other" class="js-webform-select-other webform-select-other js-webform-states-hidden js-form-item webform-select-other--wrapper fieldgroup form-composite webform-composite-visible-title js-webform-type-webform-select-other webform-type-webform-select-other form-item js-form-wrapper form-wrapper" id="edit-dependent-select-other" data-drupal-states="{"visible":{".webform-submission-test-states-server-hidden-add-form :input[name=\u0022trigger_checkbox\u0022]":{"checked":true}}}">'); diff --git a/web/modules/webform/tests/src/Functional/States/WebformStatesServerTest.php b/web/modules/webform/tests/src/Functional/States/WebformStatesServerTest.php index be003c239d..1838a8f398 100644 --- a/web/modules/webform/tests/src/Functional/States/WebformStatesServerTest.php +++ b/web/modules/webform/tests/src/Functional/States/WebformStatesServerTest.php @@ -59,9 +59,9 @@ protected function setUp() { */ public function testFormStatesValidatorRequired() { - /**************************************************************************/ + /* ********************************************************************** */ // required. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_required'); @@ -69,9 +69,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform); $this->assertRaw('New submission added to Test: Form API #states server-side required validation.'); - /**************************************************************************/ + /* ********************************************************************** */ // multiple_triggers. - /**************************************************************************/ + /* ********************************************************************** */ // Check required multiple dependents 'AND' and 'OR' operator. $edit = [ @@ -84,9 +84,9 @@ public function testFormStatesValidatorRequired() { $this->assertRaw('dependent_textfield_required_or field is required.'); $this->assertNoRaw('dependent_textfield_required_xor field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // multiple_dependents. - /**************************************************************************/ + /* ********************************************************************** */ // Check required multiple dependents 'OR' operator. $edit = [ @@ -109,9 +109,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('dependent_textfield_required_xor field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // required_hidden_trigger. - /**************************************************************************/ + /* ********************************************************************** */ $edit = [ 'required_hidden_trigger' => TRUE, @@ -119,9 +119,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('required_hidden_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // minlength_hidden_trigger. - /**************************************************************************/ + /* ********************************************************************** */ $edit = [ 'minlength_hidden_trigger' => TRUE, @@ -134,11 +134,12 @@ public function testFormStatesValidatorRequired() { 'minlength_hidden_dependent' => 'X', ]; $this->postSubmission($webform, $edit); + // phpcs:ignore // $this->assertRaw('<em class="placeholder">minlength_hidden_dependent</em> cannot be less than <em class="placeholder">5</em> characters'); - /**************************************************************************/ + /* ********************************************************************** */ // checkboxes_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required checkboxes. $edit = [ @@ -147,9 +148,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('checkboxes_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // checkboxes_other_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required checkboxes other checkbox. $edit = [ @@ -166,9 +167,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('checkboxes_other_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // text_format_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required text_format. $edit = [ @@ -177,9 +178,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('text_format_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // select_other_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required webform_select_other select #options. $edit = [ @@ -196,9 +197,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('select_other_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // select_other_multiple_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required webform_select_other_multiple select #options. $edit = [ @@ -207,9 +208,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('select_other_multiple_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // select_values_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required select_values_trigger select option 'one'. $edit = [ @@ -225,9 +226,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('select_values_trigger_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // email_confirm_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required webform_email_confirm. $edit = [ @@ -237,9 +238,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('email_confirm_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // likert_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required webform_likert. $edit = [ @@ -248,9 +249,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('likert_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // datelist_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required datelist. $edit = [ @@ -265,9 +266,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('datelist_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // datetime_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required datetime. $edit = [ @@ -277,9 +278,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('datetime_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // currency_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required currency input mask. $edit = [ @@ -289,9 +290,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('currency_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // address_trigger. - /**************************************************************************/ + /* ********************************************************************** */ // Check required address. $edit = [ @@ -305,9 +306,9 @@ public function testFormStatesValidatorRequired() { $this->postSubmission($webform, $edit); $this->assertRaw('address_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // composite_required. - /**************************************************************************/ + /* ********************************************************************** */ // Check required composite. $edit = [ @@ -347,9 +348,9 @@ public function testFormStatesValidatorRequired() { $this->assertRaw('postal_code_b field is required.'); $this->assertRaw('country_b field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // custom. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_custom'); @@ -407,9 +408,9 @@ public function testFormStatesValidatorRequired() { $this->assertNoRaw('dependent_between field is required.'); $this->assertRaw('dependent_not_between field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // multiple element. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_multiple'); @@ -421,9 +422,9 @@ public function testFormStatesValidatorRequired() { // Check multiple error. $this->assertRaw('textfield_multiple field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // composite element. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_comp'); @@ -452,23 +453,23 @@ public function testFormStatesValidatorRequired() { $this->assertRaw('webform_name_nested_last field is required.'); $this->assertRaw(' <input data-drupal-selector="edit-webform-name-nested-last" type="text" id="edit-webform-name-nested-last" name="webform_name_nested[last]" value="" size="60" maxlength="255" class="form-text error" aria-invalid="true" data-drupal-states="{"required":{".webform-submission-test-states-server-comp-add-form :input[name=\u0022webform_name_nested_trigger\u0022]":{"checked":true}}}" />'); - /**************************************************************************/ + /* ********************************************************************** */ // file_trigger. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_file'); // Check required error. - $files = $this->getTestFiles('text');; + $files = $this->getTestFiles('text'); $edit = [ 'files[trigger_file]' => \Drupal::service('file_system')->realpath($files[0]->uri), ]; $this->postSubmission($webform, $edit); $this->assertRaw('textfield_dependent_required field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // likert element. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_likert'); @@ -486,9 +487,9 @@ public function testFormStatesValidatorRequired() { $this->assertNoRaw('q1 field is required.'); $this->assertNoRaw('q2 field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // nested containers. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_containers'); @@ -532,9 +533,9 @@ public function testFormStatesValidatorRequired() { $this->assertRaw('visible_custom_textfield field is required.'); $this->assertRaw('visible_slide_custom_textfield field is required.'); - /**************************************************************************/ + /* ********************************************************************** */ // nested conditions. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_server_nested'); @@ -564,9 +565,9 @@ public function testFormStatesValidatorRequired() { $this->assertRaw('<label for="edit-page-2-target" class="js-form-required form-required">page_2_target: [a and b] or c = required</label>'); $this->assertRaw('<input data-drupal-selector="edit-page-2-target" type="text" id="edit-page-2-target" name="page_2_target" value="" size="60" maxlength="255" class="form-text required" required="required" aria-required="true" />'); - /**************************************************************************/ + /* ********************************************************************** */ // test_states_crosspage. - /**************************************************************************/ + /* ********************************************************************** */ $webform = Webform::load('test_states_crosspage'); diff --git a/web/modules/webform/tests/src/Functional/States/WebformStatesWizardTest.php b/web/modules/webform/tests/src/Functional/States/WebformStatesWizardTest.php index e94c14db7a..9c19556034 100644 --- a/web/modules/webform/tests/src/Functional/States/WebformStatesWizardTest.php +++ b/web/modules/webform/tests/src/Functional/States/WebformStatesWizardTest.php @@ -27,7 +27,7 @@ class WebformStatesWizardTest extends WebformBrowserTestBase { public function testFormStatesValidatorWizard() { $webform = Webform::load('test_states_server_wizard'); - /**************************************************************************/ + /* ********************************************************************** */ // Go to default #states for page 02 with trigger-checkbox unchecked. $this->postSubmission($webform, [], 'Next >'); @@ -118,7 +118,7 @@ public function testFormStatesValidatorWizard() { page_03_textfield_required: '' page_01_trigger_checkbox_computed: 'No'"); - /**************************************************************************/ + /* ********************************************************************** */ // Go to default #states for page 02 with trigger_checkbox checked. $this->postSubmission($webform, ['page_01_trigger_checkbox' => TRUE], 'Next >'); diff --git a/web/modules/webform/tests/src/Functional/Variant/WebformVariantElementTest.php b/web/modules/webform/tests/src/Functional/Variant/WebformVariantElementTest.php index e93fd3609b..ffae289e84 100644 --- a/web/modules/webform/tests/src/Functional/Variant/WebformVariantElementTest.php +++ b/web/modules/webform/tests/src/Functional/Variant/WebformVariantElementTest.php @@ -41,7 +41,7 @@ public function testVariantElement() { $variant_user = $this->drupalCreateUser(['administer webform', 'edit webform variants']); $admin_user = $this->drupalCreateUser(['administer webform']); - /***************************************************************************/ + /* *********************************************************************** */ // Check that the variant element is visible to users with // 'edit webform variants' permission. diff --git a/web/modules/webform/tests/src/Functional/Variant/WebformVariantTest.php b/web/modules/webform/tests/src/Functional/Variant/WebformVariantTest.php index 0386507943..fdd424f748 100644 --- a/web/modules/webform/tests/src/Functional/Variant/WebformVariantTest.php +++ b/web/modules/webform/tests/src/Functional/Variant/WebformVariantTest.php @@ -31,9 +31,9 @@ class WebformVariantTest extends WebformBrowserTestBase { public function testWebformVariant() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Off-canvas width. - /**************************************************************************/ + /* ********************************************************************** */ // Check add off-canvas element width is 800. $this->drupalGet('/admin/structure/webform/manage/test_variant/variants/add'); diff --git a/web/modules/webform/tests/src/Functional/Views/WebformViewsBulkFormTest.php b/web/modules/webform/tests/src/Functional/Views/WebformViewsBulkFormTest.php index e8423ff793..33ef7120cf 100644 --- a/web/modules/webform/tests/src/Functional/Views/WebformViewsBulkFormTest.php +++ b/web/modules/webform/tests/src/Functional/Views/WebformViewsBulkFormTest.php @@ -28,7 +28,7 @@ public function testViewsBulkForm() { 'administer webform submission', ]); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($admin_submission_user); diff --git a/web/modules/webform/tests/src/Functional/WebformBlockCacheTest.php b/web/modules/webform/tests/src/Functional/WebformBlockCacheTest.php index 26a3788b42..f6fb80f745 100644 --- a/web/modules/webform/tests/src/Functional/WebformBlockCacheTest.php +++ b/web/modules/webform/tests/src/Functional/WebformBlockCacheTest.php @@ -6,6 +6,8 @@ use Drupal\webform\Entity\Webform; /** + * Test block caching. + * * These tests proof that the webform block which * renders the webform as a block provides the correct * cache tags / cache contexts so that cachability works. diff --git a/web/modules/webform/tests/src/Functional/WebformBrowserTestBase.php b/web/modules/webform/tests/src/Functional/WebformBrowserTestBase.php index bd8fcaedba..d34e192165 100644 --- a/web/modules/webform/tests/src/Functional/WebformBrowserTestBase.php +++ b/web/modules/webform/tests/src/Functional/WebformBrowserTestBase.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\webform\Functional; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Test\AssertMailTrait; use Drupal\Tests\BrowserTestBase; use Drupal\Tests\webform\Traits\WebformBrowserTestTrait; @@ -15,6 +16,7 @@ abstract class WebformBrowserTestBase extends BrowserTestBase { use AssertMailTrait; use WebformBrowserTestTrait; use WebformAssertLegacyTrait; + use StringTranslationTrait; /** * Set default theme to stable. diff --git a/web/modules/webform/tests/src/Functional/WebformEditorTest.php b/web/modules/webform/tests/src/Functional/WebformEditorTest.php index 230294ed7e..333e35a8d4 100644 --- a/web/modules/webform/tests/src/Functional/WebformEditorTest.php +++ b/web/modules/webform/tests/src/Functional/WebformEditorTest.php @@ -4,7 +4,6 @@ use Drupal\file\Entity\File; use Drupal\Tests\TestFileCreationTrait; -use Drupal\webform\Entity\Webform; /** * Tests for webform editor. @@ -254,9 +253,9 @@ public function testWebformConfigurationFiles() { $this->assertTrue($images[2]->isTemporary()); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Reload images. diff --git a/web/modules/webform/tests/src/Functional/WebformEmailProviderTest.php b/web/modules/webform/tests/src/Functional/WebformEmailProviderTest.php index 6696ffa07e..7bbeb43581 100644 --- a/web/modules/webform/tests/src/Functional/WebformEmailProviderTest.php +++ b/web/modules/webform/tests/src/Functional/WebformEmailProviderTest.php @@ -37,9 +37,9 @@ public function testEmailProvider() { $this->assertRaw('Provided by the Webform module.'); $this->assertRaw("Webform PHP mailer: Sends the message as plain text or HTML, using PHP's native mail() function."); - /**************************************************************************/ + /* ********************************************************************** */ // Mail System. - /**************************************************************************/ + /* ********************************************************************** */ // Install mailsystem.module. \Drupal::service('module_installer')->install(['mailsystem']); @@ -58,9 +58,9 @@ public function testEmailProvider() { // Uninstall mailsystem.module. \Drupal::service('module_installer')->uninstall(['mailsystem']); - /**************************************************************************/ + /* ********************************************************************** */ // SMTP. - /**************************************************************************/ + /* ********************************************************************** */ // Install smtp.module. \Drupal::service('module_installer')->install(['smtp']); diff --git a/web/modules/webform/tests/src/Functional/WebformEntityTranslationTest.php b/web/modules/webform/tests/src/Functional/WebformEntityTranslationTest.php index 2f92c5e99e..8cbfadaab3 100644 --- a/web/modules/webform/tests/src/Functional/WebformEntityTranslationTest.php +++ b/web/modules/webform/tests/src/Functional/WebformEntityTranslationTest.php @@ -235,9 +235,9 @@ public function testWebformTranslate() { $translation_element = $translation_manager->getElements($webform, 'fr', TRUE); $this->assertEqual(['textfield' => ['#title' => 'French']], $translation_element); - /**************************************************************************/ + /* ********************************************************************** */ // Submissions. - /**************************************************************************/ + /* ********************************************************************** */ // Check English table headers are not translated. $this->drupalGet('/admin/structure/webform/manage/test_translation/results/submissions'); @@ -265,9 +265,9 @@ public function testWebformTranslate() { $this->assertNoRaw('Site name: Sitio web de prueba'); $this->assertNoRaw('Site name: Sitio web de prueba'); - /**************************************************************************/ + /* ********************************************************************** */ // Site wide language. - /**************************************************************************/ + /* ********************************************************************** */ // Make sure the site language is English (en). \Drupal::configFactory()->getEditable('system.site')->set('default_langcode', 'en')->save(); @@ -301,7 +301,7 @@ public function testWebformTranslate() { $this->drupalGet('/webform/test_translation', ['language' => $language_manager->getLanguage('fr')]); $this->assertRaw('<label for="edit-textfield">French</label>'); - /**************************************************************************/ + /* ********************************************************************** */ // Make sure the site language is English (en). \Drupal::configFactory()->getEditable('system.site')->set('default_langcode', 'en')->save(); diff --git a/web/modules/webform/tests/src/Functional/WebformHelpTest.php b/web/modules/webform/tests/src/Functional/WebformHelpTest.php index b53d4fb4ab..184e6f1598 100644 --- a/web/modules/webform/tests/src/Functional/WebformHelpTest.php +++ b/web/modules/webform/tests/src/Functional/WebformHelpTest.php @@ -30,9 +30,9 @@ protected function setUp() { */ public function testHelp() { - /**************************************************************************/ + /* ********************************************************************** */ // Help page. - /**************************************************************************/ + /* ********************************************************************** */ // Check access denied to the webform help page. $this->drupalGet('/admin/structure/webform/help'); @@ -62,9 +62,9 @@ public function testHelp() { $this->assertResponse(200); $this->assertRaw('Watch more videos'); - /**************************************************************************/ + /* ********************************************************************** */ // Help block. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/Functional/WebformLibrariesTest.php b/web/modules/webform/tests/src/Functional/WebformLibrariesTest.php index 73eb65f2c6..dd5a074df7 100644 --- a/web/modules/webform/tests/src/Functional/WebformLibrariesTest.php +++ b/web/modules/webform/tests/src/Functional/WebformLibrariesTest.php @@ -107,7 +107,7 @@ public function testLibraries() { $this->assertNoText('jQuery: Chosen library '); $this->assertNoText('jQuery: Timepicker library '); $this->assertNoText('jQuery: Text Counter library '); - + // phpcs:disable // Issue #2934542: Fix broken Webform.Drupal\webform\Tests\WebformLibrariesTest // @see https://www.drupal.org/project/webform/issues/2934542 /* @@ -124,31 +124,32 @@ public function testLibraries() { $this->assertNoText('jQuery: RateIt library'); $this->assertNoText('Signature Pad library'); */ + // phpcs:enable // Issue #3110478: [Webform 8.x-6.x] Track the D9 readiness state of the - // Webform module's (optional) dependencies + // Webform module's (optional) dependencies. // @see https://www.drupal.org/project/webform/issues/3110478 // Check that choices, chosen, and select2 using webform's CDN URLs. // Check that choices, chosen, and select2 using webform's CDN URLs. $edit = [ 'excluded_libraries[jquery.select2]' => TRUE, -// 'excluded_libraries[jquery.chosen]' => TRUE, + 'excluded_libraries[jquery.chosen]' => TRUE, ]; $this->drupalPostForm('/admin/structure/webform/config/libraries', $edit, 'Save configuration'); $this->drupalGet('/webform/test_libraries_optional'); -// $this->assertRaw('https://cdnjs.cloudflare.com/ajax/libs/chosen'); + $this->assertRaw('https://cdnjs.cloudflare.com/ajax/libs/chosen'); $this->assertRaw('https://cdnjs.cloudflare.com/ajax/libs/select2'); // Install chosen and select2 modules. -// \Drupal::service('module_installer')->install(['chosen', 'chosen_lib', 'select2']); + \Drupal::service('module_installer')->install(['chosen', 'chosen_lib', 'select2']); \Drupal::service('module_installer')->install(['select2']); drupal_flush_all_caches(); // Check that chosen and select2 using module's path and not CDN. $this->drupalGet('/webform/test_libraries_optional'); -// $this->assertNoRaw('https://cdnjs.cloudflare.com/ajax/libs/chosen'); + $this->assertNoRaw('https://cdnjs.cloudflare.com/ajax/libs/chosen'); $this->assertNoRaw('https://cdnjs.cloudflare.com/ajax/libs/select2'); -// $this->assertRaw('/modules/contrib/chosen/css/chosen-drupal.css'); + $this->assertRaw('/modules/contrib/chosen/css/chosen-drupal.css'); } } diff --git a/web/modules/webform/tests/src/Functional/WebformListBuilderTest.php b/web/modules/webform/tests/src/Functional/WebformListBuilderTest.php index c8b395c20a..2c07026fd0 100644 --- a/web/modules/webform/tests/src/Functional/WebformListBuilderTest.php +++ b/web/modules/webform/tests/src/Functional/WebformListBuilderTest.php @@ -104,9 +104,9 @@ public function testBulkOperations() { $this->assertCssSelect('option[value="webform_unarchive_action"]'); $this->assertCssSelect('option[value="webform_delete_action"]'); - /**************************************************************************/ + /* ********************************************************************** */ // Disable/Enable. - /**************************************************************************/ + /* ********************************************************************** */ // Check bulk operation disable. \Drupal::configFactory()->getEditable('webform.settings') @@ -120,9 +120,9 @@ public function testBulkOperations() { ->set('settings.webform_bulk_form', TRUE) ->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Open/Close. - /**************************************************************************/ + /* ********************************************************************** */ // Check webform one is opened. $this->assertTrue($webforms[0]->isOpen()); @@ -154,9 +154,9 @@ public function testBulkOperations() { $webforms[0] = $this->reloadWebform('one'); $this->assertTrue($webforms[0]->isOpen()); - /**************************************************************************/ + /* ********************************************************************** */ // Archive/Restore. - /**************************************************************************/ + /* ********************************************************************** */ // Check webform archive action. $edit = [ @@ -185,9 +185,9 @@ public function testBulkOperations() { $webforms[0] = $this->reloadWebform('one'); $this->assertFalse($webforms[0]->isArchived()); - /**************************************************************************/ + /* ********************************************************************** */ // Delete. - /**************************************************************************/ + /* ********************************************************************** */ // Check webform delete action. $edit = [ diff --git a/web/modules/webform/tests/src/Functional/WebformOptionsTest.php b/web/modules/webform/tests/src/Functional/WebformOptionsTest.php index 64a9d52411..ab73fa3160 100644 --- a/web/modules/webform/tests/src/Functional/WebformOptionsTest.php +++ b/web/modules/webform/tests/src/Functional/WebformOptionsTest.php @@ -40,7 +40,7 @@ public function testWebformOptions() { 'administer users', ]); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($normal_user); diff --git a/web/modules/webform/tests/src/Functional/WebformRenderingTest.php b/web/modules/webform/tests/src/Functional/WebformRenderingTest.php index b0aa405a3e..cc8b2fc5cf 100644 --- a/web/modules/webform/tests/src/Functional/WebformRenderingTest.php +++ b/web/modules/webform/tests/src/Functional/WebformRenderingTest.php @@ -46,9 +46,9 @@ protected function setUp() { public function testRendering() { $webform = Webform::load('test_rendering'); - /**************************************************************************/ + /* ********************************************************************** */ // Preview. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalPostForm('/webform/test_rendering', [], 'Preview'); @@ -72,9 +72,9 @@ public function testRendering() { // Create a submission. $sid = $this->postSubmission($webform); - /**************************************************************************/ + /* ********************************************************************** */ // Emails. - /**************************************************************************/ + /* ********************************************************************** */ // Get sent emails. $sent_emails = $this->getMails(); @@ -100,9 +100,9 @@ public function testRendering() { $this->assertStringContainsString('text_format_basic_html:', $text_email['params']['body']); $this->assertStringContainsString('/{default_value}/', $text_email['params']['body']); - /**************************************************************************/ + /* ********************************************************************** */ // Submission. - /**************************************************************************/ + /* ********************************************************************** */ // Check view submission. $this->drupalGet("admin/structure/webform/manage/test_rendering/submission/$sid"); diff --git a/web/modules/webform/tests/src/Functional/WebformResultsDisabledTest.php b/web/modules/webform/tests/src/Functional/WebformResultsDisabledTest.php index 9cac7786ff..c375935f2f 100644 --- a/web/modules/webform/tests/src/Functional/WebformResultsDisabledTest.php +++ b/web/modules/webform/tests/src/Functional/WebformResultsDisabledTest.php @@ -32,16 +32,16 @@ public function testSettings() { // Check that error message is displayed and form is available for admins. $this->drupalGet('/webform/test_form_results_disabled'); - $this->assertRaw(t('This webform is currently not saving any submitted data.')); + $this->assertRaw('This webform is currently not saving any submitted data.'); $this->assertFieldByName('op', 'Submit'); - $this->assertNoRaw(t('Unable to display this webform. Please contact the site administrator.')); + $this->assertNoRaw('Unable to display this webform. Please contact the site administrator.'); // Check that error message not displayed and form is disabled for everyone. $this->drupalLogout(); $this->drupalGet('/webform/test_form_results_disabled'); - $this->assertNoRaw(t('This webform is currently not saving any submitted data.')); + $this->assertNoRaw('This webform is currently not saving any submitted data.'); $this->assertNoFieldByName('op', 'Submit'); - $this->assertRaw(t('Unable to display this webform. Please contact the site administrator.')); + $this->assertRaw('Unable to display this webform. Please contact the site administrator.'); // Enabled ignore disabled results. $webform_results_disabled->setSetting('results_disabled_ignore', TRUE); @@ -50,8 +50,8 @@ public function testSettings() { // Check that no error message is displayed and form is available for admins. $this->drupalGet('/webform/test_form_results_disabled'); - $this->assertNoRaw(t('This webform is currently not saving any submitted data.')); - $this->assertNoRaw(t('Unable to display this webform. Please contact the site administrator.')); + $this->assertNoRaw('This webform is currently not saving any submitted data.'); + $this->assertNoRaw('Unable to display this webform. Please contact the site administrator.'); $this->assertFieldByName('op', 'Submit'); // Check that results tab is not accessible. @@ -61,8 +61,8 @@ public function testSettings() { // Check that error message not displayed and form is enabled for everyone. $this->drupalLogout(); $this->drupalGet('/webform/test_form_results_disabled'); - $this->assertNoRaw(t('This webform is currently not saving any submitted data.')); - $this->assertNoRaw(t('Unable to display this webform. Please contact the site administrator.')); + $this->assertNoRaw('This webform is currently not saving any submitted data.'); + $this->assertNoRaw('Unable to display this webform. Please contact the site administrator.'); $this->assertFieldByName('op', 'Submit'); // Unset disabled results. diff --git a/web/modules/webform/tests/src/Functional/WebformResultsExportOptionsTest.php b/web/modules/webform/tests/src/Functional/WebformResultsExportOptionsTest.php index 4e6e17db71..3b592f2b3d 100644 --- a/web/modules/webform/tests/src/Functional/WebformResultsExportOptionsTest.php +++ b/web/modules/webform/tests/src/Functional/WebformResultsExportOptionsTest.php @@ -33,7 +33,7 @@ public function testExportOptions() { 'administer webform submission', ]); - /**************************************************************************/ + /* ********************************************************************** */ /** @var \Drupal\webform\WebformInterface $webform */ $webform = Webform::load('test_submissions'); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionApiTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionApiTest.php index 825ee2edd4..3eb5387d39 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionApiTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionApiTest.php @@ -29,9 +29,9 @@ public function testApi() { $contact_webform = Webform::load('contact'); - /**************************************************************************/ + /* ********************************************************************** */ // Basic form. - /**************************************************************************/ + /* ********************************************************************** */ // Check submitting a simple webform. $values = [ @@ -89,9 +89,9 @@ public function testApi() { $webform_submission = WebformSubmissionForm::submitFormValues($values); $this->assertInstanceOf(WebformSubmissionInterface::class, $webform_submission); - /**************************************************************************/ + /* ********************************************************************** */ // Multistep form. - /**************************************************************************/ + /* ********************************************************************** */ $test_form_wizard_advanced_webform = Webform::load('test_form_wizard_advanced'); @@ -143,9 +143,9 @@ public function testApi() { 'sex' => 'An illegal choice has been detected. Please contact the site administrator.', ]); - /**************************************************************************/ + /* ********************************************************************** */ // Submission limit form. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($normal_user); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionGenerateTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionGenerateTest.php index 3001c46c9e..5584820a17 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionGenerateTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionGenerateTest.php @@ -20,9 +20,9 @@ public function testWebformSubmissionGenerate() { $webform = Webform::load('contact'); - /**************************************************************************/ + /* ********************************************************************** */ // Test tab. - /**************************************************************************/ + /* ********************************************************************** */ // Check test form. $sid = $this->postSubmissionTest($webform); @@ -43,9 +43,9 @@ public function testWebformSubmissionGenerate() { $this->assertFieldByName($name, $value); } - /**************************************************************************/ + /* ********************************************************************** */ // Test querystring parameter. - /**************************************************************************/ + /* ********************************************************************** */ // Check add form classes and empty values. $this->drupalGet('/webform/contact'); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderBulkOperationsTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderBulkOperationsTest.php index d326a80716..bd9f73bfa8 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderBulkOperationsTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderBulkOperationsTest.php @@ -46,7 +46,7 @@ public function testResults() { $path = '/admin/structure/webform/manage/' . $webform->id() . '/results/submissions'; - /**************************************************************************/ + /* ********************************************************************** */ // Login the admin submission user. $this->drupalLogin($admin_submission_user); @@ -66,9 +66,9 @@ public function testResults() { $this->assertCssSelect('option[value="webform_submission_make_unlock_action"]'); $this->assertCssSelect('option[value="webform_submission_delete_action"]'); - /**************************************************************************/ + /* ********************************************************************** */ // Access. - /**************************************************************************/ + /* ********************************************************************** */ // Login the update submission user. $this->drupalLogin($update_submission_user); @@ -83,9 +83,9 @@ public function testResults() { // Login the admin submission user. $this->drupalLogin($admin_submission_user); - /**************************************************************************/ + /* ********************************************************************** */ // Disable/Enable. - /**************************************************************************/ + /* ********************************************************************** */ // Check bulk operation disable. \Drupal::configFactory()->getEditable('webform.settings') @@ -99,9 +99,9 @@ public function testResults() { ->set('settings.webform_submission_bulk_form', TRUE) ->save(); - /**************************************************************************/ + /* ********************************************************************** */ // Sticky/Unsticky. - /**************************************************************************/ + /* ********************************************************************** */ // Check first submission is NOT sticky. $this->assertFalse($submissions[0]->isSticky()); @@ -130,9 +130,9 @@ public function testResults() { $submissions[0] = $this->reloadSubmission($submissions[0]->id()); $this->assertFalse($submissions[0]->isSticky()); - /**************************************************************************/ + /* ********************************************************************** */ // Lock/Unlock. - /**************************************************************************/ + /* ********************************************************************** */ // Check first submission is NOT lock. $this->assertFalse($submissions[0]->isLocked()); @@ -161,9 +161,9 @@ public function testResults() { $submissions[0] = $this->reloadSubmission($submissions[0]->id()); $this->assertFalse($submissions[0]->isLocked()); - /**************************************************************************/ + /* ********************************************************************** */ // Delete. - /**************************************************************************/ + /* ********************************************************************** */ // Check submission delete action. $edit = [ diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderCustomizeTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderCustomizeTest.php index 2855fe52ae..2265722178 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderCustomizeTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderCustomizeTest.php @@ -55,9 +55,9 @@ public function testCustomize() { /** @var \Drupal\user\UserDataInterface $user_data */ $user_data = \Drupal::service('user.data'); - /**************************************************************************/ + /* ********************************************************************** */ // Customize default table. - /**************************************************************************/ + /* ********************************************************************** */ // Check that access is denied to custom results default table. $this->drupalLogin($admin_submission_user); @@ -224,9 +224,9 @@ public function testCustomize() { $this->assertTableHeaderSort('dob'); $this->assertRaw('<td>1947-10-26</td>'); - /**************************************************************************/ + /* ********************************************************************** */ // Customize user results table. - /**************************************************************************/ + /* ********************************************************************** */ // Switch to admin user. $this->drupalLogin($admin_user); @@ -325,9 +325,9 @@ public function testCustomize() { $this->assertNoRaw('First name'); $this->assertNoRaw('Last name'); - /**************************************************************************/ + /* ********************************************************************** */ // Customize user results. - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($own_submission_user); @@ -349,9 +349,9 @@ public function testCustomize() { $this->assertRaw('<th specifier="element__first_name" aria-sort="ascending" class="is-active">'); $this->assertRaw('<th specifier="element__last_name">'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform delete. - /**************************************************************************/ + /* ********************************************************************** */ // Switch to admin user. $this->drupalLogin($admin_user); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderTest.php index 35c2a37d74..c0234c00ec 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionListBuilderTest.php @@ -46,7 +46,7 @@ public function testResults() { /** @var \Drupal\webform\WebformSubmissionInterface[] $submissions */ $submissions = array_values(\Drupal::entityTypeManager()->getStorage('webform_submission')->loadByProperties(['webform_id' => 'test_submissions'])); - /**************************************************************************/ + /* ********************************************************************** */ // Login the own submission user. $this->drupalLogin($own_submission_user); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionTest.php index baff32bb52..ad90a05744 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionTest.php @@ -41,7 +41,7 @@ public function testWebformSubmission() { /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = reset($submissions); - /**************************************************************************/ + /* ********************************************************************** */ // Check create submission. $this->assertInstanceOf(WebformSubmission::class, $webform_submission); @@ -100,7 +100,7 @@ public function testDuplicate() { 'administer webform submission', ]); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($admin_submission_user); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionTokenOperationsTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionTokenOperationsTest.php index 824fe6fb8b..4f99834404 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionTokenOperationsTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionTokenOperationsTest.php @@ -41,7 +41,7 @@ public function testTokenOperationsTest() { /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = WebformSubmission::load($sid); - /**************************************************************************/ + /* ********************************************************************** */ // Check confirmation page's operations (view, update, & delete) token URLs. foreach ($token_operations as $token_operation) { @@ -51,9 +51,9 @@ public function testTokenOperationsTest() { $this->assertRaw('<a href="' . $link_url . '">' . $link_label . '</a>'); } - /**************************************************************************/ + /* ********************************************************************** */ /* View */ - /**************************************************************************/ + /* ********************************************************************** */ // Check token view access allowed. $this->drupalLogin($normal_user); @@ -73,10 +73,9 @@ public function testTokenOperationsTest() { $this->assertNoRaw('Submission information'); $this->assertNoRaw('<label>textfield</label>'); - - /**************************************************************************/ + /* ********************************************************************** */ /* Update */ - /**************************************************************************/ + /* ********************************************************************** */ // Check token update access allowed. $this->drupalLogin($normal_user); @@ -93,9 +92,9 @@ public function testTokenOperationsTest() { $this->assertNoRaw('Submission information'); $this->assertNoFieldByName('textfield', $webform_submission->getElementData('textfield')); - /**************************************************************************/ + /* ********************************************************************** */ /* Delete */ - /**************************************************************************/ + /* ********************************************************************** */ // Check token delete access allowed. $this->drupalLogin($normal_user); @@ -108,9 +107,9 @@ public function testTokenOperationsTest() { $this->drupalGet($webform_submission->getTokenUrl('delete')); $this->assertResponse(403); - /**************************************************************************/ + /* ********************************************************************** */ /* Anonymous */ - /**************************************************************************/ + /* ********************************************************************** */ // Logout and switch to anonymous user. $this->drupalLogout(); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionViewTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionViewTest.php index 47d829087d..6a98c289e4 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionViewTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionViewTest.php @@ -46,7 +46,7 @@ public function testView() { 'administer webform submission', ]); - /**************************************************************************/ + /* ********************************************************************** */ $account = User::load(1); diff --git a/web/modules/webform/tests/src/Functional/WebformSubmissionViewsTest.php b/web/modules/webform/tests/src/Functional/WebformSubmissionViewsTest.php index ced9e8d877..c31266a1a7 100644 --- a/web/modules/webform/tests/src/Functional/WebformSubmissionViewsTest.php +++ b/web/modules/webform/tests/src/Functional/WebformSubmissionViewsTest.php @@ -74,9 +74,9 @@ public function testSubmissionViews() { $uid = $this->rootUser->id(); $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Global. - /**************************************************************************/ + /* ********************************************************************** */ // Setup global submissions and user submissions views. \Drupal::configFactory()->getEditable('webform.settings') @@ -136,9 +136,9 @@ public function testSubmissionViews() { $this->assertNoRaw('webform-results-table'); $this->assertRaw('view-id-webform_submissions view-display-id-embed_default'); - /**************************************************************************/ + /* ********************************************************************** */ // Webform. - /**************************************************************************/ + /* ********************************************************************** */ // Post a submission and save a draft. $webform = Webform::load('test_submission_views'); diff --git a/web/modules/webform/tests/src/Functional/WebformThirdPartySettingsTest.php b/web/modules/webform/tests/src/Functional/WebformThirdPartySettingsTest.php index 38a15a50fc..d72975de78 100644 --- a/web/modules/webform/tests/src/Functional/WebformThirdPartySettingsTest.php +++ b/web/modules/webform/tests/src/Functional/WebformThirdPartySettingsTest.php @@ -26,7 +26,7 @@ public function testThirdPartySettings() { $this->drupalLogin($this->rootUser); - /**************************************************************************/ + /* ********************************************************************** */ // Check honeypot (custom) third party setting does not exist. $this->assertNull($webform->getThirdPartySetting('honeypot', 'honeypot')); diff --git a/web/modules/webform/tests/src/Functional/Wizard/WebformWizardValidateTest.php b/web/modules/webform/tests/src/Functional/Wizard/WebformWizardValidateTest.php index 8cc1e2daab..1a7d99e9ad 100644 --- a/web/modules/webform/tests/src/Functional/Wizard/WebformWizardValidateTest.php +++ b/web/modules/webform/tests/src/Functional/Wizard/WebformWizardValidateTest.php @@ -29,9 +29,9 @@ class WebformWizardValidateTest extends WebformWizardTestBase { public function testWizardValidate() { $this->drupalGet('/webform/test_form_wizard_validate'); - /**************************************************************************/ + /* ********************************************************************** */ // Basic validation. - /**************************************************************************/ + /* ********************************************************************** */ // Check validation errors. $this->drupalPostForm('/webform/test_form_wizard_validate', [], 'Next >'); @@ -78,9 +78,9 @@ public function testWizardValidate() { wizard_2_datelist: - '2002-02-02T02:20:00+1100'"); - /**************************************************************************/ + /* ********************************************************************** */ // Composite validation. - /**************************************************************************/ + /* ********************************************************************** */ // Check validation errors. $this->drupalPostForm('/webform/test_form_wizard_validate_comp', [], 'Next >'); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementCheckboxesJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementCheckboxesJavaScriptTest.php index 6883ee8ef0..9125ddcab4 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementCheckboxesJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementCheckboxesJavaScriptTest.php @@ -24,10 +24,9 @@ class WebformElementCheckboxesJavaScriptTest extends WebformWebDriverTestBase { * Tests check all or none of the above. */ public function testCheckboxesAllNone() { - $session = $this->getSession(); $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_element_checkboxes_all_none'); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementComputedJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementComputedJavaScriptTest.php index e87697f3d5..c025f9c48c 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementComputedJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementComputedJavaScriptTest.php @@ -33,7 +33,7 @@ public function testComputedElementAjax() { $webform = Webform::load('test_element_computed_ajax'); - /**************************************************************************/ + /* ********************************************************************** */ // Check computed Twig element a and b elements exist. $this->drupalGet($webform->toUrl()); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementSignatureJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementSignatureJavaScriptTest.php index 75d7eebcb3..2107eebbd2 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementSignatureJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/Element/WebformElementSignatureJavaScriptTest.php @@ -30,7 +30,7 @@ public function testComputedElementAjax() { $webform = Webform::load('test_element_signature'); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet($webform->toUrl()); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/Settings/WebformSettingsAjaxJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/Settings/WebformSettingsAjaxJavaScriptTest.php index f7cf0c6a97..4a99a2c06e 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/Settings/WebformSettingsAjaxJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/Settings/WebformSettingsAjaxJavaScriptTest.php @@ -34,9 +34,9 @@ public function testAjax() { $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax. (test_ajax) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax = Webform::load('test_ajax'); @@ -68,9 +68,9 @@ public function testAjax() { // Check that text field is blank. $assert_session->fieldValueEquals('textfield', ''); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax confirmation inline. (test_ajax_confirmation_inline) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax_confirmation_inline = Webform::load('test_ajax_confirmation_inline'); @@ -90,9 +90,9 @@ public function testAjax() { $assert_session->responseNotContains('This is a custom inline confirmation message.'); $assert_session->responseContains('This webform will display the confirmation inline when submitted.'); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax confirmation message. (test_ajax_confirmation_message) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax_confirmation_message = Webform::load('test_ajax_confirmation_message'); @@ -104,9 +104,9 @@ public function testAjax() { $assert_session->responseContains('This is a <b>custom</b> confirmation message.'); $assert_session->responseContains('This webform will display a confirmation message when submitted.'); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax confirmation message. (test_ajax_confirmation_modal) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax_confirmation_modal = Webform::load('test_ajax_confirmation_modal'); @@ -117,9 +117,9 @@ public function testAjax() { // Check confirmation modal. $assert_session->responseContains('This is a <b>custom</b> confirmation modal.'); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax confirmation page. (test_ajax_confirmation_page) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax_confirmation_page = Webform::load('test_ajax_confirmation_page'); @@ -130,9 +130,9 @@ public function testAjax() { // Check confirmation page message. $assert_session->responseContains('This is a custom confirmation page.'); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax confirmation url. (test_ajax_confirmation_url) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax_confirmation_url = Webform::load('test_ajax_confirmation_url'); @@ -143,9 +143,9 @@ public function testAjax() { // Check current page is <front>. $this->assertSession()->addressEquals('/'); - /**************************************************************************/ + /* ********************************************************************** */ // Test Ajax confirmation url with message. (test_ajax_confirmation_url_msg) - /**************************************************************************/ + /* ********************************************************************** */ $webform_ajax_confirmation_url_msg = Webform::load('test_ajax_confirmation_url_msg'); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesCustomJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesCustomJavaScriptTest.php index b6f07d7827..917277a812 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesCustomJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesCustomJavaScriptTest.php @@ -29,9 +29,9 @@ public function testCustomStates() { $this->drupalGet('/webform/test_states_server_custom'); - /**************************************************************************/ + /* ********************************************************************** */ // Pattern (^[a-z]+$). - /**************************************************************************/ + /* ********************************************************************** */ // Check pattern dependent is not visible. $dependent_pattern = $page->findField('edit-dependent-pattern'); @@ -45,9 +45,9 @@ public function testCustomStates() { $page->fillField('edit-trigger-pattern', '1'); $this->assertFalse($dependent_pattern->isVisible()); - /**************************************************************************/ + /* ********************************************************************** */ // !Pattern (^$). - /**************************************************************************/ + /* ********************************************************************** */ // Check !pattern dependent is not visible. $dependent_not_pattern = $page->findField('edit-dependent-not-pattern'); @@ -61,9 +61,9 @@ public function testCustomStates() { $page->fillField('edit-trigger-not-pattern', ''); $this->assertFalse($dependent_not_pattern->isVisible()); - /**************************************************************************/ + /* ********************************************************************** */ // Less (< 10). - /**************************************************************************/ + /* ********************************************************************** */ // Check less dependent is not visible. $dependent_less = $page->findField('edit-dependent-less'); @@ -77,9 +77,9 @@ public function testCustomStates() { $page->fillField('edit-trigger-less', '11'); $this->assertFalse($dependent_less->isVisible()); - /**************************************************************************/ + /* ********************************************************************** */ // Less/Equal (<= 10). - /**************************************************************************/ + /* ********************************************************************** */ // Check less dependent is not visible. $dependent_less_equal = $page->findField('edit-dependent-less-equal'); @@ -93,9 +93,9 @@ public function testCustomStates() { $page->fillField('edit-trigger-less-equal', '11'); $this->assertFalse($dependent_less_equal->isVisible()); - /**************************************************************************/ + /* ********************************************************************** */ // Greater (> 10). - /**************************************************************************/ + /* ********************************************************************** */ // Check greater dependent is not visible. $dependent_greater = $page->findField('edit-dependent-greater'); @@ -109,9 +109,9 @@ public function testCustomStates() { $page->fillField('edit-trigger-greater', '5'); $this->assertFalse($dependent_greater->isVisible()); - /**************************************************************************/ + /* ********************************************************************** */ // Greater/Equal (> 10). - /**************************************************************************/ + /* ********************************************************************** */ // Check greater dependent is not visible. $dependent_greater_equal = $page->findField('edit-dependent-greater-equal'); @@ -125,9 +125,9 @@ public function testCustomStates() { $page->fillField('edit-trigger-greater-equal', '5'); $this->assertFalse($dependent_greater_equal->isVisible()); - /**************************************************************************/ + /* ********************************************************************** */ // Between (10 > & < 20). - /**************************************************************************/ + /* ********************************************************************** */ // Check between dependent is not visible. $dependent_between = $page->findField('edit-dependent-between'); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesRequiredJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesRequiredJavaScriptTest.php index 29e2f2d467..ee3c7e55bc 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesRequiredJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/States/WebformStatesRequiredJavaScriptTest.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\Tests\webform\FunctionalJavascript\States; @@ -38,7 +39,7 @@ public function testRequiredState() { $session = $this->getSession(); $page = $session->getPage(); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalGet('/webform/test_states_client_required'); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/WebformFilterJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/WebformFilterJavaScriptTest.php index 69a9bd6fa3..f14d5a27b9 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/WebformFilterJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/WebformFilterJavaScriptTest.php @@ -26,7 +26,7 @@ public function testFilter() { /** @var \Drupal\webform\WebformAddonsManagerInterface $addons_manager */ $addons_manager = \Drupal::service('webform.addons_manager'); - /**************************************************************************/ + /* ********************************************************************** */ $this->drupalLogin($this->rootUser); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/WebformSubmissionListBuilderJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/WebformSubmissionListBuilderJavaScriptTest.php index c241b4399b..5fbb125746 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/WebformSubmissionListBuilderJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/WebformSubmissionListBuilderJavaScriptTest.php @@ -30,7 +30,7 @@ public function testToggleLinks() { $assert_session = $this->assertSession(); - /**************************************************************************/ + /* ********************************************************************** */ $submit = $this->getWebformSubmitButtonLabel($webform); $this->drupalPostForm('/webform/' . $webform->id(), [], $submit); diff --git a/web/modules/webform/tests/src/FunctionalJavascript/Wizard/WebformWizardBasicJavaScriptTest.php b/web/modules/webform/tests/src/FunctionalJavascript/Wizard/WebformWizardBasicJavaScriptTest.php index e7fcc81a78..322185f86d 100644 --- a/web/modules/webform/tests/src/FunctionalJavascript/Wizard/WebformWizardBasicJavaScriptTest.php +++ b/web/modules/webform/tests/src/FunctionalJavascript/Wizard/WebformWizardBasicJavaScriptTest.php @@ -29,7 +29,7 @@ public function testBasicWizard() { $webform = Webform::load('test_form_wizard_basic'); - /**************************************************************************/ + /* ********************************************************************** */ // Check page 1 URL. $this->drupalGet('/webform/test_form_wizard_basic'); @@ -76,7 +76,7 @@ public function testBasicWizard() { $assert_session->waitForText('Element 1'); $this->assertQuery('custom_param=1&page=page_1'); - /**************************************************************************/ + /* ********************************************************************** */ // Set the webform to use ajax. $webform->setSetting('ajax', TRUE); diff --git a/web/modules/webform/tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php b/web/modules/webform/tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php index 90681c4bb3..99e5c2a6a5 100644 --- a/web/modules/webform/tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php +++ b/web/modules/webform/tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php @@ -151,9 +151,9 @@ protected function setUp() { \Drupal::setContainer($container); } - /****************************************************************************/ + /* ************************************************************************ */ // Below test is passing locally but failing on Drupal.org. - /****************************************************************************/ + /* ************************************************************************ */ /** * Tests WebformBreadcrumbBuilder::applies(). @@ -451,9 +451,9 @@ public function testBuildUserSubmission() { $this->assertLinks($route_match, $links); } - /****************************************************************************/ + /* ************************************************************************ */ // Helper functions. - /****************************************************************************/ + /* ************************************************************************ */ /** * Assert breadcrumb builder generates links for specified route match. diff --git a/web/modules/webform/tests/src/Kernel/Entity/WebformEntityTest.php b/web/modules/webform/tests/src/Kernel/Entity/WebformEntityTest.php index be69d088f9..bc1b4509c9 100644 --- a/web/modules/webform/tests/src/Kernel/Entity/WebformEntityTest.php +++ b/web/modules/webform/tests/src/Kernel/Entity/WebformEntityTest.php @@ -31,9 +31,9 @@ public function testWebformMethods() { $this->installSchema('webform', ['webform']); $this->installConfig('webform'); - /**************************************************************************/ + /* ********************************************************************** */ // Create. - /**************************************************************************/ + /* ********************************************************************** */ // Create webform. /** @var \Drupal\webform\WebformInterface $webform */ @@ -43,9 +43,9 @@ public function testWebformMethods() { $this->assertFalse($webform->isTemplate()); $this->assertTrue($webform->isOpen()); - /**************************************************************************/ + /* ********************************************************************** */ // Override. - /**************************************************************************/ + /* ********************************************************************** */ try { $webform->setOverride(TRUE); @@ -65,9 +65,9 @@ public function testWebformMethods() { $this->fail('Possible to save webform with override = FALSE.'); } - /**************************************************************************/ + /* ********************************************************************** */ // Status. - /**************************************************************************/ + /* ********************************************************************** */ // Check set status to FALSE. $webform->setStatus(FALSE); @@ -98,9 +98,9 @@ public function testWebformMethods() { $this->assertTrue($webform->isOpen()); $this->assertTrue($webform->isScheduled()); - /**************************************************************************/ + /* ********************************************************************** */ // Scheduled. - /**************************************************************************/ + /* ********************************************************************** */ $webform->setStatus(WebformInterface::STATUS_SCHEDULED); @@ -163,18 +163,18 @@ public function testWebformMethods() { $this->assertNull($webform->get('open')); $this->assertNull($webform->get('close')); - /**************************************************************************/ + /* ********************************************************************** */ // Templates. - /**************************************************************************/ + /* ********************************************************************** */ // Check that templates are always closed. $webform->set('template', TRUE)->save(); $this->assertTrue($webform->isTemplate()); $this->assertFalse($webform->isOpen()); - /**************************************************************************/ + /* ********************************************************************** */ // Elements. - /**************************************************************************/ + /* ********************************************************************** */ // Set elements. $elements = [ @@ -281,9 +281,9 @@ public function testWebformMethods() { $webform->set('elements', 'invalid')->save(); $this->assertEquals([], $webform->getElementsInitialized()); - /**************************************************************************/ + /* ********************************************************************** */ // Wizard pages. - /**************************************************************************/ + /* ********************************************************************** */ // Check get no wizard pages. $this->assertEquals($webform->getPages(), []); diff --git a/web/modules/webform/tests/src/Kernel/WebformEntityElementsValidationTest.php b/web/modules/webform/tests/src/Kernel/WebformEntityElementsValidationTest.php index df268b8235..f0808b3bca 100644 --- a/web/modules/webform/tests/src/Kernel/WebformEntityElementsValidationTest.php +++ b/web/modules/webform/tests/src/Kernel/WebformEntityElementsValidationTest.php @@ -188,7 +188,7 @@ public function testValidate() { 'Pages and cards cannot be used in the same webform. Please remove or convert the pages/cards to the same element type.', ], ], - +// phpcs:disable /* // Check validate rendering. [ @@ -207,6 +207,7 @@ public function testValidate() { ], ], */ +// phpcs:enable ]; // Check invalid YAML. diff --git a/web/modules/webform/tests/src/Kernel/WebformSubmissionStorageTest.php b/web/modules/webform/tests/src/Kernel/WebformSubmissionStorageTest.php index 68b8867d43..fe846b1358 100644 --- a/web/modules/webform/tests/src/Kernel/WebformSubmissionStorageTest.php +++ b/web/modules/webform/tests/src/Kernel/WebformSubmissionStorageTest.php @@ -115,6 +115,7 @@ public function testPurge($webform_purging, $webform_submissions_definition, $pu * @see testPurge() */ public function providerPurge() { + // phpcs:disable Drupal.Commenting.InlineComment.SpacingBefore // The structure of each test case data is the following: // 0: (string) The webform 'purge' setting // 1: (array) Array of webform submissions to create in the webforms. It @@ -124,6 +125,7 @@ public function providerPurge() { // that it becomes eligible for purging based on its creation time // 2: (array) Array of webform submission sequence IDs that should be purged // in the test. + // phpcs:enable Drupal.Commenting.InlineComment.SpacingBefore $tests = []; // Test that only drafts are purged. diff --git a/web/modules/webform/tests/src/Traits/WebformAssertLegacyTrait.php b/web/modules/webform/tests/src/Traits/WebformAssertLegacyTrait.php index 511a49286f..a6050532f0 100644 --- a/web/modules/webform/tests/src/Traits/WebformAssertLegacyTrait.php +++ b/web/modules/webform/tests/src/Traits/WebformAssertLegacyTrait.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\Tests\webform\Traits; diff --git a/web/modules/webform/tests/src/Traits/WebformBrowserTestTrait.php b/web/modules/webform/tests/src/Traits/WebformBrowserTestTrait.php index 4338a80f38..f7bcf4e9d5 100644 --- a/web/modules/webform/tests/src/Traits/WebformBrowserTestTrait.php +++ b/web/modules/webform/tests/src/Traits/WebformBrowserTestTrait.php @@ -18,9 +18,9 @@ */ trait WebformBrowserTestTrait { - /****************************************************************************/ + /* ************************************************************************ */ // Block. - /****************************************************************************/ + /* ************************************************************************ */ /** * Place breadcrumb page, tasks, and actions. @@ -50,9 +50,9 @@ protected function placeWebformBlocks($module_name) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Filter. - /****************************************************************************/ + /* ************************************************************************ */ /** * Basic HTML filter format. @@ -93,9 +93,9 @@ protected function createFilters() { $this->fullHtmlFilter->save(); } - /****************************************************************************/ + /* ************************************************************************ */ // Taxonomy. - /****************************************************************************/ + /* ************************************************************************ */ /** * Create the 'tags' taxonomy vocabulary. @@ -126,9 +126,9 @@ protected function createTags() { } } - /****************************************************************************/ + /* ************************************************************************ */ // Webform. - /****************************************************************************/ + /* ************************************************************************ */ /** * Lazy load a test webforms. @@ -246,9 +246,9 @@ protected function reloadSubmission($id) { return $storage->load($id); } - /****************************************************************************/ + /* ************************************************************************ */ // Submission. - /****************************************************************************/ + /* ************************************************************************ */ /** * Post a new submission to a webform. @@ -292,9 +292,9 @@ protected function postSubmissionTest(WebformInterface $webform, array $edit = [ return $this->getLastSubmissionId($webform); } - /****************************************************************************/ + /* ************************************************************************ */ // Submission. - /****************************************************************************/ + /* ************************************************************************ */ /** * Load the specified webform submission from the storage. @@ -372,9 +372,9 @@ protected function getLastSubmissionId(WebformInterface $webform) { } } - /****************************************************************************/ + /* ************************************************************************ */ // Export. - /****************************************************************************/ + /* ************************************************************************ */ /** * Request a webform results export CSV. @@ -410,9 +410,9 @@ protected function getExportColumns(WebformInterface $webform) { return array_combine($columns, $columns); } - /****************************************************************************/ + /* ************************************************************************ */ // Email. - /****************************************************************************/ + /* ************************************************************************ */ /** * Gets that last email sent during the currently running test case. @@ -428,9 +428,9 @@ protected function getLastEmail() { return $sent_email; } - /****************************************************************************/ + /* ************************************************************************ */ // Assert. - /****************************************************************************/ + /* ************************************************************************ */ /** * Passes if the CSS selector IS found on the loaded page, fail otherwise. @@ -475,9 +475,9 @@ protected function assertElementNotVisible($css_selector, $message = '') { $this->assertFalse($this->getSession()->getDriver()->isVisible($this->cssSelectToXpath($css_selector)), $message); } - /****************************************************************************/ + /* ************************************************************************ */ // Debug. - /****************************************************************************/ + /* ************************************************************************ */ /** * Logs verbose (debug) message in a text file. diff --git a/web/modules/webform/tests/src/Unit/Access/WebformAccountAccessTest.php b/web/modules/webform/tests/src/Unit/Access/WebformAccountAccessTest.php index 99cf39c786..e16a27b826 100644 --- a/web/modules/webform/tests/src/Unit/Access/WebformAccountAccessTest.php +++ b/web/modules/webform/tests/src/Unit/Access/WebformAccountAccessTest.php @@ -35,7 +35,7 @@ public function testWebformAccountAccess() { 'view any webform submission' => TRUE, ]); - /**************************************************************************/ + /* ********************************************************************** */ // Check admin access. $this->assertEquals(AccessResult::neutral()->cachePerPermissions(), WebformAccountAccess::checkAdminAccess($anonymous_account)->setReason('')); diff --git a/web/modules/webform/tests/src/Unit/Access/WebformSourceEntityAccessTest.php b/web/modules/webform/tests/src/Unit/Access/WebformSourceEntityAccessTest.php index 2f6ab1834b..1ff4285799 100644 --- a/web/modules/webform/tests/src/Unit/Access/WebformSourceEntityAccessTest.php +++ b/web/modules/webform/tests/src/Unit/Access/WebformSourceEntityAccessTest.php @@ -58,7 +58,7 @@ public function testWebformSourceEntityAccess() { ])); $this->container->set('webform.entity_reference_manager', $entity_reference_manager); - /**************************************************************************/ + /* ********************************************************************** */ // Check entity results access. $this->assertEquals(AccessResult::neutral(), WebformSourceEntityAccess::checkEntityResultsAccess($node, $anonymous_account)); diff --git a/web/modules/webform/tests/src/Unit/Access/WebformSubmissionAccessTest.php b/web/modules/webform/tests/src/Unit/Access/WebformSubmissionAccessTest.php index 510b8beb4a..31dec0c70d 100644 --- a/web/modules/webform/tests/src/Unit/Access/WebformSubmissionAccessTest.php +++ b/web/modules/webform/tests/src/Unit/Access/WebformSubmissionAccessTest.php @@ -83,7 +83,7 @@ public function testWebformSubmissionAccess() { ->method('getWebform') ->will($this->returnValue($webform_wizard)); - /**************************************************************************/ + /* ********************************************************************** */ // Check resend (email) message access. $this->assertEquals(AccessResult::forbidden(), WebformSubmissionAccess::checkResendAccess($webform_submission, $anonymous_account)); diff --git a/web/modules/webform/tests/src/Unit/Cache/WebformBubbleableMetadataTest.php b/web/modules/webform/tests/src/Unit/Cache/WebformBubbleableMetadataTest.php index 32611cf8f4..41d8656ece 100644 --- a/web/modules/webform/tests/src/Unit/Cache/WebformBubbleableMetadataTest.php +++ b/web/modules/webform/tests/src/Unit/Cache/WebformBubbleableMetadataTest.php @@ -24,14 +24,13 @@ class WebformBubbleableMetadataTest extends UnitTestCase { * A render array. * @param array $expected * The expected render array. - * @covers ::appendTo * + * @covers ::appendTo * @dataProvider providerTestAppendTo - * * @see \Drupal\Tests\Core\Cache\CacheableMetadataTest */ public function testAppendTo(WebformBubbleableMetadata $bubbleable_metadata, array $build, array $expected) { - // Mock CacheContextsManager::assertValidTokens + // Mock CacheContextsManager::assertValidTokens. // @see \Drupal\Core\Cache\Cache::mergeContexts $cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager') ->disableOriginalConstructor() @@ -41,16 +40,17 @@ public function testAppendTo(WebformBubbleableMetadata $bubbleable_metadata, arr $container->set('cache_contexts_manager', $cache_contexts_manager); \Drupal::setContainer($container); - /**************************************************************************/ + /* ********************************************************************** */ $bubbleable_metadata->appendTo($build); - $this->assertEquals($expected, $build); + $this->assertEqualsCanonicalizing($expected, $build); } /** * Provides test data for testAppendTo(). * * @return array + * Test data */ public function providerTestAppendTo() { return [ diff --git a/web/modules/webform/tests/src/Unit/Plugin/Block/WebformBlockTest.php b/web/modules/webform/tests/src/Unit/Plugin/Block/WebformBlockTest.php index c61482e26a..0dd837a7fa 100644 --- a/web/modules/webform/tests/src/Unit/Plugin/Block/WebformBlockTest.php +++ b/web/modules/webform/tests/src/Unit/Plugin/Block/WebformBlockTest.php @@ -7,7 +7,6 @@ use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Tests\UnitTestCase; use Drupal\webform\Plugin\Block\WebformBlock; @@ -137,10 +136,6 @@ protected function mockWebformBlock(WebformInterface $webform) { ->disableOriginalConstructor() ->getMock(); - $route_match = $this->getMockBuilder(RouteMatchInterface::class) - ->disableOriginalConstructor() - ->getMock(); - // Build container. $container = new ContainerBuilder(); $container->set('request_stack', $request_stack); diff --git a/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/QueryStringWebformSourceEntityTest.php b/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/QueryStringWebformSourceEntityTest.php index 168a56b4a2..02e731f8a2 100644 --- a/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/QueryStringWebformSourceEntityTest.php +++ b/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/QueryStringWebformSourceEntityTest.php @@ -65,10 +65,10 @@ public function testGetCurrentSourceEntity(array $options, $expect_source_entity 'ignored_types' => [], ]; - /**************************************************************************/ + /* ********************************************************************** */ $webform = $this->getMockWebform($options); - list($source_entity, $source_entity_translation) = $this->getMockSourceEntity($options, $webform); + [$source_entity, $source_entity_translation] = $this->getMockSourceEntity($options, $webform); // Mock source entity storage. $source_entity_storage = $this->getMockBuilder(EntityStorageInterface::class) @@ -137,7 +137,7 @@ public function testGetCurrentSourceEntity(array $options, $expect_source_entity $container->set('language_manager', $language_manager); $container->set('webform.entity_reference_manager', $webform_entity_reference_manager); - /**************************************************************************/ + /* ********************************************************************** */ // Create QueryStringWebformSourceEntity plugin instance. $plugin = QueryStringWebformSourceEntity::create($container, [], 'query_string', []); diff --git a/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/RouteParametersWebformSourceEntityTest.php b/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/RouteParametersWebformSourceEntityTest.php index 0e0351f79f..bdf601e114 100644 --- a/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/RouteParametersWebformSourceEntityTest.php +++ b/web/modules/webform/tests/src/Unit/Plugin/WebformSourceEntity/RouteParametersWebformSourceEntityTest.php @@ -62,7 +62,7 @@ public function testGetCurrentSourceEntity(array $route_parameters, array $ignor $container = new ContainerBuilder(); $container->set('current_route_match', $route_match); - /**************************************************************************/ + /* ********************************************************************** */ $plugin = RouteParametersWebformSourceEntity::create($container, [], 'route_parameters', []); $output = $plugin->getSourceEntity($ignored_types); diff --git a/web/modules/webform/tests/src/Unit/Plugin/views/field/WebformSubmissionBulkFormTest.php b/web/modules/webform/tests/src/Unit/Plugin/views/field/WebformSubmissionBulkFormTest.php index 2cf65f4e82..be9fb45b9a 100644 --- a/web/modules/webform/tests/src/Unit/Plugin/views/field/WebformSubmissionBulkFormTest.php +++ b/web/modules/webform/tests/src/Unit/Plugin/views/field/WebformSubmissionBulkFormTest.php @@ -1,4 +1,5 @@ <?php +// phpcs:ignoreFile namespace Drupal\Tests\webform\Unit\Plugin\views\field; diff --git a/web/modules/webform/tests/src/Unit/Utility/WebformHtmlHelperTest.php b/web/modules/webform/tests/src/Unit/Utility/WebformHtmlHelperTest.php index d415c83d65..1d13652612 100644 --- a/web/modules/webform/tests/src/Unit/Utility/WebformHtmlHelperTest.php +++ b/web/modules/webform/tests/src/Unit/Utility/WebformHtmlHelperTest.php @@ -35,7 +35,7 @@ public function testToPlainText($text, $expected) { $container->set('config.factory', $config_factory); \Drupal::setContainer($container); - /**************************************************************************/ + /* ********************************************************************** */ $result = WebformHtmlHelper::toPlainText($text); $this->assertEquals((string) $expected, (string) $result, $text); @@ -75,7 +75,7 @@ public function testToHtmlMarkup($text, $expected) { $container->set('config.factory', $config_factory); \Drupal::setContainer($container); - /**************************************************************************/ + /* ********************************************************************** */ $result = WebformHtmlHelper::toHtmlMarkup($text); $this->assertEquals((string) $expected, (string) $result, $text); diff --git a/web/modules/webform/tests/src/Unit/WebformEntityAccessControlHandlerTest.php b/web/modules/webform/tests/src/Unit/WebformEntityAccessControlHandlerTest.php index 8cb9eb5756..e30071d2cd 100644 --- a/web/modules/webform/tests/src/Unit/WebformEntityAccessControlHandlerTest.php +++ b/web/modules/webform/tests/src/Unit/WebformEntityAccessControlHandlerTest.php @@ -106,7 +106,7 @@ public function testCheckAccess($operation, array $options, array $expected, $as 'access_result_cache_contexts' => [], ]; - /**************************************************************************/ + /* ********************************************************************** */ $token = $this->randomMachineName(); @@ -213,7 +213,7 @@ function ($operation, AccountInterface $account, WebformInterface $webform) use $container->set('plugin.manager.webform.source_entity', $webform_source_entity_manager); $container->set('webform.access_rules_manager', $access_rules_manager); - /**************************************************************************/ + /* ********************************************************************** */ // Create webform access control handler. $access_handler = WebformEntityAccessControlHandler::createInstance($container, $entity_type); @@ -224,8 +224,8 @@ function ($operation, AccountInterface $account, WebformInterface $webform) use // Check expected results. $this->assertEquals($expected['access_result_is_allowed'], $access_result->isAllowed(), $assert_message); $this->assertEquals(Cache::PERMANENT, $access_result->getCacheMaxAge(), $assert_message . ': cache max age'); - $this->assertArrayEquals($expected['access_result_cache_contexts'], $access_result->getCacheContexts(), $assert_message . ': cache contexts'); - $this->assertArrayEquals($expected['access_result_cache_tags'], $access_result->getCacheTags(), $assert_message . ': cache tags'); + $this->assertEqualsCanonicalizing($expected['access_result_cache_contexts'], $access_result->getCacheContexts(), $assert_message . ': cache contexts'); + $this->assertEqualsCanonicalizing($expected['access_result_cache_tags'], $access_result->getCacheTags(), $assert_message . ': cache tags'); } /** @@ -236,9 +236,9 @@ function ($operation, AccountInterface $account, WebformInterface $webform) use public function providerCheckAccess() { $tests = []; - /**************************************************************************/ + /* ********************************************************************** */ // The "view" HTML operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'view', @@ -277,9 +277,9 @@ public function providerCheckAccess() { 'View when has "administer" access rule', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "view" configuration operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'view', @@ -366,9 +366,9 @@ public function providerCheckAccess() { 'View when has "access own webform configuration" permission and is owner and request form is NOT HTML', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "test" operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'test', @@ -448,9 +448,9 @@ public function providerCheckAccess() { 'Test when has "edit own webform" permission and is owner', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "update" operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'update', @@ -528,9 +528,9 @@ public function providerCheckAccess() { 'Update when has "edit own webform" permission and is owner', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "duplicate" operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'duplicate', @@ -623,9 +623,9 @@ public function providerCheckAccess() { 'Duplicate when has "create webform" and "edit own webform" permissions and is owner', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "delete" operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'delete', @@ -705,9 +705,9 @@ public function providerCheckAccess() { 'Delete when has "delete own webform" permission and is owner', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "purge" operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'submission_purge', @@ -735,9 +735,9 @@ public function providerCheckAccess() { 'Purge when has "purge_any" access rule', ]; - /**************************************************************************/ + /* ********************************************************************** */ // The "view" operation. - /**************************************************************************/ + /* ********************************************************************** */ $tests[] = [ 'submission_view_any', diff --git a/web/modules/webform/tests/src/Unit/WebformMessageManagerTest.php b/web/modules/webform/tests/src/Unit/WebformMessageManagerTest.php index bfdc8b565a..2f0feeb5d8 100644 --- a/web/modules/webform/tests/src/Unit/WebformMessageManagerTest.php +++ b/web/modules/webform/tests/src/Unit/WebformMessageManagerTest.php @@ -46,7 +46,7 @@ public function testMessageManager() { $url->method('toString') ->willReturn('http://example.com/'); - /**************************************************************************/ + /* ********************************************************************** */ // Mock current user. $current_user = $this->getMockBuilder(AccountInterface::class) @@ -127,7 +127,7 @@ public function testMessageManager() { // Set message manager mock webform. $message_manager->setWebform($webform); - /**************************************************************************/ + /* ********************************************************************** */ // Check custom single message. $expected = [ diff --git a/web/modules/webform/tests/themes/webform_test_bartik/webform_test_bartik.info.yml b/web/modules/webform/tests/themes/webform_test_bartik/webform_test_bartik.info.yml index eb3c0004a2..33a4a0371d 100644 --- a/web/modules/webform/tests/themes/webform_test_bartik/webform_test_bartik.info.yml +++ b/web/modules/webform/tests/themes/webform_test_bartik/webform_test_bartik.info.yml @@ -5,7 +5,7 @@ name: 'Webform Bartik test' description: 'Support theme for webform Bartik integration testing.' package: 'Webform Testing' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/third_party_settings/webform.captcha.inc b/web/modules/webform/third_party_settings/webform.captcha.inc index be5a3541cb..fa493eccd7 100644 --- a/web/modules/webform/third_party_settings/webform.captcha.inc +++ b/web/modules/webform/third_party_settings/webform.captcha.inc @@ -67,7 +67,7 @@ function captcha_webform_submission_form_alter(&$form, FormStateInterface $form_ // If the webform already has a CAPTCHA point is already configured, do not // do anything. - /* @var \Drupal\captcha\CaptchaPointInterface $captcha_point */ + /** @var \Drupal\captcha\CaptchaPointInterface $captcha_point */ $captcha_point = \Drupal::entityTypeManager() ->getStorage('captcha_point') ->load($form_id); @@ -100,7 +100,7 @@ function _captcha_webform_submission_form_after_build(array $form, FormStateInte // If the webform has a CAPTCHA element, display a link to edit the element. $elements = $webform->getElementsInitializedAndFlattened(); - foreach ($elements as $key => $element) { + foreach ($elements as $key => &$element) { if (WebformElementHelper::isType($element, 'captcha')) { // Update the details element's title. $form['captcha']['#title'] = t('CAPTCHA: challenge enabled'); @@ -117,6 +117,7 @@ function _captcha_webform_submission_form_after_build(array $form, FormStateInte '#url' => Url::fromRoute($route_name, $route_parameters, $route_options), '#prefix' => '<em>', '#suffix' => '</em>', + '#parents' => [], ]; } else { @@ -140,6 +141,7 @@ function _captcha_webform_submission_form_after_build(array $form, FormStateInte '#type' => 'link', '#title' => t('Add CAPTCHA element to this webform for untrusted users.'), '#url' => Url::fromRoute($route_name, $route_parameters, $route_options), + '#parents' => [], ]; } else { diff --git a/web/modules/webform/webform.api.php b/web/modules/webform/webform.api.php index a3cb0c075d..5cd6acba06 100644 --- a/web/modules/webform/webform.api.php +++ b/web/modules/webform/webform.api.php @@ -5,6 +5,8 @@ * Hooks related to Webform module. */ +// phpcs:disable DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable + /** * @addtogroup hooks * @{ @@ -120,6 +122,7 @@ function hook_webform_element_configuration_form_alter(array &$form, \Drupal\Cor '#type' => 'textfield', '#title' => t('Custom data'), '#description' => t("The custom data value will be added to the \$element's render array attributes."), + // The element #default_value is auto-populated upstream and should NOT be set here. ]; } @@ -625,8 +628,8 @@ function hook_webform_access_rules() { // The below 2 operations can be queried together as following: // // \Drupal::entityTypeManager() - // ->getAccessControlHandler('webform_submission') - // ->access($webform_submission, 'some_operation', $account); + // ->getAccessControlHandler('webform_submission') + // ->access($webform_submission, 'some_operation', $account); // // This will return TRUE as long as the $account is has either // 'some_operation_any' or has 'some_operation_own' and is author of diff --git a/web/modules/webform/webform.info.yml b/web/modules/webform/webform.info.yml index fe858ac0af..2a9f84f671 100644 --- a/web/modules/webform/webform.info.yml +++ b/web/modules/webform/webform.info.yml @@ -8,7 +8,7 @@ dependencies: - 'drupal:field' - 'drupal:user' -# Information added by Drupal.org packaging script on 2021-10-31 -version: '6.1.0' +# Information added by Drupal.org packaging script on 2021-12-07 +version: '6.1.2' project: 'webform' -datestamp: 1635676674 +datestamp: 1638917157 diff --git a/web/modules/webform/webform.install b/web/modules/webform/webform.install index c1e2b2aced..58284743ed 100644 --- a/web/modules/webform/webform.install +++ b/web/modules/webform/webform.install @@ -14,6 +14,27 @@ // Webform update hooks. include_once __DIR__ . '/includes/webform.install.update.inc'; +/** + * Implements hook_uninstall(). + */ +function webform_install() { + // Automatically install sub-modules to improve the UX via SimplyTest.me. + $tugboat_project = $_ENV['TUGBOAT_PROJECT'] ?? ''; + if ($tugboat_project === 'SimplyTest.me') { + /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */ + $module_installer = \Drupal::service('module_installer'); + $module_installer->install([ + 'webform_ui', + 'webform_templates', + 'webform_examples', + 'webform_image_select', + 'webform_node', + 'webform_share', + 'webform_submission_log', + ]); + } +} + /** * Implements hook_uninstall(). */ diff --git a/web/modules/webform/webform.libraries.yml b/web/modules/webform/webform.libraries.yml index 8c503e3c7a..bf46770c14 100644 --- a/web/modules/webform/webform.libraries.yml +++ b/web/modules/webform/webform.libraries.yml @@ -355,6 +355,12 @@ webform.theme.gin: theme: css/webform.theme.gin.css: {} +webform.theme.olivero: + version: VERSION + css: + theme: + css/webform.theme.olivero.css: {} + webform.theme.seven: version: VERSION css: @@ -666,6 +672,17 @@ webform.element.details.toggle: - core/drupal.announce - core/jquery.once +webform.element.excluded_elements: + version: VERSION + css: + component: + css/webform.element.excluded_elements.css: {} + js: + js/webform.element.excluded_elements.js: {} + dependencies: + - core/drupal + - core/jquery.once + webform.element.file.button: version: VERSION css: diff --git a/web/modules/webform/webform.module b/web/modules/webform/webform.module index e9369f8763..951bb541f4 100644 --- a/web/modules/webform/webform.module +++ b/web/modules/webform/webform.module @@ -532,7 +532,7 @@ function webform_menu_links_discovered_alter(&$links) { + ['parent' => 'entity.webform.collection']; } } - foreach($menu_links as $sub_link_task_name => $sub_link) { + foreach ($menu_links as $sub_link_task_name => $sub_link) { foreach ($definitions as $task_name => $definition) { if (isset($definition['parent_id']) && $definition['parent_id'] === preg_replace('/\.item$/', '', $sub_link_task_name)) { $menu_links[$task_name . '.item'] = $default_definition @@ -542,6 +542,14 @@ function webform_menu_links_discovered_alter(&$links) { } } + // Make sure weight are integers and not floats which throw fatal errors + // for PostgreSQL. + // @see https://www.drupal.org/project/webform/issues/3247861 + // @see https://www.drupal.org/project/drupal/issues/3248199 + foreach ($menu_links as &$menu_link) { + $menu_link['weight'] = (int) $menu_link['weight']; + } + $links += $menu_links; } } @@ -883,9 +891,9 @@ function webform_webform_access_rules() { ]; } -/******************************************************************************/ +/* ************************************************************************** */ // Devel generate info hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_devel_generate_info_alter(). @@ -907,9 +915,9 @@ function webform_devel_generate_info_alter(array &$generators) { } } -/******************************************************************************/ +/* ************************************************************************** */ // Element info hooks. -/******************************************************************************/ +/* ************************************************************************** */ /** * Implements hook_element_info_alter(). @@ -950,7 +958,7 @@ function webform_process_options(&$element, FormStateInterface $form_state, &$co continue; } - list($title, $description) = WebformOptionsHelper::splitOption($title); + [$title, $description] = WebformOptionsHelper::splitOption($title); $element[$key]['#title'] = $title; $element[$key]['#webform_element'] = TRUE; $element[$key][$description_property_name] = $description; @@ -1012,9 +1020,9 @@ function webform_process_options(&$element, FormStateInterface $form_state, &$co return $element; } -/******************************************************************************/ +/* ************************************************************************** */ // Private functions. -/******************************************************************************/ +/* ************************************************************************** */ /** * Provides custom PHP error handling when webform rendering is validated. diff --git a/web/modules/webform/webform.tokens.inc b/web/modules/webform/webform.tokens.inc index 6cd51618c1..e64a65ccf9 100644 --- a/web/modules/webform/webform.tokens.inc +++ b/web/modules/webform/webform.tokens.inc @@ -32,9 +32,9 @@ function webform_token_info() { $types = []; $tokens = []; - /****************************************************************************/ + /* ************************************************************************ */ // Webform submission. - /****************************************************************************/ + /* ************************************************************************ */ $types['webform_submission'] = [ 'name' => t('Webform submissions'), @@ -307,9 +307,9 @@ function webform_token_info() { $tokens['webform_submission'] = $webform_submission; - /****************************************************************************/ + /* ************************************************************************ */ // Webform. - /****************************************************************************/ + /* ************************************************************************ */ $types['webform'] = [ 'name' => t('Webforms'), @@ -381,9 +381,9 @@ function webform_token_info() { $tokens['webform'] = $webform; - /****************************************************************************/ + /* ************************************************************************ */ // Webform role. - /****************************************************************************/ + /* ************************************************************************ */ $roles = \Drupal::config('webform.settings')->get('mail.roles'); if ($roles) { @@ -408,7 +408,7 @@ function webform_token_info() { $tokens['webform_role'] = $webform_role; } - /****************************************************************************/ + /* ************************************************************************ */ return ['types' => $types, 'tokens' => $tokens]; } @@ -811,7 +811,7 @@ function webform_tokens($type, $tokens, array $data, array $options, BubbleableM $element_property = 'title'; } else { - list($element_key, $element_property) = explode(':', $key); + [$element_key, $element_property] = explode(':', $key); } $element_property = $element_property ?: 'title'; $element = $webform->getElement($element_key); @@ -831,7 +831,7 @@ function webform_tokens($type, $tokens, array $data, array $options, BubbleableM if (($handler_tokens = $token_service->findWithPrefix($tokens, 'handler'))) { foreach ($handler_tokens as $key => $original) { - $webform_handler = isset($data['webform_handler']) ? $data['webform_handler'] : []; + $webform_handler = $data['webform_handler'] ?? []; $parents = explode(':', $key); $key_exists = NULL; $value = NestedArray::getValue($webform_handler, $parents, $key_exists); @@ -884,6 +884,7 @@ function webform_tokens($type, $tokens, array $data, array $options, BubbleableM function _webform_token_get_submission_value($value_token, array $options, WebformSubmissionInterface $webform_submission, WebformElementManagerInterface $element_manager, BubbleableMetadata $bubbleable_metadata) { $submission_data = $webform_submission->getData(); + // phpcs:disable Drupal.Commenting.InlineComment.InvalidEndChar // Formats: // [html] // [values:{element_key}:{format}] @@ -894,6 +895,7 @@ function _webform_token_get_submission_value($value_token, array $options, Webfo // [values:{element_key}:{format}:{items}:urlencode] // [values:{element_key}:{delta}:{format}] // [values:{element_key}:{delta}:{sub-element}] + // phpcs:enable Drupal.Commenting.InlineComment.InvalidEndChar $keys = explode(':', $value_token); $element_key = array_shift($keys); @@ -965,9 +967,9 @@ function _webform_token_get_submission_value($value_token, array $options, Webfo $composite_key = NULL; } - /****************************************************************************/ + /* ************************************************************************ */ // Get value. - /****************************************************************************/ + /* ************************************************************************ */ // Set entity reference chaining. if ($keys && $keys[0] === 'entity' && $element_plugin instanceof WebformElementEntityReferenceInterface) { @@ -984,7 +986,7 @@ function _webform_token_get_submission_value($value_token, array $options, Webfo 'taxonomy_term' => 'term', 'taxonomy_vocabulary' => 'vocabulary', ]; - $entity_token_name = (isset($entity_token_names[$entity_type])) ? $entity_token_names[$entity_type] : $entity_type; + $entity_token_name = $entity_token_names[$entity_type] ?? $entity_type; $entity_token = implode(':', $keys); $token_value = Markup::create(\Drupal::token()->replace( "[$entity_token_name:$entity_token]", -- GitLab